
/* Typing Stack v17.10.45 — canvas-only competitive falling type game */
.typing-stack-shell{max-width:1500px;margin:0 auto;padding:0 18px 36px}.typing-stack-card{background:var(--surface,#fff);border:1px solid var(--border,#d9e2ef);border-radius:24px;box-shadow:0 18px 45px rgba(15,23,42,.08);overflow:hidden}.typing-stack-head{padding:24px 26px 18px;border-bottom:1px solid var(--border,#d9e2ef)}.typing-stack-head h1{margin:.25rem 0 .4rem;font-size:clamp(1.75rem,3vw,2.55rem)}.typing-stack-head p{margin:0;max-width:980px;color:var(--text-secondary,#64748b)}.typing-stack-toolbar{display:grid;grid-template-columns:minmax(190px,1fr) minmax(220px,1fr) auto;gap:12px;padding:16px 20px;background:linear-gradient(180deg,#f8fbff,#f3f7fc);border-bottom:1px solid #d8e2f0}.typing-stack-toolbar label{display:grid;gap:7px;font-size:.77rem;font-weight:800;letter-spacing:.06em;text-transform:uppercase;color:#64748b}.typing-stack-toolbar select,.typing-stack-best,.typing-stack-format{min-height:48px;border:1px solid #cbd7e7;border-radius:14px;background:#fff;padding:0 14px;font:700 1rem Inter,sans-serif;color:#0f172a}.typing-stack-best,.typing-stack-format{display:flex;align-items:center}.typing-stack-best{min-width:255px}.typing-stack-format{min-width:240px}.typing-stack-hud{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:10px;padding:12px 20px;background:#fff}.typing-stack-stat{min-height:72px;border:1px solid #d9e3ef;border-radius:16px;display:grid;place-items:center;text-align:center;padding:8px}.typing-stack-stat span{font-size:.72rem;font-weight:800;letter-spacing:.08em;text-transform:uppercase;color:#64748b}.typing-stack-stat strong{font-size:1.45rem;color:#1769ff}.typing-stack-level-progress{padding:10px 20px 12px;background:#f8fbff;border-top:1px solid #edf2f7;border-bottom:1px solid #d9e3ef}.typing-stack-level-progress-copy{display:flex;justify-content:space-between;gap:14px;align-items:center;color:#334155;font-weight:800}.typing-stack-level-progress-copy span{color:#64748b;font-size:.86rem}.typing-stack-level-track{height:8px;border-radius:999px;background:#dbe6f2;overflow:hidden;margin-top:8px}.typing-stack-level-track span{display:block;height:100%;width:0;background:linear-gradient(90deg,#06b6d4,#2563eb,#7c3aed);transition:width .25s linear}.typing-stack-master-goal{display:block;margin-top:8px;color:#b45309;font-weight:800;font-size:.86rem}.typing-stack-master-goal[hidden]{display:none}.typing-stack-board-wrap{position:relative;background:#091225;overflow:auto;border-top:1px solid #d9e3ef;border-bottom:1px solid #d9e3ef}.typing-stack-board-inner{min-width:800px;position:relative}.typing-stack-board-wrap canvas{display:block;width:100%;height:auto;aspect-ratio:1400/720;max-height:760px;outline:none;background:#08111f}.typing-stack-controls{display:flex;flex-wrap:wrap;gap:10px;justify-content:center;padding:14px 18px;background:#f8fbff}.typing-stack-note{text-align:center;padding:0 20px 16px;background:#f8fbff;color:#516173;font-weight:700}.typing-stack-note strong{color:#1d4ed8}.typing-stack-results{padding:20px}.typing-stack-results[hidden]{display:none}.typing-stack-result-card{border:1px solid #cfe0f4;border-radius:22px;padding:24px;background:linear-gradient(135deg,#eff6ff,#f5f3ff 55%,#ecfeff)}.typing-stack-result-card h2{margin:0 0 8px}.typing-stack-result-grid{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:10px;margin:18px 0}.typing-stack-result-grid div{background:rgba(255,255,255,.82);border:1px solid #d8e4f0;border-radius:14px;padding:12px;text-align:center}.typing-stack-result-grid span{display:block;font-size:.72rem;text-transform:uppercase;letter-spacing:.07em;color:#64748b;font-weight:800}.typing-stack-result-grid strong{font-size:1.25rem;color:#0f172a}.typing-stack-result-actions{display:flex;gap:10px;flex-wrap:wrap}.typing-stack-info{display:grid;grid-template-columns:1.15fr .85fr;gap:18px;margin-top:20px}.typing-stack-info-card{background:#fff;border:1px solid #d9e3ef;border-radius:20px;padding:22px}.typing-stack-info-card h2,.typing-stack-info-card h3{margin-top:0}.typing-stack-info-card li{margin:.5rem 0}.typing-stack-mode-badge{display:inline-flex;align-items:center;gap:6px;padding:6px 10px;border-radius:999px;background:#eaf2ff;color:#1d4ed8;font-weight:800;font-size:.8rem}.typing-stack-flash{animation:typingStackLevelPulse 1s ease}.typing-stack-hit{animation:typingStackHit .22s ease}@keyframes typingStackLevelPulse{0%{box-shadow:inset 0 0 0 0 rgba(255,255,255,0)}35%{box-shadow:inset 0 0 90px 18px rgba(255,255,255,.35)}100%{box-shadow:inset 0 0 0 0 rgba(255,255,255,0)}}@keyframes typingStackHit{50%{filter:brightness(1.2)}}
html[data-theme="dark"] .typing-stack-card,html[data-theme="dark"] .typing-stack-info-card{background:#101827;border-color:#2b3950}html[data-theme="dark"] .typing-stack-toolbar,html[data-theme="dark"] .typing-stack-controls,html[data-theme="dark"] .typing-stack-note{background:#0e1726}html[data-theme="dark"] .typing-stack-toolbar select,html[data-theme="dark"] .typing-stack-best,html[data-theme="dark"] .typing-stack-hud{background:#101827;color:#e5edf7;border-color:#334155}html[data-theme="dark"] .typing-stack-stat{border-color:#334155}html[data-theme="dark"] .typing-stack-result-card{background:linear-gradient(135deg,#14213a,#1c1d3a,#102a35);border-color:#334155}html[data-theme="dark"] .typing-stack-result-grid div{background:rgba(15,23,42,.75);border-color:#334155}html[data-theme="dark"] .typing-stack-result-grid strong{color:#f8fafc}
@media(max-width:1050px){.typing-stack-hud{grid-template-columns:repeat(4,1fr)}.typing-stack-result-grid{grid-template-columns:repeat(3,1fr)}.typing-stack-info{grid-template-columns:1fr}}@media(max-width:720px){.typing-stack-shell{padding-inline:10px}.typing-stack-toolbar{grid-template-columns:1fr}.typing-stack-best{min-width:0}.typing-stack-hud{grid-template-columns:repeat(2,1fr)}.typing-stack-result-grid{grid-template-columns:repeat(2,1fr)}.typing-stack-head{padding:20px 18px}.typing-stack-board-wrap{overscroll-behavior-x:contain}}@media(prefers-reduced-motion:reduce){.typing-stack-flash,.typing-stack-hit{animation:none!important}}

.typing-stack-card:fullscreen{width:100%;height:100vh;border-radius:0;border:0;display:flex;flex-direction:column;overflow:auto;background:#f8fafc}
.typing-stack-card:fullscreen .typing-stack-head{display:none}
.typing-stack-card:fullscreen .typing-stack-toolbar{padding:8px 14px;grid-template-columns:minmax(180px,1fr) minmax(220px,1fr) auto}
.typing-stack-card:fullscreen .typing-stack-hud{padding:8px 14px;gap:8px}
.typing-stack-card:fullscreen .typing-stack-stat{min-height:58px;padding:5px}
.typing-stack-card:fullscreen .typing-stack-level-progress{padding:7px 14px 9px}
.typing-stack-card:fullscreen .typing-stack-board-wrap{flex:1;min-height:0;overflow:hidden}
.typing-stack-card:fullscreen .typing-stack-board-inner{height:100%;min-width:0;display:grid;place-items:center}
.typing-stack-card:fullscreen canvas{width:auto;height:100%;max-width:100%;max-height:none;aspect-ratio:1400/720}
.typing-stack-card:fullscreen .typing-stack-controls{padding:8px 12px;flex:0 0 auto}
.typing-stack-card:fullscreen .typing-stack-note{display:none}
.typing-stack-card.typing-stack-finished:fullscreen .typing-stack-board-wrap,.typing-stack-card.typing-stack-finished:fullscreen .typing-stack-level-progress{display:none}
.typing-stack-card.typing-stack-finished:fullscreen .typing-stack-results{display:block;overflow:auto;flex:1;background:#f8fbff}
.typing-stack-next-games{margin-top:20px;padding-top:18px;border-top:1px solid #d8e4f0}.typing-stack-next-games h3{margin:0 0 10px}.typing-stack-next-games>div{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}.typing-stack-next-games a{display:grid;gap:5px;padding:13px;border:1px solid #d8e4f0;border-radius:14px;background:rgba(255,255,255,.82);color:#0f172a;text-decoration:none}.typing-stack-next-games a:hover{border-color:#93c5fd}.typing-stack-next-games span{font-size:.84rem;color:#64748b;line-height:1.35}
html[data-theme="dark"] .typing-stack-level-progress{background:#0e1726;border-color:#334155}html[data-theme="dark"] .typing-stack-level-progress-copy{color:#e5edf7}html[data-theme="dark"] .typing-stack-level-track{background:#263449}html[data-theme="dark"] .typing-stack-master-goal{color:#fbbf24}html[data-theme="dark"] .typing-stack-format{background:#101827;color:#e5edf7;border-color:#334155}html[data-theme="dark"] .typing-stack-card:fullscreen,html[data-theme="dark"] .typing-stack-card.typing-stack-finished:fullscreen .typing-stack-results{background:#0b1120}html[data-theme="dark"] .typing-stack-next-games a{background:#101827;border-color:#334155;color:#f8fafc}html[data-theme="dark"] .typing-stack-next-games span{color:#94a3b8}
@media(max-width:1050px){.typing-stack-next-games>div{grid-template-columns:repeat(2,1fr)}}@media(max-width:720px){.typing-stack-level-progress-copy{align-items:flex-start;flex-direction:column;gap:3px}.typing-stack-next-games>div{grid-template-columns:1fr}.typing-stack-card:fullscreen .typing-stack-toolbar{grid-template-columns:1fr}}

/* v17.10.45 — in-canvas results and faster letter challenge */
.typing-stack-results{
  position:absolute;
  inset:0;
  z-index:20;
  display:grid;
  place-items:center;
  padding:22px;
  background:rgba(2,6,23,.78);
  overflow:auto;
  overscroll-behavior:contain;
}
.typing-stack-results[hidden]{display:none!important}
.typing-stack-results .typing-stack-result-card{
  width:min(1080px,calc(100% - 20px));
  max-height:calc(100% - 20px);
  overflow:auto;
  box-shadow:0 24px 70px rgba(2,6,23,.34);
}
.typing-stack-card.typing-stack-finished .typing-stack-controls,
.typing-stack-card.typing-stack-finished .typing-stack-note{display:none}
.typing-stack-card.typing-stack-finished:fullscreen .typing-stack-board-wrap{
  display:block;
  flex:1;
  min-height:0;
  overflow:hidden;
}
.typing-stack-card.typing-stack-finished:fullscreen .typing-stack-level-progress{display:none}
.typing-stack-card.typing-stack-finished:fullscreen .typing-stack-results{
  position:absolute;
  inset:0;
  display:grid!important;
  place-items:center;
  background:rgba(2,6,23,.82);
  overflow:auto;
  padding:22px;
}
.typing-stack-card.typing-stack-finished:fullscreen .typing-stack-results[hidden]{display:none!important}
html[data-theme="dark"] .typing-stack-results{background:rgba(2,6,23,.86)}
@media(max-width:720px){
  .typing-stack-results{padding:12px}
  .typing-stack-results .typing-stack-result-card{width:calc(100% - 8px);max-height:calc(100% - 8px);padding:16px}
}

html[data-theme="dark"] .typing-stack-card.typing-stack-finished:fullscreen .typing-stack-results{background:rgba(2,6,23,.88)}
