/* ================= TYPESTORM — Defenders of the Keyboard Galaxy ================= */
:root {
  --space: #0b1026;
  --space-deep: #060818;
  --panel: rgba(20, 28, 64, .82);
  --cyan: #22d3ee;
  --magenta: #ff3ec8;
  --lime: #a3ff12;
  --gold: #ffd23e;
  --violet: #8b5cf6;
  --red: #ff5470;
  --ink: #eef2ff;
  --muted: #9aa5d1;
  /* finger colors */
  --f-lpinky: #ff5470; --f-lring: #ff9f43; --f-lmiddle: #ffd23e; --f-lindex: #a3ff12;
  --f-rindex: #22d3ee; --f-rmiddle: #5aa2ff; --f-rring: #8b5cf6; --f-rpinky: #ff3ec8;
  --f-thumb: #9aa5d1;
  font-size: clamp(13px, 1.35vw, 18px);
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; overflow: hidden; overscroll-behavior: none; }
body {
  font-family: "Arial Rounded MT Bold", ui-rounded, "Hiragino Maru Gothic ProN", Quicksand, Comfortaa, Manjari, "Segoe UI", system-ui, sans-serif;
  background: radial-gradient(120% 100% at 50% 0%, #16204d 0%, var(--space) 45%, var(--space-deep) 100%);
  color: var(--ink);
  user-select: none;
}
kbd {
  background: #1c2650; border: 2px solid var(--cyan); border-bottom-width: 4px;
  border-radius: .4em; padding: .05em .45em; font-family: inherit; color: var(--cyan);
  font-size: .9em; box-shadow: 0 0 12px rgba(34, 211, 238, .35);
}

/* ---------- animated starfield ---------- */
#stars-bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.stars { position: absolute; inset: -100% 0 0 0; background-repeat: repeat; }
.stars.s1 { background-image: radial-gradient(1px 1px at 20px 30px, #fff9, transparent), radial-gradient(1px 1px at 90px 140px, #fff6, transparent), radial-gradient(1.5px 1.5px at 160px 60px, #fffc, transparent), radial-gradient(1px 1px at 220px 190px, #fff7, transparent); background-size: 260px 260px; animation: starDrift 90s linear infinite; }
.stars.s2 { background-image: radial-gradient(1.5px 1.5px at 40px 90px, #9df3, transparent), radial-gradient(2px 2px at 150px 40px, #9df5, transparent), radial-gradient(1.5px 1.5px at 260px 170px, #f9d3, transparent); background-size: 320px 320px; animation: starDrift 55s linear infinite; }
.stars.s3 { background-image: radial-gradient(2.5px 2.5px at 100px 100px, #fdf4, transparent), radial-gradient(2px 2px at 240px 220px, #4ef4, transparent); background-size: 420px 420px; animation: starDrift 32s linear infinite; }
@keyframes starDrift { to { transform: translateY(50%); } }

/* ---------- screens ---------- */
.screen { position: fixed; inset: 0; z-index: 1; display: none; flex-direction: column; align-items: center; padding: 1.2rem; overflow-y: auto; }
.screen.active { display: flex; animation: screenIn .35s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes screenIn { from { opacity: 0; transform: scale(.96) translateY(12px); } }
.hidden { display: none !important; }
.row { display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; }
.row.center { justify-content: center; }

/* ---------- title ---------- */
.title-wrap { margin: auto; text-align: center; display: flex; flex-direction: column; gap: 1.4rem; align-items: center; }
.logo { font-size: clamp(3.2rem, 10vw, 7rem); letter-spacing: .04em; line-height: 1; filter: drop-shadow(0 6px 0 #000a); animation: logoBob 3s ease-in-out infinite; }
@keyframes logoBob { 50% { transform: translateY(-8px) rotate(-1deg); } }
.logo-type { color: var(--cyan); text-shadow: 0 0 30px var(--cyan), 0 4px 0 #0e7490; }
.logo-storm { color: var(--magenta); text-shadow: 0 0 34px var(--magenta), 0 4px 0 #86198f; }
.tagline { letter-spacing: .35em; color: var(--gold); font-size: clamp(.7rem, 2vw, 1.1rem); text-shadow: 0 0 18px #ffd23e88; }
.hint { color: var(--muted); }

/* ---------- teacher link (title screen, discreet) ---------- */
.teacher-link {
  position: absolute; bottom: .9rem; right: 1.2rem;
  color: var(--muted); font-size: .72rem; text-decoration: none;
  opacity: .55; transition: opacity .15s;
}
.teacher-link:hover { opacity: 1; color: var(--gold); }

/* ---------- buttons ---------- */
.btn {
  font-family: inherit; font-size: 1rem; font-weight: bold; color: var(--ink);
  background: linear-gradient(180deg, #2a3a7a, #1c2650); border: 2px solid #4457a5;
  border-radius: 14px; padding: .7em 1.4em; cursor: pointer; letter-spacing: .04em;
  transition: transform .12s cubic-bezier(.2, 1.6, .4, 1), box-shadow .12s, filter .12s;
  box-shadow: 0 4px 0 #101636, 0 6px 16px #0008;
}
.btn:hover { transform: translateY(-2px) scale(1.03); filter: brightness(1.15); }
.btn:active { transform: translateY(2px) scale(.98); box-shadow: 0 1px 0 #101636; }
.btn-big { font-size: 1.35rem; padding: .8em 1.6em; border-radius: 18px; }
.btn-small { font-size: .8rem; padding: .45em .9em; }
.btn-glow { background: linear-gradient(180deg, var(--cyan), #0891b2); border-color: #67e8f9; color: #06202a; box-shadow: 0 4px 0 #155e75, 0 0 28px rgba(34, 211, 238, .55); animation: pulseGlow 1.6s ease-in-out infinite; }
@keyframes pulseGlow { 50% { box-shadow: 0 4px 0 #155e75, 0 0 44px rgba(34, 211, 238, .85); } }
.btn-ghost { background: transparent; border-color: #3a4780; box-shadow: none; color: var(--muted); text-decoration: none; display: inline-block; }
.btn-danger { background: linear-gradient(180deg, #7f1d3a, #4c0d22); border-color: var(--red); box-shadow: 0 4px 0 #2d0713; }
.btn-speak { background: #1c2650; border: 2px solid var(--gold); color: var(--gold); border-radius: 999px; font-family: inherit; font-weight: bold; cursor: pointer; padding: .3em .7em; font-size: 1rem; transition: transform .12s; box-shadow: 0 0 14px #ffd23e44; }
.btn-speak:hover { transform: scale(1.12); }
.btn-speak.big { font-size: 1.05rem; padding: .5em 1.1em; }
.btn-speak.playing { animation: speakPulse .6s ease-in-out infinite; }
@keyframes speakPulse { 50% { transform: scale(1.15); box-shadow: 0 0 26px #ffd23ecc; } }

/* ---------- panels ---------- */
.panel {
  background: var(--panel); border: 2px solid #3a4780; border-radius: 22px;
  padding: 1.6rem 2rem; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 18px 50px #000a, inset 0 1px 0 #fff2; max-width: 860px; width: 100%;
  display: flex; flex-direction: column; gap: 1rem; align-items: center; text-align: center;
}
.screen-title { font-size: 1.6rem; letter-spacing: .08em; color: var(--ink); text-shadow: 0 0 16px #22d3ee66; display: flex; gap: .6em; align-items: center; }
.brief-text { font-size: 1.15rem; line-height: 1.55; color: var(--ink); max-width: 40em; }

/* ---------- topbar ---------- */
.topbar { width: 100%; max-width: 1100px; display: flex; align-items: center; gap: 1rem; justify-content: space-between; margin-bottom: 1rem; flex-wrap: wrap; }
.pilot-chip, .rank-chip { background: var(--panel); border: 2px solid #3a4780; border-radius: 999px; padding: .35em .9em; font-weight: bold; display: flex; align-items: center; gap: .5em; }
.rank-chip { border-color: var(--gold); color: var(--gold); box-shadow: 0 0 14px #ffd23e33; }

/* ---------- profiles ---------- */
.profile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1rem; width: 100%; max-width: 900px; margin-top: 1rem; }
.profile-card { background: var(--panel); border: 2px solid #3a4780; border-radius: 18px; padding: 1rem; text-align: center; cursor: pointer; transition: transform .15s, border-color .15s, box-shadow .15s; font-family: inherit; color: var(--ink); }
.profile-card:hover { transform: translateY(-4px) scale(1.04); border-color: var(--cyan); box-shadow: 0 0 24px #22d3ee55; }
.profile-card .pa { font-size: 2.6rem; display: block; }
.profile-card .pn { font-weight: bold; font-size: 1.1rem; display: block; margin-top: .3em; }
.profile-card .pr { color: var(--gold); font-size: .75rem; }
.profile-card.new { border-style: dashed; color: var(--muted); }
.avatar-pick { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; }
.avatar-pick button { font-size: 2rem; background: #1c2650; border: 2px solid #3a4780; border-radius: 14px; padding: .3em .4em; cursor: pointer; transition: transform .12s, border-color .12s; }
.avatar-pick button:hover { transform: scale(1.15); }
.avatar-pick button.sel { border-color: var(--lime); box-shadow: 0 0 16px #a3ff1266; transform: scale(1.15); }
input[type="text"] { font-family: inherit; font-size: 1.2rem; font-weight: bold; text-align: center; background: #10173a; color: var(--ink); border: 2px solid #3a4780; border-radius: 12px; padding: .5em .8em; outline: none; width: 14em; max-width: 90%; }
input[type="text"]:focus { border-color: var(--cyan); box-shadow: 0 0 16px #22d3ee44; }

/* ---------- menu ---------- */
.menu-title { font-size: 2rem; letter-spacing: .15em; margin: .6rem 0 1.2rem; color: var(--ink); text-shadow: 0 0 22px #22d3ee66; }
.menu-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1rem; width: 100%; max-width: 1000px; }
.menu-card { background: var(--panel); border: 2px solid #3a4780; border-radius: 20px; padding: 1.3rem 1rem; cursor: pointer; font-family: inherit; color: var(--ink); display: flex; flex-direction: column; align-items: center; gap: .3rem; transition: transform .15s cubic-bezier(.2, 1.6, .4, 1), border-color .15s, box-shadow .15s; }
.menu-card:hover { transform: translateY(-5px) scale(1.04) rotate(-.5deg); border-color: var(--magenta); box-shadow: 0 0 30px #ff3ec855; }
.mc-emoji { font-size: 2.6rem; filter: drop-shadow(0 4px 6px #0008); }
.mc-name { font-size: 1.25rem; font-weight: bold; letter-spacing: .08em; }
.mc-sub { color: var(--muted); font-size: .8rem; }
.menu-footer { margin-top: auto; padding-top: 1rem; display: flex; gap: .8rem; }

/* ---------- worlds & levels ---------- */
.world-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; width: 100%; max-width: 1100px; }
.world-card { position: relative; background: var(--panel); border: 2px solid #3a4780; border-radius: 20px; padding: 1.2rem; cursor: pointer; font-family: inherit; color: var(--ink); text-align: left; transition: transform .15s, border-color .15s, box-shadow .15s; overflow: hidden; }
.world-card:hover:not(.locked) { transform: translateY(-4px) scale(1.02); border-color: var(--cyan); box-shadow: 0 0 26px #22d3ee44; }
.world-card .wc-num { position: absolute; right: .6rem; top: .2rem; font-size: 3.4rem; opacity: .14; font-weight: bold; }
.world-card .wc-name { font-size: 1.3rem; font-weight: bold; }
.world-card .wc-tag { color: var(--muted); font-size: .85rem; margin-top: .2em; }
.world-card .wc-stars { margin-top: .6em; color: var(--gold); letter-spacing: .1em; }
.world-card.locked { opacity: .45; cursor: not-allowed; filter: grayscale(.7); }
.world-card.locked::after { content: "🔒"; position: absolute; right: 1rem; bottom: .8rem; font-size: 1.6rem; }
.level-list { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center; max-width: 900px; }
.level-node { width: 108px; height: 108px; border-radius: 26px; background: var(--panel); border: 3px solid #3a4780; cursor: pointer; font-family: inherit; color: var(--ink); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .15rem; transition: transform .15s, border-color .15s, box-shadow .15s; }
.level-node:hover:not(.locked) { transform: scale(1.1) rotate(2deg); border-color: var(--lime); box-shadow: 0 0 24px #a3ff1255; }
.level-node .ln-num { font-size: 1.6rem; font-weight: bold; }
.level-node .ln-stars { color: var(--gold); font-size: .8rem; letter-spacing: .05em; }
.level-node .ln-keys { font-size: .6rem; color: var(--muted); }
.level-node.locked { opacity: .4; cursor: not-allowed; }
.level-node.boss { border-color: var(--red); background: linear-gradient(180deg, #4c0d22aa, var(--panel)); }
.level-node.boss .ln-num { font-size: 1.9rem; }

/* ---------- briefing ---------- */
.briefing { margin: auto; }
.brief-keys { display: flex; gap: .5rem; flex-wrap: wrap; justify-content: center; }
.brief-keys .bk { font-size: 1.6rem; min-width: 2.2em; text-align: center; padding: .25em .4em; border-radius: .35em; border: 3px solid; border-bottom-width: 6px; font-weight: bold; background: #10173a; animation: keyPop .5s cubic-bezier(.2, 1.8, .4, 1) backwards; }
.brief-keys .bk:nth-child(2) { animation-delay: .08s; } .brief-keys .bk:nth-child(3) { animation-delay: .16s; } .brief-keys .bk:nth-child(4) { animation-delay: .24s; }
@keyframes keyPop { from { transform: scale(0) rotate(-15deg); } }
.brief-hands { font-size: .95rem; color: var(--muted); }
.powerup-loadout { display: flex; gap: .6rem; flex-wrap: wrap; justify-content: center; }
.pu-card { background: #10173a; border: 2px solid #3a4780; border-radius: 14px; padding: .5rem .8rem; cursor: pointer; font-family: inherit; color: var(--ink); text-align: center; transition: transform .12s, border-color .12s; }
.pu-card:hover { transform: scale(1.07); }
.pu-card.sel { border-color: var(--lime); box-shadow: 0 0 18px #a3ff1266; }
.pu-card.locked { opacity: .4; cursor: not-allowed; }
.pu-card .pu-emoji { font-size: 1.7rem; display: block; }
.pu-card .pu-name { font-size: .8rem; font-weight: bold; }
.pu-card .pu-desc { font-size: .65rem; color: var(--muted); }

/* ---------- game screen ---------- */
.game-screen { padding: 0; overflow: hidden; }
#game-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; }
.hud { position: absolute; top: 0; left: 0; right: 0; z-index: 3; display: flex; justify-content: space-between; align-items: flex-start; padding: .6rem 1rem; pointer-events: none; }
.hud-left, .hud-right { display: flex; gap: .6rem; align-items: center; }
.hud-right { pointer-events: auto; }
.hud-stat { background: #10173acc; border: 2px solid #3a4780; border-radius: 999px; padding: .25em .8em; font-weight: bold; font-size: .95rem; }
.hud-stat.combo { border-color: var(--magenta); color: var(--magenta); }
.hud-stat.combo.hot { animation: comboHot .4s ease-in-out infinite; border-color: var(--gold); color: var(--gold); }
@keyframes comboHot { 50% { transform: scale(1.12); box-shadow: 0 0 20px #ffd23e88; } }
.hud-mission { font-size: .85rem; color: var(--muted); background: #10173acc; border-radius: 999px; padding: .25em 1em; }
#powerbar-wrap { position: absolute; top: 3.2rem; left: 50%; transform: translateX(-50%); width: min(420px, 60vw); height: 20px; background: #10173acc; border: 2px solid #3a4780; border-radius: 999px; z-index: 3; overflow: hidden; }
#powerbar { height: 100%; width: 0%; background: linear-gradient(90deg, var(--violet), var(--magenta), var(--gold)); border-radius: 999px; transition: width .2s; }
#powerbar-wrap.ready { border-color: var(--gold); animation: pulseGlow 1s infinite; }
#powerbar-label { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: .62rem; letter-spacing: .1em; color: #fffc; text-shadow: 0 1px 2px #000; }
#powerbar-label kbd { font-size: .85em; padding: 0 .3em; margin-left: .3em; }

/* ---------- keyboard coach ---------- */
#keyboard-coach { position: absolute; bottom: .5rem; left: 50%; transform: translateX(-50%); z-index: 3; display: flex; flex-direction: column; gap: 3px; align-items: center; background: #0a0f28d9; border: 2px solid #3a4780; border-radius: 16px; padding: .55rem .8rem .45rem; }
.kb-row { display: flex; gap: 3px; }
.kb-key { width: 2.1em; height: 2.1em; font-size: clamp(10px, 1.5vw, 15px); display: flex; align-items: center; justify-content: center; border-radius: 6px; font-weight: bold; color: #fffd; background: #1c2650; border: 1px solid #0006; border-bottom: 3px solid #0008; text-transform: uppercase; position: relative; }
.kb-key.wide { width: 4.5em; } .kb-key.space { width: 12em; }
.kb-key.unlocked { box-shadow: inset 0 0 0 2px var(--fc, #3a4780); color: var(--fc, #fffd); }
.kb-key.next { background: var(--fc, var(--cyan)); color: #04121a; animation: nextKey .5s ease-in-out infinite; z-index: 1; }
@keyframes nextKey { 50% { transform: scale(1.25); box-shadow: 0 0 18px var(--fc, var(--cyan)); } }
.kb-key.home::after { content: ""; position: absolute; bottom: 3px; left: 50%; transform: translateX(-50%); width: 40%; height: 2px; background: currentColor; border-radius: 2px; }
.kb-finger-hint { font-size: .78rem; font-weight: bold; letter-spacing: .06em; height: 1.2em; }

/* ---------- results ---------- */
.results { margin: auto; }
.results-stars { font-size: 3.4rem; letter-spacing: .1em; height: 1.2em; }
.results-stars .st { display: inline-block; animation: starLand .5s cubic-bezier(.2, 1.8, .4, 1) backwards; filter: drop-shadow(0 0 14px #ffd23e); }
.results-stars .st:nth-child(2) { animation-delay: .25s; } .results-stars .st:nth-child(3) { animation-delay: .5s; }
.results-stars .st.dim { filter: grayscale(1) opacity(.3); }
@keyframes starLand { from { transform: scale(3) rotate(60deg); opacity: 0; } }
.results-stats { display: flex; gap: 1rem; flex-wrap: wrap; justify-content: center; }
.results-stats .rs { background: #10173a; border: 2px solid #3a4780; border-radius: 14px; padding: .6rem 1rem; min-width: 7em; }
.results-stats .rs b { display: block; font-size: 1.5rem; color: var(--cyan); }
.results-badges { display: flex; gap: .6rem; flex-wrap: wrap; justify-content: center; }
.new-badge { background: linear-gradient(180deg, #3a2a00, #1c1500); border: 2px solid var(--gold); border-radius: 14px; padding: .5rem .9rem; animation: badgeIn .6s cubic-bezier(.2, 1.8, .4, 1) backwards; box-shadow: 0 0 22px #ffd23e66; }
@keyframes badgeIn { from { transform: scale(0) rotate(-20deg); } }

/* ---------- badges screen ---------- */
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .9rem; width: 100%; max-width: 1000px; }
.badge-card { background: var(--panel); border: 2px solid #3a4780; border-radius: 16px; padding: .9rem .6rem; text-align: center; transition: transform .15s; }
.badge-card:hover { transform: scale(1.05); }
.badge-card .be { font-size: 2.4rem; display: block; filter: drop-shadow(0 3px 5px #000a); }
.badge-card .bn { font-weight: bold; font-size: .9rem; display: block; margin: .3em 0 .15em; }
.badge-card .bd { font-size: .7rem; color: var(--muted); }
.badge-card.locked { opacity: .38; filter: grayscale(1); }
.badge-card.earned { border-color: var(--gold); box-shadow: 0 0 18px #ffd23e33; }

/* ---------- leaderboard ---------- */
.lb-tabs { display: flex; gap: .5rem; margin-bottom: 1rem; }
.lb-tab { font-family: inherit; font-weight: bold; background: #10173a; color: var(--muted); border: 2px solid #3a4780; border-radius: 999px; padding: .4em 1.1em; cursor: pointer; }
.lb-tab.active { color: var(--gold); border-color: var(--gold); box-shadow: 0 0 14px #ffd23e33; }
.lb-list { list-style: none; width: 100%; max-width: 640px; display: flex; flex-direction: column; gap: .5rem; }
.lb-row { display: flex; align-items: center; gap: .9rem; background: var(--panel); border: 2px solid #3a4780; border-radius: 14px; padding: .55rem 1rem; animation: screenIn .3s backwards; }
.lb-row .lr-rank { font-size: 1.3rem; font-weight: bold; width: 2em; color: var(--muted); }
.lb-row:nth-child(1) .lr-rank { color: var(--gold); } .lb-row:nth-child(2) .lr-rank { color: #cbd5e1; } .lb-row:nth-child(3) .lr-rank { color: #d97706; }
.lb-row .lr-ava { font-size: 1.6rem; }
.lb-row .lr-name { font-weight: bold; flex: 1; }
.lb-row .lr-score { font-weight: bold; color: var(--cyan); font-size: 1.15rem; }
.lb-row.me { border-color: var(--lime); box-shadow: 0 0 16px #a3ff1233; }

/* ---------- ghost & versus ---------- */
.ghost-pick { display: flex; gap: .7rem; flex-wrap: wrap; justify-content: center; }
.ghost-card { background: #10173a; border: 2px solid #3a4780; border-radius: 14px; padding: .6rem 1rem; cursor: pointer; font-family: inherit; color: var(--ink); transition: transform .12s, border-color .12s; }
.ghost-card:hover { transform: scale(1.06); }
.ghost-card.sel { border-color: var(--cyan); box-shadow: 0 0 16px #22d3ee55; }
.ghost-card .gc-wpm { color: var(--cyan); font-weight: bold; }
.vs-names { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; justify-content: center; }
.vs-vs { font-size: 1.6rem; font-weight: bold; color: var(--red); text-shadow: 0 0 14px #ff547088; }

/* ---------- overlays / announcer / toasts ---------- */
.overlay { position: fixed; inset: 0; z-index: 10; background: #060818cc; display: flex; align-items: center; justify-content: center; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.overlay .panel { max-width: 480px; }
.announcer { position: fixed; top: 22%; left: 50%; z-index: 9; transform: translate(-50%, -50%); font-size: clamp(2rem, 7vw, 4.4rem); font-weight: bold; letter-spacing: .06em; pointer-events: none; text-shadow: 0 4px 0 #000a, 0 0 40px currentColor; animation: announce .9s cubic-bezier(.2, 1.6, .4, 1) forwards; }
@keyframes announce { 0% { transform: translate(-50%, -50%) scale(0) rotate(-8deg); opacity: 0; } 25% { transform: translate(-50%, -50%) scale(1.15) rotate(2deg); opacity: 1; } 80% { transform: translate(-50%, -50%) scale(1); opacity: 1; } 100% { transform: translate(-50%, -60%) scale(.9); opacity: 0; } }
.toast-stack { position: fixed; bottom: 1rem; right: 1rem; z-index: 20; display: flex; flex-direction: column; gap: .5rem; }
.toast { background: var(--panel); border: 2px solid var(--gold); border-radius: 14px; padding: .7rem 1.1rem; font-weight: bold; box-shadow: 0 0 22px #ffd23e44; animation: toastIn .4s cubic-bezier(.2, 1.8, .4, 1), toastOut .4s ease-in 3.2s forwards; }
@keyframes toastIn { from { transform: translateX(120%); } }
@keyframes toastOut { to { transform: translateX(120%); opacity: 0; } }

/* ---------- grownups ---------- */
.grownups { max-width: 1000px; text-align: left; align-items: stretch; }
.dash-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.dash-table th, .dash-table td { padding: .5em .7em; border-bottom: 1px solid #3a4780; text-align: left; }
.dash-table th { color: var(--muted); font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; }

/* ---------- screen shake ---------- */
.shake { animation: shake .25s; }
@keyframes shake { 0%, 100% { transform: translate(0, 0); } 25% { transform: translate(-7px, 4px); } 50% { transform: translate(6px, -5px); } 75% { transform: translate(-4px, -3px); } }

/* ---------- small screens (iPad landscape ~1024, CB ~1366) ---------- */
@media (max-height: 700px) {
  .kb-key { font-size: 10px; }
  #keyboard-coach { padding: .35rem .5rem .3rem; }
  .panel { padding: 1rem 1.2rem; gap: .6rem; }
}
