/* The lab app around the games (list, settings, stats, admin). Uses the theme tokens only. */
.lab-boot { position: fixed; inset: 0; display: grid; place-items: center; }
.lab-boot-dot { width: 18px; height: 18px; border-radius: 50%; background: var(--gold); animation: rw-pulse .6s ease-in-out infinite alternate; }

.lab-page { max-width: 560px; margin: 0 auto; padding: calc(12px + var(--safe-t)) 16px calc(28px + var(--safe-b)); min-height: 100%; overflow-x: hidden; }
.lab-page > *, .lab-stats > *, .lab-box, .lab-admin-group { min-width: 0; }
.lab-top { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.lab-title { flex: 1; text-align: center; font-size: 1.3rem; margin: 0; }
.lab-lead { color: var(--ink-2); font-weight: 700; text-align: center; margin: 0 0 14px; }

.lab-hero { background: var(--card); border-radius: 26px; padding: 16px 16px 14px; box-shadow: var(--shadow); margin-bottom: 18px; position: relative; overflow: hidden; }
.lab-hero::before { content: ''; position: absolute; inset: -40% -20% auto auto; width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(circle, var(--gold-l), transparent 70%); pointer-events: none; }
.lab-hero-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; position: relative; }
.lab-brand { font-family: 'Baloo', 'Tajawal', sans-serif; font-weight: 800; font-size: 1.7rem; line-height: 1.15; }
.lab-brand.big { font-size: 2.4rem; text-align: center; margin-top: 12vh; }
.lab-balance { display: inline-flex; align-items: center; gap: 6px; background: var(--gold-l); color: var(--gold-d); border-radius: 999px; padding: 4px 14px 4px 8px; font-size: 1.25rem; }
.lab-today { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-weight: 700; color: var(--ink-2); position: relative; }
.lab-today-bar { flex: 1; height: 10px; border-radius: 99px; background: var(--card-2); overflow: hidden; }
.lab-today-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-d)); border-radius: 99px; }

.lab-h2 { font-size: 1.15rem; margin: 6px 4px 10px; color: var(--ink-2); }
.lab-section { margin-bottom: 18px; }
.lab-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 520px) { .lab-grid { grid-template-columns: repeat(3, 1fr); } }
.lab-card {
  text-align: start; background: var(--card); border-radius: 22px; padding: 14px 14px 12px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 3px; position: relative; overflow: hidden; transition: transform var(--fast) var(--ease);
}
.lab-card::after { content: ''; position: absolute; inset: auto -30px -30px auto; width: 90px; height: 90px; border-radius: 50%; background: color-mix(in srgb, var(--gc) 10%, transparent); }
.lab-card:active { transform: scale(.97); }
.lab-card-icon { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; font-size: 1.9rem; background: color-mix(in srgb, var(--gc) 16%, var(--card)); margin-bottom: 6px; }
.lab-card-title { font-weight: 800; font-size: 1.05rem; line-height: 1.3; }
.lab-card-skill { color: var(--muted); font-size: .8rem; font-weight: 700; }
.lab-card-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; min-height: 18px; position: relative; z-index: 1; }
.lab-stars { display: inline-flex; gap: 1px; }
.lab-new { font-size: .75rem; font-weight: 800; color: var(--accent); background: var(--accent-l); border-radius: 99px; padding: 0 8px; }
.lab-lv { font-size: .78rem; font-weight: 800; color: var(--ink-2); background: var(--card-2); border-radius: 99px; padding: 0 8px; }

.lab-nav { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 8px 0 16px; }
.lab-nav-btn { display: flex; align-items: center; gap: 8px; background: var(--card); border-radius: 16px; padding: 12px 14px; box-shadow: var(--shadow); font-weight: 800; color: var(--ink-2); }
.lab-nav-btn:active { transform: scale(.97); }

.lab-who { text-align: center; display: flex; flex-direction: column; gap: 14px; }
.lab-choice { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.lab-grades { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.lab-pill { min-height: 48px; padding: 8px 18px; border-radius: 16px; background: var(--card); box-shadow: var(--shadow); font-weight: 800; }
.lab-pill.small { min-height: 42px; padding: 6px 10px; }
.lab-pill.on { background: var(--accent); color: var(--on-accent); }

.lab-list { display: grid; gap: 4px; padding: 6px 14px; }
.lab-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 58px; border-bottom: 1px solid var(--line); font-weight: 700; }
.lab-row:last-child { border-bottom: 0; }
.lab-switch { width: 54px; height: 32px; border-radius: 99px; background: var(--card-2); position: relative; box-shadow: inset 0 0 0 1px var(--line); transition: background var(--mid); }
.lab-switch i { position: absolute; top: 3px; right: 3px; width: 26px; height: 26px; border-radius: 50%; background: var(--card); box-shadow: 0 2px 5px rgba(0,0,0,.2); transition: transform var(--mid) var(--spring); }
.lab-switch.on { background: var(--accent); }
.lab-switch.on i { transform: translateX(-22px); }

.lab-pages { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.lab-page-cell { background: var(--card); border-radius: 18px; padding: 12px 6px; box-shadow: var(--shadow); display: grid; gap: 4px; justify-items: center; }
.lab-page-cell b { font-size: 1.5rem; }
.lab-page-cell.now { box-shadow: 0 0 0 3px var(--gc), var(--shadow); }
.lab-page-cell.locked { opacity: .5; }

.lab-install { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.lab-install > div { flex: 1; }
.lab-install b { display: block; }

.lab-medals { margin-bottom: 12px; }
.lab-medals h3 { margin: 0 0 8px; font-size: 1.05rem; }
.lab-medal-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.lab-medal { display: grid; justify-items: center; text-align: center; gap: 2px; opacity: .35; filter: grayscale(1); }
.lab-medal.has { opacity: 1; filter: none; }
.lab-medal small { font-size: .72rem; font-weight: 700; line-height: 1.25; }

/* stats */
.lab-stats { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
.lab-kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.lab-kpi { background: var(--card); border-radius: 18px; padding: 12px 14px; box-shadow: var(--shadow); }
.lab-kpi b { display: block; font-family: 'Baloo', 'Tajawal', sans-serif; font-size: 1.6rem; line-height: 1.1; }
.lab-kpi small { color: var(--muted); font-weight: 700; }
.lab-box { background: var(--card); border-radius: 20px; padding: 14px; box-shadow: var(--shadow); }
.lab-box h3 { margin: 0 0 10px; font-size: 1.05rem; }
.lab-box p.note { margin: -4px 0 10px; color: var(--muted); font-size: .85rem; font-weight: 700; }
.lab-bars { display: grid; gap: 7px; }
.lab-bar { display: grid; min-width: 0; grid-template-columns: 7.5em minmax(0, 1fr) auto; align-items: center; gap: 8px; font-size: .88rem; font-weight: 700; }
.lab-bar .track { height: 12px; background: var(--card-2); border-radius: 99px; overflow: hidden; }
.lab-bar .track i { display: block; height: 100%; border-radius: 99px; background: var(--gc, var(--accent)); }
.lab-bar .v { color: var(--ink-2); font-family: 'Baloo', 'Tajawal', sans-serif; min-width: 3ch; text-align: end; }
.lab-hours { display: grid; grid-template-columns: repeat(24, 1fr); gap: 2px; align-items: end; height: 90px; direction: ltr; }
.lab-hours i { display: block; background: var(--accent); border-radius: 3px 3px 0 0; min-height: 2px; }
.lab-hours-x { display: grid; grid-template-columns: repeat(24, 1fr); font-size: .62rem; color: var(--muted); direction: ltr; text-align: center; }
.lab-table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.lab-table th, .lab-table td { padding: 6px 4px; border-bottom: 1px solid var(--line); text-align: start; white-space: nowrap; }
.lab-table th { color: var(--muted); font-weight: 800; }
.lab-scroll { overflow-x: auto; }

/* admin */
.lab-admin-group { margin-bottom: 14px; }
.lab-admin-group h3 { margin: 0 0 2px; }
.lab-admin-group > p { margin: 0 0 8px; color: var(--muted); font-weight: 700; font-size: .88rem; }
.lab-set { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.lab-set:last-child { border-bottom: 0; }
.lab-set .lbl { font-weight: 700; }
.lab-set .lbl small { display: block; color: var(--muted); font-weight: 700; font-size: .75rem; }
.lab-set input { width: 7.5em; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--card-2); text-align: center; font-weight: 800; }
.lab-set input.wide { width: 10em; }
.lab-set select { padding: 8px; border-radius: 12px; border: 1px solid var(--line); background: var(--card-2); font-weight: 700; }
.lab-tag { display: inline-block; font-size: .68rem; font-weight: 800; border-radius: 99px; padding: 0 7px; margin-inline-start: 6px; background: var(--card-2); color: var(--muted); vertical-align: middle; }
.lab-tag.live { background: var(--accent-l); color: var(--accent); }

.lab-bar span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lab-set input.wide { max-width: 46vw; }
