/* ============================================
   Fufty Games — Main Stylesheet
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

:root {
  --color-bg: #FAFAF7;
  --color-bg-alt: #F3F1EC;
  --color-bg-dark: #1A1D1B;
  --color-surface: #FFFFFF;
  --color-text: #1A1A1A;
  --color-text-secondary: #5C5C5C;
  --color-text-tertiary: #707070;
  --color-text-inverse: #F0EDE8;
  --color-primary: #3A7D5C;
  --color-primary-hover: #2E6349;
  --color-primary-light: rgba(58, 125, 92, 0.08);
  --color-accent: #C9944E;
  --color-border: #E2E0DB;
  --color-border-light: #ECEAE5;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-serif: 'Literata', Georgia, 'Times New Roman', serif;
  --font-mono: 'Geist Mono', monospace;

  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2.5rem;
  --spacing-xl: 4rem;
  --spacing-2xl: 6rem;
  --spacing-3xl: 8rem;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.05), 0 1px 4px rgba(0,0,0,0.04);

  --max-width: 1120px;
  --nav-height: 72px;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--color-text);
  background-color: var(--color-bg);
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--color-primary-hover);
}

h1, h2, h3, h4 {
  line-height: 1.2;
  font-weight: 600;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

/* Honeypot field — invisible to real users */
.hp-field {
  position: absolute;
  left: -9999px;
  top: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

/* --- Skip Link --- */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--spacing-md);
  z-index: 200;
  padding: 12px 24px;
  background-color: var(--color-primary);
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: var(--spacing-sm);
  color: #fff;
}

/* --- Focus Styles --- */
*:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.btn:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(58, 125, 92, 0.2);
}

.nav-toggle:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 4px;
}


/* --- Layout --- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

.section {
  padding: var(--spacing-3xl) 0;
}


/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  z-index: 100;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.nav.scrolled {
  background-color: rgba(250, 250, 247, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 var(--color-border-light);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.nav-logo:hover {
  opacity: 0.85;
}

.logo-img {
  height: 56px;
  width: auto;
}

.logo-bird {
  height: 58px;
  width: auto;
}

.logo-icon {
  display: flex;
  align-items: center;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--spacing-lg);
  list-style: none;
}

.nav-links a {
  color: var(--color-text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s ease;
}

.nav-links a:hover {
  color: var(--color-text);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background-color: var(--color-text);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav-toggle.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}


/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  padding: 12px 28px;
}

.btn-primary {
  background-color: var(--color-primary);
  color: #fff;
}

.btn-primary:hover {
  background-color: var(--color-primary-hover);
  color: #fff;
}

.btn-ghost {
  background-color: transparent;
  color: var(--color-text-secondary);
  border: 1.5px solid var(--color-border);
}

.btn-ghost:hover {
  border-color: var(--color-text-secondary);
  color: var(--color-text);
}

.btn-nav {
  padding: 8px 20px;
  background-color: var(--color-primary);
  color: #fff !important;
  border-radius: var(--radius-sm);
}

.btn-nav:hover {
  background-color: var(--color-primary-hover);
  color: #fff !important;
}

.btn-full {
  width: 100%;
}


/* --- Hero --- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: calc(var(--nav-height) + var(--spacing-xl)) 0 var(--spacing-xl);
  position: relative;
  overflow: hidden;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 620px;
}

.hero-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--spacing-md);
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  font-weight: 500;
  line-height: 1.15;
  color: var(--color-text);
  margin-bottom: var(--spacing-md);
  letter-spacing: -0.02em;
}

.hero-description {
  font-size: 1.1rem;
  color: var(--color-text-secondary);
  line-height: 1.7;
  margin-bottom: var(--spacing-lg);
  max-width: 520px;
}

.hero-actions {
  display: flex;
  gap: var(--spacing-sm);
  flex-wrap: wrap;
}



/* --- Section Headers --- */
.section-header {
  margin-bottom: var(--spacing-xl);
}

.section-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--spacing-xs);
}

.section-title {
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 3.5vw, 2.4rem);
  font-weight: 500;
  color: var(--color-text);
  letter-spacing: -0.02em;
}


/* --- Product Section --- */
.product {
  background-color: var(--color-surface);
}

.product-intro {
  max-width: 680px;
  margin-bottom: var(--spacing-xl);
}

.product-intro p {
  color: var(--color-text-secondary);
  margin-bottom: var(--spacing-sm);
  font-size: 1.05rem;
}

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--spacing-md);
}

.feature-card {
  padding: var(--spacing-lg);
  border-radius: var(--radius-md);
  background-color: var(--color-bg);
  border: 1px solid var(--color-border-light);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.feature-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--color-border);
}

.feature-icon {
  color: var(--color-primary);
  margin-bottom: var(--spacing-sm);
}

.feature-card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.feature-card p {
  font-size: 0.92rem;
  color: var(--color-text-secondary);
  line-height: 1.6;
}


/* --- Stage: one phone that plays every game's demo, and the picker --- */
.stage {
  padding: calc(var(--nav-height) + var(--spacing-md)) 0 var(--spacing-lg);
}

.stage-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "copy demo"
    "picker picker";
  column-gap: var(--spacing-xl);
  row-gap: var(--spacing-md);
  align-items: center;
}

.game-copy {
  grid-area: copy;
  max-width: 480px;
}

.game-copy.swap > * {
  animation: copy-in 0.35s ease-out both;
}

@keyframes copy-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.facts {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: var(--spacing-md);
}

.facts li {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 4px 12px;
}

.stage-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--spacing-sm);
}

.stage-more {
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-primary);
  background: none;
  border: none;
  cursor: pointer;
  padding: 12px 4px;
}

.stage-more:hover {
  color: var(--color-primary-hover);
  text-decoration: underline;
}

.picker {
  grid-area: picker;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr)) 44px;
  gap: 8px;
}

.pick {
  font: inherit;
  color: var(--color-text);
  text-align: left;
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 9px 10px 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  min-width: 0;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.pick:hover {
  border-color: var(--color-text-tertiary);
}

.pick b {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 1.05rem;
  line-height: 1.25;
  white-space: nowrap;
}

.pick small {
  font-size: 0.72rem;
  color: var(--color-text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pick .bar {
  height: 3px;
  border-radius: 2px;
  background: var(--color-border-light);
  margin-top: 7px;
  overflow: hidden;
}

.pick .bar i {
  display: block;
  height: 100%;
  background: var(--color-primary);
  transform: scaleX(0);
  transform-origin: left center;
}

.pick[aria-pressed="true"] {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 1px var(--color-primary);
}

.pick-pause {
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--color-text-secondary);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.pick-pause:hover {
  border-color: var(--color-text-tertiary);
  color: var(--color-text);
}

.pick-pause .i-play,
.pick-pause[aria-pressed="true"] .i-pause {
  display: none;
}

.pick-pause[aria-pressed="true"] .i-play {
  display: block;
}

/* --- Every game, as a plain list --- */
.all-games {
  background: var(--color-bg-alt);
  padding: var(--spacing-2xl) 0;
}

.all-intro {
  color: var(--color-text-secondary);
  font-size: 1.05rem;
  max-width: 620px;
  margin: var(--spacing-xs) 0 var(--spacing-lg);
}

.game-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--spacing-sm);
}

.gl-item {
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  display: flex;
  flex-direction: column;
}

.gl-item h3 {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 1.45rem;
  letter-spacing: -0.01em;
}

.gl-tag {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: 2px;
}

.gl-line {
  color: var(--color-text-secondary);
  font-size: 0.93rem;
  line-height: 1.55;
  margin: 8px 0 14px;
  flex: 1;
}

.gl-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  font-size: 0.9rem;
  font-weight: 600;
}

.game-tag {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: 6px;
}

.game-name {
  font-family: var(--font-serif);
  font-size: clamp(2.4rem, 5vw, 3.2rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  margin-bottom: var(--spacing-sm);
}

.game-copy p:not(.game-tag) {
  color: var(--color-text-secondary);
  font-size: 1.05rem;
  margin-bottom: var(--spacing-sm);
}

/* The phones are stacked in one spot and only the chosen game's shows. The
   page sets --demo-scale so the phone and the picker fit one screen. */
.demo {
  --demo-scale: 1;
  grid-area: demo;
  position: relative;
  width: calc(280px * var(--demo-scale));
  height: calc(540px * var(--demo-scale));
  margin: 0 auto;
}

.phone {
  position: absolute;
  top: 0;
  left: 0;
  width: 280px;
  height: 540px;
  border-radius: 36px;
  border: 8px solid #1b1b1d;
  box-shadow: 0 20px 50px rgba(0,0,0,0.18);
  overflow: hidden;
  user-select: none;
  transform: scale(var(--demo-scale));
  transform-origin: top left;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0s 0.35s;
}

.phone.on {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.35s ease;
}

.finger {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 5;
  pointer-events: none;
}

.finger svg {
  display: block;
  margin: -5px 0 0 -18px;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.35));
  transition: transform 0.15s;
  transform-origin: 18px 5px;
}

.finger.press svg {
  transform: scale(0.88);
}

.pressed {
  transform: scale(0.9);
  filter: brightness(1.25);
}

/* Fufty demo: colours and shapes from Fufty's dark theme */
.phone-fufty {
  background: #f5f0e8;
  color: #000;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 8px 14px;
  font-family: var(--font-sans);
}

.fu-top {
  align-self: stretch;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 6px;
}

.fu-round {
  font-size: 0.7rem;
  color: #8a6508;
  background: rgba(184, 134, 11, 0.13);
  border: 1px solid rgba(184, 134, 11, 0.45);
  border-radius: 6px;
  padding: 2px 8px;
}

.fu-toast-slot {
  height: 30px;
  margin: 34px 0 10px;
  display: grid;
  place-items: center;
}

.fu-toast {
  padding: 3px 8px;
  border-radius: 4px;
  color: #fff;
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  opacity: 0;
}

.fu-toast.blue { background: #0077b6; }
.fu-toast.green { background: #008000; }
.fu-toast.show { animation: fu-toast 1.8s ease-out forwards; }
.fu-toast.stay { animation: fu-pop 0.32s ease-out both; }

@keyframes fu-toast {
  0%, 70% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes fu-pop {
  0% { opacity: 0; transform: scale(0.8); }
  70% { opacity: 1; transform: scale(1.05); }
  100% { opacity: 1; transform: scale(1); }
}

.fu-phrase {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 12px;
  max-width: 250px;
}

.fu-word {
  display: flex;
  gap: 2px;
}

.fu-tile {
  position: relative;
  width: 26px;
  height: 34px;
  perspective: 300px;
}

.fu-face {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 1.8rem;
  line-height: 1;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transition: transform 0.9s ease;
}

.fu-face.down {
  background: #333438;
  color: #fff;
}

.fu-face.up {
  background: #0077b6;
  color: #fff;
  transform: rotateY(180deg);
}

.fu-tile.up .fu-face.down { transform: rotateY(-180deg); }
.fu-tile.up .fu-face.up { transform: rotateY(0); }
.fu-tile.next .fu-face.down { box-shadow: inset 0 0 0 2px #d4a017; }

.fu-clue {
  margin-top: auto;
  font-style: italic;
  font-size: 0.8rem;
  color: #4b5563;
}

.fu-entry {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 44px;
  margin-top: 12px;
  margin-bottom: 10px;
}

.fu-bulb {
  transition: transform 0.15s;
}

/* Solid bulb normally; outline only while in solve mode. */
.fu-bulb .fu-glass { fill: #b8860b; transition: fill 0.3s; }
.fu-bulb.on .fu-glass { fill: none; }

.fu-cards {
  display: flex;
  gap: 8px;
}

.fu-card {
  width: 22px;
  height: 29px;
  background: #333438;
  color: #fff;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 1.6rem;
  line-height: 1;
  display: grid;
  place-items: center;
  box-shadow: 0 0 15px rgba(0,0,0,0.3);
}

.fu-go {
  color: #2e68a6;
  transition: transform 0.15s;
}

.fu-keys {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.fu-keys div {
  display: flex;
  gap: 3px;
}

.fu-key {
  width: 22px;
  height: 32px;
  border-radius: 4px;
  background: #1f2937;
  color: #fff;
  font-size: 0.85rem;
  display: grid;
  place-items: center;
  transition: transform 0.15s, opacity 0.3s;
}

.fu-key.used {
  opacity: 0.3;
}

/* Board editor demo */
.phone-editor {
  background: #ebe6de;
  font-family: var(--font-sans);
  color: #000;
}

.ed-scene {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: 20px 10px 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s;
}

.ed-scene.on {
  opacity: 1;
}

.ed-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0 2px 10px;
}

.ed-title span {
  font-weight: 500;
  font-size: 0.65rem;
  color: #4b5563;
}

.ed-board {
  display: grid;
  grid-template-columns: repeat(15, 1fr);
  gap: 1px;
}

.ed-cell {
  aspect-ratio: 1;
  background: #dbd9d5;
  border-radius: 2px;
  font-size: 0.4rem;
  font-weight: 600;
  color: #63636a;
  display: grid;
  place-items: center;
  transition: background 0.25s;
}

.ed-cell.start::before {
  content: '\2605';
  font-size: 0.55rem;
}

.ed-palette {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 18px;
}

.ed-chip,
.ed-float {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #63636a;
  transition: transform 0.15s;
}

.ed-float {
  position: absolute;
  top: -18px;
  left: -18px;
  z-index: 4;
  box-shadow: 0 6px 14px rgba(0,0,0,0.3);
}

.ed-palette .ed-chip {
  width: 32px;
  height: 32px;
}

.ed-sub {
  margin-top: 16px;
  font-size: 0.7rem;
  color: #4b5563;
  text-align: center;
}

.ed-tiles {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 6px;
}

.ed-tiles .ya-tile {
  background: #15803d;
  transition: transform 0.15s, box-shadow 0.2s;
}

.ed-tiles .ya-tile.picked {
  box-shadow: 0 0 0 2px #f2bb4b;
}

.ed-save {
  display: flex;
  gap: 6px;
  margin-top: auto;
}

.ed-save .ed-btn {
  padding: 0 10px;
}

.ed-export {
  background: #0077b6;
}

.ed-name {
  flex: 1;
  height: 36px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
  padding: 0 10px;
  display: flex;
  align-items: center;
  font-size: 0.85rem;
}

.ed-name:empty::before {
  content: 'Board name';
  color: #9ca3af;
}

.ed-btn {
  padding: 0 16px;
  height: 36px;
  border-radius: 6px;
  background: #3a7d5c;
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  display: grid;
  place-items: center;
  transition: transform 0.15s;
}

.ed-toast {
  position: absolute;
  left: 50%;
  bottom: 64px;
  transform: translateX(-50%);
  background: #000;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 12px;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.3s;
}

.ed-toast.show {
  opacity: 1;
}

.ed-new {
  background: rgba(0, 0, 0, 0.6);
  justify-content: center;
}

.ed-sheet {
  background: #fff;
  border-radius: 14px;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ed-q {
  font-weight: 700;
  text-align: center;
  margin-bottom: 4px;
}

.ed-opt {
  border: 2px solid #15803d;
  border-radius: 8px;
  padding: 8px;
  text-align: center;
  display: flex;
  flex-direction: column;
  font-size: 0.85rem;
  transition: background 0.2s, transform 0.15s;
}

.ed-opt small {
  font-size: 0.65rem;
  color: #4b5563;
}

.ed-opt.sel {
  background: rgba(21, 128, 61, 0.12);
}

.ed-label {
  font-size: 0.75rem;
  color: #4b5563;
  margin-top: 6px;
}

.ed-boards {
  display: flex;
  flex-direction: column;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
}

.ed-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 7px 10px;
  font-size: 0.75rem;
  border-top: 1px solid #e5e7eb;
  transition: background 0.2s, transform 0.15s;
}

.ed-row:first-child {
  border-top: none;
}

.ed-row small {
  font-size: 0.62rem;
  color: #6b7280;
}

.ed-row.sel {
  background: rgba(21, 128, 61, 0.12);
  box-shadow: inset 3px 0 0 #15803d;
}

.ed-pick {
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 14px;
  border: 1px solid #d1d5db;
}

.ed-pick.sel {
  border-color: #15803d;
  background: #15803d;
  color: #fff;
}

.ed-pick.added {
  animation: fu-pop 0.32s ease-out both;
}

.ed-import {
  font-size: 0.65rem;
  color: #0077b6;
  align-self: flex-start;
  transition: transform 0.15s;
}

.ed-start {
  margin-top: 6px;
}

.ed-caption {
  margin-top: 16px;
  text-align: center;
  font-size: 0.8rem;
  color: #4b5563;
}

/* Yaska demo */
.phone-yaska {
  background: #ebe6de;
  display: flex;
  flex-direction: column;
  padding: 22px 10px 16px;
  font-family: var(--font-sans);
}

.ya-score {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: #4b5563;
  padding: 0 4px 12px;
}

.ya-score b {
  color: #000;
  margin-left: 4px;
}

.ya-board {
  position: relative;
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 2px;
}

.ya-cell {
  position: relative;
  aspect-ratio: 1;
  background: #dbd9d5;
  border-radius: 3px;
  font-size: 0.55rem;
  font-weight: 600;
  color: #63636a;
  display: grid;
  place-items: center;
}

.ya-cell.start::before {
  content: '\2605';
  font-size: 0.8rem;
}

.p-W2 { background: #ecb4ac; }
.p-W3 { background: #e08a80; }
.p-W5 { background: #d67369; }
.p-L2 { background: #aecfe8; }
.p-L3 { background: #7fb5de; }

.ya-cell .ya-tile {
  position: absolute;
  inset: 0;
  width: auto;
  height: auto;
  font-size: 0.75rem;
  padding: 2px 5px 0 0;
}

.ya-cell .ya-tile sub {
  font-size: 0.42rem;
  right: 1px;
}

.ya-tile {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  background: #15803d;
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  display: grid;
  place-items: center;
  position: relative;
  /* Nudge the letter down-left so the top-right value never touches it. */
  padding: 3px 7px 0 0;
}

.ya-tile.pending,
.ya-rack .ya-tile,
.ya-float {
  background: #0d5f2c;
}

.ya-tile sub {
  position: absolute;
  right: 2px;
  top: 1px;
  bottom: auto;
  line-height: 1;
  font-size: 0.5rem;
  font-weight: 600;
}

.ya-float {
  position: absolute;
  top: -16px;
  left: -16px;
  z-index: 4;
  box-shadow: 0 6px 14px rgba(0,0,0,0.3);
}

.ya-rack {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-top: auto;
}

.ya-slot {
  width: 32px;
  height: 32px;
}

.ya-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 14px;
}

.ya-act {
  width: 46px;
  height: 46px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  color: #4b5563;
  font-size: 0.6rem;
  font-weight: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
}

.ya-act i {
  font-style: normal;
  font-size: 1rem;
  line-height: 1;
}

.ya-act.narrow {
  width: 38px;
  font-size: 1rem;
}

.ya-play {
  flex: 1;
  height: 46px;
  border-radius: 8px;
  background: #6b7280;
  display: grid;
  place-items: center;
  transition: background 0.2s ease, transform 0.15s;
}

.ya-play.armed {
  background: #0077b6;
}

/* Yaska's valid-word frame: gold line, check square, score disc */
.ya-frame {
  position: absolute;
  z-index: 3;
  outline: 3px solid #f5a524;
  outline-offset: 1px;
  border-radius: 2px;
  pointer-events: none;
  animation: fu-pop 0.25s ease-out both;
}

.ya-check,
.ya-total {
  position: absolute;
  background: #f5a524;
  color: #3a2a00;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.45);
  display: grid;
  place-items: center;
}

.ya-check {
  top: -12px;
  left: -12px;
  width: 15px;
  height: 15px;
  border-radius: 3px;
}

.ya-total {
  right: -12px;
  bottom: -12px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.55rem;
}

/* --- About Section --- */
.about {
  background-color: var(--color-bg);
}

.about-content {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: var(--spacing-2xl);
  align-items: start;
}

.about-text p {
  color: var(--color-text-secondary);
  margin-bottom: var(--spacing-sm);
  font-size: 1.05rem;
}

.team-heading {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--spacing-md);
}

.team-studio {
  padding: var(--spacing-md);
  background-color: var(--color-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-light);
}

.team-bio {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  line-height: 1.55;
}


/* --- Values Section --- */
.values {
  background-color: var(--color-bg-dark);
  color: var(--color-text-inverse);
}

.values .section-label {
  color: var(--color-accent);
}

.values-title {
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 500;
  max-width: 600px;
  margin-bottom: var(--spacing-xl);
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.values-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--spacing-lg);
}

.value-item h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: #fff;
}

.value-item p {
  font-size: 0.9rem;
  color: rgba(240, 237, 232, 0.7);
  line-height: 1.6;
}



.form-note {
  font-size: 0.8rem;
  color: var(--color-text-tertiary);
}

.form-message {
  margin-top: var(--spacing-md);
  padding: 24px 20px;
  border-radius: var(--radius-sm);
  font-size: 1.05rem;
  font-weight: 500;
  text-align: center;
}

.form-success {
  background-color: rgba(58, 125, 92, 0.08);
  color: var(--color-primary);
  border: 1px solid rgba(58, 125, 92, 0.2);
}

.form-error {
  background-color: rgba(200, 50, 50, 0.08);
  color: #b91c1c;
  border: 1px solid rgba(200, 50, 50, 0.2);
}

.btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.turnstile-widget {
  margin-top: var(--spacing-sm);
}

/* Hide Turnstile by default — it auto-expands only if a challenge is needed */
.turnstile-hidden:empty,
.turnstile-hidden[style*="display: none"] {
  margin: 0;
  height: 0;
  overflow: hidden;
}


/* --- Contact Section --- */
.contact {
  background-color: var(--color-surface);
}

.contact-page {
  padding-top: calc(var(--nav-height) + var(--spacing-xl));
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: var(--spacing-2xl);
  align-items: start;
}

.contact-item {
  margin-bottom: var(--spacing-lg);
}

.contact-item h3 {
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-tertiary);
  margin-bottom: 6px;
}

.contact-item a {
  font-size: 1.05rem;
  font-weight: 500;
}

.contact-item p {
  color: var(--color-text-secondary);
  font-size: 0.95rem;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.form-field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  margin-bottom: 6px;
}

.form-field input,
.form-field textarea {
  width: 100%;
  padding: 12px 16px;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  background-color: var(--color-bg);
  color: var(--color-text);
  transition: border-color 0.2s ease;
}

.form-field input:focus,
.form-field textarea:focus {
  border-color: var(--color-primary);
  outline: 2px solid var(--color-primary);
  outline-offset: 1px;
}

.form-field textarea {
  resize: vertical;
  min-height: 120px;
}


/* --- Footer --- */
.footer {
  background-color: var(--color-bg-dark);
  color: var(--color-text-inverse);
  padding: var(--spacing-2xl) 0 var(--spacing-lg);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--spacing-xl);
  margin-bottom: var(--spacing-xl);
}

.footer .nav-logo {
  margin-bottom: 8px;
}

.footer .nav-logo:hover {
  opacity: 0.85;
}

.footer .logo-img {
  filter: brightness(0) invert(1);
}

.footer .logo-icon {
  color: var(--color-text-inverse);
}

.footer-tagline {
  color: rgba(240, 237, 232, 0.65);
  font-size: 0.9rem;
}

.footer-links {
  display: flex;
  gap: var(--spacing-2xl);
}

.footer-col h4 {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(240, 237, 232, 0.65);
  margin-bottom: var(--spacing-sm);
}

.footer-col ul {
  list-style: none;
}

.footer-col li {
  margin-bottom: 8px;
}

.footer-col a {
  color: var(--color-text-inverse);
  font-size: 0.9rem;
  opacity: 0.8;
  transition: opacity 0.2s ease;
}

.footer-col a:hover {
  opacity: 1;
  color: var(--color-text-inverse);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  padding-top: var(--spacing-lg);
  border-top: 1px solid rgba(240, 237, 232, 0.1);
}

.footer-bottom p {
  font-size: 0.82rem;
  color: rgba(240, 237, 232, 0.6);
}


/* ============================================
   Responsive
   ============================================ */

@media (max-width: 900px) {
  .about-content {
    grid-template-columns: 1fr;
    gap: var(--spacing-xl);
  }

  .contact-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-xl);
  }

  .values-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
  }

  .footer-inner {
    flex-direction: column;
    gap: var(--spacing-lg);
  }
}

@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background-color: rgba(250, 250, 247, 0.98);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    flex-direction: column;
    padding: var(--spacing-lg) var(--spacing-md);
    gap: var(--spacing-sm);
    box-shadow: 0 8px 24px rgba(0,0,0,0.06);
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s ease, opacity 0.3s ease;
  }

  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav-links li {
    width: 100%;
    text-align: center;
  }

  .nav-links .btn-nav {
    width: 100%;
    margin-top: var(--spacing-xs);
  }

  .hero {
    min-height: auto;
    padding: calc(var(--nav-height) + var(--spacing-2xl)) 0 var(--spacing-2xl);
  }

  .hero-title {
    font-size: 2.2rem;
  }

  .section {
    padding: var(--spacing-2xl) 0;
  }

  .features {
    grid-template-columns: 1fr;
  }

  .footer-links {
    gap: var(--spacing-xl);
  }

  .footer-bottom {
    flex-direction: column;
    gap: 4px;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 1.9rem;
  }

  .hero-actions {
    flex-direction: column;
  }

  .hero-actions .btn {
    width: 100%;
    text-align: center;
  }
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  html {
    scroll-behavior: auto;
  }
}

/* ============================================
   Home page: stage on a phone, and the new game demos
   ============================================ */

@media (max-width: 768px) {
  /* A shorter header on the home page, so the picker, the phone and the
     Play button share the first screen. */
  .home { --nav-height: 60px; }
  .home .logo-img { height: 44px; }
  .home .logo-bird { height: 46px; }

  .stage {
    padding: calc(var(--nav-height) + 4px) 0 var(--spacing-lg);
  }

  .stage .container { padding: 0 16px; }

  .stage-grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "picker"
      "demo"
      "copy";
    row-gap: 12px;
  }

  .picker {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }

  .pick {
    padding: 6px 4px 5px;
    border-radius: 8px;
    text-align: center;
  }

  .pick b { font-size: 0.74rem; letter-spacing: -0.01em; }
  .pick small { display: none; }
  .pick .bar { margin-top: 4px; }
  .pick-pause { border-radius: 8px; }

  /* Under the phone: the name with its Play button beside it (or under it,
     when the name is long), then the line and the facts. */
  .game-copy {
    max-width: none;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 12px;
  }

  .stage-head { order: 1; flex: 1 1 auto; min-width: 0; }
  .game-copy .game-tag { margin-bottom: 0; font-size: 0.72rem; }
  .game-copy .game-name { font-size: 1.75rem; margin-bottom: 0; }
  .stage-actions { order: 2; flex: 0 0 auto; gap: 4px 14px; }
  .stage-actions .btn { padding: 11px 18px; }
  .stage-more { padding: 6px 0; font-size: 0.85rem; }
  .game-copy .stage-line { order: 3; flex: 1 1 100%; margin: 2px 0 0; font-size: 1rem; }
  .facts { order: 4; flex: 1 1 100%; margin-bottom: 0; }

  .all-games { padding: var(--spacing-xl) 0; }
}

/* Small bits every phone header shares */
.ph-top {
  align-self: stretch;
  display: flex;
  align-items: center;
  height: 24px;
  padding: 0 2px;
}

.ph-top > b {
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.ph-icons {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 9px;
}

.ph-user {
  display: block;
  position: relative;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: currentColor;
  overflow: hidden;
}

.ph-user::before,
.ph-user::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  background: var(--ph-bg, #f5f0e8);
}

.ph-user::before { left: 5px; top: 3px; width: 6px; height: 6px; }
.ph-user::after { left: 2px; top: 10.5px; width: 12px; height: 10px; }

.ph-dots {
  display: block;
  width: 3px;
  height: 3px;
  margin: 0 3px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 -5px 0 currentColor, 0 5px 0 currentColor;
}

.ph-modes {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 10px;
  font-size: 0.68rem;
  font-weight: 500;
}

.ph-modes i { font-style: normal; color: #9ca3af; }
.ph-modes b { background: #366899; color: #fff; border-radius: 4px; padding: 2px 7px; font-weight: 500; }

/* Great Minds demo: the game's own cards and line, as in its How to play */
.phone-gm {
  --ph-bg: #f5f0e8;
  background: #f5f0e8;
  color: #000;
  display: flex;
  flex-direction: column;
  padding: 18px 10px 14px;
  font-family: var(--font-sans);
}

.gm-band {
  margin-top: 10px;
  background: #2e7d32;
  color: #fff;
  border-radius: 8px;
  padding: 5px 9px;
  display: flex;
  justify-content: space-between;
  font-size: 0.66rem;
  font-weight: 600;
}

.gm-band span:last-child { font-weight: 500; opacity: 0.85; }

.gm-word {
  margin-top: 10px;
  text-align: center;
  font-size: 1.5rem;
  line-height: 1.15;
}

.gm-ask {
  margin-top: 2px;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
}

.gm-ask b { color: #2e7d32; }

.gm-board {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 106px minmax(0, 1fr);
  gap: 8px;
  height: 262px;
}

.gm-cards {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.gm-card {
  flex: 1;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 6px 9px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: background-color 0.25s, border-color 0.25s;
}

.gm-card.to-move { background: #dbe7f5; border-color: #366899; }
.gm-card.mine { border-color: #c2410c; }

.gm-who {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 600;
}

.gm-who i { display: block; width: 8px; height: 8px; border-radius: 50%; }

.gm-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 20px;
}

.gm-foot em {
  font-style: normal;
  font-size: 0.62rem;
  font-weight: 600;
  color: #6b7280;
}

.gm-foot em.think { color: #366899; }
.gm-foot em.spot { color: #2e7d32; }

.gm-foot em.gain {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 700;
  color: #000;
  animation: fu-pop 0.32s ease-out both;
}

.gm-foot em.gain-3 { background: rgba(46, 125, 50, 0.9); color: #fff; }
.gm-foot em.gain-2 { background: rgba(46, 125, 50, 0.42); }
.gm-foot em.gain-1 { background: rgba(46, 125, 50, 0.18); }
.gm-foot em.gain-0 { box-shadow: inset 0 0 0 1px #e5e7eb; color: #6b7280; }

.gm-foot b { font-size: 1.15rem; font-weight: 800; line-height: 1; }

.gm-spectrum {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.gm-end {
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.2;
  padding: 2px 0;
}

.gm-track {
  position: relative;
  flex: 1;
  width: 100%;
  margin: 10px 0;
}

.gm-line {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 6px;
  margin-left: -3px;
  border-radius: 3px;
  background: #d6cfc2;
}

.gm-zone {
  position: absolute;
  left: 22%;
  right: 22%;
  top: 30%;
  transform: translateY(-50%);
  border-radius: 6px;
  opacity: 0;
  transition: opacity 0.5s;
}

.gm-z1 { height: 36%; background: rgba(46, 125, 50, 0.1); }
.gm-z2 { height: 21.6%; background: rgba(46, 125, 50, 0.22); }
.gm-z3 { height: 9%; background: rgba(46, 125, 50, 0.42); }
.phone-gm.scored .gm-zone { opacity: 1; }

.gm-mark {
  position: absolute;
  left: 14%;
  right: 14%;
  top: 30%;
  height: 3px;
  margin-top: -1.5px;
  border-radius: 2px;
  background: #2e7d32;
  opacity: 0;
  transition: opacity 0.4s;
}

.gm-mark em {
  position: absolute;
  right: 0;
  bottom: 5px;
  font-style: normal;
  font-size: 0.66rem;
  font-weight: 700;
  line-height: 1;
  color: #2e7d32;
}

.gm-mark.on { opacity: 1; }

.gm-dot {
  position: absolute;
  left: 50%;
  width: 0;
  height: 0;
  opacity: 0;
  transition: opacity 0.4s;
}

.gm-dot.on { opacity: 1; }

.gm-dot i {
  position: absolute;
  left: -8px;
  top: -8px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid #f5f0e8;
}

.gm-dot span {
  position: absolute;
  top: -8px;
  line-height: 16px;
  font-size: 0.68rem;
  color: #4b5563;
  white-space: nowrap;
}

.gm-dot.right span { left: 13px; }
.gm-dot.left span { right: 13px; font-weight: 700; color: #000; }
.gm-dot span b { color: #2e7d32; font-weight: 700; }

.gm-marker {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 22px;
  height: 22px;
  margin: -11px 0 0 -11px;
  border-radius: 50%;
  background: #c2410c;
  border: 2px solid #f5f0e8;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3), 0 2px 5px rgba(0, 0, 0, 0.25);
  opacity: 0;
  transition: opacity 0.2s;
}

.gm-marker.on { opacity: 1; }

.gm-hit {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 2px;
  height: 2px;
  margin: -1px 0 0 -1px;
}

.gm-btn {
  margin-top: auto;
  display: grid;
  place-items: center;
  height: 40px;
  border-radius: 10px;
  border: 1.5px solid #000;
  background: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  transition: transform 0.15s, background-color 0.2s, color 0.2s, border-color 0.2s;
}

.gm-btn.idle { border-color: #d1d5db; background: transparent; color: #9ca3af; }
.gm-btn.locked { border-color: transparent; background: rgba(0, 119, 182, 0.14); color: #0077b6; }

/* Yaskita demo: Yaska's board, already underway, with outlines to fill */
.phone-yaskita {
  --ph-bg: #ebe6de;
  background: #ebe6de;
  color: #000;
  display: flex;
  flex-direction: column;
  padding: 18px 10px 16px;
  font-family: var(--font-sans);
}

.yk-logo { font-size: 0.8rem !important; font-weight: 700 !important; letter-spacing: 0.3em !important; }

.yk-score {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.yk-you {
  min-width: 62px;
  display: flex;
  flex-direction: column;
  border: 1.5px solid #366899;
  border-radius: 6px;
  background: rgba(54, 104, 153, 0.12);
  padding: 3px 9px 2px;
  font-size: 0.66rem;
  line-height: 1.2;
}

.yk-you b { font-family: var(--font-mono); font-size: 0.95rem; }

.yk-bar {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: #dcd8d0;
  overflow: hidden;
}

.yk-bar i {
  display: block;
  height: 100%;
  width: 0;
  background: #366899;
  transition: width 0.6s ease;
}

.yk-goal {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.8rem;
  color: #6b7280;
}

.yk-hint {
  margin: 7px 0;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: #4b5563;
}

/* Yaskita has no Swap: that place in the row stays empty. */
.yk-gap { visibility: hidden; }

.yk-outline {
  position: absolute;
  z-index: 2;
  border: 2px solid #366899;
  border-radius: 4px;
  pointer-events: none;
}

/* 8box demo */
.phone-8box {
  --ph-bg: #f7f6f2;
  background: #f7f6f2;
  color: #15181d;
  display: flex;
  flex-direction: column;
  padding: 18px 8px 14px;
  font-family: var(--font-sans);
}

.bx-logo { color: #073e56; font-size: 0.9rem !important; }

.bx-time {
  margin-left: 14px;
  font-size: 0.72rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.bx-pause {
  display: block;
  width: 2.5px;
  height: 10px;
  margin-left: 10px;
  border-radius: 1px;
  background: currentColor;
  box-shadow: 5px 0 0 currentColor;
}

.phone-8box .ph-icons svg { display: block; }

.bx-clue {
  margin-top: 10px;
  height: 36px;
  border-radius: 9px;
  background: #cde4fa;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  font-size: 0.78rem;
}

.bx-clue span { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bx-clue b { margin-right: 6px; }
.bx-clue i { font-style: normal; font-size: 0.95rem; line-height: 1; }

.bx-grid {
  margin-top: 10px;
  background: #15181d;
  border-radius: 3px;
  padding: 2px;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 1px;
}

.bx-cell {
  position: relative;
  aspect-ratio: 1;
  background: #fff;
  display: grid;
  place-items: center;
  padding-top: 5px;
  font-size: 1.05rem;
  font-weight: 500;
  line-height: 1;
  transition: background-color 0.12s;
}

.bx-cell.block { background: #15181d; }
.bx-cell.word { background: #cde4fa; }
.bx-cell.cur { background: #ffd94a; }

.bx-cell sup {
  position: absolute;
  left: 2px;
  top: 2px;
  font-size: 0.42rem;
  font-weight: 600;
  line-height: 1;
}

.bx-keys {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
}

.bx-keys div { display: flex; gap: 3px; }

.bx-key {
  width: 22px;
  height: 38px;
  border-radius: 5px;
  background: #1f2937;
  color: #fff;
  font-size: 1.05rem;
  display: grid;
  place-items: center;
  transition: transform 0.15s;
}

/* The hint key (the Saffron bird) and backspace */
.bx-key.wide { width: 33px; }
.bx-key img { display: block; height: 25px; width: auto; }
.bx-key svg { display: block; }

/* Chess demo: the puzzle screen, with the game's own pieces */
.phone-chess {
  --ph-bg: #f4f0e7;
  background: #f4f0e7;
  color: #17294c;
  display: flex;
  flex-direction: column;
  padding: 16px 8px 14px;
  font-family: var(--font-sans);
}

.ch-strip {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) 62px;
  gap: 6px;
  align-items: center;
}

.ch-chip {
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1.5px solid #d9d2c0;
  border-radius: 7px;
  background: #fffdf8;
  padding: 3px 8px 2px;
  font-size: 0.6rem;
  line-height: 1.2;
  color: #5f6878;
  transition: border-color 0.25s, background-color 0.25s;
}

.ch-chip b { font-family: var(--font-mono); font-size: 0.92rem; color: #17294c; }
.ch-chip.end { align-items: flex-end; }
.ch-chip.active { border-color: #0077b6; background: rgba(0, 119, 182, 0.14); }

.ch-delta {
  position: absolute;
  right: 6px;
  top: 3px;
  font-size: 0.6rem;
  font-weight: 700;
  color: #2f7a4b;
  opacity: 0;
  transition: opacity 0.3s;
}

.ch-delta.on { opacity: 1; }

.ch-turn { text-align: center; font-size: 0.68rem; font-weight: 700; }

.ch-turn .sw {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 5px;
  vertical-align: -1px;
  border-radius: 2px;
  background: #f7f1e3;
  border: 1px solid #3b2f22;
}

.ch-daily { display: flex; justify-content: center; gap: 5px; margin-top: 4px; }

.ch-daily i {
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.5px solid #c9c2b0;
  transition: background-color 0.3s, border-color 0.3s;
}

.ch-daily i.done { background: #2f7a4b; border-color: #2f7a4b; }

.ch-board {
  position: relative;
  margin-top: 10px;
  width: 248px;
  height: 248px;
  border-radius: 5px;
  overflow: hidden;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(8, 1fr);
}

.ch-sq { position: relative; }
.ch-sq.light { background: #ece5d1; color: #6f8169; }
.ch-sq.dark { background: #84987f; color: #f1ecdd; }

.ch-sq.last::before,
.ch-sq.sel::before {
  content: '';
  position: absolute;
  inset: 0;
}

.ch-sq.last::before { background: rgba(226, 170, 52, 0.5); }
.ch-sq.sel::before { background: rgba(7, 62, 86, 0.38); }

.ch-sq.dot::after {
  content: '';
  position: absolute;
  left: 35%;
  top: 35%;
  width: 30%;
  height: 30%;
  border-radius: 50%;
  background: rgba(23, 41, 76, 0.32);
}

.ch-sq small {
  position: absolute;
  font-size: 0.4rem;
  font-weight: 700;
  line-height: 1;
}

.ch-sq small.rank { left: 2px; top: 2px; }
.ch-sq small.file { right: 2px; bottom: 2px; }

.ch-piece {
  position: absolute;
  left: 0;
  top: 0;
  width: 12.5%;
  height: 12.5%;
  pointer-events: none;
  transition: left 0.5s cubic-bezier(0.2, 0.8, 0.2, 1), top 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.ch-piece svg { display: block; width: 100%; height: 100%; }
.ch-piece.w { --p-body: #f7f1e3; --p-shade: #e4d8bf; --p-line: #3b2f22; --p-detail: #3b2f22; }
.ch-piece.b { --p-body: #2e2e33; --p-shade: #1c1c20; --p-line: #0e0e10; --p-detail: #cdbf9e; }
.ch-piece .body, .ch-piece .accent { fill: var(--p-body); }
.ch-piece .shade { fill: var(--p-shade); }
.ch-piece .outline, .ch-piece .accent { stroke: var(--p-line); stroke-width: 2.2; stroke-linejoin: round; }
.ch-piece .outline { fill: none; }
.ch-piece .accent .eye { fill: var(--p-detail); stroke: none; }
.ch-piece .detail { fill: none; stroke: var(--p-detail); stroke-width: 2.6; stroke-linecap: round; }

.ch-toast-slot { height: 28px; margin-top: 14px; display: grid; place-items: center; }

.ch-toast {
  padding: 3px 10px;
  border-radius: 4px;
  background: #008000;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  opacity: 0;
}

.ch-toast.show { animation: fu-pop 0.32s ease-out both; }

.ch-ask {
  margin-top: auto;
  text-align: center;
  font-size: 0.86rem;
  font-weight: 700;
}

.ch-ask b {
  margin-left: 4px;
  padding: 1px 7px;
  border-radius: 5px;
  border: 1px solid #d9d2c0;
  background: #fffdf8;
}

.ch-last {
  margin-top: 10px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: #5f6878;
}

/* Recall demo */
.phone-recall {
  --ph-bg: #f5f0e8;
  background: #f5f0e8;
  color: #15181d;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 9px 14px;
  font-family: var(--font-sans);
}

.rc-logo { font-family: var(--font-serif); font-size: 1rem !important; font-weight: 500 !important; letter-spacing: 0 !important; }

.rc-modes {
  margin-left: 8px;
  display: flex;
  padding: 2px;
  border-radius: 999px;
  background: #e9e8e2;
  font-size: 0.58rem;
  font-weight: 700;
}

.rc-modes b { padding: 2px 7px; border-radius: 999px; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18); }
.rc-modes i { padding: 2px 7px; font-style: normal; color: #8a8f98; }

.rc-score {
  padding: 3px 9px;
  border-radius: 999px;
  background: #e9e8e2;
  font-size: 0.62rem;
  font-weight: 700;
}

.rc-round {
  margin-top: 24px;
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 500;
  line-height: 1.2;
}

.rc-attempts { display: flex; gap: 6px; margin-top: 8px; }

.rc-attempts i {
  display: block;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 1.5px solid #d1d5db;
}

.rc-attempts i.on { border-color: #10b981; box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.22); }

.rc-board {
  margin-top: 26px;
  display: grid;
  grid-template-columns: repeat(5, 44px);
  gap: 6px;
}

.rc-cell {
  height: 44px;
  border-radius: 6px;
  border: 1.5px solid #15181d;
  background: #fff;
  display: grid;
  place-items: center;
  font-size: 1.9rem;
  font-weight: 600;
  line-height: 1;
  transition: background-color 0.12s, border-color 0.12s, color 0.12s, transform 0.15s;
}

.rc-cell.lit { background: #1a7f4b; border-color: #1a7f4b; color: #fff; }
.rc-cell.tap { background: #c6ead4; border-color: #c6ead4; }

.rc-entry {
  margin-top: 28px;
  min-height: 34px;
  display: flex;
  gap: 5px;
}

.rc-slot {
  width: 28px;
  height: 34px;
  border-radius: 6px;
  background: #efeee9;
  display: grid;
  place-items: center;
  font-size: 1.05rem;
  font-weight: 600;
  transition: background-color 0.18s;
}

.rc-slot.filled { background: #c6ead4; }

.rc-cheer {
  margin-top: 16px;
  padding: 5px 14px;
  border-radius: 999px;
  background: #15181d;
  color: #f4f0e7;
  font-size: 0.78rem;
  font-weight: 600;
  opacity: 0;
}

.rc-cheer.show { animation: fu-pop 0.32s ease-out both; }
