/* Type Meltdown — dark effects stage, with Play Weird's paper arcade controls. */
@font-face {
  font-family: 'TM Bungee';
  src: url('./fonts/Bungee-Regular.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'TM Nunito';
  src: url('./fonts/NunitoSans.ttf') format('truetype');
  font-weight: 200 1000;
  font-display: swap;
}
:root {
  color-scheme: light;
  --tm-cream: #fff4d6;
  --tm-ink: #111111;
  --tm-yellow: #ffd500;
  --tm-pink: #ff5fa2;
  --tm-blue: #2f6bff;
  --font-sans: 'TM Nunito', sans-serif;
  --font-pixel: 'TM Bungee', sans-serif;
  --ds-background-100: #090a0f;
  --ds-gray-100: #fffdf7;
  --ds-gray-200: #ffedbc;
  --ds-gray-500: #766f61;
  --ds-gray-900: #54504a;
  --ds-gray-1000: #f5f0e8;
  --ds-gray-alpha-100: #1111110b;
  --ds-gray-alpha-200: #11111112;
  --ds-gray-alpha-300: #11111122;
  --ds-gray-alpha-400: #111111;
  --ds-gray-alpha-500: #11111155;
  --ds-gray-alpha-600: #11111199;
  --ds-amber-800: var(--tm-yellow);
  --ds-red-500: #bf154d;
  --ds-red-800: #c92144;
  --ds-red-900: #c92144;
  --type-bg: #090a0f;
  --type-untyped: #a0a6b0;
  --type-correct: #f5f0e8;
  --type-caret: #ff5fa2;
  --type-error: #ff637d;
  --type-error-extra: #cf4264;
  --type-sub: #a5a6af;
  --type-highlight: var(--tm-yellow);
  --background: #090a0f;
  --foreground: #f5f0e8;
  --card: #fffdf7;
  --card-foreground: var(--tm-ink);
  --popover: #fffdf7;
  --popover-foreground: var(--tm-ink);
  --primary: var(--tm-yellow);
  --primary-foreground: var(--tm-ink);
  --secondary: #ffedbc;
  --secondary-foreground: var(--tm-ink);
  --muted: #f3e7c8;
  --muted-foreground: #b3b1b6;
  --accent: #ffdfed;
  --accent-foreground: var(--tm-ink);
  --destructive: #c92144;
  --border: var(--tm-ink);
  --input: var(--tm-ink);
  --ring: var(--tm-blue);
  --radius: .65rem;
}
body { background: var(--background); font-family: var(--font-sans); font-weight: 700; }
a { color: #b3b1b6; }
a:hover { color: #f5f0e8; }
button, input, textarea { font-family: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--tm-blue); outline-offset: 3px; }
/* The host's shared GameHeader owns site navigation and the game title. */
.brand[data-astro-cid-e6xjdcgf] { display: none; }
body::after {
  content: 'TYPING PRACTICE. QUESTIONABLE PHYSICS.';
  position: fixed;
  bottom: 18px;
  left: 24px;
  z-index: 1;
  font: 9px/1.5 'TM Bungee', sans-serif;
  letter-spacing: .055em;
  color: #a5a6af;
  pointer-events: none;
}
.keycap[data-astro-cid-e6xjdcgf] { width: 46px; height: 46px; }
.tm-wordmark { display: grid; gap: 2px; }
.tm-wordmark small { font-size: 9px; line-height: 13px; letter-spacing: .12em; font-weight: 1000; }
.tm-wordmark strong { font: 20px/1.15 'TM Bungee', sans-serif; letter-spacing: -.04em; }
.tm-intro {
  position: fixed;
  top: 126px;
  left: 26px;
  z-index: 1;
  width: 270px;
  pointer-events: none;
  transition: opacity .16s;
}
.tm-intro p { max-width: 200px; font-size: 10px; line-height: 1.5; letter-spacing: .06em; font-weight: 1000; }
.tm-intro h2 { margin-top: 12px; font: 35px/1.08 'TM Bungee', sans-serif; letter-spacing: -.04em; }
.tm-intro h2 span { display: inline-block; background: var(--tm-yellow); color: #111; padding: 1px 5px 3px; margin-left: -5px; }
.tm-stamp {
  display: inline-block;
  margin-top: 16px;
  padding: 5px 8px;
  transform: rotate(-4deg);
  border: 2px solid #111;
  border-radius: 4px;
  box-shadow: 2px 2px 0 #111;
  background: var(--tm-pink);
  color: #111;
  font: 8px/1.5 'TM Bungee', sans-serif;
}
html:is([data-typing], [data-tm-result], [data-tm-page='stats']) .tm-intro { opacity: 0; visibility: hidden; }
html[data-tm-page='stats'] body::after { display: none; }
html[data-tm-page='stats'] .r3f-canvas-container { visibility: hidden; }
html[data-tm-page='stats'] {
  --background: var(--tm-cream);
  --foreground: var(--tm-ink);
  --ds-gray-1000: var(--tm-ink);
  --muted-foreground: #54504a;
  --primary: var(--tm-blue);
}
/* The scene stays dark even on a direct Stats entry, ready for the Typing desk. */
:is([data-slot='dialog-content'], [data-slot='select-content'], [data-slot='popover-content'], [data-slot='card'], [data-slot='daily']) {
  --foreground: #111;
  --ds-gray-1000: #111;
  --muted-foreground: #54504a;
  --type-correct: #111;
  --type-untyped: #766f61;
  --type-sub: #54504a;
  --type-highlight: #2f6bff;
}
[data-slot='dialog-content'] { --primary: var(--tm-blue); }
/* Engine controls stay in the frame; site navigation belongs to the host header. */
astro-island > section > .fixed.top-4 { z-index: 3; }
astro-island > section > .fixed.top-16 { top: 56px; gap: 18px; }
astro-island > section > .fixed.top-28 { top: 104px; }
astro-island > section > button.fixed[class*='top-[60px]'] {
  top: auto;
  bottom: 16px;
  left: auto;
  right: 24px;
  z-index: 3;
  padding: 3px 7px;
  border: 2px solid #111;
  border-radius: 5px;
  background: var(--tm-yellow);
  color: #111;
  box-shadow: 2px 2px 0 #111;
  font-family: var(--font-sans);
  font-weight: 900;
}
[data-slot='button'], [data-slot='select-trigger'] {
  min-height: 32px;
  border: 2px solid #111;
  border-radius: 8px;
  box-shadow: 2px 2px 0 #111;
  background: #fffdf7;
  color: #111;
  font-weight: 900;
  transition: background-color .12s, box-shadow .12s, transform .12s;
}
[data-slot='button'][data-variant='default'] { background: var(--tm-yellow); }
[data-slot='button'][data-variant='ghost'] { background: var(--tm-cream); }
[data-slot='button']:hover, [data-slot='select-trigger']:hover { background: #ffedbc; }
[data-slot='button']:active, [data-slot='select-trigger']:active { transform: translate(2px, 2px); box-shadow: none; }
[data-slot='button']:disabled { box-shadow: none; opacity: .55; }
.keycap-button, .keycap-button[data-variant='orange'] {
  background: var(--tm-yellow);
  padding: 0;
  border: 2px solid #111;
  border-radius: 8px;
  box-shadow: 3px 3px 0 #111;
}
.keycap-face { padding: 5px 10px; background: none; box-shadow: none; color: #111; font-weight: 1000; }
.font-pixel { color: #f5f0e8; }
:is([data-slot='dialog-content'], [data-slot='select-content'], [data-slot='popover-content'], [data-slot='card'], [data-slot='daily'], [data-slot='keycap'], [data-slot='button']) .font-pixel { color: #111; }
[data-slot='toggle-group'] { gap: 5px; }
[data-slot='toggle-group-item'] {
  min-height: 31px;
  padding-inline: 10px;
  border: 2px solid #111;
  border-radius: 7px;
  background: #fffdf7;
  color: #343029;
  font-weight: 900;
}
[data-slot='toggle-group-item'][data-state='on'] { background: var(--tm-yellow); color: #111; box-shadow: 2px 2px 0 #111; }
[data-slot='daily'] {
  border: 2px solid #111;
  box-shadow: 3px 3px 0 #111;
  border-radius: 9px;
  background: #fffdf7;
  color: #111;
}
[data-slot='daily']:hover { background: #ffdfed; }
[data-slot='dialog-overlay'] { background: #11111160; backdrop-filter: blur(3px); }
[data-slot='dialog-content'], [data-slot='select-content'], [data-slot='popover-content'] {
  background: #fffdf7;
  color: #111;
  border: 3px solid #111;
  border-radius: 14px;
  box-shadow: 7px 7px 0 #111;
}
[data-slot='dialog-title'] { font: 24px/1.25 'TM Bungee', sans-serif; letter-spacing: -.035em; }
[data-slot='dialog-description'] { color: #54504a; line-height: 1.55; font-weight: 700; }
[data-slot='dialog-footer'] { gap: 10px; }
[data-slot='dialog-close'] { color: #111; }
[data-slot='card'] { border: 2px solid #111; box-shadow: 3px 3px 0 #111; background: #fffdf7; }
[data-slot='card-title'] { font-family: 'TM Bungee', sans-serif; font-size: 15px; }
[data-slot='input'], [data-slot='textarea'] { border: 2px solid #111; background: var(--tm-cream); color: #111; box-shadow: none; }
/* Keep long custom passages inside the editor instead of sizing its grid column. */
#setting-custom[data-slot='textarea'] {
  field-sizing: fixed;
  min-width: 0;
  max-width: 100%;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  overflow-x: hidden;
}
[data-slot='switch'] { border: 2px solid #111; height: 20px; box-shadow: 1px 1px 0 #111; }
[data-slot='switch-thumb'] { background: #111; }
[data-slot='switch'][data-state='checked'] { background: var(--tm-yellow); }
[data-slot='switch'][data-state='unchecked'] { background: #ddd3bc; }
[data-slot='slider-track'] { background: #ddd3bc; border: 1px solid #111; height: 7px; }
[data-slot='slider-range'] { background: var(--tm-pink); }
[data-slot='slider-thumb'] { border: 2px solid #111; background: var(--tm-yellow); box-shadow: 2px 2px 0 #111; }
[data-slot='select-item'][data-highlighted] { background: #ffdfed; }
[data-slot='progress'] { background: #ddd3bc; }
.text-white { color: #f5f0e8; }
.text-primary { color: var(--tm-yellow); }
:is([data-slot='dialog-content'], [data-slot='select-content'], [data-slot='popover-content'], [data-slot='card'], [data-slot='daily'], [data-slot='keycap'], [data-slot='button']) .text-white { color: #111; }
:is([data-slot='dialog-content'], [data-slot='select-content'], [data-slot='popover-content'], [data-slot='card'], [data-slot='daily'], [data-slot='keycap'], [data-slot='button']) .text-primary { color: #111; }
.bg-white\/5, .bg-white\/10 { background-color: #11111112; }
.border-white\/10, .border-white\/15, .border-white\/20 { border-color: #111; }
.shimmer { animation: none; background: none; -webkit-text-fill-color: currentColor; }
kbd { border: 2px solid #111; border-radius: 5px; box-shadow: 1px 2px 0 #111; background: #fffdf7; padding: 2px 5px; color: #111; }
.tm-effect-preview {
  position: relative;
  display: block;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 8 / 5;
  border: 2px solid #111;
  border-radius: 10px;
  background: #090a0f;
  color: #f5f0e8;
}
.tm-effect-video { display: block; width: 100%; height: 100%; aspect-ratio: 8 / 5; object-fit: cover; background: #090a0f; }
.tm-effect-caption {
  position: absolute;
  left: 8px;
  bottom: 8px;
  padding: 3px 6px;
  border: 1px solid #f5f0e830;
  border-radius: 4px;
  background: #090a0fcc;
  color: #f5f0e8;
  font-size: 8px;
  font-weight: 1000;
  letter-spacing: .09em;
  pointer-events: none;
}
.tm-welcome-visual { display: grid; place-content: center; gap: 20px; min-height: 220px; padding: 24px; background: var(--tm-pink); border: 2px solid #111; border-radius: 10px; }
.tm-keyboard { display: flex; justify-content: center; gap: 9px; height: 66px; align-items: flex-start; }
.tm-keycap { display: grid; place-content: center; width: 52px; height: 55px; border: 3px solid #111; border-radius: 9px; background: var(--tm-yellow); box-shadow: 4px 5px 0 #111; font: 26px 'TM Bungee', sans-serif; }
.tm-keycap:nth-child(even) { transform: translateY(10px) rotate(9deg); background: var(--tm-cream); }
.tm-keycap:nth-child(odd) { transform: rotate(-7deg); }
.tm-welcome-tagline { margin: 0; text-align: center; font-size: 10px; letter-spacing: .06em; font-weight: 1000; }
.tm-welcome-caption { text-align: center; font-size: 12px; font-weight: 900; }
@media (min-width: 1100px) {
  .tm-intro { top: 132px; }
}
@media (max-width: 900px) and (min-width: 640px) {
  .tm-intro { width: 220px; top: 153px; left: 20px; }
  .tm-intro h2 { font-size: 28px; }
}
@media (max-width: 639px) {
  body::after { font-size: 7px; bottom: 12px; left: 16px; }
  .keycap[data-astro-cid-e6xjdcgf] { width: 36px; height: 38px; }
  .tm-wordmark small { font-size: 7px; line-height: 10px; letter-spacing: .075em; }
  .tm-wordmark strong { font-size: 13px; }
  astro-island > section > .fixed.top-4 { top: 12px; right: 14px; }
  astro-island > section > .fixed.top-4 [data-slot='button'] { font-size: 10px; min-height: 29px; padding-inline: 7px; }
  astro-island > section > .fixed.top-16 { top: 52px; }
  astro-island > section > .fixed.top-28 { top: 96px; }
  astro-island > section > button.fixed[class*='top-[60px]'] { bottom: 9px; right: 14px; font-size: 10px; }
  .tm-intro { top: 160px; left: 50%; transform: translateX(-50%); width: 100%; text-align: center; }
  .tm-intro p { max-width: none; font-size: 8px; }
  .tm-intro h2 { margin-top: 9px; font-size: 34px; line-height: 1.05; }
  .tm-stamp { display: none; }
  [data-slot='dialog-content'] { border-radius: 12px; box-shadow: 4px 4px 0 #111; }
  [data-slot='dialog-title'] { font-size: 21px; }
  [data-slot='daily'] { min-height: 32px; }
}
@media (max-height: 650px) {
  .tm-intro { display: none; }
}
@media (max-width: 639px) and (max-height: 780px) {
  .tm-intro { top: 145px; }
  .tm-intro p { display: none; }
  .tm-intro h2 { font-size: 26px; }
}
@media (max-width: 639px) and (max-height: 720px) {
  .tm-intro { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
