/* ==========================================================================
   MANIAXE TYPING — DESIGN SYSTEM
   One accent color, used sparingly. Warm near-black, not blue-black.
   ========================================================================== */

:root{
  /* -- brand -- */
  --accent: #2b3ff2;
  --accent-dim: #16217a;
  --accent-soft: rgba(43,63,242,.14);
  --correct: #4caf7d;
  --error: #c1443a;

  /* -- surfaces (dark, default) -- */
  --bg: #121013;
  --surface: #19161a;
  --surface-2: #221e22;
  --border: #2e292e;
  --text: #eae6e5;
  --text-dim: #9a9296;
  --text-faint: #5d565a;
  --caret: var(--accent);

  /* -- type -- */
  --font-ui: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: "Space Grotesk", var(--font-ui);
  --font-mono: "JetBrains Mono", "Courier New", monospace;

  --radius-s: 6px;
  --radius-m: 10px;
  --radius-l: 16px;
  --shadow-pop: 0 12px 30px rgba(0,0,0,.35);
  --max-w: 1180px;
}

:root[data-theme="light"]{
  --bg: #f6f4f1;
  --surface: #ffffff;
  --surface-2: #efece7;
  --border: #e2ddd6;
  --text: #201d1c;
  --text-dim: #6f6764;
  --text-faint: #b3aaa4;
  --accent-soft: rgba(43,63,242,.10);
  --shadow-pop: 0 12px 30px rgba(30,20,15,.10);
}

*,*::before,*::after{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }
body{
  margin:0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background .25s ease, color .25s ease;
}
img{ max-width:100%; display:block; }
a{ color:inherit; text-decoration:none; }
button{ font-family: inherit; }
ul{ margin:0; padding:0; list-style:none; }
h1,h2,h3,h4{ font-family: var(--font-display); margin:0; font-weight:600; letter-spacing:-.01em; }
p{ margin:0; }

:focus-visible{
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.wrap{
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

.visually-hidden{
  position:absolute; width:1px; height:1px; overflow:hidden;
  clip:rect(0 0 0 0); white-space:nowrap; border:0; padding:0; margin:-1px;
}

@media (prefers-reduced-motion: reduce){
  *{ animation-duration:.001ms !important; transition-duration:.001ms !important; }
}

/* ==========================================================================
   HEADER
   ========================================================================== */

.site-header{
  position: sticky; top:0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner{
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 14px 24px;
  display:flex;
  align-items:center;
  gap: 28px;
}
.brand{
  display:flex; align-items:center; gap:10px;
  font-family: var(--font-display);
  font-weight:700; font-size:1.05rem;
  color: var(--text);
  white-space: nowrap;
}
.brand img{ width:28px; height:28px; border-radius:7px; }
.brand .tag{
  font-family: var(--font-ui); font-weight:500; font-size:.68rem;
  color: var(--text-dim); border:1px solid var(--border);
  padding:2px 6px; border-radius: 20px; margin-left:2px;
}

.main-nav{ display:flex; gap:4px; flex:1; }
.main-nav a{
  font-size:.88rem; font-weight:500; color: var(--text-dim);
  padding: 8px 12px; border-radius: var(--radius-s);
  transition: color .15s ease, background .15s ease;
}
.main-nav a:hover{ color: var(--text); background: var(--surface); }
.main-nav a.active{ color: var(--text); background: var(--surface-2); }

.header-actions{ display:flex; align-items:center; gap:10px; margin-left:auto; }

.icon-btn{
  width:36px; height:36px; display:flex; align-items:center; justify-content:center;
  border-radius: var(--radius-s); border:1px solid var(--border);
  background: var(--surface); color: var(--text-dim); cursor:pointer;
}
.icon-btn:hover{ color: var(--text); border-color: var(--text-faint); }
.icon-btn svg{ width:17px; height:17px; }

.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  font-size:.86rem; font-weight:600; padding:9px 16px;
  border-radius: var(--radius-s); border:1px solid transparent;
  cursor:pointer; transition: transform .12s ease, filter .15s ease, background .15s ease, border-color .15s ease;
  white-space: nowrap;
}
.btn:active{ transform: translateY(1px); }
.btn-primary{ background: var(--accent); color:#fff; }
.btn-primary:hover{ filter:brightness(1.08); }
.btn-ghost{ background:transparent; border-color: var(--border); color: var(--text); }
.btn-ghost:hover{ border-color: var(--text-faint); }
.btn-block{ width:100%; }
.btn[disabled]{ opacity:.55; cursor:not-allowed; }

.auth-slot{ position:relative; }
.profile-btn{
  display:flex; align-items:center; gap:8px; padding:5px 10px 5px 5px;
  border-radius: 999px; border:1px solid var(--border); background: var(--surface);
  cursor:pointer; color: var(--text); font-size:.85rem; font-weight:600;
}
.profile-avatar{
  width:26px; height:26px; border-radius:50%; background: var(--accent);
  color:#fff; display:flex; align-items:center; justify-content:center;
  font-size:.75rem; font-weight:700; text-transform:uppercase;
}
.profile-menu{
  position:absolute; right:0; top: calc(100% + 8px); min-width:190px;
  background: var(--surface); border:1px solid var(--border); border-radius: var(--radius-m);
  box-shadow: var(--shadow-pop); padding:6px; display:none; flex-direction:column; gap:2px;
}
.profile-menu.open{ display:flex; }
.profile-menu a, .profile-menu button{
  display:flex; align-items:center; gap:9px; width:100%; text-align:left;
  background:none; border:none; color: var(--text); font-size:.87rem;
  padding:9px 10px; border-radius: var(--radius-s); cursor:pointer;
}
.profile-menu a:hover, .profile-menu button:hover{ background: var(--surface-2); }
.profile-menu .danger{ color: var(--error); }
.profile-menu hr{ border:none; border-top:1px solid var(--border); margin:4px 2px; }

.mobile-toggle{ display:none; }
.mobile-nav{ display:none; }
.mobile-nav:not(.open){ display:none !important; }

/* mobile nav */
@media (max-width: 920px){
  .main-nav{ display:none; }
  .mobile-toggle{
    display:flex; width:36px; height:36px; align-items:center; justify-content:center;
    border-radius: var(--radius-s); border:1px solid var(--border); background: var(--surface);
    color: var(--text); cursor:pointer;
  }
  .mobile-nav{
    display:none; flex-direction:column; gap:2px; padding: 10px 24px 16px;
    border-bottom:1px solid var(--border); background: var(--bg);
  }
  .mobile-nav.open{ display:flex; }
  .mobile-nav a{
    padding:11px 6px; font-size:.95rem; color: var(--text-dim); border-radius: var(--radius-s);
  }
  .mobile-nav a.active{ color: var(--text); }
}

/* ==========================================================================
   FOOTER
   ========================================================================== */

.site-footer{ border-top:1px solid var(--border); margin-top: 64px; background: var(--surface); }
.footer-top{
  max-width: var(--max-w); margin:0 auto; padding: 48px 24px;
  display:grid; grid-template-columns: 1.3fr 1fr 1fr 1.4fr; gap: 40px;
}
.footer-brand .brand{ margin-bottom:10px; }
.footer-brand p{ color: var(--text-dim); font-size:.87rem; max-width: 32ch; }
.footer-col h4{ font-size:.78rem; color: var(--text-dim); font-weight:600; margin-bottom:14px; }
.footer-col ul{ display:flex; flex-direction:column; gap:9px; }
.footer-col a{ font-size:.87rem; color: var(--text); display:flex; align-items:center; gap:8px; }
.footer-col a:hover{ color: var(--accent); }
.footer-col svg{ width:15px; height:15px; flex-shrink:0; color: var(--text-dim); }

.footer-contact{ background: var(--surface-2); border:1px solid var(--border); border-radius: var(--radius-m); padding:18px; }
.footer-contact h4{ font-size:.86rem; color: var(--text); margin-bottom:4px; }
.footer-contact p.hint{ font-size:.78rem; color: var(--text-dim); margin-bottom:12px; }
.footer-contact input, .footer-contact textarea{
  width:100%; margin-bottom:9px; padding:9px 11px; border-radius: var(--radius-s);
  border:1px solid var(--border); background: var(--surface); color: var(--text);
  font-family: inherit; font-size:.85rem; resize: vertical;
}
.footer-contact textarea{ min-height:64px; }
.footer-contact input:focus, .footer-contact textarea:focus{ border-color: var(--accent); }
.footer-msg{ font-size:.8rem; margin-top:8px; min-height:1em; }

.footer-bottom{
  border-top:1px solid var(--border);
  padding: 16px 24px; display:flex; justify-content:space-between; align-items:center;
  max-width: var(--max-w); margin:0 auto; color: var(--text-faint); font-size:.78rem; gap:12px; flex-wrap:wrap;
}
.footer-bottom a{ color: var(--text-dim); }
.footer-bottom a:hover{ color: var(--accent); }

@media (max-width: 860px){
  .footer-top{ grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px){
  .footer-top{ grid-template-columns: 1fr; }
}

/* ==========================================================================
   PAGE HEADER (non-home pages)
   ========================================================================== */

.page-head{ padding: 46px 0 30px; }
.page-head .eyebrow-free{ display:none; } /* purposely unused: no ALL-CAPS eyebrow chrome */
.page-head h1{ font-size: clamp(1.7rem, 2.6vw, 2.3rem); }
.page-head p{ color: var(--text-dim); margin-top:10px; max-width: 62ch; font-size:1rem; }

.section{ padding: 40px 0; }
.section-tight{ padding: 24px 0; }

/* ==========================================================================
   TEST / PRACTICE ENGINE
   ========================================================================== */

.test-shell{
  min-height: calc(100vh - 250px);
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  padding: 30px 24px 70px;
}

.config-bar{
  display:flex; align-items:center; flex-wrap:wrap; justify-content:center; gap:8px;
  background: var(--surface); border:1px solid var(--border); border-radius: var(--radius-m);
  padding:8px; margin-bottom: 46px;
}
.config-group{ display:flex; align-items:center; gap:2px; padding:0 6px; }
.config-sep{ width:1px; height:20px; background: var(--border); }
.chip{
  font-size:.8rem; color: var(--text-dim); background:transparent; border:none;
  padding:7px 11px; border-radius: var(--radius-s); cursor:pointer; font-weight:500;
}
.chip:hover{ color: var(--text); }
.chip.active{ color: var(--accent); background: var(--accent-soft); }
.chip-icon{ display:flex; align-items:center; gap:6px; }
.chip-icon svg{ width:14px; height:14px; }

.custom-time-input{
  width:52px; background: var(--surface-2); border:1px solid var(--border); color: var(--text);
  border-radius: var(--radius-s); padding:6px 8px; font-size:.8rem; text-align:center; font-family: var(--font-mono);
}

select.select-inline{
  background: var(--surface-2); color: var(--text); border:1px solid var(--border);
  border-radius: var(--radius-s); padding:7px 10px; font-size:.8rem; cursor:pointer;
}

.live-stats{
  display:flex; gap:26px; margin-bottom: 22px; font-family: var(--font-mono);
  color: var(--accent); font-size:1.05rem; min-height:1.4em;
}
.live-stats span{ color: var(--text-faint); font-size:.7rem; display:block; font-family: var(--font-ui); margin-bottom:2px; letter-spacing:.02em; }

.words-panel{
  position:relative; width:100%; max-width: 860px;
  font-family: var(--font-mono); font-size: 1.5rem; line-height:2.05;
  color: var(--text-faint); letter-spacing: .01em;
  max-height: calc(2.05em * 3); overflow:hidden;
  filter: blur(0px); transition: filter .2s ease;
}
.words-panel.blurred{ filter: blur(5px); }
.words-panel .word{ display:inline-block; margin: 0 .32em 0 0; }
.words-panel .char{ position:relative; }
.words-panel .char.correct{ color: var(--text); }
.words-panel .char.incorrect{ color: var(--error); text-decoration: underline; text-decoration-color: var(--error); text-underline-offset:3px; }
.words-panel .char.extra{ color: var(--error); opacity:.7; }
.words-panel .char.missed{ color: var(--text-faint); text-decoration: line-through; text-decoration-color: var(--text-faint); }
.words-inner{ transition: transform .18s ease; }
.words-panel .char.current::before{
  content:""; position:absolute; left:-1px; top:2px; bottom:2px; width:2px;
  background: var(--caret); animation: blink 1s steps(1) infinite;
}
@keyframes blink{ 50%{ opacity:0; } }

.click-veil{
  position:absolute; inset:0; display:flex; align-items:center; justify-content:center;
  background: color-mix(in srgb, var(--bg) 55%, transparent); border-radius: var(--radius-m);
  color: var(--text-dim); font-size:.9rem; cursor:text; opacity:0; pointer-events:none; transition: opacity .15s;
}
.click-veil.show{ opacity:1; pointer-events:all; }

.hidden-input{
  position:fixed; left:50%; top:50%; transform:translate(-50%,-50%);
  width:1px; height:1px; min-width:1px; min-height:1px;
  padding:0; margin:0; border:0; opacity:.01; pointer-events:auto;
  background:transparent; color:transparent; z-index:1;
  font-size:16px; line-height:1; -webkit-user-select:text; user-select:text;
}

.test-footer-hint{ margin-top:26px; color: var(--text-faint); font-size:.78rem; display:flex; gap:18px; }
.test-footer-hint kbd{
  font-family: var(--font-mono); background: var(--surface); border:1px solid var(--border);
  border-bottom-width:2px; padding:1px 6px; border-radius:4px; font-size:.72rem; color: var(--text-dim);
}

/* results */
.results-panel{ width:100%; max-width:860px; display:none; flex-direction:column; gap:28px; }
.results-panel.show{ display:flex; }
.results-grid{ display:flex; gap:56px; flex-wrap:wrap; }
.result-main .num{ font-family: var(--font-display); font-size:4rem; font-weight:700; color: var(--accent); line-height:1; }
.result-main .lbl{ color: var(--text-dim); font-size:.85rem; margin-top:6px; }
.result-mini-grid{ display:grid; grid-template-columns: repeat(4,auto); gap: 24px 36px; align-content:center; }
.result-mini .num{ font-family: var(--font-mono); font-size:1.3rem; color: var(--text); }
.result-mini .lbl{ color: var(--text-faint); font-size:.72rem; margin-top:2px; }
.results-actions{ display:flex; gap:10px; flex-wrap:wrap; }
.guest-note{
  border:1px dashed var(--border); border-radius: var(--radius-m); padding:14px 16px;
  color: var(--text-dim); font-size:.85rem; display:flex; justify-content:space-between; align-items:center; gap:12px; flex-wrap:wrap;
}

@media (max-width: 640px){
  .words-panel{ font-size:1.15rem; line-height:1.9; max-height: calc(1.9em * 4); }
  .result-main .num{ font-size:2.8rem; }
  .config-bar{ gap:2px; }
}

/* ==========================================================================
   CARDS / GENERIC COMPONENTS
   ========================================================================== */

.card{ background: var(--surface); border:1px solid var(--border); border-radius: var(--radius-m); padding: 22px; }
.grid-2{ display:grid; grid-template-columns: 1fr 1fr; gap:20px; }
.grid-3{ display:grid; grid-template-columns: repeat(3,1fr); gap:20px; }
@media (max-width:820px){ .grid-2,.grid-3{ grid-template-columns:1fr; } }

.accordion-item{ border-bottom:1px solid var(--border); }
.accordion-item:first-child{ border-top:1px solid var(--border); }
.accordion-q{
  width:100%; display:flex; justify-content:space-between; align-items:center; gap:16px;
  background:none; border:none; color: var(--text); text-align:left; cursor:pointer;
  padding: 18px 4px; font-size:.98rem; font-weight:500; font-family: var(--font-ui);
}
.accordion-q svg{ width:16px; height:16px; color: var(--text-dim); flex-shrink:0; transition: transform .2s ease; }
.accordion-item.open .accordion-q svg{ transform: rotate(45deg); }
.accordion-a{ max-height:0; overflow:hidden; transition: max-height .22s ease; color: var(--text-dim); font-size:.92rem; line-height:1.65; }
.accordion-a-inner{ padding: 0 4px 18px; max-width: 68ch; }

table.key-table{ width:100%; border-collapse: collapse; }
table.key-table th{ text-align:left; color: var(--text-dim); font-size:.76rem; font-weight:600; padding:10px 12px; border-bottom:1px solid var(--border); }
table.key-table td{ padding:12px; border-bottom:1px solid var(--border); font-size:.88rem; }
table.key-table kbd{ font-family: var(--font-mono); background: var(--surface-2); border:1px solid var(--border); border-bottom-width:2px; padding:2px 7px; border-radius:5px; font-size:.78rem; }

.lesson-row{ display:flex; align-items:center; gap:18px; padding:18px 0; border-bottom:1px solid var(--border); }
.lesson-num{ font-family: var(--font-mono); color: var(--accent); font-size:.85rem; width:26px; flex-shrink:0; }
.lesson-body h3{ font-size:1rem; font-weight:600; }
.lesson-body p{ color: var(--text-dim); font-size:.85rem; margin-top:3px; }

.keyboard-map{ display:flex; flex-direction:column; gap:6px; align-items:center; margin:22px 0; }
.kb-row{ display:flex; gap:6px; }
.kb-key{
  width:38px; height:38px; border-radius:6px; background: var(--surface-2); border:1px solid var(--border);
  display:flex; align-items:center; justify-content:center; font-family: var(--font-mono); font-size:.78rem; color: var(--text-dim);
}
.kb-key.f-left{ box-shadow: inset 0 0 0 2px var(--accent-soft); color: var(--accent); }
.kb-key.f-right{ box-shadow: inset 0 0 0 2px rgba(76,175,125,.25); color: var(--correct); }

/* ==========================================================================
   APP SHOWCASE PAGE
   ========================================================================== */

.app-hero{ display:flex; gap:48px; align-items:center; padding: 50px 0 20px; flex-wrap:wrap; }
.app-hero-media{ flex:1; min-width:260px; display:flex; justify-content:center; }
.phone-frame{
  width:250px; border-radius: 34px; border:8px solid var(--surface-2); background: var(--surface);
  box-shadow: var(--shadow-pop); overflow:hidden; aspect-ratio: 9/18.5;
}
.phone-frame img{ width:100%; height:100%; object-fit:cover; }
.app-hero-copy{ flex:1.2; min-width:280px; }
.app-hero-copy h1{ font-size: clamp(1.8rem,3vw,2.5rem); margin-bottom:14px; }
.app-hero-copy p{ color: var(--text-dim); max-width:50ch; margin-bottom:26px; }
.store-badges{ display:flex; align-items:center; gap:16px; flex-wrap:wrap; }
.store-card{
  display:flex; align-items:center; gap:12px; background: var(--surface); border:1px solid var(--border);
  border-radius: var(--radius-m); padding:12px 18px; cursor:pointer; transition: border-color .15s;
}
.store-card:hover{ border-color: var(--accent); }
.store-card .store-icon{ width:34px; height:34px; border-radius:8px; background: var(--accent-soft); display:flex; align-items:center; justify-content:center; color: var(--accent); }
.store-card .store-icon svg{ width:19px; height:19px; }
.store-card .store-text{ display:flex; flex-direction:column; }
.store-card .store-text small{ color: var(--text-dim); font-size:.68rem; }
.store-card .store-text strong{ font-size:.95rem; }
.app-meta{ display:flex; gap:24px; margin-top:26px; color: var(--text-dim); font-size:.82rem; flex-wrap:wrap; }
.app-meta b{ color: var(--text); font-family: var(--font-mono); font-size:1.05rem; display:block; }

.shot-preview{
  width:100%; max-width:420px; border-radius: var(--radius-l); border:1px solid var(--border);
  background: linear-gradient(155deg, var(--surface-2), var(--surface));
}


/* ==========================================================================
   APP PAGE — PLAY-STORE-STYLE SHOWCASE
   ========================================================================== */

.app-page{ overflow:hidden; }
.app-store-wrap{ padding-top:26px; }
.app-share-row{
  display:flex; align-items:center; justify-content:space-between; gap:16px;
  margin-bottom:12px;
}
.app-breadcrumb{
  color:var(--text-faint); font-size:.76rem; font-family:var(--font-mono);
  letter-spacing:.02em;
}
.app-share-btn{
  width:40px; height:40px; border-radius:999px; border:1px solid var(--border);
  background:var(--surface); color:var(--text-dim); display:flex; align-items:center;
  justify-content:center; cursor:pointer; transition:color .15s ease,border-color .15s ease,background .15s ease;
}
.app-share-btn:hover{ color:var(--text); border-color:var(--accent); background:var(--surface-2); }
.app-share-btn svg{ width:18px; height:18px; }

.app-share-wrap{ position:relative; flex-shrink:0; }
.app-share-popover{
  position:absolute; right:0; top:calc(100% + 9px); width:240px; padding:8px;
  background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-m);
  box-shadow:var(--shadow-pop); display:none; z-index:30;
}
.app-share-popover.open{ display:block; }
.app-share-popover-title{
  padding:7px 9px 8px; color:var(--text-faint); font-size:.68rem;
  font-family:var(--font-mono); text-transform:uppercase; letter-spacing:.07em;
}
.app-share-option{
  width:100%; display:flex; align-items:center; gap:10px; padding:10px 9px;
  border:0; border-radius:var(--radius-s); background:transparent; color:var(--text);
  text-align:left; cursor:pointer;
}
.app-share-option:hover{ background:var(--surface-2); }
.app-share-option-primary{ background:var(--accent-soft); }
.app-share-option-primary:hover{ background:var(--accent-soft); }
.app-share-option-icon{
  width:32px; height:32px; flex:0 0 32px; border-radius:8px;
  background:var(--accent-soft); color:var(--accent); display:flex; align-items:center; justify-content:center;
}
.app-share-option-icon svg{ width:16px; height:16px; }
.app-share-option > span:last-child{ display:flex; flex-direction:column; gap:2px; min-width:0; }
.app-share-option strong{ font-size:.8rem; font-weight:600; }
.app-share-option small{ color:var(--text-dim); font-size:.68rem; }

.app-store-card{
  background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-l);
  padding:30px; box-shadow:var(--shadow-pop);
}
.app-store-main{
  display:flex; align-items:flex-start; gap:24px;
}
.app-icon-wrap{
  width:112px; height:112px; flex:0 0 112px; border-radius:24px; overflow:hidden;
  background:var(--surface-2); border:1px solid var(--border);
  display:flex; align-items:center; justify-content:center;
}
.app-icon-wrap img{ width:100%; height:100%; object-fit:cover; }
.app-store-info{ min-width:0; flex:1; }
.app-store-info h1{ font-size:clamp(1.9rem,4vw,2.7rem); line-height:1.05; margin-bottom:6px; }
.app-byline{ color:var(--accent); font-size:.9rem; font-weight:600; margin-bottom:10px; }
.app-description{ color:var(--text-dim); max-width:72ch; font-size:.94rem; }
.app-meta-store{
  gap:28px; margin-top:18px; align-items:flex-start;
}
.app-meta-store div{ display:flex; flex-direction:column; gap:2px; }
.app-meta-store b{ font-size:.96rem; }
.app-meta-store span{ color:var(--text-faint); font-size:.72rem; }

.store-card-full{
  width:100%; margin-top:28px; min-height:64px; padding:12px 16px; text-align:left;
  border-radius:var(--radius-m); justify-content:flex-start;
}
.store-card-full .store-icon{ flex:0 0 40px; width:40px; height:40px; }
.store-card-full .store-text{ flex:1; }
.store-card-full .store-text strong{ font-size:1rem; }
.store-card-full .download-arrow{ width:19px; height:19px; color:var(--text-dim); margin-left:auto; }

.app-showcase-section{ padding-top:48px; }
.app-section-head{
  display:flex; justify-content:space-between; align-items:end; gap:28px; margin-bottom:18px;
}
.app-section-head h2{ font-size:clamp(1.35rem,2.4vw,1.8rem); }
.app-section-head > p{ max-width:48ch; color:var(--text-dim); font-size:.84rem; }
.section-kicker{
  color:var(--accent); font-size:.72rem; font-family:var(--font-mono);
  text-transform:uppercase; letter-spacing:.08em; margin-bottom:7px;
}
.app-shot-rail{
  display:flex; gap:16px; overflow-x:auto; overflow-y:hidden; padding:2px 2px 16px;
  scroll-snap-type:x proximity; overscroll-behavior-x:contain;
  scrollbar-width:auto;
}
.app-shot-card{
  flex:0 0 340px; height:352px; background:var(--surface);
  border:1px solid var(--border); border-radius:var(--radius-l);
  padding:10px; scroll-snap-align:start; display:flex; flex-direction:column;
}
.app-shot-media{
  height:280px; border-radius:calc(var(--radius-l) - 5px); overflow:hidden;
  background:var(--surface-2); display:flex; align-items:center; justify-content:center;
  border:1px solid var(--border);
}
.app-shot-media img{
  width:100%; height:100%; object-fit:contain; display:block;
}
.app-shot-caption{
  min-height:52px; padding:10px 4px 2px; display:flex; flex-direction:column; justify-content:center;
}
.app-shot-caption strong{ font-size:.86rem; }
.app-shot-caption span{ color:var(--text-faint); font-size:.72rem; margin-top:2px; }

.app-feature-section{ padding-top:24px; }
.app-feature-grid{ display:grid; grid-template-columns:repeat(3,1fr); gap:16px; }
.app-feature-grid .card h3{ font-size:.98rem; margin-bottom:7px; }
.app-feature-grid .card p{ color:var(--text-dim); font-size:.83rem; line-height:1.65; }

@media (max-width:700px){
  .app-store-card{ padding:20px; }
  .app-store-main{ gap:16px; }
  .app-icon-wrap{ width:82px; height:82px; flex-basis:82px; border-radius:18px; }
  .app-store-info h1{ font-size:1.7rem; }
  .app-description{ font-size:.86rem; }
  .app-meta-store{ gap:16px; }
  .app-section-head{ align-items:flex-start; flex-direction:column; gap:8px; }
  .app-shot-card{ flex-basis:320px; }
  .app-feature-grid{ grid-template-columns:1fr; }
}

@media (max-width:430px){
  .app-store-main{ align-items:center; }
  .app-description{ margin-top:8px; }
  .app-meta-store{ flex-wrap:wrap; }
}

.modal-overlay{
  position:fixed; inset:0; background: rgba(0,0,0,.55); display:none; align-items:center; justify-content:center;
  z-index:100; padding:20px;
}
.modal-overlay.show{ display:flex; }
.modal-box{
  background: var(--surface); border:1px solid var(--border); border-radius: var(--radius-l);
  padding: 28px; max-width: 380px; width:100%; text-align:center; box-shadow: var(--shadow-pop);
}
.modal-box h3{ font-size:1.1rem; margin-bottom:8px; }
.modal-box p{ color: var(--text-dim); font-size:.88rem; margin-bottom:20px; }
.modal-actions{ display:flex; gap:10px; justify-content:center; }


/* ==========================================================================
   HOME — QUICK REFERENCE + INLINE FAQ
   ========================================================================== */

.home-info-section,.home-faq-section{ padding-top:30px; }
.home-faq-section{ padding-bottom:20px; }
.home-section-head{
  display:flex; justify-content:space-between; align-items:end; gap:24px; margin-bottom:18px;
}
.home-section-head h2{ font-size:clamp(1.35rem,2.5vw,1.8rem); }
.text-link{ color:var(--text-dim); font-size:.82rem; white-space:nowrap; }
.text-link:hover{ color:var(--accent); }
.text-link span{ color:var(--accent); margin-left:4px; }

.shortcut-grid{
  display:grid; grid-template-columns:repeat(3,1fr); gap:10px;
}
.shortcut-card{
  min-height:86px; padding:15px 16px; background:var(--surface);
  border:1px solid var(--border); border-radius:var(--radius-m);
  display:flex; flex-direction:column; justify-content:center; gap:9px;
}
.shortcut-card > div{ display:flex; align-items:center; flex-wrap:wrap; gap:5px; }
.shortcut-card span{ color:var(--text-dim); font-size:.76rem; }
.shortcut-card b{ color:var(--text-faint); font-size:.7rem; }
.shortcut-card kbd{
  font-family:var(--font-mono); font-size:.7rem; color:var(--text);
  background:var(--surface-2); border:1px solid var(--border); border-bottom-width:2px;
  padding:3px 7px; border-radius:5px;
}
.home-faq-list{ max-width:920px; }
.home-faq-list .accordion-item:first-child{ border-top:1px solid var(--border); }

@media (max-width:820px){
  .shortcut-grid{ grid-template-columns:repeat(2,1fr); }
}
@media (max-width:560px){
  .home-section-head{ align-items:flex-start; flex-direction:column; gap:8px; }
  .shortcut-grid{ grid-template-columns:1fr; }
}

/* ==========================================================================
   AUTH PAGES
   ========================================================================== */

.auth-shell{ min-height: calc(100vh - 64px); display:flex; align-items:center; justify-content:center; padding: 40px 20px; }
.auth-card{ width:100%; max-width:380px; background: var(--surface); border:1px solid var(--border); border-radius: var(--radius-l); padding: 32px; }
.auth-card h1{ font-size:1.4rem; margin-bottom:6px; }
.auth-card > p{ color: var(--text-dim); font-size:.87rem; margin-bottom:24px; }
.field{ margin-bottom:14px; text-align:left; }
.field label{ display:block; font-size:.8rem; color: var(--text-dim); margin-bottom:6px; }
.field input{
  width:100%; padding:10px 12px; border-radius: var(--radius-s); border:1px solid var(--border);
  background: var(--surface-2); color: var(--text); font-size:.9rem; font-family:inherit;
}
.field input:focus{ border-color: var(--accent); }
.auth-message{ font-size:.82rem; min-height:1.3em; margin: 6px 0 4px; text-align:center; }
.auth-divider{ display:flex; align-items:center; gap:10px; color: var(--text-faint); font-size:.76rem; margin: 18px 0; }
.auth-divider::before, .auth-divider::after{ content:""; flex:1; height:1px; background: var(--border); }
.auth-switch{ text-align:center; font-size:.85rem; color: var(--text-dim); margin-top:16px; }
.auth-switch a{ color: var(--accent); font-weight:600; }

/* ==========================================================================
   PROFILE / PROGRESS
   ========================================================================== */

.stat-row{ display:grid; grid-template-columns: repeat(4,1fr); gap:16px; margin-bottom:28px; }
.stat-card{ background: var(--surface); border:1px solid var(--border); border-radius: var(--radius-m); padding:18px; }
.stat-card .num{ font-family: var(--font-mono); font-size:1.7rem; color: var(--accent); }
.stat-card .lbl{ color: var(--text-dim); font-size:.78rem; margin-top:4px; }
@media (max-width:760px){ .stat-row{ grid-template-columns: repeat(2,1fr); } }

.history-table{ width:100%; border-collapse: collapse; }
.history-table th{ text-align:left; font-size:.75rem; color: var(--text-dim); padding:10px 12px; border-bottom:1px solid var(--border); }
.history-table td{ padding:11px 12px; border-bottom:1px solid var(--border); font-size:.85rem; font-family: var(--font-mono); }
.empty-state{ text-align:center; padding: 60px 20px; color: var(--text-dim); }
.empty-state h3{ color: var(--text); margin-bottom:8px; }

/* utility */
.toast{
  position:fixed; bottom:22px; left:50%; transform: translateX(-50%);
  background: var(--surface-2); border:1px solid var(--border); color: var(--text);
  padding:11px 18px; border-radius: var(--radius-m); font-size:.85rem; box-shadow: var(--shadow-pop);
  z-index:200; opacity:0; pointer-events:none; transition: opacity .2s ease, transform .2s ease;
}
.toast.show{ opacity:1; transform: translateX(-50%) translateY(-6px); }

/* ==========================================================================\n   APP — LIVE RATINGS + FEEDBACK\n   ========================================================================== */
.app-live-stats{
  display:grid; grid-template-columns:1fr 1fr; gap:1px; margin-top:18px;
  border:1px solid var(--border); border-radius:var(--radius-m); overflow:hidden;
  background:var(--border);
}
.app-live-stat{
  background:var(--surface-2); padding:14px 16px; display:flex; flex-direction:column; gap:3px;
}
.app-live-stat > strong{ font-family:var(--font-mono); font-size:1.15rem; color:var(--text); }
.app-live-stat > span{ color:var(--text-faint); font-size:.72rem; }
.app-rating-line{ display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
.app-rating-line strong{ font-family:var(--font-mono); font-size:1.15rem; }
.stat-icon-label{ color:var(--text-dim); font-size:.78rem; }
.star-display{ color:var(--accent); font-size:.84rem; letter-spacing:.04em; white-space:nowrap; }

.app-feedback-section{ padding-top:48px; }
.app-feedback-grid{ display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1.15fr); gap:16px; }
.app-feedback-form-card,.feedback-list-card{ min-width:0; }
.feedback-user-note{ color:var(--text-dim); font-size:.78rem; line-height:1.55; margin-bottom:18px; }
.feedback-label{ display:block; color:var(--text-dim); font-size:.78rem; margin-bottom:8px; }
.rating-picker{ display:flex; align-items:center; gap:4px; margin-bottom:16px; }
.rating-picker button{
  border:0; background:transparent; color:var(--text-faint); font-size:1.55rem; line-height:1;
  padding:4px; cursor:pointer; transition:color .12s ease, transform .12s ease;
}
.rating-picker button:hover,.rating-picker button.selected{ color:var(--accent); }
.rating-picker button:hover{ transform:translateY(-1px); }
.feedback-textarea{
  width:100%; min-height:128px; resize:vertical; padding:12px 13px; border-radius:var(--radius-m);
  border:1px solid var(--border); background:var(--surface-2); color:var(--text); font:inherit; font-size:.84rem;
}
.feedback-textarea:focus{ border-color:var(--accent); outline:none; }
.feedback-form-footer{ display:flex; align-items:center; justify-content:space-between; gap:12px; margin-top:12px; }
.feedback-form-msg{ min-height:1.2em; color:var(--text-faint); font-size:.75rem; }
.feedback-list-head{ display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:12px; }
.feedback-list-head h3{ font-size:1rem; }
.feedback-list-head > span{ color:var(--text-faint); font-family:var(--font-mono); font-size:.72rem; }
.feedback-list{ display:flex; flex-direction:column; gap:9px; max-height:360px; overflow:auto; padding-right:3px; }
.feedback-item{ padding:12px 13px; border:1px solid var(--border); border-radius:var(--radius-m); background:var(--surface-2); }
.feedback-item-top{ display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:5px; }
.feedback-item-top strong{ font-size:.8rem; }
.feedback-stars{ color:var(--accent); font-size:.68rem; letter-spacing:.03em; white-space:nowrap; }
.feedback-item p{ color:var(--text-dim); font-size:.78rem; line-height:1.55; white-space:pre-wrap; word-break:break-word; }
.feedback-empty{ color:var(--text-faint); font-size:.8rem; line-height:1.6; padding:16px 2px; }

@media (max-width:820px){
  .app-feedback-grid{ grid-template-columns:1fr; }
}
@media (max-width:560px){
  .app-live-stats{ grid-template-columns:1fr; }
  .feedback-form-footer{ align-items:flex-start; flex-direction:column; }
  .feedback-form-footer .btn{ width:100%; }
}


/* ==========================================================================
   RESULT SHARING / CUSTOM / LEADERBOARD — additive styles
   Keeps the existing Maniaxe Typing visual language.
   ========================================================================== */

.shot-actions{ display:flex; gap:10px; flex-wrap:wrap; justify-content:center; }

.result-share-wrap{ position:relative; display:inline-flex; }
.result-share-menu{
  position:absolute; left:0; bottom:calc(100% + 8px); width:260px; padding:8px;
  background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-m);
  box-shadow:var(--shadow-pop); display:none; z-index:50;
}
.result-share-menu.open{ display:block; }
.result-share-title{
  padding:7px 9px 8px; color:var(--text-faint); font-size:.68rem;
  font-family:var(--font-mono); text-transform:uppercase; letter-spacing:.07em;
}
.result-share-option{
  width:100%; border:0; background:transparent; color:var(--text);
  text-align:left; padding:10px 9px; border-radius:var(--radius-s); cursor:pointer;
  font:500 .82rem var(--font-ui);
}
.result-share-option:hover{ background:var(--surface-2); }

.custom-result-status{
  display:inline-flex; align-items:center; width:max-content; padding:6px 10px;
  border-radius:999px; font:700 .75rem var(--font-mono); letter-spacing:.04em;
}
.custom-result-status.pass{ color:var(--correct); background:rgba(76,175,125,.12); border:1px solid rgba(76,175,125,.28); }
.custom-result-status.fail{ color:var(--error); background:rgba(193,68,58,.12); border:1px solid rgba(193,68,58,.28); }

.custom-builder{ padding-bottom:40px; }
.custom-form{ display:grid; gap:18px; }
.custom-form textarea{
  width:100%; min-height:230px; resize:vertical; padding:16px;
  background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-m);
  color:var(--text); font:500 1rem/1.65 var(--font-mono);
}
.custom-form textarea:focus{ outline:2px solid var(--accent); outline-offset:1px; }
.custom-grid{ display:grid; grid-template-columns:repeat(2,1fr); gap:14px; }
.custom-setting{
  background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-m); padding:15px;
}
.custom-setting label{ display:flex; align-items:center; justify-content:space-between; gap:12px; color:var(--text-dim); font-size:.8rem; margin-bottom:8px; }
.custom-setting input[type="number"]{
  width:100%; padding:10px 12px; background:var(--surface-2); color:var(--text);
  border:1px solid var(--border); border-radius:var(--radius-s);
}
.custom-check{ display:flex; align-items:center; gap:9px; color:var(--text); font-size:.86rem; }
.custom-subsettings{ display:none; grid-template-columns:repeat(2,1fr); gap:12px; margin-top:12px; }
.custom-subsettings.show{ display:grid; }
.custom-help{ color:var(--text-faint); font-size:.76rem; }
.custom-test-note{
  color:var(--text-dim); font-size:.82rem; padding:12px 14px;
  border:1px dashed var(--border); border-radius:var(--radius-m);
}

.leaderboard-card{ margin-top:32px; }
.leaderboard-head{ display:flex; justify-content:space-between; align-items:end; gap:14px; margin-bottom:14px; }
.leaderboard-list{ display:grid; gap:7px; }
.leaderboard-row{
  display:grid; grid-template-columns:38px minmax(0,1fr) auto auto; align-items:center; gap:12px;
  padding:10px 12px; border:1px solid var(--border); border-radius:var(--radius-s); background:var(--surface);
}
.leaderboard-rank{ font:700 .82rem var(--font-mono); color:var(--accent); }
.leaderboard-name{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.leaderboard-wpm{ font:700 .9rem var(--font-mono); color:var(--text); }
.leaderboard-accuracy{ color:var(--text-dim); font-size:.72rem; }
.leaderboard-empty,.leaderboard-note{ color:var(--text-dim); font-size:.82rem; }
.leaderboard-user{ margin-top:12px; color:var(--text-faint); font-size:.75rem; }

.uptodown-download-card{
  width:100%; margin-top:28px; min-height:72px; padding:13px 16px;
  display:flex; align-items:center; gap:16px; text-decoration:none;
  background:var(--surface-2); border:1px solid var(--border); border-radius:var(--radius-m);
  color:var(--text); transition:border-color .15s ease, background .15s ease, transform .15s ease;
}
.uptodown-download-card:hover{ border-color:var(--accent); background:var(--surface); transform:translateY(-1px); }
.uptodown-download-copy{ display:flex; flex-direction:column; gap:3px; min-width:0; flex:1; }
.uptodown-kicker{ color:var(--accent); font:600 .66rem var(--font-mono); text-transform:uppercase; letter-spacing:.08em; }
.uptodown-download-copy strong{ font-size:1rem; }
.uptodown-download-copy small{ color:var(--text-dim); font-size:.7rem; }
.uptodown-badge{ flex:0 0 auto; display:flex; align-items:center; justify-content:center; padding:3px; border-radius:7px; }
.uptodown-badge img{ display:block; width:150px; max-width:28vw; height:auto; }
.uptodown-download-card .download-arrow{ width:19px; height:19px; color:var(--text-dim); flex:0 0 auto; }
.github-fallback-row{ display:flex; justify-content:flex-end; align-items:center; gap:8px; margin:9px 2px 0; color:var(--text-faint); font-size:.68rem; }
.github-fallback-row span{ display:inline-flex; align-items:center; gap:5px; }
.github-fallback-row svg{ width:13px; height:13px; }
.github-fallback-row a{ color:var(--text-dim); text-decoration:none; border-bottom:1px dotted var(--border); }
.github-fallback-row a:hover{ color:var(--accent); border-color:var(--accent); }

.result-leaderboard-card{
  display:flex; align-items:center; justify-content:space-between; gap:16px;
  padding:14px 16px; border:1px solid var(--border); border-radius:var(--radius-m);
  background:var(--surface);
}
.result-leaderboard-copy{ display:flex; flex-direction:column; gap:3px; min-width:0; }
.result-leaderboard-copy .section-kicker{ margin-bottom:0; }
.result-leaderboard-copy strong{ font-size:.92rem; }
.result-leaderboard-copy > span:last-child{ color:var(--text-dim); font-size:.76rem; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

.footer-leaderboard{ max-width:1180px; margin:0 auto; padding:28px 24px 30px; border-top:1px solid var(--border); }
.footer-leaderboard-head{ display:flex; justify-content:space-between; align-items:flex-end; gap:20px; margin-bottom:14px; }
.footer-leaderboard-head h3{ font-size:1.05rem; margin-bottom:4px; }
.footer-leaderboard-head p:not(.section-kicker){ color:var(--text-dim); font-size:.76rem; }
.leaderboard-game-badge{ padding:6px 9px; border:1px solid var(--border); border-radius:999px; color:var(--accent); font:700 .64rem var(--font-mono); letter-spacing:.08em; white-space:nowrap; }

@media (max-width:640px){
  .custom-grid,.custom-subsettings,.app-download-options{ grid-template-columns:1fr; }
  .result-share-menu{ left:auto; right:0; }
  .leaderboard-row{ grid-template-columns:30px minmax(0,1fr) auto; }
  .leaderboard-accuracy{ display:none; }
  .uptodown-download-card{ gap:10px; padding:12px; }
  .uptodown-badge img{ width:128px; max-width:34vw; }
  .github-fallback-row{ justify-content:flex-start; flex-wrap:wrap; }
  .result-leaderboard-card{ align-items:flex-start; flex-direction:column; }
  .footer-leaderboard{ padding-left:16px; padding-right:16px; }
  .footer-leaderboard-head{ align-items:flex-start; flex-direction:column; gap:10px; }
}
