:root {
  --ink-950: #0a0710;
  --ink-900: #0f0b16;
  --ink-850: #140e1c;
  --ink-800: #181123;
  --ink-700: #211830;
  --ink-600: #2c2140;

  --cream-rgb: 247, 240, 228;
  --cream: #f3ead6;
  --cream-deep: #e3d5b6;
  --on-cream: #241a10;

  --text-hi: #f7f0e4;
  --text-mid: rgba(var(--cream-rgb), 0.82);
  --text-lo: rgba(var(--cream-rgb), 0.62);
  --text-faint: rgba(var(--cream-rgb), 0.44);

  --glass-1: rgba(var(--cream-rgb), 0.04);
  --glass-2: rgba(var(--cream-rgb), 0.075);
  --glass-3: rgba(var(--cream-rgb), 0.115);

  --stroke-1: rgba(var(--cream-rgb), 0.09);
  --stroke-2: rgba(var(--cream-rgb), 0.17);
  --stroke-hi: rgba(var(--cream-rgb), 0.32);

  /* 6 Per-game jewel tabletop palettes */
  --wavelength: #3ad0bb;
  --wavelength-soft: #8ae4da;
  --wavelength-card: #14544e;
  --wavelength-card-hi: #1c6d65;

  --alchemy: #a98cf5;
  --alchemy-soft: #d2c2ff;
  --alchemy-card: #34246b;
  --alchemy-card-hi: #47328f;

  --converge: #5fdcff;
  --converge-soft: #a9edff;
  --converge-card: #184d67;
  --converge-card-hi: #226587;

  --wordle: #62d183;
  --wordle-soft: #9ce4b0;
  --wordle-card: #1f5c38;
  --wordle-card-hi: #287548;

  --titles: #f5a93c;
  --titles-soft: #ffd9a0;
  --titles-card: #58310f;
  --titles-card-hi: #734216;

  --proverbs: #ff6fa5;
  --proverbs-soft: #ffb3cf;
  --proverbs-card: #5a1d38;
  --proverbs-card-hi: #73264a;

  --accent: var(--cream);
  --accent-soft: #fcf7ec;

  --tile-green: #58c97b;
  --tile-yellow: #f0b840;
  --tile-gray: #2b233a;
  --bad: #ff6b7a;

  --font-display: "Fraunces", ui-serif, Georgia, "Times New Roman", serif;
  --font-body: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;

  --r-xs: 10px;
  --r-sm: 14px;
  --r-md: 18px;
  --r-lg: 24px;
  --r-pill: 999px;

  --shadow-sm: 0 2px 10px rgba(4, 2, 8, 0.42);
  --shadow-md: 0 12px 30px rgba(4, 2, 8, 0.52);
  --shadow-lg: 0 24px 56px rgba(4, 2, 8, 0.65);

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 0.15s;
  --dur: 0.26s;
}

body[data-game="wavelength"] { --accent: var(--wavelength); --accent-soft: var(--wavelength-soft); }
body[data-game="alchemy"]    { --accent: var(--alchemy);    --accent-soft: var(--alchemy-soft); }
body[data-game="converge"]   { --accent: var(--converge);   --accent-soft: var(--converge-soft); }
body[data-game="wordle"]     { --accent: var(--wordle);     --accent-soft: var(--wordle-soft); }
body[data-game="titles"]     { --accent: var(--titles);     --accent-soft: var(--titles-soft); }
body[data-game="proverbs"]   { --accent: var(--proverbs);   --accent-soft: var(--proverbs-soft); }

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background-color: var(--ink-900); }

body {
  font-family: var(--font-body);
  background:
    radial-gradient(110% 65% at 50% -12%, rgba(114, 72, 178, 0.22) 0%, transparent 62%),
    radial-gradient(80% 50% at 85% 15%, rgba(245, 169, 60, 0.08) 0%, transparent 55%),
    linear-gradient(180deg, var(--ink-850) 0%, var(--ink-900) 45%, var(--ink-950) 100%);
  background-attachment: fixed;
  color: var(--text-hi);
  min-height: 100dvh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .brand-title, .active-game-title {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 48;
  letter-spacing: -0.02em;
}

/* TOPBAR */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 1px solid var(--stroke-1);
  background: rgba(15, 11, 22, 0.78);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 30;
}

.brand { display: flex; align-items: center; gap: 11px; cursor: pointer; }

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(160deg, #fcf7ec 0%, var(--cream-deep) 100%);
  color: var(--on-cream);
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(4, 2, 8, 0.45), inset 0 1px rgba(255, 255, 255, 0.75);
}

.brand-title { font-size: 1.15rem; font-weight: 700; color: var(--text-hi); line-height: 1.1; }
.brand-sub { font-size: 0.74rem; color: var(--text-lo); }

.topbar-right, .room-controls { display: flex; align-items: center; gap: 8px; }

.pill {
  background: var(--glass-2);
  border: 1px solid var(--stroke-2);
  color: var(--text-hi);
  border-radius: var(--r-pill);
  min-height: 40px;
  padding: 0 14px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: transform var(--dur-fast) var(--ease-out), background var(--dur-fast), border-color var(--dur-fast);
}
.pill-icon { padding: 0 11px; }
.pill:hover { background: var(--glass-3); border-color: var(--stroke-hi); }
.pill:active { transform: scale(0.95); }
.pill-code strong { font-family: var(--font-display); letter-spacing: 0.1em; color: var(--cream); }
.pill-label { color: var(--text-lo); font-weight: 500; }
.copy-icon { color: var(--text-lo); font-size: 0.85rem; }

.badge {
  background: var(--proverbs);
  color: var(--ink-950);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: var(--r-pill);
}

/* LAYOUT */
.container { max-width: 760px; margin: 0 auto; padding: 24px 16px 76px; }

.hero { text-align: center; padding: 10px 0 26px; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--r-pill);
  background: var(--glass-2);
  border: 1px solid var(--stroke-1);
  color: var(--cream);
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 15px;
}

.hero h1 {
  font-size: clamp(2.3rem, 6vw, 3.4rem);
  font-weight: 700;
  line-height: 1.04;
  margin-bottom: 14px;
}

.hero h1 em {
  font-style: italic;
  font-weight: 500;
  background: linear-gradient(120deg, var(--cream) 0%, #ffd9a0 52%, #ffb3cf 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-lead { color: var(--text-lo); max-width: 510px; margin: 0 auto; font-size: 0.98rem; }

/* CARDS */
.card {
  position: relative;
  border-radius: var(--r-lg);
  background: var(--glass-1);
  border: 1px solid var(--stroke-1);
  box-shadow: var(--shadow-sm);
  padding: 22px;
  backdrop-filter: blur(8px);
}

.card--elev {
  background: linear-gradient(170deg, rgba(247, 240, 228, 0.065) 0%, rgba(247, 240, 228, 0.025) 100%);
  border-color: var(--stroke-2);
  box-shadow: var(--shadow-md);
}

.entry-card { max-width: 490px; margin: 0 auto 36px; }

.invite-callout {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--r-sm);
  background: rgba(98, 209, 131, 0.14);
  border: 1px solid rgba(98, 209, 131, 0.4);
  margin-bottom: 18px;
}

/* FORMS */
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 0.84rem; font-weight: 600; color: var(--text-mid); margin-bottom: 7px; }
.muted { color: var(--text-lo); font-weight: 400; }

input[type="text"], textarea {
  width: 100%;
  background: rgba(10, 7, 16, 0.55);
  border: 1px solid var(--stroke-2);
  color: var(--text-hi);
  border-radius: var(--r-sm);
  padding: 13px 15px;
  font-size: 0.96rem;
  font-family: inherit;
  outline: none;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast), background var(--dur-fast);
}
input[type="text"]::placeholder, textarea::placeholder { color: var(--text-faint); }
input[type="text"]:focus, textarea:focus {
  border-color: var(--accent);
  background: rgba(10, 7, 16, 0.78);
  box-shadow: 0 0 0 3px rgba(243, 234, 214, 0.12);
}

.lang-picker { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }

.lang-btn {
  background: rgba(10, 7, 16, 0.45);
  border: 1px solid var(--stroke-1);
  color: var(--text-lo);
  border-radius: var(--r-pill);
  min-height: 44px;
  padding: 0 10px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
}
.lang-btn:hover { border-color: var(--stroke-2); color: var(--text-hi); }
.lang-btn.active {
  background: var(--cream);
  border-color: var(--cream);
  color: var(--on-cream);
  box-shadow: 0 6px 18px rgba(4, 2, 8, 0.35);
}

/* TACTILE PILL BUTTONS */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 22px;
  border: none;
  border-radius: var(--r-pill);
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  white-space: nowrap;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-out), filter var(--dur-fast) var(--ease-out), background var(--dur-fast);
}
.btn:active:not(:disabled) { transform: scale(0.965); filter: brightness(1.06); transition-duration: 0ms; }
.btn:disabled {
  background: var(--glass-2) !important;
  border: 1px solid var(--stroke-1);
  color: var(--text-faint) !important;
  box-shadow: none !important;
  cursor: not-allowed;
  transform: none;
}
.btn--block { display: flex; width: 100%; }
.btn--lg { min-height: 56px; font-size: 1.08rem; }
.btn--sm { min-height: 38px; padding: 0 15px; font-size: 0.86rem; }

.btn--primary {
  color: var(--ink-950);
  background: linear-gradient(170deg, var(--accent-soft) 0%, var(--accent) 115%);
  box-shadow: 0 10px 26px rgba(4, 2, 8, 0.45), inset 0 1px rgba(255, 255, 255, 0.55);
}
.btn--primary:hover:not(:disabled) { filter: brightness(1.04); transform: translateY(-1px); }

.btn--secondary { color: var(--text-hi); background: var(--glass-2); border: 1px solid var(--stroke-2); }
.btn--secondary:hover:not(:disabled) { background: var(--glass-3); border-color: var(--stroke-hi); }

.btn--ghost {
  background: transparent;
  color: var(--text-mid);
  font-family: var(--font-body);
  font-size: 0.86rem;
  font-weight: 600;
  padding: 0 10px;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: var(--stroke-2);
}
.btn--ghost:hover { color: var(--text-hi); text-decoration-color: var(--stroke-hi); }

.divider { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--text-faint); font-size: 0.8rem; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--stroke-1); }

.join-row { display: flex; gap: 10px; }
.code-input {
  text-transform: uppercase;
  letter-spacing: 0.24em;
  text-align: center;
  font-weight: 700;
  font-family: var(--font-display);
  font-size: 1.08rem;
  max-width: 148px;
}
.code-inline { font-family: var(--font-display); letter-spacing: 0.1em; color: var(--cream); }

/* SHELF & GAME BOX CARDS */
.shelf-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; gap: 8px; flex-wrap: wrap; }
.shelf-head h2 { font-size: 1.35rem; font-weight: 600; }

.preview-grid, .games-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.game-box {
  position: relative;
  text-align: left;
  border-radius: var(--r-lg);
  padding: 20px;
  color: var(--text-hi);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: var(--shadow-md), inset 0 1px rgba(255, 255, 255, 0.18);
  overflow: hidden;
  transition: transform var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out), border-color var(--dur-fast);
}
button.game-box { cursor: pointer; display: flex; flex-direction: column; }
button.game-box:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg), inset 0 1px rgba(255, 255, 255, 0.28);
  border-color: rgba(255, 255, 255, 0.28);
}
button.game-box:active { transform: scale(0.975); }

.game-box--wavelength { background: linear-gradient(155deg, var(--wavelength-card-hi) 0%, var(--wavelength-card) 100%); }
.game-box--alchemy    { background: linear-gradient(155deg, var(--alchemy-card-hi) 0%, var(--alchemy-card) 100%); }
.game-box--converge   { background: linear-gradient(155deg, var(--converge-card-hi) 0%, var(--converge-card) 100%); }
.game-box--wordle     { background: linear-gradient(155deg, var(--wordle-card-hi) 0%, var(--wordle-card) 100%); }
.game-box--titles     { background: linear-gradient(155deg, var(--titles-card-hi) 0%, var(--titles-card) 100%); }
.game-box--proverbs   { background: linear-gradient(155deg, var(--proverbs-card-hi) 0%, var(--proverbs-card) 100%); }

.game-box__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.game-box__icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: rgba(10, 7, 16, 0.26);
  border: 1px solid rgba(255, 255, 255, 0.14);
  display: grid;
  place-items: center;
  font-size: 1.45rem;
}
.game-box__pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  background: rgba(10, 7, 16, 0.32);
  color: var(--cream);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.game-box h3 { font-size: 1.25rem; font-weight: 700; margin-bottom: 6px; }
.game-box p { font-size: 0.85rem; color: rgba(247, 240, 228, 0.84); line-height: 1.48; flex: 1; }
.game-box__cta { margin-top: 14px; font-family: var(--font-display); font-size: 0.9rem; font-weight: 600; color: var(--cream); }

/* PLAYERS STRIP & PRESENCE */
.players-strip { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }

.player-chip {
  background: var(--glass-2);
  border: 1px solid var(--stroke-1);
  border-radius: var(--r-md);
  padding: 12px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  text-align: left;
  color: var(--text-hi);
}
.player-chip.is-self {
  border-color: rgba(243, 234, 214, 0.38);
  background: linear-gradient(150deg, rgba(243, 234, 214, 0.11) 0%, var(--glass-1) 100%);
  cursor: pointer;
}
.player-chip.is-self:hover { border-color: var(--cream); }
.player-chip.empty { border-style: dashed; border-color: var(--stroke-2); color: var(--text-faint); justify-content: center; font-size: 0.88rem; }

.player-meta { display: flex; align-items: center; gap: 10px; min-width: 0; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--wordle); box-shadow: 0 0 8px rgba(98, 209, 131, 0.6); flex-shrink: 0; }
.status-dot.offline { background: var(--text-faint); box-shadow: none; }
.player-name { font-weight: 700; font-size: 0.94rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-lang { font-size: 0.74rem; color: var(--text-lo); }
.player-score {
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--cream);
  background: rgba(10, 7, 16, 0.35);
  padding: 4px 10px;
  border-radius: var(--r-pill);
  border: 1px solid var(--stroke-1);
  flex-shrink: 0;
}

.presence-bar {
  text-align: center;
  font-size: 0.8rem;
  color: var(--accent-soft);
  margin-bottom: 12px;
  min-height: 20px;
}

/* WAITING BANNER */
.waiting-card {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
  flex-wrap: wrap;
  border-color: rgba(243, 234, 214, 0.25);
  background: linear-gradient(160deg, rgba(243, 234, 214, 0.08) 0%, var(--glass-1) 100%);
}
.waiting-card__text { flex: 1; min-width: 180px; }
.waiting-card h3 { font-size: 1.08rem; margin-bottom: 2px; }

.pulse-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--cream);
  box-shadow: 0 0 0 5px rgba(243, 234, 214, 0.2);
  animation: pulse 1.8s infinite;
  flex-shrink: 0;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.25); opacity: 0.6; }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-7px); }
  40%, 80% { transform: translateX(7px); }
}
.shake { animation: shake 0.35s ease; }

/* GAME STAGE */
.game-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 8px; }
.active-game-title { font-size: 1.25rem; font-weight: 700; color: var(--accent-soft); }

.stage-card {
  animation: fadeUp 0.24s var(--ease-out);
  border-color: var(--stroke-2);
  background: linear-gradient(170deg, rgba(247, 240, 228, 0.055) 0%, rgba(15, 11, 22, 0.72) 100%);
}

.banner {
  padding: 13px 16px;
  border-radius: var(--r-sm);
  margin-bottom: 18px;
  font-size: 0.9rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.banner-info   { background: var(--glass-2); border: 1px solid var(--stroke-2); }
.banner-green  { background: rgba(98, 209, 131, 0.14); border: 1px solid rgba(98, 209, 131, 0.42); }
.banner-yellow { background: rgba(240, 184, 64, 0.14); border: 1px solid rgba(240, 184, 64, 0.45); }
.banner-win    { background: rgba(98, 209, 131, 0.2);  border: 1px solid var(--wordle); }
.banner-lose   { background: rgba(255, 107, 122, 0.16); border: 1px solid var(--bad); }

/* 1. WAVELENGTH */
.wl-poles {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: 12px;
  margin-bottom: 14px;
}
.wl-pole {
  flex: 1;
  padding: 12px 14px;
  border-radius: var(--r-sm);
  background: rgba(10, 7, 16, 0.45);
  border: 1px solid var(--stroke-1);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.02rem;
}
.wl-pole--right { text-align: right; }

.wl-track-wrap {
  position: relative;
  padding: 22px 0 18px;
  margin-bottom: 14px;
}
.wl-track {
  position: relative;
  height: 36px;
  border-radius: var(--r-pill);
  background: linear-gradient(90deg, #273859 0%, #224d57 50%, #5c2a42 100%);
  border: 1.5px solid var(--stroke-2);
  overflow: hidden;
  box-shadow: inset 0 3px 10px rgba(0, 0, 0, 0.5);
}
.wl-zone {
  position: absolute;
  top: 0;
  bottom: 0;
  transform: translateX(-50%);
  pointer-events: none;
}
.wl-zone--2 { width: 36%; background: rgba(245, 169, 60, 0.28); }
.wl-zone--3 { width: 20%; background: rgba(240, 184, 64, 0.52); }
.wl-zone--4 { width: 8%;  background: var(--tile-green); box-shadow: 0 0 12px rgba(88, 201, 123, 0.8); }

.wl-needle {
  position: absolute;
  top: 12px;
  bottom: 8px;
  width: 4px;
  background: var(--cream);
  border-radius: 4px;
  transform: translateX(-50%);
  box-shadow: 0 0 10px rgba(0,0,0,0.8);
  pointer-events: none;
  transition: left 0.08s linear;
}
.wl-needle::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--cream);
  border: 3px solid var(--ink-900);
}
.wl-slider {
  width: 100%;
  margin-top: 10px;
  accent-color: var(--wavelength);
  cursor: pointer;
}
.wl-clue-display {
  text-align: center;
  padding: 16px;
  border-radius: var(--r-md);
  background: linear-gradient(155deg, var(--wavelength-card-hi), var(--wavelength-card));
  border: 1px solid rgba(138, 228, 218, 0.35);
  margin-bottom: 16px;
}
.wl-clue-word {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 700;
  margin-top: 4px;
}

/* 2. WORD ALCHEMY */
.alc-header {
  text-align: center;
  padding: 18px;
  border-radius: var(--r-md);
  background: linear-gradient(155deg, var(--alchemy-card-hi), var(--alchemy-card));
  border: 1px solid rgba(210, 194, 255, 0.3);
  margin-bottom: 16px;
}
.alc-target { font-family: var(--font-display); font-size: 1.85rem; font-weight: 700; margin: 4px 0; }
.alc-slots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 16px 0;
  flex-wrap: wrap;
}
.alc-slot {
  min-width: 104px;
  min-height: 48px;
  padding: 8px 16px;
  border-radius: var(--r-sm);
  border: 2px dashed var(--stroke-hi);
  background: rgba(10, 7, 16, 0.5);
  color: var(--cream);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.alc-slot.filled {
  border-style: solid;
  border-color: var(--alchemy-soft);
  background: rgba(71, 50, 143, 0.55);
}
.alc-plus { font-weight: 700; color: var(--text-lo); }

.alc-pool {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
}
.alc-tile {
  padding: 10px 16px;
  border-radius: var(--r-pill);
  background: var(--ink-600);
  border: 1px solid var(--stroke-2);
  color: var(--text-hi);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: transform 0.12s, background 0.15s;
}
.alc-tile:hover:not(:disabled) { border-color: var(--cream); transform: translateY(-1px); }
.alc-tile.used { opacity: 0.32; pointer-events: none; }

.alc-attempts { display: flex; flex-direction: column; gap: 7px; margin-bottom: 14px; }
.alc-attempt-row { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; }
.alc-chip {
  padding: 5px 12px;
  border-radius: var(--r-pill);
  font-size: 0.82rem;
  font-weight: 700;
}
.alc-chip.green  { background: var(--tile-green); color: var(--ink-950); }
.alc-chip.yellow { background: var(--tile-yellow); color: var(--ink-950); }
.alc-chip.gray   { background: var(--tile-gray); color: var(--text-lo); }

/* 3. CONVERGE */
.seed-box {
  text-align: center;
  padding: 22px 20px;
  border-radius: var(--r-md);
  background: linear-gradient(155deg, var(--converge-card-hi) 0%, var(--converge-card) 100%);
  border: 1px solid rgba(169, 237, 255, 0.32);
  margin-bottom: 16px;
}
.seed-word { font-family: var(--font-display); font-size: 2.2rem; font-weight: 700; margin: 6px 0 4px; }
.converge-history { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.converge-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  background: rgba(10, 7, 16, 0.42);
  border: 1px solid var(--stroke-1);
  border-radius: var(--r-sm);
  padding: 12px 14px;
}
.converge-row.matched { border-color: var(--wordle); background: rgba(98, 209, 131, 0.16); }
.converge-word { font-family: var(--font-display); font-size: 1.18rem; font-weight: 700; text-align: center; }
.converge-round-pill {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--cream);
  background: var(--glass-2);
  border: 1px solid var(--stroke-1);
  padding: 4px 10px;
  border-radius: var(--r-pill);
}
.inline-form { display: flex; gap: 8px; }

/* 4. SPLIT WORDLE */
.wordle-board { display: grid; gap: 8px; max-width: 320px; margin: 0 auto 14px; }
.wordle-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.wordle-tile {
  aspect-ratio: 1;
  border-radius: 12px;
  border: 1.5px solid var(--stroke-2);
  background: rgba(10, 7, 16, 0.48);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  text-transform: uppercase;
  transition: transform 0.14s var(--ease-out), background 0.22s;
}
.wordle-tile.filled { border-color: var(--cream); transform: scale(1.03); }
.wordle-tile.draft-dot { border-color: rgba(243, 234, 214, 0.32); color: var(--text-lo); font-size: 1.1rem; }
.wordle-tile.green  { background: var(--tile-green);  border-color: var(--tile-green);  color: var(--ink-950); }
.wordle-tile.yellow { background: var(--tile-yellow); border-color: var(--tile-yellow); color: var(--ink-950); }
.wordle-tile.gray   { background: var(--tile-gray);   border-color: transparent;        color: var(--text-lo); }

.signal-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-bottom: 14px;
}
.signal-chip {
  background: var(--glass-2);
  border: 1px solid var(--stroke-1);
  color: var(--cream);
  border-radius: var(--r-pill);
  padding: 5px 11px;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
}
.signal-chip:hover { border-color: var(--stroke-hi); background: var(--glass-3); }

.signal-feed {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-bottom: 12px;
}

.kb { display: flex; flex-direction: column; gap: 7px; max-width: 480px; margin: 0 auto; }
.kb-row { display: flex; justify-content: center; gap: 5px; }
.kb-key {
  background: var(--ink-600);
  color: var(--text-hi);
  border: 1px solid var(--stroke-1);
  border-radius: 10px;
  height: 45px;
  min-width: 28px;
  flex: 1;
  max-width: 44px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  touch-action: manipulation;
  box-shadow: 0 2px 0 rgba(4, 2, 8, 0.55);
}
.kb-key:disabled { opacity: 0.45; cursor: not-allowed; }
.kb-key.wide { max-width: 70px; font-size: 0.75rem; }
.kb-key.green  { background: var(--tile-green);  color: var(--ink-950); border-color: transparent; }
.kb-key.yellow { background: var(--tile-yellow); color: var(--ink-950); border-color: transparent; }
.kb-key.gray   { background: var(--ink-800);     color: var(--text-faint); }

/* 5. TITLE TWISTER */
.clue-box {
  background: linear-gradient(155deg, rgba(115, 66, 22, 0.65) 0%, rgba(88, 49, 15, 0.55) 100%);
  border: 1px solid rgba(255, 217, 160, 0.28);
  border-radius: var(--r-md);
  padding: 20px;
  margin-bottom: 16px;
}
.literal-title { font-family: var(--font-display); font-size: 1.7rem; font-weight: 700; line-height: 1.2; margin: 8px 0 10px; }
.clue-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; align-items: center; }
.clue-chip {
  background: rgba(10, 7, 16, 0.42);
  border: 1px solid var(--stroke-2);
  border-radius: var(--r-pill);
  padding: 5px 13px;
  font-size: 0.84rem;
  color: var(--cream);
}
.tts-btn {
  background: rgba(243, 234, 214, 0.14);
  border: 1px solid var(--stroke-2);
  color: var(--cream);
  border-radius: var(--r-pill);
  padding: 5px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}
.tts-btn:hover { background: rgba(243, 234, 214, 0.24); }

.guess-list { display: flex; flex-direction: column; gap: 7px; margin-top: 14px; }
.guess-item { padding: 10px 14px; border-radius: var(--r-sm); background: rgba(10, 7, 16, 0.42); font-size: 0.92rem; display: flex; justify-content: space-between; }
.guess-item.ok { border: 1px solid var(--wordle); color: var(--wordle-soft); }
.guess-item.no { border: 1px solid rgba(255, 107, 122, 0.35); color: #ffb3bc; }

/* 6. TWO REAL, ONE FAKE */
.proverb-list { display: flex; flex-direction: column; gap: 11px; margin: 14px 0 18px; }
.proverb-card {
  text-align: left;
  width: 100%;
  background: rgba(10, 7, 16, 0.45);
  border: 1px solid var(--stroke-2);
  border-radius: var(--r-md);
  padding: 16px 18px;
  color: var(--text-hi);
  font-family: var(--font-body);
  font-size: 0.96rem;
  line-height: 1.48;
  transition: border-color var(--dur-fast), transform var(--dur-fast) var(--ease-out), background var(--dur-fast);
}
.proverb-card.selectable { cursor: pointer; }
.proverb-card.selectable:hover { border-color: var(--proverbs); background: rgba(115, 38, 74, 0.35); transform: translateY(-2px); }
.proverb-card.is-fake { border-color: var(--proverbs); background: linear-gradient(155deg, rgba(115, 38, 74, 0.52) 0%, rgba(90, 29, 56, 0.38) 100%); }
.proverb-card.is-real { border-color: rgba(98, 209, 131, 0.48); background: rgba(31, 92, 56, 0.3); }
.proverb-note { margin-top: 10px; font-size: 0.83rem; color: var(--text-mid); border-top: 1px solid var(--stroke-1); padding-top: 9px; }

/* CHAT DRAWER */
.chat-drawer {
  position: fixed;
  right: 16px;
  bottom: 16px;
  width: min(350px, calc(100vw - 32px));
  height: 430px;
  background: var(--ink-800);
  border: 1px solid var(--stroke-2);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  z-index: 50;
  overflow: hidden;
}
.chat-header { padding: 13px 16px; border-bottom: 1px solid var(--stroke-1); display: flex; align-items: center; justify-content: space-between; font-family: var(--font-display); }
.chat-messages { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 9px; }
.chat-bubble { max-width: 85%; padding: 9px 13px; border-radius: 16px; font-size: 0.87rem; background: var(--ink-700); border: 1px solid var(--stroke-1); align-self: flex-start; }
.chat-bubble.self { background: var(--cream); color: var(--on-cream); border-color: transparent; align-self: flex-end; }
.chat-bubble .sender { font-size: 0.7rem; opacity: 0.7; font-weight: 600; margin-bottom: 2px; }
.chat-form { display: flex; gap: 7px; padding: 10px; border-top: 1px solid var(--stroke-1); background: var(--ink-850); }

.toast {
  position: fixed;
  top: 72px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--cream);
  color: var(--on-cream);
  padding: 10px 20px;
  border-radius: var(--r-pill);
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  z-index: 60;
}

[hidden] { display: none !important; }

@media (max-width: 580px) {
  .preview-grid, .games-grid { grid-template-columns: 1fr; }
  .players-strip { gap: 8px; }
  .player-chip { padding: 10px 12px; }
  .kb-key { height: 43px; font-size: 0.8rem; }
  .hero h1 { font-size: 2.25rem; }
}
