/* Game shell. Our own look: ink-on-paper board with one accent; not HireVue's purple, teal or hexagons. */
.ag-game {
  --g-bg: #f6f3ec;
  --g-ink: #1d2433;
  --g-sub: #5b6475;
  --g-line: #d9d3c4;
  --g-card: #ffffff;
  --g-accent: #e2572b;
  --g-accent-ink: #ffffff;
  --g-win: #1f9d61;
  --g-lose: #c9372c;
  --g-bar: #f0b429;
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 420px;
  min-height: 560px;
  margin: 0 auto;
  background: var(--g-bg);
  color: var(--g-ink);
  border: 1px solid var(--g-line);
  border-radius: 18px;
  overflow: hidden;
  font: 16px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .ag-game {
    --g-bg: #151a24; --g-ink: #eef1f6; --g-sub: #9aa3b5; --g-line: #2b3343; --g-card: #1f2633; --g-bar: #f0b429;
  }
}
:root[data-theme="dark"] .ag-game {
  --g-bg: #151a24; --g-ink: #eef1f6; --g-sub: #9aa3b5; --g-line: #2b3343; --g-card: #1f2633;
}
.ag-top { display: grid; grid-template-columns: 44px 1fr 64px; align-items: center; padding: 10px 12px 6px; font-weight: 600; }
.ag-level { text-align: center; }
.ag-clock { text-align: right; font-variant-numeric: tabular-nums; }
.ag-pause { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--g-line); background: var(--g-card); color: var(--g-ink); font-weight: 700; cursor: pointer; }
.ag-bar { height: 6px; margin: 0 12px; background: var(--g-line); border-radius: 3px; overflow: hidden; }
.ag-bar-fill { height: 100%; width: 100%; background: var(--g-bar); }
.ag-stage { flex: 1; display: flex; flex-direction: column; padding: 14px; }
.ag-flash { position: absolute; inset: 0; display: grid; place-items: center; font-size: 72px; font-weight: 700; color: #fff; pointer-events: none; opacity: 0; transition: opacity .12s; }
.ag-flash.is-win { background: color-mix(in srgb, var(--g-win) 82%, transparent); opacity: 1; }
.ag-flash.is-lose { background: color-mix(in srgb, var(--g-lose) 78%, transparent); opacity: 1; }
.ag-paused { position: absolute; inset: 0; display: grid; place-content: center; gap: 14px; padding: 24px; text-align: center; background: var(--g-bg); }
.ag-paused[hidden] { display: none; }
.ag-btn { padding: 12px 20px; border: 0; border-radius: 12px; background: var(--g-accent); color: var(--g-accent-ink); font: inherit; font-weight: 700; cursor: pointer; }
.ag-done { margin: auto; font-size: 22px; font-weight: 700; }

/* Numerosity */
.nu { display: flex; flex-direction: column; gap: 18px; flex: 1; }
.nu-head { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.nu-head > div { background: var(--g-card); border: 1px solid var(--g-line); border-radius: 12px; padding: 8px 12px; display: flex; flex-direction: column; }
.nu-head span { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--g-sub); }
.nu-head b { font-size: 34px; line-height: 1.1; }
.nu-tiles { flex: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; align-content: center; justify-items: center; }
.nu-tile { width: 84px; height: 84px; border-radius: 50%; border: 2px solid var(--g-line); background: var(--g-card); color: var(--g-ink); font: 700 28px/1 system-ui, sans-serif; cursor: pointer; transform: translateY(calc(var(--i) * 0px)); }
.nu-tile:nth-child(3n+2) { margin-top: 28px; }
.nu-tile.is-on { border-color: var(--g-accent); background: var(--g-accent); color: var(--g-accent-ink); }
.nu-tile:focus-visible { outline: 3px solid var(--g-bar); outline-offset: 2px; }

.ag-card { margin: auto; padding: 28px 22px; text-align: center; display: flex; flex-direction: column; gap: 10px; }
.ag-card h2 { margin: 0 0 4px; font-size: 24px; }
.ag-card p { margin: 0; color: var(--g-sub); }
.ag-card .ag-btn { margin-top: 10px; }

/* Digitspan */
.ds { position: relative; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.ds-show, .ds-input { min-height: 46px; display: grid; place-items: center; border-radius: 12px; font: 700 26px/1 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .12em; }
.ds-show { background: var(--g-ink); color: var(--g-bg); }
.ds-input { background: var(--g-card); border: 1px solid var(--g-line); }
.ds-pad { flex: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; align-content: center; padding: 6px 10px; }
.ds-pad.is-wide { grid-template-columns: repeat(4, 1fr); }
.ds-key { aspect-ratio: 1.25; border-radius: 14px; border: 2px solid var(--g-line); background: var(--g-card); color: var(--g-ink); font: 700 24px/1 system-ui, sans-serif; cursor: pointer; }
.ds-key:disabled { opacity: .35; cursor: default; }
.ds-back { color: var(--g-lose); }
.ds-note { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; gap: 12px; padding: 24px; text-align: center; background: var(--g-bg); }
.ds-note b { font-size: 22px; }
.ds-note p { margin: 0; color: var(--g-sub); }

/* Disconumbers */
.dn { display: flex; flex-direction: column; gap: 12px; flex: 1; }
.dn-board { position: relative; flex: 1; min-height: 330px; }
.dn-dot { position: absolute; width: 58px; height: 58px; margin: -29px 0 0 -29px; border-radius: 50%; display: grid; place-items: center; background: var(--g-card); color: var(--g-ink); border: 4px solid var(--c); font: 700 22px/1 system-ui, sans-serif; transition: transform .15s, background .15s, color .15s; }
.dn-dot.is-lit { background: var(--c); color: #fff; transform: scale(1.18); box-shadow: 0 0 0 6px color-mix(in srgb, var(--c) 30%, transparent); }
.dn-answers { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.dn-answer { height: 54px; border-radius: 12px; border: 2px solid var(--g-line); background: var(--g-card); color: var(--g-ink); font: 700 22px/1 system-ui, sans-serif; cursor: pointer; }
.dn-answer:disabled { cursor: default; color: transparent; }

/* Shapedance */
.sd { display: flex; flex-direction: column; gap: 12px; flex: 1; }
.sd-grid { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-content: center; justify-items: center; }
.sd-card { width: 120px; height: 120px; padding: 14px; border: 3px solid transparent; border-radius: 16px; background: transparent; cursor: pointer; }
.sd-card.is-on { border-color: var(--g-accent); background: color-mix(in srgb, var(--g-accent) 14%, transparent); }
.sd-card svg { width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 2px 3px rgba(0,0,0,.18)); }
.sd-cell { fill: #ffffff; } .sd-cell2 { fill: #ece7dc; }
.sd-circle { fill: #c9372c; } .sd-square { fill: #2f6fdf; } .sd-tri { fill: #e89a1c; }
.sd-card svg.is-spin { animation: sd-spin 6s linear infinite; }
.sd-card svg.is-spin-r { animation: sd-spin 7s linear infinite reverse; }
@keyframes sd-spin { from { transform: rotate(var(--a)); } to { transform: rotate(calc(var(--a) + 360deg)); } }
@media (prefers-reduced-motion: reduce) { .sd-card svg.is-spin, .sd-card svg.is-spin-r { animation-duration: 18s; } }

/* Flashback */
.fb { position: relative; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.fb-q { min-height: 48px; display: grid; place-items: center; text-align: center; padding: 8px 12px; border-radius: 12px; background: var(--g-card); border: 1px solid var(--g-line); font-weight: 600; }
.fb-stage { flex: 1; display: grid; place-items: center; overflow: hidden; }
.fb-stage svg { width: 230px; height: 230px; }
.fb-in { animation: fb-in .22s ease-out; }
@keyframes fb-in { from { transform: translateX(40%) scale(.9); opacity: 0; } to { transform: none; opacity: 1; } }
.fb-seg { stroke: var(--g-bg); stroke-width: 1.6; }
.fb-none { fill: #9aa3b5; } .fb-a { fill: #e2572b; } .fb-b { fill: #2f6fdf; }
.fb-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fb-buttons button { height: 58px; border-radius: 12px; border: 2px solid var(--g-line); background: var(--g-card); color: var(--g-ink); font: 700 20px/1 system-ui, sans-serif; cursor: pointer; }
.fb-buttons button:disabled { opacity: .4; cursor: default; }

/* Pathfinder */
.pf { flex: 1; display: grid; place-items: center; }
.pf-grid { --n: 3; display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 4px; width: min(100%, 340px); aspect-ratio: 1; padding: 6px; border-radius: 14px; background: var(--g-line); }
.pf-cell { padding: 0; border: 0; border-radius: 8px; background: var(--g-card); cursor: pointer; }
.pf-cell svg { width: 100%; height: 100%; display: block; }
.pf-pipe { stroke: #2f6fdf; stroke-width: 2.6; stroke-linecap: round; fill: none; }
.pf-end, .pf-fixed { background: #c9c3b4; cursor: default; }
.pf-end .pf-pipe { stroke: #1d2433; }
.pf-end circle { fill: var(--g-accent); }
.pf-empty { background: transparent; cursor: default; }
.pf-cell:disabled { opacity: 1; }
.pf-cell.is-picked { outline: 3px solid var(--g-accent); outline-offset: -3px; }
.pf-empty.is-target { background: color-mix(in srgb, var(--g-accent) 22%, transparent); cursor: pointer; }

/* Puzzle */
.pz { flex: 1; display: grid; place-items: center; }
.pz-intro { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.pz-intro p { margin: 0; font-weight: 600; }
.pz-full { width: 260px; height: 260px; border-radius: 10px; box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.pz-grid { --n: 3; display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 3px; width: min(100%, 320px); aspect-ratio: 1; padding: 3px; background: var(--g-line); border-radius: 10px; }
.pz-tile { padding: 0; border: 0; background: var(--g-card); cursor: pointer; }
.pz-tile svg { width: 100%; height: 100%; display: block; }
.pz-tile.is-hole { background: var(--g-ink); cursor: default; }

/* PortraitXT (survey) */
.px { flex: 1; display: flex; flex-direction: column; gap: 18px; padding: 18px 16px; }
.px-top { display: flex; justify-content: center; }
.px-ring { --p: 0deg; width: 74px; height: 74px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--g-accent) var(--p), var(--g-line) 0); position: relative; font-weight: 700; font-size: 15px; }
.px-ring::before { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: var(--g-bg); }
.px-ring span { position: relative; }
.px-stmt { margin: 0; min-height: 96px; display: grid; place-items: center; text-align: center; font-size: 21px; font-weight: 600; padding: 0 6px; }
.px-opts { display: flex; flex-direction: column; gap: 9px; }
.px-opt { height: 50px; border-radius: 12px; border: 2px solid var(--g-line); background: var(--g-card); color: var(--g-ink); font: 600 17px/1 system-ui, sans-serif; cursor: pointer; }
.px-opt.is-on { border-color: var(--g-accent); background: var(--g-accent); color: var(--g-accent-ink); }
.px-result { text-align: left; gap: 12px; }
.px-bar { display: grid; gap: 4px; }
.px-bar span { font-size: 14px; color: var(--g-sub); }
.px-bar div { height: 10px; border-radius: 5px; background: var(--g-line); overflow: hidden; }
.px-bar i { display: block; height: 100%; background: var(--g-accent); }
.px-note { font-size: 13px; }

/* Singularity */
.sg { flex: 1; display: grid; place-items: center; }
.sg-grid { --cols: 4; display: grid; grid-template-columns: repeat(var(--cols), 1fr); gap: 6px; width: 100%; }
.sg-item { aspect-ratio: 1; padding: 14%; border: 0; border-radius: 10px; background: transparent; cursor: pointer; }
@media (hover: hover) { .sg-item:hover { background: color-mix(in srgb, var(--g-ink) 6%, transparent); } }
.sg-item svg { width: 100%; height: 100%; display: block; }

/* Pulse */
.pu-stage { flex: 1; margin: 14px; display: grid; place-items: center; border: 3px solid transparent; border-radius: 16px; background: var(--g-card); cursor: pointer; touch-action: manipulation; }
.pu-item { width: 120px; height: 120px; }
.pu-item[hidden] { display: block; visibility: hidden; }
.pu-stage.is-ok { animation: pu-ok .35s; } .pu-stage.is-bad { animation: pu-bad .35s; }
@keyframes pu-ok { from { border-color: var(--g-win); } to { border-color: transparent; } }
@keyframes pu-bad { from { border-color: var(--g-lose); } to { border-color: transparent; } }

/* Teamchat */
.tc-log { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; max-height: 360px; }
.tc-msg { max-width: 82%; padding: 9px 12px; border-radius: 14px; font-size: 15px; line-height: 1.35; user-select: text; -webkit-user-select: text; }
.tc-msg b { display: block; font-size: 12px; color: var(--g-sub); margin-bottom: 2px; }
.tc-them { align-self: flex-start; background: var(--g-card); border: 1px solid var(--g-line); border-bottom-left-radius: 4px; }
.tc-me { align-self: flex-end; background: var(--g-accent); color: var(--g-accent-ink); border-bottom-right-radius: 4px; }
.tc-typing { color: var(--g-sub); letter-spacing: .2em; }
.tc-sep { height: 1px; background: var(--g-line); margin: 8px 0; }
.tc-opts { display: flex; flex-direction: column; gap: 7px; padding: 0 14px 14px; }
.tc-opt { text-align: left; padding: 10px 12px; border-radius: 12px; border: 2px solid var(--g-line); background: var(--g-card); color: var(--g-ink); font: 500 14px/1.35 system-ui, sans-serif; cursor: pointer; }
@media (hover: hover) { .tc-opt:hover { border-color: var(--g-accent); } }
.ag-card.is-long p { text-align: left; font-size: 14px; }

/* Portrait */
.pt-opts { display: grid; gap: 12px; }
.pt-opt { min-height: 96px; padding: 16px; border-radius: 14px; border: 2px solid var(--g-line); background: var(--g-card); color: var(--g-ink); font: 600 18px/1.35 system-ui, sans-serif; cursor: pointer; }
.pt-opt.is-on { border-color: var(--g-accent); background: var(--g-accent); color: var(--g-accent-ink); }

/* E-Motions (cartoon) */
.em { flex: 1; display: flex; flex-direction: column; gap: 14px; }
.em-stage { flex: 1; display: grid; place-items: center; }
.em-face { width: 220px; height: 264px; }
.em-opts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.em-opt { height: 50px; border-radius: 12px; border: 2px solid var(--g-line); background: var(--g-card); color: var(--g-ink); font: 600 15px/1 system-ui, sans-serif; cursor: pointer; }
.em-opt:disabled { opacity: .4; cursor: default; }

/* Paywall card */
.ag-pay-buttons { display: grid; gap: 10px; margin-top: 8px; }
.ag-pay-buttons .ag-btn { margin: 0; }
.ag-btn-alt { background: var(--g-ink); color: var(--g-bg); }
.ag-pay-small { font-size: 13px; }
.ag-pay-small a { color: var(--g-accent); }
.ag-pay-error { color: var(--g-lose) !important; font-size: 14px; }
