/* InternDoor: the game layer's pieces (27 Oct 2026). Levels and XP, quests,
   solved by level, the activity map, badges, the rating and the mock test
   history, drawn by web/public/game.js on /practice, /dashboard and /u/<name>.
   Hand-committed, loaded by those pages only (src/pages.js GAME_CSS), so
   page.css and styles.css keep their versions.

   The site's calm system holds (styles.css, 9 Oct 2026): zinc greys, the
   accent for signals only (lime on dark, olive on light), 16px radius for
   content, sentence case, nothing that moves on hover. Badges, medals and
   the solved ring carry their own colours, the same in both themes. */

.g-k { margin: 0; font-size: 12.5px; color: var(--ink-2); }
.g-dim { color: var(--ink-2); }
.g-big { margin: 2px 0; font-size: 40px; font-weight: 600; letter-spacing: -.035em; line-height: 1; color: var(--ink); font-variant-numeric: tabular-nums; }
.g-link { color: var(--ink-15); font-size: 13.5px; text-decoration: none; }
.g-link:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.g-art { display: block; flex: none; }

/* ---- bars: the inner element is scaled (progress.js fill), never resized ---- */
.g-bar { display: block; height: 8px; border-radius: 999px; background: color-mix(in oklab, var(--ink) 10%, transparent); overflow: hidden; }
.g-bar > i { display: block; height: 100%; border-radius: inherit; background: var(--accent); transform-origin: 0 50%; transform: scaleX(0); }

/* ---- level ---- */
.g-level { display: grid; gap: 8px; min-width: 0; }
.g-level-top { display: flex; align-items: center; gap: 10px; min-width: 0; }
.g-lv { display: inline-grid; place-items: center; min-width: 48px; height: 28px; padding: 0 10px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font: 700 13.5px/1 var(--ui); letter-spacing: -.01em; font-variant-numeric: tabular-nums; flex: none; }
.g-title { font-size: 16px; font-weight: 600; color: var(--ink); letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-level-link { margin-left: auto; font-size: 12.5px; color: var(--ink-2); text-decoration: none; white-space: nowrap; }
.g-level-link:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.g-xp { display: flex; justify-content: space-between; gap: 12px; font-size: 12.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.g-xp > span:last-child { text-align: right; }
.g-levelup { margin: 2px 0 0; font-size: 13.5px; font-weight: 600; color: var(--accent); }

/* ---- quests ---- */
.g-quests { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.g-quest { display: grid; }
.g-quest-in { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 11px 13px; border: 1px solid var(--rule); border-radius: 12px; background: var(--card-2); color: inherit; text-decoration: none; }
a.g-quest-in:hover { border-color: var(--rule-2); }
a.g-quest-in:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.g-quest-t { min-width: 0; display: grid; gap: 2px; }
.g-quest-t b { font-size: 13.5px; font-weight: 600; color: var(--ink); line-height: 1.3; }
.g-quest-t > span { font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.g-quest .g-qbar { height: 5px; margin-top: 4px; }
.g-check { width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--rule-2); display: grid; place-items: center; }
.g-quest.is-done .g-check { background: var(--accent); border-color: var(--accent); }
.g-quest.is-done .g-check::after { content: ''; width: 6px; height: 11px; border: solid var(--accent-ink); border-width: 0 2.4px 2.4px 0; transform: translateY(-1px) rotate(45deg); }
.g-quest.is-done .g-quest-t b { color: var(--ink-2); }
.g-pts { font: 600 12px/1 var(--mono); color: var(--ink-15); white-space: nowrap; font-variant-numeric: tabular-nums; }
.g-quest.is-done .g-pts { color: var(--ink-2); }

/* ---- solved by level ---- */
.g-solved { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 22px; align-items: center; }
.g-ring { position: relative; width: 132px; height: 132px; }
.g-ring svg { display: block; }
.g-ring-track { stroke: color-mix(in oklab, var(--ink) 9%, transparent); }
.g-ring-c { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.g-ring-c b { display: block; font-size: 30px; font-weight: 600; letter-spacing: -.03em; color: var(--ink); font-variant-numeric: tabular-nums; }
.g-ring-c span { font-size: 12px; color: var(--ink-2); }
.g-lvls { display: grid; gap: 12px; min-width: 0; }
.g-lvl { display: grid; grid-template-columns: 62px minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: 13px; }
.g-lvl .g-bar { height: 6px; }
.g-lvl b { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.g-lvl b .g-dim { font-weight: 400; }
.g-lv1 .g-lvl-k { color: #16a34a; } .g-lv2 .g-lvl-k { color: #b45309; } .g-lv3 .g-lvl-k { color: #dc2626; }
:root:not([data-theme="light"]) .g-lv1 .g-lvl-k { color: #4ade80; }
:root:not([data-theme="light"]) .g-lv2 .g-lvl-k { color: #fbbf24; }
:root:not([data-theme="light"]) .g-lv3 .g-lvl-k { color: #f87171; }
.g-lv1 .g-bar > i { background: #4ade80; } .g-lv2 .g-bar > i { background: #fbbf24; } .g-lv3 .g-bar > i { background: #f87171; }
@media (max-width: 420px) { .g-solved { grid-template-columns: 1fr; justify-items: center; } .g-lvls { width: 100%; } }
.g-solved-note { grid-column: 1 / -1; font-size: 12.5px; }

/* ---- the activity map: newest week on the right; on a narrow screen the
   oldest weeks run off the left edge, not the newest off the right ---- */
.g-heatbox { min-width: 0; }
.g-heat { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 11px); grid-auto-columns: 11px; gap: 3px; overflow: hidden; justify-content: end; }
.g-heat i { border-radius: 3px; background: color-mix(in oklab, var(--ink) 7%, transparent); }
.g-heat i.h1, .g-heat-key i.h1 { background: color-mix(in oklab, var(--accent) 30%, transparent); }
.g-heat i.h2, .g-heat-key i.h2 { background: color-mix(in oklab, var(--accent) 54%, transparent); }
.g-heat i.h3, .g-heat-key i.h3 { background: color-mix(in oklab, var(--accent) 78%, transparent); }
:root[data-theme="light"] .g-heat i.h1, :root[data-theme="light"] .g-heat-key i.h1 { background: color-mix(in oklab, var(--accent) 38%, transparent); }
.g-heat i.h4, .g-heat-key i.h4 { background: var(--accent); }
.g-heat-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 10px; font-size: 12.5px; color: var(--ink-2); }
.g-heat-key { display: inline-flex; gap: 3px; align-items: center; }
.g-heat-key i { width: 11px; height: 11px; border-radius: 3px; background: color-mix(in oklab, var(--ink) 7%, transparent); }
.g-heat-key i:first-of-type { margin-left: 4px; }
.g-heat-key i:last-of-type { margin-right: 4px; }

/* ---- badges ---- */
.g-badges { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 112px), 1fr)); gap: 10px; }
.g-badge { display: grid; justify-items: center; align-content: start; gap: 6px; text-align: center; padding: 14px 8px 12px; border-radius: 14px; border: 1px solid var(--rule); background: var(--card-2); min-width: 0; }
.g-badge b { font-size: 12.5px; font-weight: 600; color: var(--ink); line-height: 1.25; }
.g-badge > span { font-size: 11.5px; line-height: 1.35; color: var(--ink-2); overflow-wrap: anywhere; }
.g-badge.is-locked .g-art { filter: grayscale(1); opacity: .42; }
.g-badge.is-locked b { color: var(--ink-2); }

/* ---- rating ---- */
.g-rating { display: grid; gap: 4px; }
.g-tier { display: flex; align-items: center; gap: 14px; }
.g-tier-name { margin: 0; font-size: 13px; font-weight: 600; letter-spacing: .01em; color: var(--ink-15); }
.g-tier-bronze { color: #b06a2c; } .g-tier-silver { color: #6b7380; } .g-tier-gold { color: #9a6b12; } .g-tier-platinum { color: #1f7a6e; } .g-tier-diamond { color: #2f5fbf; }
:root:not([data-theme="light"]) .g-tier-bronze { color: #e0a070; }
:root:not([data-theme="light"]) .g-tier-silver { color: #c3cad6; }
:root:not([data-theme="light"]) .g-tier-gold { color: #e9b949; }
:root:not([data-theme="light"]) .g-tier-platinum { color: #7fd6c9; }
:root:not([data-theme="light"]) .g-tier-diamond { color: #8ab4ff; }
.g-spark { display: block; width: 100%; height: 64px; margin: 10px 0 2px; }
.g-rating .g-link { justify-self: start; margin-top: 8px; }

/* ---- Sunday mock test history ---- */
.g-hist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.g-hist li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; gap: 6px 14px; align-items: center; padding: 10px 14px; border: 1px solid var(--rule); border-radius: 12px; font-size: 13.5px; scroll-margin-top: calc(var(--bar-h) + 16px); }
.g-hist li:target { border-color: color-mix(in oklab, var(--accent) 55%, var(--rule)); }
.g-hist li:has(.g-hist-card) { grid-template-columns: minmax(0, 1fr) auto auto auto auto; }
.g-hist-k { min-width: 0; color: var(--ink); }
.g-hist-rank { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.g-hist .g-dim { font-variant-numeric: tabular-nums; }
.g-hist-d { min-width: 40px; text-align: right; font: 600 13px/1 var(--mono); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.g-hist-d.up { color: #16a34a; } .g-hist-d.down { color: #dc2626; }
:root:not([data-theme="light"]) .g-hist-d.up { color: #4ade80; }
:root:not([data-theme="light"]) .g-hist-d.down { color: #f87171; }
.g-hist-card { font-size: 12.5px; color: var(--ink-15); text-decoration: none; white-space: nowrap; }
.g-hist-card:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 560px) {
  .g-hist li, .g-hist li:has(.g-hist-card) { grid-template-columns: minmax(0, 1fr) auto; }
  .g-hist-k { grid-column: 1 / -1; }
}

/* ---- a section's heading row (dashboard and profile) ---- */
.g-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.g-head h2, .g-head h3 { margin: 0; }
.g-empty { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--ink-2); }

/* ---- the figures beside a level ---- */
.g-facts { margin: 0; display: grid; gap: 8px; font-size: 13.5px; }
.g-facts > div { display: flex; justify-content: space-between; gap: 12px; }
.g-facts dt { color: var(--ink-2); }
.g-facts dd { margin: 0; color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---- the dashboard's and the profile's frame: a side column (level,
   rating) beside the main one on a wide screen; cards as the career tools
   draw them (career.css .pr-card), so the two pages match ---- */
.g-card {
  background: var(--card); border: 1px solid var(--rule); border-radius: var(--r-2); padding: 22px; min-width: 0;
  box-shadow: 0 1px 0 rgb(255 255 255 / .035) inset, 0 1px 2px rgb(0 0 0 / .18);
}
:root[data-theme="light"] .g-card { box-shadow: 0 1px 2px rgb(24 24 27 / .06); }
.page .g-card h2 { font-size: 15px; font-weight: 600; color: var(--ink); margin: 0 0 14px; letter-spacing: -.01em; }
.page .g-card .g-head h2 { margin: 0; }
.g-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-items: start; }
@media (min-width: 1000px) { .g-grid { grid-template-columns: 300px minmax(0, 1fr); } }
.g-side, .g-main { display: grid; gap: 14px; min-width: 0; align-content: start; }
.g-two { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
@media (min-width: 760px) { .g-two { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); } }
.g-who { display: grid; gap: 16px; }
.g-who .go, .g-who .alt { justify-self: start; }
