/* === Unit 10 game: kill site header offset (empty top band) === */
.arcade-header-bar,
.arcade-nav,
.nav-profile,
.profile-fab,
[data-theme-toggle],
.theme-toggle,
body > header,
.site-footer {
  display: none !important;
}
html, body {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  margin: 0 !important;
}
body.game-page,
body[data-type="game"] {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

/* Kill global header offset on game pages */
html, body {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  margin: 0 !important;
}
body.game-page,
body[data-type="game"] {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

/* ===== Unscramble Countries – Starter Unit 1B ===== */

.arcade-header-bar,
.arcade-nav,
.nav-profile,
[data-theme-toggle],
.theme-toggle,
body > header,
.site-footer {
  display: none !important;
}

html, body {
  height: 100%;
  height: 100dvh;
  margin: 0;
  padding: 0 !important;
  overflow: hidden !important;
}

body {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  background: #f0f2f8 !important;
  color: #1e293b !important;
  -webkit-font-smoothing: antialiased;
}

html[data-theme="dark"] body {
  background: #0f1117 !important;
  color: #f1f5f9 !important;
}

*, *::before, *::after { box-sizing: border-box; }

.uc-game {
  max-width: 520px;
  margin: 0 auto;
  padding: 12px 14px 16px;
  height: 100%;
  height: 100dvh;
  max-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Top bar */
.uc-topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  flex-shrink: 0;
}

.uc-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  border: none;
  background: #fff;
  color: #334155;
  font-size: 1.15rem;
  text-decoration: none;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.uc-back:active { transform: scale(0.96); }

html[data-theme="dark"] .uc-back {
  background: rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
  box-shadow: none;
}

.uc-topbar-center {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}

.uc-kicker {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #7c6fd6;
}

html[data-theme="dark"] .uc-kicker { color: #a78bfa; }

.uc-title {
  font-weight: 800;
  font-size: 1.05rem;
  color: #1e1b4b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

html[data-theme="dark"] .uc-title { color: #f1f5f9; }

.uc-badge {
  font-size: 0.8rem;
  font-weight: 700;
  color: #475569;
  background: #fff;
  padding: 8px 12px;
  border-radius: 12px;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  min-width: 42px;
  text-align: center;
}

html[data-theme="dark"] .uc-badge {
  background: rgba(255, 255, 255, 0.06);
  color: #cbd5e1;
  box-shadow: none;
}

.uc-instruction {
  text-align: center;
  font-size: 0.9rem;
  color: #64748b;
  margin: 0 0 10px;
  flex-shrink: 0;
}

html[data-theme="dark"] .uc-instruction { color: #94a3b8; }

.uc-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 8px;
}

/* Cards */
.uc-card {
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.06);
  overflow: hidden;
  flex-shrink: 0;
}

html[data-theme="dark"] .uc-card {
  background: rgba(255, 255, 255, 0.05);
  box-shadow: none;
  border: 1px solid rgba(148, 163, 184, 0.12);
}

/* Photo card */
.uc-card-photo {
  position: relative;
}

.uc-flag-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  font-size: 1.75rem;
  line-height: 1;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 10px;
  padding: 6px 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

html[data-theme="dark"] .uc-flag-badge {
  background: rgba(15, 17, 23, 0.85);
}

.uc-photo {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
  object-position: center;
  max-height: 240px;
  min-height: 140px;
  background: #e8ecf4;
}

/* Play button — same visual as Clothes Match */
.uc-audio-btn,
.uc-audio-btn.mc-play {
  position: absolute;
  bottom: 12px;
  right: 12px;
  overflow: visible;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #38bdf8, #6366f1);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.35);
  transition: transform 0.15s, box-shadow 0.2s;
  font-size: 0;
  padding: 0;
  min-width: 56px;
  min-height: 56px;
  z-index: 3;
  -webkit-tap-highlight-color: transparent;
}
.uc-audio-btn:hover { transform: scale(1.05); }
.uc-audio-btn:active { transform: scale(0.96); }
.uc-audio-btn.is-playing,
.uc-audio-btn.playing { box-shadow: 0 0 0 5px rgba(99, 102, 241, 0.25); }
.uc-audio-btn svg {
  position: relative;
  z-index: 2;
  transition: opacity 0.2s, transform 0.2s;
}
.uc-audio-btn .wave {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid #6366f1;
  opacity: 0;
  pointer-events: none;
}
.uc-audio-btn.is-playing .wave,
.uc-audio-btn.playing .wave { animation: uc-ripple 1.25s ease-out infinite; }
.uc-audio-btn.is-playing .wave:nth-child(2),
.uc-audio-btn.playing .wave:nth-child(2) { animation-delay: 0.3s; }
.uc-audio-btn.is-playing .wave:nth-child(3),
.uc-audio-btn.playing .wave:nth-child(3) { animation-delay: 0.6s; }
@keyframes uc-ripple {
  0% { transform: scale(0.85); opacity: 0.65; }
  100% { transform: scale(1.55); opacity: 0; }
}
.uc-audio-btn .eq {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  opacity: 0;
  pointer-events: none;
  z-index: 2;
}
.uc-audio-btn .eq span {
  width: 3px;
  height: 12px;
  background: #fff;
  border-radius: 2px;
}
.uc-audio-btn.is-playing svg,
.uc-audio-btn.playing svg { opacity: 0; transform: scale(0.5); }
.uc-audio-btn.is-playing .eq,
.uc-audio-btn.playing .eq { opacity: 1; }
.uc-audio-btn.is-playing .eq span:nth-child(1),
.uc-audio-btn.playing .eq span:nth-child(1) { animation: uc-eq 0.55s ease-in-out infinite; }
.uc-audio-btn.is-playing .eq span:nth-child(2),
.uc-audio-btn.playing .eq span:nth-child(2) { animation: uc-eq 0.55s ease-in-out infinite 0.1s; }
.uc-audio-btn.is-playing .eq span:nth-child(3),
.uc-audio-btn.playing .eq span:nth-child(3) { animation: uc-eq 0.55s ease-in-out infinite 0.2s; }
.uc-audio-btn.is-playing .eq span:nth-child(4),
.uc-audio-btn.playing .eq span:nth-child(4) { animation: uc-eq 0.55s ease-in-out infinite 0.15s; }
@keyframes uc-eq {
  0%,100% { transform: scaleY(0.45); }
  50% { transform: scaleY(1.15); }
}

/* Word / slots card */
.uc-card-word {
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.uc-slots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px;
  width: 100%;
  max-width: 100%;
  row-gap: 8px;
}

.uc-slot {
  width: 36px;
  height: 44px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
  font-family: inherit;
  border: 2px solid #e2e8f0;
  background: #f8fafc;
  color: #1e1b4b;
  padding: 0;
  cursor: default;
}

.uc-slot.empty {
  background: #f1f5f9;
  border-style: dashed;
  border-color: #cbd5e1;
}

.uc-slot.filled {
  background: #fff;
  border-color: #7c6fd6;
  color: #1e1b4b;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(124, 111, 214, 0.15);
}

.uc-slot.filled:active {
  transform: scale(0.95);
}

.uc-slot.ok {
  background: #dcfce7;
  border-color: #15803d;
  color: #15803d;
  cursor: default;
}

.uc-slot.bad {
  background: #fee2e2;
  border-color: #b91c1c;
  color: #b91c1c;
  cursor: default;
}

html[data-theme="dark"] .uc-slot {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(148, 163, 184, 0.25);
  color: #f1f5f9;
}

html[data-theme="dark"] .uc-slot.empty {
  background: rgba(0, 0, 0, 0.2);
  border-color: rgba(148, 163, 184, 0.2);
}

html[data-theme="dark"] .uc-slot.filled {
  border-color: #a78bfa;
  background: rgba(124, 111, 214, 0.2);
}

html[data-theme="dark"] .uc-slot.ok {
  background: rgba(34, 197, 94, 0.2);
  border-color: #4ade80;
  color: #4ade80;
}

html[data-theme="dark"] .uc-slot.bad {
  background: rgba(239, 68, 68, 0.2);
  border-color: #f87171;
  color: #f87171;
}

.uc-space {
  display: inline-block;
  width: clamp(12px, 3vw, 22px);
  height: 1px;
  flex-shrink: 0;
  pointer-events: none;
}

.uc-feedback {
  font-weight: 800;
  font-size: 1.1rem;
  margin: 0;
}

.uc-feedback.ok { color: #15803d; }
.uc-feedback.bad { color: #b91c1c; }

html[data-theme="dark"] .uc-feedback.ok { color: #4ade80; }
html[data-theme="dark"] .uc-feedback.bad { color: #f87171; }

.uc-answer-reveal {
  margin: 0;
  font-size: 0.95rem;
  color: #64748b;
}

.uc-country-name {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #1e1b4b;
}

html[data-theme="dark"] .uc-country-name { color: #f1f5f9; }

/* Pool card */
.uc-card-pool {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.uc-pool {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.uc-tile {
  width: 42px;
  height: 48px;
  border-radius: 12px;
  border: 1.5px solid #e2e8f0;
  background: #fff;
  color: #1e1b4b;
  font-weight: 800;
  font-size: 1.15rem;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
  transition: transform 0.1s, background 0.15s, border-color 0.15s;
  -webkit-tap-highlight-color: transparent;
  padding: 0;
}

.uc-tile:hover {
  border-color: #c7d2fe;
  background: #f8fafc;
}

.uc-tile:active {
  transform: scale(0.94);
  background: #eef2ff;
  border-color: #a5b4fc;
}

.uc-tile.used {
  /* was visibility:hidden — keep ghost letter visible in place */
  visibility: visible;
  opacity: 0.4;
  pointer-events: none;
}

html[data-theme="dark"] .uc-tile {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(148, 163, 184, 0.2);
  color: #e2e8f0;
  box-shadow: none;
}

html[data-theme="dark"] .uc-tile:active {
  background: rgba(124, 111, 214, 0.25);
}

.uc-btn-check {
  width: 100%;
  appearance: none;
  border: none;
  background: #c7d2fe;
  color: #4338ca;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  padding: 14px 24px;
  min-height: 50px;
  border-radius: 14px;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}

.uc-btn-check:hover { background: #a5b4fc; }
.uc-btn-check:active { transform: scale(0.98); }

html[data-theme="dark"] .uc-btn-check {
  background: rgba(124, 111, 214, 0.35);
  color: #c7d2fe;
}

.uc-btn,
.uc-btn-next {
  appearance: none;
  border: none;
  background: #7c6fd6;
  color: #fff;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  padding: 14px 28px;
  min-height: 50px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(124, 111, 214, 0.35);
  transition: background 0.15s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}

.uc-btn:hover,
.uc-btn-next:hover { background: #6b5fc7; }

.uc-btn:active,
.uc-btn-next:active { transform: scale(0.97); }

.uc-btn-next {
  width: 100%;
  border-radius: 14px;
  flex-shrink: 0;
}

/* Start / done */
.uc-start,
.uc-done {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px 8px 32px;
  gap: 10px;
  overflow-y: auto;
}

.uc-hero,
.uc-trophy {
  font-size: 2.75rem;
  line-height: 1;
}

.uc-start h1,
.uc-done h1 {
  font-size: 1.5rem;
  font-weight: 800;
  color: #1e1b4b;
  margin: 0;
}

html[data-theme="dark"] .uc-start h1,
html[data-theme="dark"] .uc-done h1 { color: #f1f5f9; }

.uc-desc {
  color: #64748b;
  max-width: 320px;
  font-size: 0.95rem;
  margin: 0 0 8px;
  line-height: 1.5;
}

html[data-theme="dark"] .uc-desc { color: #94a3b8; }

.uc-stars {
  display: flex;
  gap: 6px;
  font-size: 1.6rem;
}

/* Wider */
@media (min-width: 480px) {
  .uc-game {
    max-width: 560px;
    padding: 16px 18px 20px;
  }
  .uc-title { font-size: 1.15rem; }
  .uc-photo { max-height: 280px; }
  .uc-slot {
    width: 40px;
    height: 48px;
    font-size: 1.2rem;
  }
  .uc-tile {
    width: 46px;
    height: 52px;
    font-size: 1.2rem;
  }
}

@media (max-width: 360px) {
  .uc-game { padding: 8px 10px 12px; }
  .uc-slot {
    width: 30px;
    height: 38px;
    font-size: 0.95rem;
    border-radius: 8px;
  }
  .uc-tile {
    width: 36px;
    height: 42px;
    font-size: 1rem;
  }
  .uc-space { width: 10px; height: 38px; }
  .uc-photo { max-height: 180px; min-height: 100px; }
}


/* Clothes unscramble tweaks */
.uc-pic {
  max-height: 160px !important;
  width: auto !important;
  object-fit: contain !important;
}
.uc-audio-btn {
  /* size controlled by Match-style block above */
  font-size: 0 !important;
}
.uc-letter, .uc-slot {
  font-size: 1.25rem !important;
  min-width: 42px !important;
  min-height: 48px !important;
}

.uc-flag-badge { display: none !important; }

/* ===== Shared theme: Listen & Write (Days) language ===== */
:root {
  --lw-bg: #f4f6fb;
  --lw-card: #ffffff;
  --lw-text: #1e1b4b;
  --lw-muted: #64748b;
  --lw-purple: #6d28d9;
  --lw-purple-soft: #ede9fe;
  --lw-green: #16a34a;
  --lw-red: #dc2626;
  --lw-radius: 18px;
  --lw-shadow: 0 10px 30px rgba(30, 27, 75, 0.08);
}
html[data-theme="dark"] {
  --lw-bg: #0f1220;
  --lw-card: #1a1f35;
  --lw-text: #f1f5f9;
  --lw-muted: #94a3b8;
  --lw-purple-soft: rgba(109, 40, 217, 0.25);
  --lw-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}
html, body {
  background: var(--lw-bg) !important;
  color: var(--lw-text) !important;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif !important;
}
.arcade-header-bar, .arcade-nav, .site-footer, body > header, .nav-profile, .theme-toggle {
  display: none !important;
}

/* Shells */
.uc-game, .mc-game, .us-game, .su-game, .lw-game {
  max-width: 560px !important;
  margin: 0 auto !important;
  padding: 16px 16px 40px !important;
  min-height: 100dvh;
  box-sizing: border-box;
}

/* Top bars */
.uc-topbar, .mc-topbar, .us-topbar, .su-topbar {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  margin-bottom: 18px !important;
}
.uc-back, .mc-back, .us-back, .us-back-btn, .su-back {
  display: grid !important;
  place-items: center !important;
  width: 40px !important;
  height: 40px !important;
  border-radius: 12px !important;
  background: var(--lw-card) !important;
  color: var(--lw-text) !important;
  text-decoration: none !important;
  font-size: 18px !important;
  box-shadow: var(--lw-shadow) !important;
  border: 1px solid rgba(109, 40, 217, 0.12) !important;
  flex-shrink: 0 !important;
}
.uc-badge, .mc-badge, .us-badge, .su-badge {
  font-size: 11px !important;
  font-weight: 800 !important;
  letter-spacing: 0.06em !important;
  text-transform: uppercase !important;
  padding: 6px 10px !important;
  border-radius: 999px !important;
  background: var(--lw-purple-soft) !important;
  color: var(--lw-purple) !important;
}
.uc-title, .mc-title, .us-title, .su-title {
  flex: 1 !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  color: var(--lw-muted) !important;
}
.uc-progress, .mc-progress, .us-progress, .su-progress,
.uc-progress > span, .mc-progress > span {
  height: 8px !important;
  border-radius: 999px !important;
  background: rgba(109, 40, 217, 0.12) !important;
  overflow: hidden !important;
}
.uc-progress > span, .mc-progress > span, .us-progress > span {
  background: linear-gradient(90deg, #a78bfa, #6d28d9) !important;
  display: block !important;
  height: 100% !important;
}

/* Cards */
.uc-card, .us-card, .su-card, .uc-card-word, .uc-card-photo, .uc-card-pool,
.us-stage, .us-pic-wrap, .su-pic {
  background: var(--lw-card) !important;
  border-radius: var(--lw-radius) !important;
  box-shadow: var(--lw-shadow) !important;
  border: 1px solid rgba(109, 40, 217, 0.12) !important;
}

/* Soft letter chips / tiles / slots */
.uc-tile, .us-tile, .us-chip, .us-chip-letter, .su-tile,
.uc-slot.filled, .us-slot.filled {
  border: 1px solid #e2e8f0 !important;
  background: #ffffff !important;
  color: #475569 !important;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.1) !important;
  border-radius: 16px !important;
  font-weight: 700 !important;
  transition: none !important;
  animation: none !important;
  transform: none !important;
}
html[data-theme="dark"] .uc-tile,
html[data-theme="dark"] .us-tile,
html[data-theme="dark"] .us-chip,
html[data-theme="dark"] .us-chip-letter,
html[data-theme="dark"] .su-tile,
html[data-theme="dark"] .uc-slot.filled,
html[data-theme="dark"] .us-slot.filled {
  background: #2a3148 !important;
  border-color: #4b5568 !important;
  color: #e2e8f0 !important;
}
.uc-slot.empty, .us-slot.empty {
  border: 2px dashed rgba(109, 40, 217, 0.4) !important;
  background: rgba(109, 40, 217, 0.08) !important;
  border-radius: 16px !important;
  box-shadow: none !important;
}
.uc-tile.used, .us-tile.used, .us-chip.used {
  opacity: 0.45 !important;
  visibility: visible !important;
  pointer-events: none !important;
  box-shadow: none !important;
}
.uc-slot.ok, .us-slot.ok, .uc-tile.ok, .us-tile.ok {
  background: #dcfce7 !important;
  border-color: #16a34a !important;
  color: #15803d !important;
}
.uc-slot.bad, .us-slot.bad, .uc-tile.bad, .us-tile.bad {
  background: #fee2e2 !important;
  border-color: #dc2626 !important;
  color: #b91c1c !important;
}

/* Buttons */
.uc-btn, .mc-btn, .us-btn, .su-btn,
.uc-btn-check, .uc-btn-next {
  border-radius: 14px !important;
  font-weight: 800 !important;
  border: none !important;
  font-family: inherit !important;
}
.uc-btn-primary, .uc-btn-check, .mc-btn:not(.secondary), .us-btn-primary,
button.uc-btn:not(.uc-btn-ghost):not(.secondary) {
  background: linear-gradient(145deg, #8b5cf6, #6d28d9) !important;
  color: #fff !important;
  box-shadow: 0 6px 18px rgba(109, 40, 217, 0.35) !important;
}
.uc-btn-ghost, .mc-btn.secondary, .us-btn.secondary, .secondary {
  background: var(--lw-card) !important;
  color: var(--lw-purple) !important;
  border: 2px solid rgba(109, 40, 217, 0.25) !important;
  box-shadow: none !important;
}

/* Audio / play circle */
.uc-audio-btn, .mc-play, .us-play, .us-hear {
  width: 56px !important;
  height: 56px !important;
  border-radius: 50% !important;
  background: linear-gradient(145deg, #8b5cf6, #6d28d9) !important;
  color: #fff !important;
  border: none !important;
  display: grid !important;
  place-items: center !important;
  box-shadow: 0 6px 16px rgba(109, 40, 217, 0.35) !important;
  overflow: hidden !important;
}

/* Start screens */
.uc-start, .mc-start, .us-start, .su-start {
  text-align: center !important;
  padding: 28px 8px 16px !important;
}
.uc-start h1, .mc-start h1, .us-start h1, .su-start h1,
.uc-hero, .mc-hero, .us-hero {
  color: var(--lw-text) !important;
}
.uc-desc, .mc-desc, .us-desc, .uc-instruction, .mc-instruction {
  color: var(--lw-muted) !important;
}

/* Mode cards (if any) */
.mc-mode-card, .us-mode-btn, .mc-mode-btn, .su-mode-card {
  background: var(--lw-card) !important;
  border: 1px solid rgba(109, 40, 217, 0.15) !important;
  border-radius: var(--lw-radius) !important;
  box-shadow: var(--lw-shadow) !important;
  color: var(--lw-text) !important;
}

/* Feedback */
.uc-feedback.ok, .us-feedback.ok, .us-ok { color: var(--lw-green) !important; }
.uc-feedback.bad, .us-feedback.bad, .us-err { color: var(--lw-red) !important; }

/* Desktop scale */
@media (min-width: 900px) {
  .uc-game, .mc-game, .us-game, .su-game {
    max-width: 720px !important;
    padding: 28px 28px 48px !important;
  }
  .uc-tile, .us-tile, .us-chip, .us-chip-letter, .su-tile,
  .uc-slot, .us-slot {
    min-width: 58px !important;
    min-height: 60px !important;
    font-size: 1.35rem !important;
  }
  .uc-audio-btn, .mc-play, .us-play {
    width: 64px !important;
    height: 64px !important;
  }
}

/* photo card layout */
.uc-card-photo {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.uc-photo {
  object-fit: contain !important;
  max-width: 100%;
  width: auto;
}

/* ===== Phone layout ===== */
@media (max-width: 420px) {
  .uc-game {
    padding: 8px 10px 12px !important;
    padding-bottom: max(12px, env(safe-area-inset-bottom, 0px)) !important;
  }
  .uc-instruction {
    font-size: 0.82rem;
    margin: 4px 0 8px;
    line-height: 1.35;
  }
  .uc-kicker {
    font-size: 9px;
  }
  .uc-title {
    font-size: 13px;
  }
  .uc-photo {
    max-height: min(28vh, 160px) !important;
    min-height: 90px;
  }
  .uc-slot {
    width: 36px;
    height: 42px;
    font-size: 1.05rem;
  }
  .uc-tile {
    min-width: 40px;
    min-height: 42px;
    font-size: 1.05rem;
  }
  .uc-audio-btn {
    width: 52px;
    height: 52px;
    min-width: 52px;
    min-height: 52px;
  }
  .uc-card-pool {
    padding-bottom: 8px;
  }
  .uc-btn-check,
  .uc-btn,
  .uc-btn-next {
    min-height: 48px;
    width: 100%;
  }
}
@media (max-width: 360px) {
  .uc-slot {
    width: 32px;
    height: 38px;
    font-size: 0.95rem;
  }
  .uc-tile {
    min-width: 36px;
    min-height: 38px;
  }
}
@media (min-width: 600px) {
  .uc-photo {
    max-height: 260px !important;
  }
  .uc-audio-btn {
    width: 56px;
    height: 56px;
  }
}


/* Multi-word abilities: keep long phrases readable */
.uc-slots {
  gap: 5px;
  row-gap: 10px;
}
.uc-space {
  width: clamp(14px, 3.5vw, 24px) !important;
  min-width: 14px;
  height: 42px;
  position: relative;
}
.uc-space::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 6px;
  height: 3px;
  border-radius: 2px;
  background: rgba(91, 33, 182, 0.25);
  transform: translate(-50%, -50%);
}
html[data-theme="dark"] .uc-space::after {
  background: rgba(196, 181, 253, 0.35);
}
@media (max-width: 400px) {
  .uc-slot {
    width: 32px;
    height: 40px;
    font-size: 1rem;
  }
  .uc-space { width: 12px !important; min-width: 12px; height: 40px; }
}


/* ============================================================
   Mechanism UI (matches postcard tile screenshot)
   - Answer row: solid purple-border chips + dashed empty
   - Pool row: same size chips; used stay in place, faded
   ============================================================ */

.uc-card-word {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.uc-slots {
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 8px !important;
  row-gap: 10px !important;
  width: 100%;
  padding: 6px 0 2px;
}

.uc-slot {
  appearance: none !important;
  -webkit-appearance: none !important;
  box-sizing: border-box !important;
  width: 46px !important;
  height: 46px !important;
  min-width: 46px !important;
  min-height: 46px !important;
  margin: 0 !important;
  padding: 0 !important;
  border-radius: 14px !important;
  border: 2.5px solid #5b21b6 !important;
  background: #ffffff !important;
  color: #0f172a !important;
  font-family: inherit !important;
  font-size: 1.2rem !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-shadow: 0 1px 0 rgba(91, 33, 182, 0.15) !important;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s, border-color 0.15s, color 0.15s !important;
  -webkit-tap-highlight-color: transparent;
}

.uc-slot.empty {
  border: 2.5px dashed #c4b5fd !important;
  background: #faf8ff !important;
  color: transparent !important;
  box-shadow: none !important;
  cursor: default !important;
  pointer-events: none !important;
}

.uc-slot.filled:active {
  transform: scale(0.94) !important;
}

.uc-slot.ok {
  border-color: #16a34a !important;
  background: #f0fdf4 !important;
  color: #166534 !important;
}

.uc-slot.bad {
  border-color: #ef4444 !important;
  background: #fef2f2 !important;
  color: #b91c1c !important;
}

.uc-space {
  display: inline-block !important;
  width: 14px !important;
  min-width: 14px !important;
  height: 46px !important;
  flex: 0 0 14px !important;
  position: relative;
  pointer-events: none;
  background: transparent !important;
  border: 0 !important;
}
.uc-space::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 7px;
  height: 3px;
  border-radius: 2px;
  background: rgba(91, 33, 182, 0.3);
  transform: translate(-50%, -50%);
}

.uc-pool {
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 8px !important;
  width: 100%;
  padding: 4px 0 2px;
  min-height: 54px;
}

.uc-tile {
  appearance: none !important;
  -webkit-appearance: none !important;
  box-sizing: border-box !important;
  width: 46px !important;
  height: 46px !important;
  min-width: 46px !important;
  min-height: 46px !important;
  margin: 0 !important;
  padding: 0 !important;
  border-radius: 14px !important;
  border: 2px solid transparent !important;
  background: #ffffff !important;
  color: #0f172a !important;
  font-family: inherit !important;
  font-size: 1.2rem !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.06),
    0 4px 14px rgba(91, 33, 182, 0.1) !important;
  cursor: pointer;
  transition: transform 0.12s ease, opacity 0.18s ease, box-shadow 0.15s ease, filter 0.18s ease, background 0.15s !important;
  -webkit-tap-highlight-color: transparent;
}

.uc-tile:hover:not(.used):not(:disabled) {
  transform: translateY(-2px);
  box-shadow:
    0 6px 16px rgba(91, 33, 182, 0.16),
    0 1px 2px rgba(15, 23, 42, 0.06) !important;
}

.uc-tile:active:not(.used):not(:disabled) {
  transform: scale(0.94);
}

/* Used pool letters: stay in the same spot, soft ghost */
.uc-tile.used,
.uc-tile:disabled {
  visibility: visible !important;
  opacity: 0.45 !important;
  filter: none !important;
  background: #f1f5f9 !important;
  color: #94a3b8 !important;
  box-shadow: none !important;
  border: 2px solid transparent !important;
  cursor: default !important;
  pointer-events: none !important;
  transform: none !important;
  /* keep full size so the row does not collapse */
  width: 46px !important;
  height: 46px !important;
  min-width: 46px !important;
  min-height: 46px !important;
}

html[data-theme="dark"] .uc-slot {
  background: #1e1b2e !important;
  border-color: #a78bfa !important;
  color: #f8fafc !important;
}
html[data-theme="dark"] .uc-slot.empty {
  background: rgba(255,255,255,0.04) !important;
  border: 2.5px dashed rgba(167, 139, 250, 0.5) !important;
}
html[data-theme="dark"] .uc-tile {
  background: #2a2440 !important;
  color: #f8fafc !important;
}
html[data-theme="dark"] .uc-tile.used,
html[data-theme="dark"] .uc-tile:disabled {
  background: rgba(255,255,255,0.06) !important;
  color: #64748b !important;
  opacity: 0.4 !important;
}

@media (max-width: 400px) {
  .uc-slot, .uc-tile {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    border-radius: 12px !important;
    font-size: 1.05rem !important;
  }
  .uc-space { width: 12px !important; min-width: 12px !important; height: 40px !important; flex-basis: 12px !important; }
  .uc-slots, .uc-pool { gap: 6px !important; }
}

/* ===== Arcade design refresh + polish (shared) ===== */
html:not([data-theme="dark"]){--bg:#f3f0ff;--bg-card:#ffffff;--bg-soft:#ede9fe;--border:#ddd6fe;--accent:#7c3aed;--accent-soft:#ede9fe;--accent-text:#6d28d9;--text:#1e1b4b;--muted:#64748b;--ps-bg:#f3f0ff;--ps-card:#ffffff;--ps-purple:#7c3aed;--ps-purple-soft:rgba(124,58,237,.12);--ps-text:#1e1b4b}
html:not([data-theme="dark"]) body{background:radial-gradient(900px 520px at 8% -8%,rgba(251,207,232,.85),transparent 60%),radial-gradient(800px 480px at 100% 0,rgba(191,219,254,.8),transparent 58%),radial-gradient(700px 500px at 50% 110%,rgba(221,214,254,.9),transparent 60%),#f5f3ff!important;background-attachment:fixed!important}
html[data-theme="dark"] body{background:radial-gradient(800px 480px at 0 -10%,rgba(124,58,237,.30),transparent 60%),radial-gradient(700px 420px at 100% 0,rgba(236,72,153,.16),transparent 55%),#0f1220!important;background-attachment:fixed!important}
[class*="-chip"]:not([class*="-chips"]),[class*="-choice"]:not([class*="-choices"]),[class*="-opt"]:not([class*="-options"]):not([class*="-opts"]){border-radius:14px;border:2px solid rgba(124,58,237,.22);box-shadow:0 4px 0 rgba(124,58,237,.18),0 8px 18px rgba(30,27,75,.08);font-weight:700;transition:transform .14s cubic-bezier(.22,.9,.3,1),box-shadow .14s,border-color .2s,background-color .2s}
[class*="-chip"]:not([class*="-chips"]):not(:disabled):hover,[class*="-choice"]:not([class*="-choices"]):not(:disabled):hover,[class*="-opt"]:not([class*="-options"]):not([class*="-opts"]):not(:disabled):hover{transform:translateY(-2px);box-shadow:0 6px 0 rgba(124,58,237,.2),0 12px 22px rgba(30,27,75,.12)}
[class*="-chip"]:not([class*="-chips"]):not(:disabled):active,[class*="-choice"]:not([class*="-choices"]):not(:disabled):active,[class*="-opt"]:not([class*="-options"]):not([class*="-opts"]):not(:disabled):active{transform:translateY(3px);box-shadow:0 1px 0 rgba(124,58,237,.2)}
[class*="-btn"]{border-radius:14px;font-weight:800;letter-spacing:.01em}
[class*="-card"]:not([class*="-cards"]),[class*="-panel"]:not([class*="-panels"]){border-radius:22px;box-shadow:0 14px 36px rgba(30,27,75,.10)}
html[data-theme="dark"] [class*="-chip"]:not([class*="-chips"]),html[data-theme="dark"] [class*="-choice"]:not([class*="-choices"]),html[data-theme="dark"] [class*="-opt"]:not([class*="-options"]):not([class*="-opts"]){border-color:rgba(167,139,250,.3);box-shadow:0 4px 0 rgba(0,0,0,.35)}
input,textarea{border-radius:14px}
@keyframes ap-in{from{opacity:0;transform:translateY(10px) scale(.985)}to{opacity:1;transform:none}}
@keyframes ap-pop{0%{transform:scale(.6);opacity:0}70%{transform:scale(1.12)}100%{transform:scale(1);opacity:1}}
.screen:not(.hidden),#game-app>section,#game-app>main,#game-app>div{animation:ap-in .38s cubic-bezier(.22,.9,.3,1) both}
button{cursor:pointer;touch-action:manipulation;-webkit-user-select:none;user-select:none;transition:transform .16s cubic-bezier(.22,.9,.3,1),box-shadow .2s,background-color .2s,opacity .2s}
button:not(:disabled):active{transform:scale(.96)}
button:focus-visible,a:focus-visible,input:focus-visible{outline:3px solid rgba(124,58,237,.55);outline-offset:3px}
[class*="-star"]{animation:ap-pop .55s cubic-bezier(.34,1.56,.64,1) both}
[class*="-star"]:nth-child(2){animation-delay:.15s}[class*="-star"]:nth-child(3){animation-delay:.3s}
@media (max-width:480px){button{min-height:44px}}
@media (prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}
/* progress bar, combo, celebration */
.afx-bar{height:12px;border-radius:999px;background:rgba(139,92,246,.16);overflow:hidden;margin:8px 0 10px}
.afx-bar i{display:block;height:100%;border-radius:999px;background:linear-gradient(90deg,#8b5cf6,#ec4899,#f59e0b);background-size:200% 100%;animation:afx-shine 2.4s linear infinite;transition:width .6s cubic-bezier(.22,.9,.3,1);box-shadow:0 0 12px rgba(139,92,246,.55)}
@keyframes afx-shine{to{background-position:-200% 0}}
.afx-combo{position:fixed;right:14px;top:68px;z-index:900;font-weight:800;font-size:15px;padding:6px 14px;border-radius:999px;opacity:0;transform:scale(.7);pointer-events:none;transition:opacity .2s,transform .3s;white-space:nowrap}
.afx-combo em{font-style:normal;font-size:11px;letter-spacing:.08em;margin-left:4px;opacity:.9}
.afx-combo.is-on{opacity:1;transform:none;background:linear-gradient(135deg,#fb923c,#f59e0b);color:#fff;box-shadow:0 6px 16px rgba(245,158,11,.4)}
.afx-combo.is-hot{background:linear-gradient(135deg,#ef4444,#f97316);box-shadow:0 6px 20px rgba(239,68,68,.5)}
.afx-combo.is-bump{animation:afx-bump .45s cubic-bezier(.34,1.56,.64,1)}
.afx-combo.is-lost{opacity:1;transform:none;background:#e2e8f0;color:#64748b;font-size:13px;animation:afx-shake .4s}
.afx-fire{display:inline-block;animation:afx-flick .7s ease-in-out infinite alternate}
@keyframes afx-bump{0%{transform:scale(.8)}55%{transform:scale(1.28) rotate(-3deg)}100%{transform:scale(1)}}
@keyframes afx-flick{to{transform:scale(1.2) rotate(8deg)}}
@keyframes afx-shake{25%{transform:translateX(-6px)}75%{transform:translateX(6px)}}
.afx-burst{position:fixed;inset:0;z-index:9999;display:flex;align-items:center;justify-content:center;background:radial-gradient(circle,rgba(139,92,246,.35),rgba(15,18,32,.55));overflow:hidden;pointer-events:none;animation:afx-fin .25s both}
.afx-burst.is-out{animation:afx-fout .4s both}
@keyframes afx-fin{from{opacity:0}}@keyframes afx-fout{to{opacity:0}}
.afx-burst i{position:absolute;top:-16px;width:10px;height:16px;border-radius:2px;animation:afx-fall linear both}
@keyframes afx-fall{to{transform:translateY(110vh) rotate(720deg)}}
.afx-card{text-align:center;padding:28px 40px;border-radius:28px;background:#fff;color:#1e1b4b;box-shadow:0 24px 60px rgba(0,0,0,.4);animation:afx-zoom .7s cubic-bezier(.34,1.56,.64,1) both;max-width:88vw}
html[data-theme="dark"] .afx-card{background:#1a1f35;color:#f1f5f9}
.afx-emoji{font-size:76px;line-height:1;animation:afx-spin 1s cubic-bezier(.34,1.56,.64,1) both}
.afx-title{font-size:30px;font-weight:900;margin-top:8px;background:linear-gradient(90deg,#8b5cf6,#ec4899,#f59e0b);-webkit-background-clip:text;background-clip:text;color:transparent}
.afx-sub{margin-top:6px;font-weight:600;opacity:.75}
@keyframes afx-zoom{from{transform:scale(.2) rotate(-8deg);opacity:0}}
@keyframes afx-spin{from{transform:scale(0) rotate(-360deg)}}
@media (prefers-reduced-motion:reduce){#game-app *,#game-app,.afx-burst i,.afx-fire,.afx-bar i{animation:none!important;transition:none!important}}

/* existing progress bars → same animated gradient bar */
.fc-progress,.clf-bar,.cw-bar,.wt-bar{height:12px!important;border-radius:999px;background:rgba(139,92,246,.16)!important;overflow:hidden}
.fc-progress-fill,.clf-bar-fill,.cw-bar-fill,.wt-bar-fill{border-radius:999px;background:linear-gradient(90deg,#8b5cf6,#ec4899,#f59e0b)!important;background-size:200% 100%;animation:afx-shine 2.4s linear infinite;transition:width .6s cubic-bezier(.22,.9,.3,1)!important;box-shadow:0 0 12px rgba(139,92,246,.55)}

/* existing bars of this batch */
.lw-progress,.progress,.mc-set-progress{height:12px!important;border-radius:999px;background:rgba(139,92,246,.16)!important;overflow:hidden}
.lw-progress-fill,.progress-fill,.mc-set-progress-fill{border-radius:999px;background:linear-gradient(90deg,#8b5cf6,#ec4899,#f59e0b)!important;background-size:200% 100%;animation:afx-shine 2.4s linear infinite;transition:width .6s cubic-bezier(.22,.9,.3,1)!important;box-shadow:0 0 12px rgba(139,92,246,.55)}
