:root {
  font-family: Roboto, Arial, sans-serif;
  --sidebar-w: 330px;
  --page: #1c1f23;
  --stage: #202020;
  --panel: #141619;
  --panel-2: #1d2024;
  --panel-3: #2a2f36;
  --panel-4: #343941;
  --text: #f2f3f5;
  --muted: #9ca3ad;
  --accent: #ff2d8b;
  --accent-rgb: 255,45,139;
  --danger: #d54e54;
  --input-text: #f2f3f5;
  --input-bg: #30343a;
  --slider-track: #343941;
  --targets-color: transparent;
  --difficulty-color: transparent;
}
:root[data-ui='light'] {
  --page: #e8ebef;
  --stage: #e7eaee;
  --panel: #f7f8fa;
  --panel-2: #edf0f3;
  --panel-3: #dce1e6;
  --panel-4: #ccd3da;
  --text: #15181c;
  --muted: #5e6670;
  --input-text: #15181c;
  --input-bg: #d9dee4;
  --slider-track: #c5ccd4;
}
:root[data-ui='cyan'] {
  --page: #8fcbd0;
  --stage: #8fcbd0;
  --panel: #174148;
  --panel-2: #20525a;
  --panel-3: #2d6870;
  --panel-4: #3b7880;
  --text: #f4ffff;
  --muted: #b9dfe3;
  --input-text: #ffffff;
  --input-bg: #2b626a;
  --slider-track: #41767d;
}
* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; }
body { overflow: hidden; background: var(--page); color: var(--text); }
button, input, select { font: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid rgba(var(--accent-rgb), .65); outline-offset: 1px; }

#app {
  width: 100vw;
  height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--sidebar-w);
  background: var(--page);
  transition: grid-template-columns 240ms linear;
}
#app.sidebar-closed { grid-template-columns: minmax(0, 1fr) 0px; }
#stage-wrap { position: relative; min-width: 0; min-height: 0; overflow: hidden; background: var(--stage); }
#stage { position: absolute; inset: 0; }
#stage canvas { display: block; width: 100%; height: 100%; }

#sidebar {
  position: relative;
  z-index: 20;
  height: 100%;
  min-width: 0;
  padding: 6px;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--panel);
  box-shadow: none;
  scrollbar-width: thin;
  scrollbar-color: #444a52 transparent;
  transition: padding 240ms linear, opacity 180ms linear;
}
#app.sidebar-closed #sidebar { padding-left: 0; padding-right: 0; opacity: 0; pointer-events: none; }
#sidebar::-webkit-scrollbar { width: 7px; }
#sidebar::-webkit-scrollbar-thumb { background: #444a52; }

.sidebar-toggle {
  position: fixed;
  top: 10px;
  right: calc(var(--sidebar-w) + 6px);
  z-index: 55;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 3px;
  background: rgba(17, 20, 24, .82);
  color: #fff;
  cursor: pointer;
  transition: right 240ms linear, background 120ms ease;
}
#app.sidebar-closed .sidebar-toggle { right: 6px; }
.sidebar-toggle:hover { background: rgba(var(--accent-rgb), .86); }
.sidebar-toggle svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; transition: transform 240ms linear; }
#app.sidebar-closed .sidebar-toggle svg { transform: rotate(180deg); }

.setting-row, .setting, .select-row, .toggle, .theme-row {
  margin-bottom: 4px;
  background: var(--panel-2);
  border-left: 3px solid transparent;
}
.setting-row:hover, .setting:hover, .select-row:hover, .toggle:hover, .theme-row:hover { border-left-color: rgba(var(--accent-rgb), .48); }
.setting-row, .select-row { min-height: 34px; display: grid; align-items: center; gap: 7px; padding: 4px 5px 4px 7px; }
.setting-row { grid-template-columns: 1fr 112px; }
.select-row { grid-template-columns: 1fr 128px; }
.setting-row label, .setting-head label, .select-row label, .theme-row label { font-size: 11px; font-weight: 700; color: var(--text); }
.setting-row input[type='number'], .theme-controls input[type='text'], .select-row select, .select-row input[type='color'] {
  width: 100%; height: 25px; border: 0; border-radius: 1px; padding: 0 7px; background: var(--input-bg); color: var(--input-text); font-size: 12px; font-weight: 800;
}
.select-row input[type='color'] { padding: 2px; }
.target-setting { background: var(--targets-color); }
.target-setting label { color: #fff; text-shadow: 0 1px 1px rgba(0,0,0,.45); }
.target-setting input { background: rgba(18, 22, 27, .42) !important; color: #fff !important; }
.difficulty-setting { background: var(--difficulty-color); }
.difficulty-setting .setting-head label,
.difficulty-setting .setting-head span { color:#fff; text-shadow:0 1px 1px rgba(0,0,0,.45); }
.difficulty-setting input[type='range']::-webkit-slider-runnable-track { background:rgba(18,22,27,.48); }
.difficulty-setting input[type='range']::-webkit-slider-thumb { background:#fff; }
.difficulty-setting input[type='range']::-moz-range-track { background:rgba(18,22,27,.48); }
.difficulty-setting input[type='range']::-moz-range-progress { background:rgba(255,255,255,.64); }
.difficulty-setting input[type='range']::-moz-range-thumb { background:#fff; }


.slider-setting { padding: 5px 6px 6px 7px; }
.slider-setting.compact { padding-top: 5px; padding-bottom: 6px; }
.setting-head { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:4px; }
.setting-head span { min-width:52px; text-align:right; color: var(--text); font-size: 11px; font-weight: 900; }
input[type='range'] { -webkit-appearance:none; appearance:none; display:block; width:100%; height:15px; margin:0; background:transparent; cursor:pointer; }
input[type='range']::-webkit-slider-runnable-track { height: 6px; border-radius:1px; background: var(--slider-track); }
input[type='range']::-webkit-slider-thumb { -webkit-appearance:none; width:12px; height:15px; margin-top:-4.5px; border:0; border-radius:1px; background: var(--accent); }
input[type='range']::-moz-range-track { height:6px; border:0; border-radius:1px; background: var(--slider-track); }
input[type='range']::-moz-range-progress { height:6px; background: var(--accent); }
input[type='range']::-moz-range-thumb { width:12px; height:15px; border:0; border-radius:1px; background: var(--accent); }

.group { margin:5px 0; background: var(--panel); }
.group > summary {
  list-style:none;
  min-height:29px;
  padding:0 7px 0 8px;
  display:flex;
  align-items:center;
  gap:5px;
  cursor:pointer;
  user-select:none;
  background: color-mix(in srgb, var(--panel) 78%, black);
  border-left:3px solid var(--accent);
  color:var(--text);
  font-size:11px;
  font-weight:800;
}
:root[data-ui='light'] .group > summary { background: #d9dee4; }
:root[data-ui='cyan'] .group > summary { background: #10363c; }
.group > summary::-webkit-details-marker { display:none; }
.group > summary::before { content:'›'; display:inline-block; color:var(--accent); font-size:16px; line-height:1; transform:rotate(0deg); transition:transform 90ms ease; }
.group[open] > summary::before { transform:rotate(90deg); }
.group-body { padding:4px 0 0; }

.toggle { width:100%; min-height:34px; border:0; border-radius:1px; padding:0 7px; display:flex; align-items:center; justify-content:space-between; color:var(--text); cursor:pointer; font-size:11px; font-weight:700; }
.toggle-dot { width:30px; height:16px; padding:2px; border-radius:2px; background:#4b5057; display:flex; justify-content:flex-start; transition:background-color 110ms ease; }
.toggle-dot::after { content:''; width:12px; height:12px; border-radius:1px; background:#cdd2d7; transition:transform 110ms ease; }
.toggle.active { border-left-color: var(--accent); }
.toggle.active .toggle-dot { background: var(--accent); }
.toggle.active .toggle-dot::after { transform: translateX(14px); background: #fff; }

.theme-row { min-height: 40px; display:grid; grid-template-columns:1fr 150px; align-items:center; gap:7px; padding:5px 5px 5px 7px; }
.theme-controls { display:grid; grid-template-columns:34px 1fr; gap:5px; }
#theme-color { width:34px; height:25px; padding:0; border:0; background:var(--input-bg); cursor:pointer; }
#theme-color::-webkit-color-swatch-wrapper { padding:2px; }
#theme-color::-webkit-color-swatch { border:0; }
.swatches { display:grid; grid-template-columns: repeat(5, 1fr); gap:4px; margin:0 0 4px; }
.swatch { height:24px; border:0; border-radius:1px; background: var(--sw); cursor:pointer; }
.swatch:hover { filter: brightness(1.1); }

.action-grid { display:grid; grid-template-columns: 1fr 1fr; gap:4px; margin-top:5px; }
.action-grid.three { grid-template-columns: 1fr 1fr 1fr; }
.restart, .reset-settings, .pause-action { min-height:40px; border:0; border-radius:1px; color:#fff; font-size:11px; font-weight:900; cursor:pointer; }
.restart { background: var(--danger); }
.reset-settings { background: var(--panel-3); color: var(--text); }
.pause-action { background: var(--accent); display:flex; align-items:center; justify-content:center; }
.restart:hover, .reset-settings:hover, .pause-action:hover, .dual-option:hover, .math-live-option:hover { filter: brightness(1.08); }
.restart:active, .reset-settings:active, .pause-action:active, .dual-option:active { transform: translateY(1px); }
.sidebar-footer { position: sticky; bottom: -6px; margin: 4px -6px -6px; padding: 5px 6px 6px; display:flex; justify-content:flex-end; gap:4px; background: var(--panel); }
.icon-button { width:31px; height:31px; padding:0; border:0; border-radius:2px; background:var(--panel-3); color:var(--text); cursor:pointer; display:grid; place-items:center; }
.icon-button:hover { background:var(--accent); color:#fff; }
.icon-button svg { width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
.discord-footer-button { text-decoration:none; }
.discord-footer-button svg { width:18px; height:18px; fill:currentColor; stroke:none; }

#message {
  position:absolute; top:8px; left:12px; z-index:10; pointer-events:none;
  color: rgba(245,245,245,.78); font-size: clamp(26px, 3.5vw, 54px); font-weight:400;
  text-shadow: 1px 2px 2px rgba(0,0,0,.78);
}
:root[data-ui='light'] #message, :root[data-ui='cyan'] #message { color: rgba(28,32,34,.70); text-shadow: 1px 1px 1px rgba(255,255,255,.45); }
#message.message-positive { color: #29d55f; text-shadow: 1px 2px 2px rgba(0,0,0,.85); }
#message.message-negative { color: #ff4e58; text-shadow: 1px 2px 2px rgba(0,0,0,.85); }
#stats { position:absolute; left:5px; bottom:4px; z-index:10; color:#f4f4f4; font-size:19px; font-weight:500; text-shadow:1px 1px 2px rgba(0,0,0,.85); }
#hint { position:absolute; right:10px; bottom:7px; z-index:10; color:rgba(255,255,255,.68); font-size:10px; font-weight:500; text-shadow:1px 1px 2px rgba(0,0,0,.9); }
:root[data-ui='light'] #stats, :root[data-ui='light'] #hint, :root[data-ui='cyan'] #stats, :root[data-ui='cyan'] #hint { color:#263238; text-shadow:none; }

#center-dot { position:absolute; left:50%; top:50%; width:12px; height:12px; margin:-6px 0 0 -6px; z-index:11; border-radius:50%; background:#f02e2e; pointer-events:none; }
#center-dot.hidden { display:none; }
#center-dot.blink { animation: dotBlink 2s infinite ease-in-out; }
@keyframes dotBlink { 0%,100% { opacity:.28; } 50% { opacity:1; } }
#center-dot.anaglyph { background:transparent; }
#center-dot.anaglyph::before, #center-dot.anaglyph::after { content:''; position:absolute; inset:0; border-radius:50%; mix-blend-mode:screen; }
#center-dot.anaglyph::before { background:red; transform: translateX(-15%); }
#center-dot.anaglyph::after { background:cyan; transform: translateX(15%); }

#center-task {
  position:absolute; left:50%; top:50%; transform:translate(-50%,-50%); min-width:120px; padding:8px 14px; z-index:12;
  border-radius:5px; background:rgba(5,10,18,.13); color:#f8fbff; text-align:center; font-size:clamp(34px,5vw,70px); font-weight:700; pointer-events:none;
  text-shadow:0 2px 4px rgba(0,0,0,.6);
}
#center-task.math { font-size:clamp(30px,4vw,58px); }
#center-task.emoji { opacity:.55; background:transparent; text-shadow:0 2px 3px rgba(0,0,0,.42); }
#center-task.hidden { display:none; }
#math-live-options { position:absolute; left:50%; top:calc(50% + 70px); transform:translateX(-50%); z-index:15; display:grid; grid-template-columns:repeat(4,minmax(70px,1fr)); gap:5px; width:min(430px,60vw); }
#math-live-options.hidden { display:none; }
.math-live-option { min-height:38px; border:0; border-radius:2px; background:rgba(20,24,30,.80); color:#fff; font-size:16px; font-weight:800; cursor:pointer; }
.math-live-option.correct { background:#237f4b; }
.math-live-option.wrong { background:#a83e43; }

#adapt-feedback {
  position:absolute; left:50%; top:50%; z-index:25; transform:translate(-50%,-50%) scale(.12); opacity:0; pointer-events:none;
  font-size:clamp(32px,5vw,72px); font-weight:400; color:rgba(248,248,248,.82); text-shadow:2px 3px 3px rgba(0,0,0,.78);
}
#adapt-feedback.positive { color:#36d96f; }
#adapt-feedback.negative { color:#ff575f; }
#adapt-feedback.adapt-pop { animation: adaptFly 920ms cubic-bezier(.16,.72,.22,1) forwards; }
@keyframes adaptFly {
  0% { transform:translate(-50%,-50%) scale(.12); opacity:0; filter:blur(3px); }
  20% { opacity:.95; }
  72% { transform:translate(-50%,-50%) scale(1.15); opacity:.9; filter:blur(0); }
  100% { transform:translate(-50%,-50%) scale(1.58); opacity:0; filter:blur(.4px); }
}

#dual-task-overlay { position:absolute; inset:0; z-index:30; display:flex; align-items:center; justify-content:center; background:rgba(12,16,24,.52); }
#dual-task-overlay.hidden { display:none; }
#dual-task-card { width:min(470px,calc(100vw - 48px)); background:var(--panel); border-left:0; padding:14px; }
#dual-task-title { display:none; }
#dual-task-question { font-size:20px; font-weight:700; color:var(--text); margin-bottom:14px; }
#dual-task-options { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
.dual-option { min-height:48px; border:0; background:var(--panel-3); color:var(--text); font-size:20px; font-weight:700; cursor:pointer; }

.modal { position:fixed; inset:0; z-index:100; display:flex; align-items:center; justify-content:center; padding:24px; background:rgba(0,0,0,.56); }
.modal.hidden { display:none; }
.modal-card { width:min(760px,94vw); max-height:88vh; overflow:auto; background:var(--panel); color:var(--text); border-left:0; }
.modal-top { position:sticky; top:0; z-index:2; display:flex; align-items:center; justify-content:space-between; gap:8px; padding:8px; background:var(--panel); }
.modal-tabs { display:flex; gap:4px; }
.modal-tab { min-height:34px; padding:0 13px; border:0; background:var(--panel-3); color:var(--text); font-weight:800; cursor:pointer; }
.modal-tab.active { background:var(--accent); color:#fff; }
.modal-close { width:34px; height:34px; border:0; background:var(--panel-3); color:var(--text); font-size:23px; cursor:pointer; }
.modal-page { display:none; padding:10px 18px 22px; line-height:1.48; }
.modal-page.active { display:block; }
.modal-page h2 { margin:4px 0 14px; font-size:24px; }
.modal-page h3 { margin:20px 0 8px; font-size:17px; }
.modal-page p { margin:0 0 12px; color:var(--text); }
.study-links { display:flex; flex-direction:column; gap:8px; margin-top:14px; }
.study-links a { color:#55b7f3; font-weight:700; text-decoration:none; }
.study-links a:hover { text-decoration:underline; }

.hidden { display:none !important; }

@media (max-width: 980px) {
  :root { --sidebar-w: 278px; }
  #sidebar { padding:5px; }
  #hint { display:none; }
  .select-row { grid-template-columns:1fr 108px; }
  .setting-row { grid-template-columns:1fr 84px; }
  .theme-row { grid-template-columns:1fr; }
  #dual-task-options { grid-template-columns:1fr; }
  #math-live-options { width:min(420px,75vw); }
}

.mini-note { margin:-1px 0 6px; padding:0 7px 3px; color:var(--muted); font-size:10px; line-height:1.35; }
.setting.disabled { opacity:.55; }

.check-row { display:flex; align-items:center; justify-content:space-between; gap:12px; min-height:34px; background:var(--panel-2); padding:0 10px; color:var(--text); font-size:12px; font-weight:700; }
.check-row input[type="checkbox"] { width:14px; height:14px; accent-color: var(--accent); }





.stage-progress-button {
  position:absolute; left:5px; bottom:31px; z-index:12;
  width:34px; height:34px; padding:0; border:0; border-radius:2px;
  background:var(--panel-3); color:var(--text); cursor:pointer; box-shadow:none;
  display:grid; place-items:center;
}
.stage-progress-button:hover { background:var(--accent); color:#fff; }
.stage-progress-button svg { width:19px; height:19px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
.stage-goal-button { bottom:69px; }
.stage-restart-button { bottom:107px; }
.stage-goal-button.goal-running { color:#f2f3f5; }
.stage-goal-button.goal-finished { animation:goalButtonFinish 1250ms ease-in-out; }
@keyframes goalButtonFinish {
  0%,100% { background:var(--panel-3); color:var(--text); }
  18%,52% { background:#29d665; color:#fff; }
  35%,70% { background:#f7f8fa; color:#1a1d20; }
}

.history-card {
  width:min(1480px,96vw); height:min(720px,92vh);
  display:flex; flex-direction:column; overflow:hidden;
  background:#050607; color:#d8d8d8;
  border:1px solid #0f1214;
  font-family:Roboto,Arial,sans-serif;
}
.history-tabs {
  display:flex; align-items:flex-end; gap:0; padding:18px 18px 0;
  background:#050607; border-bottom:1px solid #111518;
}
.history-tab {
  height:42px; padding:0 18px; border:1px solid #202428; border-bottom:0;
  background:#060708; color:#747a80; font-size:13px; font-weight:500; cursor:pointer;
}
.history-tab + .history-tab { margin-left:-1px; }
.history-tab.active { color:#efefef; background:#050607; }
.history-page { display:none; min-height:0; flex:1; }
.history-page.active { display:flex; flex-direction:column; }

.recent-table-wrap { position:relative; min-height:0; flex:1; overflow:auto; padding:0 18px; }
.recent-table { width:100%; border-collapse:collapse; table-layout:fixed; font-size:12px; }
.recent-table th {
  height:48px; padding:0 14px; text-align:left; color:#7d8084; font-weight:500;
  border-bottom:1px solid #17191b; position:sticky; top:0; z-index:2; background:#080909;
}
.recent-table td {
  height:46px; padding:0 14px; border-bottom:1px solid #17191b; color:#d5d5d5; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.recent-table th:nth-child(1) { width:16%; }
.recent-table th:nth-child(2) { width:11%; }
.recent-table th:nth-child(3) { width:12%; }
.recent-table th:nth-child(4) { width:13%; }
.recent-table th:nth-child(5) { width:14%; }
.recent-table th:nth-child(6) { width:16%; }
.recent-table th:nth-child(7) { width:18%; }
.result-badge, .accuracy-badge {
  display:inline-block; min-width:42px; padding:2px 6px; border-radius:3px; color:#fff; text-align:center; font-weight:700;
}
.result-badge.correct { background:#10ad22; }
.result-badge.miss { background:#d92331; }
.accuracy-badge.good { background:#15ad23; }
.accuracy-badge.mid { background:#979d00; }
.accuracy-badge.low { background:#d86d00; }
.accuracy-badge.bad { background:#da2633; }
.dual-none { color:#6d7175; }
.history-empty { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; color:#666b70; font-size:12px; pointer-events:none; }
.history-empty.hidden { display:none; }

.activity-section { padding:10px 18px 0; flex:0 0 180px; overflow:hidden; display:flex; flex-direction:column; align-items:center; }
.activity-years { height:21px; position:relative; color:#4e5963; font-size:10px; width:max-content; margin:0 auto; }
.activity-year-label { position:absolute; top:0; transform:translateX(-50%); }
.activity-layout { display:grid; grid-template-columns:34px max-content; gap:10px; width:max-content; margin:0 auto; }
.activity-weekdays { height:89px; display:grid; grid-template-rows:repeat(7,11px); gap:2px; padding-top:17px; color:#53606a; font-size:10px; line-height:11px; text-align:right; }
.activity-main { min-width:0; width:max-content; }
.activity-months { height:17px; position:relative; color:#53606a; font-size:10px; width:max-content; }
.activity-month-label { position:absolute; top:1px; transform:translateX(-50%); white-space:nowrap; }
.activity-grid { display:grid; grid-template-rows:repeat(7,11px); grid-auto-flow:column; grid-auto-columns:11px; gap:2px; overflow:hidden; width:max-content; }
.activity-cell { width:11px; height:11px; border:0; background:rgba(20,29,37,.74); opacity:0; transform:translateY(10px); }
.activity-cell.h1, .activity-legend .h1 { background:#0a6137; }
.activity-cell.h2, .activity-legend .h2 { background:#0b8645; }
.activity-cell.h3, .activity-legend .h3 { background:#10aa4c; }
.activity-cell.h4, .activity-legend .h4 { background:#33cb5d; }
.activity-cell.h0, .activity-legend .h0 { background:rgba(20,29,37,.74); }
.activity-cell.today { box-shadow:inset 0 0 0 1px rgba(255,255,255,.10); }
.activity-legend { height:25px; display:flex; justify-content:center; align-items:center; gap:3px; color:#c5c5c5; font-size:10px; width:max-content; margin:2px auto 0; }
.activity-legend i { width:11px; height:11px; border:0; display:block; }
.activity-legend span:first-child { margin-right:5px; }
.activity-legend span:last-child { margin-left:5px; }

.history-chart-wrap { position:relative; min-height:0; flex:1; padding:4px 18px 8px; }
#progress-chart { width:100% !important; height:100% !important; }
.history-footer { height:54px; flex:0 0 54px; display:flex; align-items:center; justify-content:space-between; padding:7px 16px 12px 18px; background:#050607; }
.history-clear, .history-close { height:38px; border:0; border-radius:0; padding:0 16px; cursor:pointer; font-size:12px; font-weight:500; }
.history-clear { background:transparent; color:#7faeff; }
.history-clear:hover { color:#e1e1e1; }
.history-close { background:#111315; color:#dedede; min-width:78px; }
.history-close:hover { background:#1b1e21; }

@media (max-width:760px) {
  .history-card { width:98vw; height:92vh; }
  .activity-section { padding-left:12px; padding-right:12px; }
  .recent-table-wrap { padding:0 8px; }
  .recent-table { min-width:840px; }
  .history-tabs { padding-left:10px; }
}

.activity-cell.anim-in { animation:activityPop .42s cubic-bezier(.2,.9,.25,1) forwards; }
@keyframes activityPop { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:translateY(0); } }
.history-chart-wrap.chart-anim-in { animation:chartRise .46s cubic-bezier(.2,.9,.25,1); }
@keyframes chartRise { from { opacity:0; transform:translateY(18px); } to { opacity:1; transform:translateY(0); } }


#optic-flow { position:absolute; inset:0; z-index:5; pointer-events:none; overflow:hidden; }
#optic-flow.hidden { display:none; }
#optic-flow-canvas { display:block; width:100%; height:100%; }
.dual-response-cue { position:absolute; z-index:16; left:50%; top:50%; transform:translate(-50%,-50%); border:0; padding:0; background:transparent; cursor:pointer; }
.dual-response-cue.react { width:44px; height:44px; background:#e8edf3; box-shadow:inset -8px -8px 0 rgba(35,42,50,.22), 0 0 18px rgba(255,255,255,.28); }
.dual-response-cue.impulse { width:48px; height:48px; border-radius:50%; box-shadow:0 0 0 2px rgba(0,0,0,.38); }
.dual-response-cue.impulse.go { background:#aeb3b8; }
.dual-response-cue.impulse.nogo { background:#2f74ba; }
.dual-response-cue.memory { min-width:64px; min-height:64px; color:#f6f6f6; font-size:54px; line-height:64px; text-shadow:0 2px 3px rgba(0,0,0,.75); }
#center-task.stroop { min-width:180px; font-size:clamp(32px,4vw,58px); font-weight:700; letter-spacing:.03em; background:rgba(10,12,15,.18); }
.memory-prime { position:absolute; z-index:18; left:50%; top:50%; transform:translate(-50%,-50%); min-width:260px; padding:18px 22px; background:rgba(8,10,13,.88); color:#fff; text-align:center; font-weight:700; pointer-events:none; }
.memory-prime strong { display:block; margin-bottom:10px; font-size:12px; letter-spacing:.12em; color:var(--accent); }
.memory-prime .memory-shapes { font-size:48px; letter-spacing:15px; }
.dual-task-hint { position:absolute; z-index:17; left:50%; top:calc(50% + 72px); transform:translateX(-50%); color:rgba(255,255,255,.72); font-size:10px; font-weight:700; pointer-events:none; text-shadow:0 1px 2px #000; }

.dual-task-note { min-height:0; margin-top:-1px; padding-bottom:5px; }
.dual-specific.hidden-row, #dual-task-rate-row.hidden-row { display:none !important; }
#box-rotation-speed-row.hidden-row { display:none !important; }
#adaptive-step-up-row.hidden-row, #adaptive-step-down-row.hidden-row, #streak-correct-row.hidden-row, #streak-incorrect-row.hidden-row, #streak-credit-row.hidden-row, #streak-credit-note.hidden-row { display:none !important; }
.vr-action { width:100%; min-height:34px; border:0; border-radius:1px; padding:0 8px; background:var(--panel-2); color:var(--text); display:flex; align-items:center; justify-content:space-between; gap:10px; cursor:pointer; font-size:11px; font-weight:700; }
.vr-action:not(:disabled):hover { background:var(--accent); color:#fff; }
.vr-action:disabled { opacity:.45; cursor:default; }
#vr-status { font-size:10px; font-weight:500; color:var(--muted); }
.vr-action:not(:disabled):hover #vr-status { color:inherit; }
.semantic-memory-label { pointer-events:none; }

.memory-color-option { display:flex; align-items:center; justify-content:center; gap:9px; }
.memory-color-option.memory-color-only { min-height:66px; }
.memory-swatch { width:34px; height:34px; border-radius:50%; box-shadow: inset 0 0 0 1px rgba(255,255,255,.28), 0 0 0 1px rgba(0,0,0,.72); flex:0 0 auto; }
.memory-word { font-size:14px; font-weight:600; }

.memory-assign-panel {
  position:absolute; z-index:36; left:50%; bottom:42px; transform:translateX(-50%);
  min-width:300px; max-width:min(700px,78vw); padding:8px;
  background:rgba(10,12,15,.92); color:#f2f3f5; border-radius:2px;
  display:grid; grid-template-columns:auto 1fr auto; gap:8px; align-items:center;
}
.memory-assign-status { font-size:12px; font-weight:600; white-space:nowrap; color:#d8dade; }
.memory-assign-options { display:flex; justify-content:center; flex-wrap:wrap; gap:6px; }
.memory-identity-button {
  min-width:48px; min-height:42px; padding:4px 8px; border:0; border-radius:2px;
  background:#262b31; color:#fff; cursor:pointer; display:flex; align-items:center; justify-content:center; gap:6px;
}
.memory-identity-button:hover { filter:brightness(1.1); }
.memory-identity-button.used { opacity:.28; cursor:not-allowed; }
.memory-identity-button.current { box-shadow:inset 0 0 0 2px #fff; }
.memory-identity-swatch { width:28px; height:28px; border-radius:50%; box-shadow:0 0 0 1px rgba(0,0,0,.8); flex:0 0 auto; }
.memory-identity-word { font-size:12px; font-weight:700; letter-spacing:.05em; }
.memory-assign-submit { height:42px; min-width:72px; border:0; border-radius:2px; background:var(--accent); color:#fff; font-weight:800; cursor:pointer; }
.memory-assign-submit:disabled { opacity:.32; cursor:not-allowed; }

.session-goal-hud {
  position:absolute; left:45px; bottom:74px; z-index:12; min-height:24px;
  display:flex; align-items:center; padding:0 8px; border-radius:2px;
  background:rgba(18,21,25,.88); color:#f2f3f5; font-size:12px; font-weight:800;
  pointer-events:none;
}
.session-goal-hud.complete { color:#42df78; }
.session-goal-hud.hidden { display:none; }
.session-goal-popover {
  position:absolute; left:5px; bottom:108px; z-index:48; width:292px; padding:6px;
  background:var(--panel); color:var(--text); border-radius:1px; box-shadow:none;
}
.session-goal-popover.hidden { display:none; }
.session-goal-popover-head { height:30px; display:flex; align-items:center; justify-content:flex-end; margin-bottom:4px; background:var(--panel-2); }
.goal-close { width:30px; height:30px; border:0; border-radius:1px; background:var(--panel-3); color:var(--text); font-size:19px; line-height:1; cursor:pointer; }
.goal-close:hover { background:var(--accent); color:#fff; }
.goal-field { display:grid; grid-template-columns:74px 1fr; align-items:center; gap:7px; min-height:34px; margin-bottom:4px; padding:4px 5px 4px 7px; background:var(--panel-2); color:var(--text); font-size:11px; font-weight:700; }
.goal-field select, .goal-field input { width:100%; height:25px; padding:0 7px; border:0; border-radius:1px; background:var(--input-bg); color:var(--input-text); font-size:12px; font-weight:800; }
.goal-field input { appearance:textfield; }
.goal-field.hidden { display:none; }
.goal-actions { display:grid; grid-template-columns:1fr 1fr; gap:4px; margin-top:4px; }
.goal-actions button { height:34px; border:0; border-radius:1px; font-size:12px; font-weight:900; cursor:pointer; }
.goal-set { background:var(--accent); color:#fff; }
.goal-clear { background:var(--panel-3); color:var(--text); }
.goal-actions button:hover { filter:brightness(1.08); }
.session-finished-feedback {
  position:absolute; left:50%; top:50%; z-index:29; transform:translate(-50%,-50%) scale(.12); opacity:0; pointer-events:none;
  font-size:clamp(36px,5.5vw,78px); font-weight:500; color:#f5ad2e; text-shadow:2px 3px 3px rgba(0,0,0,.78);
}
.session-finished-feedback.finish-pop { animation:sessionFinishFly 1350ms cubic-bezier(.16,.72,.22,1) forwards; }
.session-finished-feedback.hidden { display:none; }
@keyframes sessionFinishFly {
  0% { transform:translate(-50%,-50%) scale(.12); opacity:0; filter:blur(3px); }
  18% { opacity:1; }
  70% { transform:translate(-50%,-50%) scale(1.12); opacity:.98; filter:blur(0); }
  100% { transform:translate(-50%,-50%) scale(1.52); opacity:0; filter:blur(.4px); }
}

.emoji-history { white-space:nowrap; font-size:10px; font-weight:800; }
.emoji-history.correct { color:#36d96f; }
.emoji-history.miss { color:#ff575f; }

/* ------------------------------------------------------------ Audio-Only MOT */

#audio-group.hidden-row,
#audio-blackout-row.hidden-row,
#audio-source-row.hidden-row,
#audio-source-warning.hidden-row,
#audio-aim-rows.hidden-row,
#audio-progression-rows.hidden-row,
#audio-tolerance-min-row.hidden-row,
#audio-group-note.hidden-row,
#audio-mode-note.hidden-row { display:none !important; }

.mode-row { border-left-color: var(--accent) !important; }
.audio-progress-note { margin-top:6px; }
.audio-source-warning { color:#ffb454; }

/* Dual Task and Answer Input have no meaning while the scene is hidden. */
.disabled-row { opacity:.38; pointer-events:none; filter:saturate(.25); }

/* Matches #stats, one line above it — the app states things on the stage as
   plain text overlays, not floating cards. */
/* Sits directly above #hint on the right. The bottom-left corner is taken by
   the stage buttons and the speed readout. */
.aim-hud {
  position:absolute; right:10px; bottom:24px; z-index:10; pointer-events:none;
  color:rgba(255,255,255,.72); font-size:13px; font-weight:600; text-align:right;
  text-shadow:1px 1px 2px rgba(0,0,0,.85);
}
.aim-hud.hidden { display:none; }
.aim-hud b { color:var(--accent); font-weight:700; }
:root[data-ui='light'] .aim-hud, :root[data-ui='cyan'] .aim-hud { color:#263238; text-shadow:none; }

.mode-badge {
  display:inline-block; white-space:nowrap; font-size:10px; font-weight:800;
  padding:2px 6px; border-radius:3px; letter-spacing:.2px;
}
.mode-badge.visual { background:rgba(255,255,255,.08); color:#b9bfc7; }
.mode-badge.audio { background:rgba(var(--accent-rgb), .17); color:var(--accent); }
:root[data-ui='light'] .mode-badge.visual, :root[data-ui='cyan'] .mode-badge.visual { background:rgba(0,0,0,.07); color:#4a545e; }

.audio-notice {
  position:absolute; left:50%; top:50%; transform:translate(-50%,-50%);
  z-index:12; width:min(92%, 400px); padding:18px 20px 16px; border-radius:12px;
  background:rgba(14,15,18,.95); border:1px solid rgba(var(--accent-rgb), .4);
  box-shadow:0 18px 46px rgba(0,0,0,.55); text-align:left;
}
.audio-notice.hidden { display:none; }
.audio-notice b { display:block; margin-bottom:7px; font-size:14px; font-weight:900; color:var(--accent); }
.audio-notice p { margin:0 0 9px; font-size:11.5px; line-height:1.5; color:#c9ced6; }
.audio-notice button {
  display:block; width:100%; margin-top:3px; padding:9px 0; border:0; border-radius:7px;
  background:var(--accent); color:#fff; font-size:12px; font-weight:800; cursor:pointer;
}
.audio-notice button:hover { filter:brightness(1.08); }

@media (max-width: 720px) {
  .aim-hud { bottom:22px; font-size:11px; }
}

/* ------------------------------------------------------- Install / Chimera */

.install-button {
  flex:1; min-width:0; height:31px; padding:0 10px; border:0; border-radius:2px;
  background:var(--panel-3); color:var(--text); cursor:pointer;
  display:flex; align-items:center; justify-content:center; gap:6px;
  font-size:11px; font-weight:700; white-space:nowrap;
}
.install-button:hover { background:var(--accent); color:#fff; }
.install-button svg { width:15px; height:15px; flex:none; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
.install-button.hidden { display:none; }

.chimera-card { width:min(430px,94vw); position:relative; padding:0; }
.chimera-close { position:absolute; top:6px; right:6px; z-index:3; }
.chimera-body { padding:26px 26px 20px; text-align:center; }
.chimera-kicker {
  display:inline-block; margin-bottom:9px; padding:3px 9px; border-radius:3px;
  background:rgba(var(--accent-rgb), .16); color:var(--accent);
  font-size:10px; font-weight:900; letter-spacing:1.1px; text-transform:uppercase;
}
.chimera-body h2 { margin:0 0 12px; font-size:20px; font-weight:800; line-height:1.25; color:var(--text); }
.chimera-body p { margin:0 0 11px; font-size:12.5px; line-height:1.6; color:var(--muted); }
.chimera-body ol { margin:2px 0 12px; padding:0 0 0 18px; text-align:left; color:var(--muted); font-size:12.5px; line-height:1.7; }
.chimera-body b { color:var(--text); }
.install-note { font-size:11px !important; opacity:.8; }

.chimera-join {
  display:block; margin-top:16px; padding:11px 0; border-radius:3px;
  background:var(--accent); color:#fff; text-decoration:none;
  font-size:13px; font-weight:800;
}
.chimera-join:hover { filter:brightness(1.08); }
.chimera-dismiss {
  display:block; width:100%; margin-top:7px; padding:8px 0; border:0; border-radius:3px;
  background:transparent; color:var(--muted); font-size:11px; font-weight:600; cursor:pointer;
}
.chimera-dismiss:hover { color:var(--text); background:var(--panel-2); }

@media (max-width: 480px) {
  .chimera-body { padding:22px 18px 16px; }
  .chimera-body h2 { font-size:18px; }
}
