:root {
  --bg0: #0c0805;
  --bg1: #1c120a;
  --gold: #f0d08a;
  --gold2: #b8893a;
  --teal: #3fd0c9;
  --ink: #fff6e8;
  --muted: rgba(255, 246, 232, 0.68);
  --glass: rgba(18, 12, 8, 0.62);
  --line: rgba(240, 208, 138, 0.42);
  --danger: #ff8f70;
  /* CDN fonts preferred; system stack = offline / store airplane-mode fallback */
  --font: "Fredoka", "Lexend", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ui: "Lexend", "Fredoka", system-ui, -apple-system, "Segoe UI", sans-serif;
  --tile-font: "Fredoka", "Lexend", system-ui, -apple-system, "Segoe UI", sans-serif;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --bg-globe: url("../assets/world-tr.jpg");
  --bg-home: url("../assets/home-hero-bg.jpg");
  --bg-map: url("../assets/bg-map.jpg");
  --bg-play: url("../assets/play-adana.jpg");
  --bg-win: url("../assets/win-adana.png");
  --bg-burst: url("../assets/win-adana.png");
}

* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; overflow: hidden;
  background: #03050c;
  color: var(--ink);
  font-family: var(--ui);
  -webkit-user-select: none; user-select: none;
  touch-action: none;
}
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
body.ey-intro-on { background: #03050c; }

/* —— Shared 3EY brand intro (bloom-blocks / unity-3ey-brand) —— */
.ey-intro {
  position: fixed; inset: 0; z-index: 1000; overflow: hidden;
  --u: min(calc(100vw / 1080), calc(100dvh / 1920));
  background: linear-gradient(180deg, #0a1228, #03050c);
  font-family: var(--ui); user-select: none; -webkit-user-select: none; touch-action: none;
}
.ey-intro > * { position: absolute; left: 50%; top: 50%; pointer-events: none; }
.ey-spot {
  width: calc(1700 * var(--u)); height: calc(1700 * var(--u));
  transform: translate(-50%, calc(-50% - 130 * var(--u)));
  background: radial-gradient(closest-side, #345cc8, rgba(52,92,200,.35) 30%, rgba(52,92,200,.08) 62%, transparent);
  opacity: 0;
}
.ey-intro > .ey-vignette {
  left: calc(-200 * var(--u)); top: calc(-200 * var(--u));
  right: calc(-200 * var(--u)); bottom: calc(-200 * var(--u));
  background: radial-gradient(farthest-corner, transparent 35%, rgba(0,0,0,.59));
}
.ey-shadow {
  width: calc(399 * var(--u)); height: calc(70 * var(--u));
  transform: translate(-50%, calc(-50% + 98 * var(--u)));
  background: radial-gradient(closest-side, #000, rgba(0,0,0,.3) 45%, transparent); opacity: 0;
}
.ey-logo {
  width: calc(420 * var(--u)); height: calc(420 * var(--u));
  transform: translate(-50%, calc(-50% - 130 * var(--u))) scale(var(--s, 1));
  overflow: hidden;
  -webkit-mask: url(../brand/3ey-logo.webp) center / contain no-repeat;
  mask: url(../brand/3ey-logo.webp) center / contain no-repeat;
}
.ey-glass { position: absolute; inset: 0; background: url(../brand/3ey-logo.webp) center / contain no-repeat; opacity: 0; }
.ey-sweep {
  position: absolute; left: 50%; top: 50%;
  width: calc(150 * var(--u)); height: calc(900 * var(--u));
  transform: translate(-50%, -50%) translateX(calc(var(--x, -520) * var(--u))) rotate(20deg);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.08) 25%, rgba(255,255,255,.32) 50%, rgba(255,255,255,.08) 75%, transparent);
}
.ey-rim {
  position: absolute; inset: 0;
  background: url(../brand/3ey-rim.webp) center / contain no-repeat; opacity: 0;
  -webkit-mask: conic-gradient(#000 var(--fill, 0deg), transparent 0);
  mask: conic-gradient(#000 var(--fill, 0deg), transparent 0);
}
.ey-intro > .ey-rim-bloom {
  inset: auto; left: 50%; top: 50%;
  width: calc(462 * var(--u)); height: calc(462 * var(--u));
  transform: translate(-50%, calc(-50% - 130 * var(--u))) scale(var(--s, 1));
}
.ey-word, .ey-url { color: #fff; white-space: nowrap; line-height: 1; opacity: 0; }
.ey-word {
  font-size: calc(50 * var(--u)); font-weight: 700; letter-spacing: .28em; padding-left: .28em;
  transform: translate(-50%, calc(-50% - var(--y, -170) * var(--u)));
}
.ey-divider {
  width: calc(var(--w, 0) * var(--u)); height: max(1px, calc(2 * var(--u)));
  transform: translate(-50%, calc(-50% + 228 * var(--u)));
  background: rgba(255,255,255,.28);
}
.ey-url {
  font-size: calc(28 * var(--u)); font-weight: 600; letter-spacing: .08em; padding-left: .08em;
  transform: translate(-50%, calc(-50% + 268 * var(--u)));
}
.ey-boot .ey-logo { /* static cover before JS */ }

/* —— Settings (profile) —— */
.settings-screen {
  gap: 0;
  padding-bottom: 0;
}
.settings-ambient {
  position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
}
.settings-amb-glow {
  position: absolute; left: 50%; top: -8%;
  width: 120%; height: 42%;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center, rgba(240,208,138,.22), rgba(63,208,201,.06) 42%, transparent 70%);
}
.settings-amb-ring {
  position: absolute; left: 50%; top: 12%;
  width: min(78vw, 320px); height: min(78vw, 320px);
  transform: translate(-50%, 0);
  border-radius: 50%;
  border: 1px solid rgba(240,208,138,.12);
  box-shadow: inset 0 0 60px rgba(240,208,138,.05);
}
.settings-top {
  position: relative; z-index: 2;
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.settings-back {
  width: 44px; height: 44px; border-radius: 14px;
  display: grid; place-items: center;
  font-size: 28px; line-height: 1;
  color: var(--gold);
  background: rgba(18,12,8,.55);
  border: 1px solid var(--line);
}
.settings-top-copy h2 {
  margin: 0; font-family: var(--font); font-size: 1.45rem; color: var(--ink);
}
.settings-kicker {
  margin: 0 0 2px;
  font-size: 11px; font-weight: 800; letter-spacing: .16em;
  text-transform: uppercase; color: var(--gold);
}
.settings-scroll {
  position: relative; z-index: 2;
  flex: 1;
  overflow: auto;
  touch-action: pan-y;
  padding: 4px 0 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.settings-hero {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: center;
  padding: 16px;
  border-radius: 22px;
  background:
    linear-gradient(145deg, rgba(240,208,138,.16), rgba(18,12,8,.2) 38%, rgba(8,6,4,.72)),
    rgba(16,10,6,.78);
  border: 1px solid rgba(240,208,138,.38);
  box-shadow: 0 18px 40px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,246,232,.08);
}
.settings-hero-avatar {
  position: relative;
  width: 88px; height: 88px;
  border-radius: 28px;
  padding: 0;
  border: 1px solid rgba(240,208,138,.5);
  background: rgba(0,0,0,.25);
  overflow: hidden;
}
.settings-av {
  display: grid; place-items: center;
  width: 100%; height: 100%;
  font-family: var(--font);
  font-size: 2.2rem; font-weight: 700;
  color: #1a1008;
}
.settings-av-edit {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 4px 0 5px;
  font-size: 10px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase;
  color: #1a1008;
  background: linear-gradient(180deg, rgba(240,208,138,.0), rgba(240,208,138,.92));
}
.settings-hero-meta { min-width: 0; }
.settings-name-btn {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  text-align: left; width: 100%; padding: 0;
}
.settings-name-btn strong {
  font-family: var(--font);
  font-size: 1.35rem; font-weight: 700;
  color: var(--ink);
}
.settings-name-btn span {
  font-size: 12px; color: var(--gold); font-weight: 600;
}
.settings-stat-row {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: 10px;
}
.settings-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 12px; font-weight: 700;
  color: var(--ink);
  background: rgba(0,0,0,.28);
  border: 1px solid rgba(240,208,138,.22);
}
.settings-panel {
  padding: 16px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(63,208,201,.1), rgba(12,8,5,.86));
  border: 1px solid rgba(63,208,201,.28);
  box-shadow: 0 14px 36px rgba(0,0,0,.28);
}
.settings-panel[hidden] { display: none !important; }
.settings-panel-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
}
.settings-panel-kicker {
  margin: 0 0 2px;
  font-size: 10px; font-weight: 800; letter-spacing: .14em;
  text-transform: uppercase; color: var(--teal);
}
.settings-panel-head h3 {
  margin: 0; font-family: var(--font); font-size: 1.15rem;
}
.settings-badge {
  flex: 0 0 auto;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11px; font-weight: 800;
  color: #1a1008;
  background: linear-gradient(180deg, #f0d08a, #c9a15a);
}
.settings-badge.on {
  color: #042a28;
  background: linear-gradient(180deg, #7af0e8, #3fd0c9);
}
.settings-panel-body {
  margin: 10px 0 14px;
  font-size: 13px; line-height: 1.45;
  color: var(--muted);
}
.settings-auth-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.settings-auth {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px;
  border-radius: 14px;
  font-weight: 700;
  border: 1px solid rgba(255,255,255,.14);
}
.settings-auth.apple {
  background: #111; color: #fff;
}
.settings-auth.google {
  background: rgba(255,246,232,.96); color: #1a1008;
}
.settings-link {
  margin-top: 12px;
  width: 100%;
  text-align: center;
  font-size: 12px; font-weight: 600;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.settings-link.danger-link { color: var(--danger); }
.settings-group-title {
  margin: 0 0 8px;
  padding-left: 4px;
  font-size: 11px; font-weight: 800; letter-spacing: .14em;
  text-transform: uppercase; color: rgba(240,208,138,.72);
}
.settings-list {
  display: grid; gap: 8px;
}
.settings-row {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 12px 12px 10px;
  text-align: left;
  border-radius: 16px;
  background: rgba(18,12,8,.72);
  border: 1px solid rgba(240,208,138,.22);
  box-shadow: inset 0 1px 0 rgba(255,246,232,.04);
}
.settings-row:active { transform: scale(.985); }
.settings-row-ico {
  display: grid; place-items: center;
  width: 42px; height: 42px;
  border-radius: 13px;
  font-size: 16px; font-weight: 700;
  color: var(--gold);
  background: rgba(240,208,138,.1);
  border: 1px solid rgba(240,208,138,.2);
}
.settings-row-copy {
  display: flex; flex-direction: column; gap: 2px; min-width: 0;
}
.settings-row-copy strong {
  font-size: 15px; font-weight: 700; color: var(--ink);
}
.settings-row-copy small {
  font-size: 12px; color: var(--muted);
}
.settings-row-chev {
  color: rgba(240,208,138,.55);
  font-size: 22px; line-height: 1;
}
.settings-list.danger .settings-row,
.settings-row.danger {
  border-color: rgba(255,143,112,.35);
  background: rgba(40,12,8,.55);
}
.settings-row.danger .settings-row-ico {
  color: var(--danger);
  background: rgba(255,143,112,.1);
  border-color: rgba(255,143,112,.28);
}
.settings-danger-stack {
  display: grid;
  gap: 10px;
}
.settings-danger-btn {
  width: 100%;
  min-height: 52px;
  padding: 14px 16px;
  border-radius: 16px;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .01em;
  color: #ffd2c4;
  background: rgba(48,14,10,.88);
  border: 1.5px solid rgba(255,143,112,.55);
  box-shadow: 0 8px 20px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,200,180,.12);
}
.settings-danger-btn.solid {
  color: #1a0806;
  background: linear-gradient(180deg, #ffb39a, #e86a4f 55%, #c44a34);
  border-color: rgba(255,210,190,.55);
  box-shadow: 0 8px 0 #6a2418, 0 14px 28px rgba(0,0,0,.4);
}
.settings-danger-btn:active {
  transform: translateY(2px);
  box-shadow: 0 4px 0 #6a2418, 0 8px 16px rgba(0,0,0,.35);
}
.settings-danger-btn:not(.solid):active {
  box-shadow: 0 4px 12px rgba(0,0,0,.3), inset 0 1px 0 rgba(255,200,180,.1);
}
.settings-danger-note {
  margin: 2px 2px 0;
  font-size: 11px;
  line-height: 1.4;
  font-weight: 600;
  color: rgba(255,246,232,.42);
}
.settings-brand {
  margin: 8px 0 4px;
  text-align: center;
  font-size: 12px;
  color: rgba(255,246,232,.38);
  letter-spacing: .04em;
}

/* Smoke tour: photo-first — tiny HUD, real backgrounds fully visible */
body.smoke-tour .play-bg-veil {
  background: linear-gradient(180deg, rgba(8,6,4,.08) 0%, rgba(8,6,4,.18) 50%, rgba(8,6,4,.42) 100%);
}
body.smoke-tour #crossword,
body.smoke-tour #foundStrip,
body.smoke-tour #wordMeter,
body.smoke-tour .play-boosters,
body.smoke-tour #board,
body.smoke-tour #pathOut {
  opacity: 0.28;
  pointer-events: none;
}
#smokePanel {
  position: fixed;
  top: calc(10px + var(--safe-t, 0px));
  left: 10px;
  right: 10px;
  z-index: 2000;
  pointer-events: none;
  display: flex;
  justify-content: center;
}
#smokePanel .smoke-card {
  pointer-events: auto;
  max-width: min(420px, 94vw);
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(12, 8, 5, .72);
  border: 1px solid rgba(240, 208, 138, .45);
  color: #f5e6c8;
  font-family: var(--ui);
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
}
#smokePanel b {
  display: inline; font-family: var(--font); font-size: 11px;
  letter-spacing: .14em; color: var(--gold); margin-right: 8px;
}
#smokePanel #smokeLine {
  display: inline; margin: 0; font-size: 12px; font-weight: 700;
}
#smokePanel .smoke-bar {
  height: 4px; border-radius: 999px; background: rgba(255,255,255,.1);
  overflow: hidden; margin-top: 6px;
}
#smokePanel .smoke-bar i {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, #c9963a, #f0d08a);
  border-radius: inherit; transition: width .25s linear;
}
#smokePanel #smokeLog { display: none; }
#smokePanel #smokeClose {
  position: absolute; right: 8px; top: 6px;
  width: auto; min-height: 0; padding: 4px 8px;
  border-radius: 8px; border: 0; font-size: 11px; font-weight: 800;
  cursor: pointer; background: rgba(240,208,138,.9); color: #1a1206;
}
.game-reveal { background: linear-gradient(180deg, #1a120a, #060403); }
.game-reveal-logo {
  position: absolute; left: 50%; top: 48%; width: min(78vw, 320px);
  transform: translate(-50%, -50%) scale(.92); opacity: 0;
  filter: drop-shadow(0 18px 36px rgba(0,0,0,.55));
}
.game-reveal-logo img { width: 100%; height: auto; display: block; }
.game-reveal-tag {
  position: absolute; left: 50%; top: 62%;
  transform: translate(-50%, -50%);
  font-family: var(--font); font-weight: 700; font-size: 14px;
  letter-spacing: .28em; color: var(--gold); opacity: 0;
}

.screen {
  position: absolute; inset: 0; display: none; flex-direction: column;
  padding: calc(14px + var(--safe-t)) 16px calc(14px + var(--safe-b));
  isolation: isolate;
}
.screen.active { display: flex; }
.screen::before {
  content: ""; position: absolute; inset: 0; z-index: -2;
  background:
    radial-gradient(100% 70% at 50% -10%, rgba(184,137,58,.22), transparent 50%),
    linear-gradient(180deg, #2a1a0c 0%, #120c08 45%, #0c0805 100%);
}

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; z-index: 2; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 12px; border-radius: 999px;
  background: linear-gradient(180deg, rgba(40,28,16,.82), rgba(18,12,8,.88));
  border: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.08);
  backdrop-filter: blur(12px); font-weight: 700; font-size: 13px;
}
.plate {
  font-family: var(--tile-font); font-weight: 700; letter-spacing: .04em;
  padding: 11px 16px; border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.35), transparent 40%),
    linear-gradient(180deg, #f7e4ad, #c9963a 55%, #8a6124);
  color: #1a1206;
  box-shadow: 0 10px 28px rgba(201,150,58,.4), inset 0 -2px 0 rgba(0,0,0,.25), inset 0 1px 0 rgba(255,255,255,.55);
  min-width: 124px; text-align: center;
}
h1, h2 { font-family: var(--font); font-weight: 700; margin: 0; position: relative; z-index: 2; }
h1 { font-size: clamp(34px, 8.5vw, 48px); letter-spacing: .02em; text-shadow: 0 10px 40px rgba(0,0,0,.55); }
h2 { font-size: 28px; color: var(--gold); text-shadow: 0 0 24px rgba(240,208,138,.25); }
.sub { color: var(--muted); font-size: 14px; line-height: 1.45; margin: 8px 0 0; position: relative; z-index: 2; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 54px; padding: 0 18px; border-radius: 16px; font-weight: 800;
  transition: transform .12s ease;
}
.btn:active { transform: scale(.98); }
.btn-primary {
  background: linear-gradient(180deg, rgba(255,255,255,.35), transparent 38%), linear-gradient(180deg, #f3d591, #b8893a 60%, #7a5420);
  color: #1a1206;
  box-shadow: 0 14px 34px rgba(184,137,58,.42), inset 0 1px 0 rgba(255,255,255,.5);
}
.btn-ghost {
  background: rgba(12,8,5,.5); border: 1px solid var(--line); color: var(--ink);
  backdrop-filter: blur(10px);
}
.btn-row { display: grid; gap: 10px; position: relative; z-index: 2; }
.btn-row.two { grid-template-columns: 1fr 1fr; }

.avatar {
  width: 40px; height: 40px; border-radius: 50%;
  border: 2px solid var(--gold); display: grid; place-items: center;
  font-weight: 800; font-size: 14px; color: #1a1206;
  box-shadow: 0 0 0 3px rgba(240,208,138,.15), 0 8px 20px rgba(0,0,0,.4);
  overflow: hidden;
  flex-shrink: 0;
}
.avatar.has-photo,
.settings-av.has-photo {
  color: transparent;
  text-shadow: none;
}

/* —— Title screen (one composition) —— */
#world.world-home {
  padding-left: 18px; padding-right: 18px;
  justify-content: space-between;
  overflow: hidden;
}
#world.world-home::before { background: #060403; }

.home-ambient {
  position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
}
.home-amb-pan {
  position: absolute; inset: -8% -10%;
  background:
    linear-gradient(180deg, rgba(6,4,3,.18) 0%, rgba(6,4,3,.5) 40%, rgba(6,4,3,.9) 72%, #060403 100%),
    var(--bg-home) center 40% / cover no-repeat;
  animation: homePan 28s ease-in-out infinite alternate;
  will-change: transform;
}
@keyframes homePan {
  from { transform: scale(1.08) translate3d(-2.5%, 1%, 0); }
  to   { transform: scale(1.14) translate3d(2.5%, -1.5%, 0); }
}
.home-amb-glow {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 80% 45% at 50% 22%, rgba(240,208,138,.22), transparent 62%),
    radial-gradient(ellipse 60% 40% at 20% 70%, rgba(184,100,40,.14), transparent 55%),
    radial-gradient(ellipse 50% 35% at 85% 55%, rgba(240,180,80,.1), transparent 50%);
  animation: homeGlow 9s ease-in-out infinite alternate;
}
@keyframes homeGlow {
  from { opacity: .75; filter: hue-rotate(-6deg); }
  to   { opacity: 1; filter: hue-rotate(8deg); }
}
.home-amb-bokeh {
  position: absolute; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,220,140,.55), rgba(255,180,60,.12) 45%, transparent 70%);
  filter: blur(2px);
  mix-blend-mode: screen;
}
.home-amb-bokeh.b1 {
  width: 120px; height: 120px; left: 8%; top: 58%;
  animation: bokehDrift 14s ease-in-out infinite;
}
.home-amb-bokeh.b2 {
  width: 80px; height: 80px; right: 12%; top: 42%;
  animation: bokehDrift 18s ease-in-out infinite reverse;
  animation-delay: -4s;
}
.home-amb-bokeh.b3 {
  width: 160px; height: 160px; left: 42%; bottom: 18%;
  opacity: .55;
  animation: bokehDrift 22s ease-in-out infinite;
  animation-delay: -9s;
}
@keyframes bokehDrift {
  0%   { transform: translate3d(0, 0, 0) scale(1); opacity: .35; }
  40%  { transform: translate3d(28px, -36px, 0) scale(1.12); opacity: .7; }
  70%  { transform: translate3d(-18px, -18px, 0) scale(.92); opacity: .45; }
  100% { transform: translate3d(0, 0, 0) scale(1); opacity: .35; }
}
.home-dust {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: .9;
  mask-image: linear-gradient(180deg, transparent 0%, #000 8%, #000 88%, transparent 100%);
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 8%, #000 88%, transparent 100%);
}
@media (prefers-reduced-motion: reduce) {
  .home-amb-pan, .home-amb-glow, .home-amb-bokeh, .title-logo { animation: none !important; }
  .home-dust { display: none; }
}
.pill.bank { font-variant-numeric: tabular-nums; }
.home-top { margin-bottom: 0; position: relative; z-index: 2; }

.title-stack {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; z-index: 2; min-height: 0; gap: 10px;
  animation: titleIn .7s cubic-bezier(.2,.85,.2,1) both;
}
@keyframes titleIn {
  from { opacity: 0; transform: translateY(22px); }
  to { opacity: 1; transform: translateY(0); }
}
.title-logo {
  width: min(86vw, 340px); height: auto;
  filter: drop-shadow(0 22px 36px rgba(0,0,0,.65)) drop-shadow(0 0 28px rgba(240,208,138,.22));
  animation: logoPulse 4.5s ease-in-out infinite;
  opacity: 0;
  transform: translateY(8px) scale(0.96);
  transition: opacity .55s ease, transform .55s ease;
}
body.launch-ready .title-logo {
  opacity: 1;
  transform: translateY(0) scale(1);
  animation: logoPulse 4.5s ease-in-out 0.55s infinite;
}
@keyframes logoPulse {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-4px) scale(1.015); }
}
.title-line {
  margin: 4px 0 0; font-family: var(--font); font-size: clamp(20px, 5.4vw, 26px);
  letter-spacing: .08em; color: var(--gold);
  text-shadow: 0 4px 24px rgba(0,0,0,.55);
}
.title-meta {
  margin: 0; font-size: 13px; font-weight: 700; letter-spacing: .04em;
  color: var(--muted);
}

.title-actions {
  display: grid; gap: 12px; width: 100%; z-index: 2; margin: 10px 0 16px;
}
.btn-play {
  position: relative; width: 100%; min-height: 64px; border-radius: 20px; font-weight: 800;
  font-family: var(--font); font-size: 22px; letter-spacing: .22em; color: #1a1206;
  background:
    linear-gradient(180deg, #fff8e4 0%, #f7e4ad 28%, #e0b86a 62%, #b8893a 100%);
  border: 2px solid rgba(255,246,232,.55);
  box-shadow:
    0 0 0 1px rgba(184,137,58,.55),
    0 10px 0 #6a4a1a,
    0 18px 40px rgba(0,0,0,.45),
    0 0 48px rgba(240,208,138,.45),
    inset 0 2px 0 rgba(255,255,255,.75);
  animation: playPulse 2.2s ease-in-out infinite;
}
.btn-play::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,.35) 50%, transparent 60%);
  background-size: 220% 100%;
  animation: playShine 3.2s ease-in-out infinite;
}
@keyframes playPulse {
  0%, 100% { transform: translateY(0) scale(1); box-shadow: 0 0 0 1px rgba(184,137,58,.55), 0 10px 0 #6a4a1a, 0 18px 40px rgba(0,0,0,.45), 0 0 40px rgba(240,208,138,.4), inset 0 2px 0 rgba(255,255,255,.75); }
  50% { transform: translateY(-2px) scale(1.015); box-shadow: 0 0 0 2px rgba(255,230,160,.7), 0 12px 0 #6a4a1a, 0 22px 48px rgba(0,0,0,.5), 0 0 64px rgba(240,208,138,.65), inset 0 2px 0 rgba(255,255,255,.8); }
}
@keyframes playShine {
  0%, 55% { background-position: 120% 0; opacity: 0; }
  60% { opacity: 1; }
  85%, 100% { background-position: -40% 0; opacity: 0; }
}
.btn-play:active { animation: none; transform: translateY(3px) scale(.98); box-shadow: 0 0 0 1px rgba(184,137,58,.55), 0 4px 0 #6a4a1a, 0 8px 20px rgba(0,0,0,.4), inset 0 2px 0 rgba(255,255,255,.55); }
.btn-continue {
  width: 100%; min-height: 50px; border-radius: 16px; font-weight: 800; font-size: 15px;
  color: #fff6e8;
  background:
    linear-gradient(180deg, rgba(60,42,22,.92), rgba(18,12,8,.95));
  border: 1.5px solid rgba(240,208,138,.55);
  box-shadow:
    0 8px 24px rgba(0,0,0,.4),
    0 0 24px rgba(240,208,138,.18),
    inset 0 1px 0 rgba(255,255,255,.12);
  backdrop-filter: blur(12px);
}
.btn-continue span {
  color: #f7e4ad;
  text-shadow: 0 0 12px rgba(240,208,138,.45);
}

.home-dock {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  z-index: 2; margin-top: auto;
}
.home-dock button {
  padding: 13px 4px; border-radius: 16px; font-size: 12px; font-weight: 800;
  letter-spacing: .02em; color: #f0d08a;
  background:
    linear-gradient(180deg, rgba(55,38,20,.88), rgba(16,10,6,.92));
  border: 1.5px solid rgba(240,208,138,.42);
  box-shadow:
    0 6px 18px rgba(0,0,0,.35),
    inset 0 1px 0 rgba(255,255,255,.1);
  backdrop-filter: blur(10px);
  transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease;
}
.home-dock button:active {
  transform: scale(.96);
  border-color: rgba(240,208,138,.75);
  box-shadow: 0 0 20px rgba(240,208,138,.35);
}
@media (prefers-reduced-motion: reduce) {
  .btn-play, .btn-play::after { animation: none !important; }
}

/* Hub — lux map + province cards */
#hub.hub-screen::before {
  background:
    radial-gradient(ellipse 90% 50% at 50% -5%, rgba(240,208,138,.2), transparent 55%),
    linear-gradient(180deg, #1c120a 0%, #0c0805 55%, #060403 100%);
}
.hub-top { margin-bottom: 4px; }
.hub-progress-pill { font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.hub-hero {
  z-index: 2; text-align: center; margin: 2px 0 8px;
}
.hub-hero h2 {
  font-size: clamp(28px, 7vw, 36px); letter-spacing: .06em;
  background: linear-gradient(180deg, #fff6e8, #f0d08a 55%, #c9963a);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: none; filter: drop-shadow(0 6px 18px rgba(0,0,0,.45));
}
.hub-hero-sub {
  margin: 4px 0 0; font-size: 13px; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
}
.hub-map {
  position: relative; height: min(42vh, 340px); min-height: 240px;
  margin: 0 0 10px; border-radius: 26px; overflow: hidden;
  border: 1.5px solid rgba(240,208,138,.5);
  box-shadow:
    0 0 0 1px rgba(0,0,0,.45),
    0 26px 56px rgba(0,0,0,.6),
    0 0 40px rgba(240,208,138,.12),
    inset 0 1px 0 rgba(255,255,255,.12);
  background:
    radial-gradient(ellipse 80% 60% at 50% 40%, rgba(240,208,138,.18), transparent 62%),
    linear-gradient(160deg, #2a1c10 0%, #120c08 55%, #080504 100%);
}
.hub-map .map-frame {
  position: absolute; inset: 7px; border-radius: 20px; pointer-events: none; z-index: 2;
  border: 1px solid rgba(240,208,138,.16);
  box-shadow: inset 0 0 48px rgba(0,0,0,.4);
}
.hub-map .map-glow {
  position: absolute; inset: 4% 2% 16%;
  background: radial-gradient(ellipse at 50% 55%, rgba(240,208,138,.32), transparent 58%);
  pointer-events: none; z-index: 1; animation: mapGlow 5s ease-in-out infinite alternate;
}
@keyframes mapGlow {
  from { opacity: .65; }
  to { opacity: 1; }
}
.hub-map .map-art {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; object-position: center 42%;
  pointer-events: none; user-select: none;
  filter: saturate(1.05) contrast(1.08) brightness(.92);
  transform: scale(1.02);
}
.hub-map .map-svg {
  position: absolute; left: 3%; right: 3%; top: 3%; bottom: 15%;
  width: 94%; height: 80%;
  object-fit: contain; object-position: center;
  filter: drop-shadow(0 10px 22px rgba(0,0,0,.55));
  opacity: .42; mix-blend-mode: screen;
  pointer-events: none; user-select: none; z-index: 1;
}
.map-dots { position: absolute; inset: 3% 3% 15%; pointer-events: none; z-index: 3; }
.map-dot {
  position: absolute; width: 8px; height: 8px; margin: -4px 0 0 -4px;
  border-radius: 50%; background: rgba(240,208,138,.55);
  box-shadow: 0 0 0 2px rgba(12,8,5,.5), 0 0 10px rgba(240,208,138,.25);
}
.map-dot.on {
  width: 11px; height: 11px; margin: -5.5px 0 0 -5.5px;
  background: #fff6e8;
  box-shadow: 0 0 0 3px rgba(240,208,138,.45), 0 0 20px rgba(240,208,138,.75);
}
.map-dot.done { background: #3fd0c9; box-shadow: 0 0 0 2px rgba(12,8,5,.45), 0 0 12px rgba(63,208,201,.5); }
.hub-pin {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, calc(-100% - 12px));
  z-index: 5; text-align: center; pointer-events: none;
  padding: 10px 14px 12px; border-radius: 16px;
  background: linear-gradient(180deg, rgba(40,28,16,.95), rgba(12,8,5,.96));
  border: 1.5px solid #f0d08a;
  box-shadow: 0 14px 32px rgba(0,0,0,.55), 0 0 28px rgba(240,208,138,.25);
  backdrop-filter: blur(12px); min-width: 140px;
  transition: left .35s ease, top .35s ease;
}
.hub-pin b { display: block; color: #f7e4ad; font-family: var(--font); font-size: 16px; letter-spacing: .04em; }
.hub-pin small { color: rgba(255,246,232,.7); font-size: 11px; font-weight: 700; }
.hub-pin-dot {
  position: absolute; left: 50%; bottom: -18px; transform: translateX(-50%);
  width: 15px; height: 15px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff6e8, #c9963a 55%, #8a6124);
  border: 2px solid #f0d08a;
  box-shadow: 0 0 0 5px rgba(240,208,138,.22), 0 6px 16px rgba(0,0,0,.45);
  animation: pinPulse 1.8s ease-in-out infinite;
}
@keyframes pinPulse {
  0%, 100% { box-shadow: 0 0 0 5px rgba(240,208,138,.22), 0 6px 16px rgba(0,0,0,.45); }
  50% { box-shadow: 0 0 0 10px rgba(240,208,138,.1), 0 6px 16px rgba(0,0,0,.45); }
}
.hub-map-cta {
  position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%);
  z-index: 6; min-width: 132px; min-height: 40px; padding: 0 22px;
  border-radius: 999px; font-family: var(--font); font-weight: 800;
  font-size: 15px; letter-spacing: .16em; color: #1a1206;
  background: linear-gradient(180deg, #fff8e4, #e0b86a 55%, #b8893a);
  border: 1.5px solid rgba(255,246,232,.5);
  box-shadow: 0 8px 0 #6a4a1a, 0 14px 28px rgba(0,0,0,.45), 0 0 24px rgba(240,208,138,.35);
}
.hub-map-cta:active { transform: translateX(-50%) translateY(2px); box-shadow: 0 4px 0 #6a4a1a, 0 8px 16px rgba(0,0,0,.4); }
.hub-list-head {
  z-index: 2; display: flex; justify-content: space-between; align-items: baseline;
  margin: 0 2px 8px; font-weight: 800; font-size: 13px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--gold);
}
.hub-list-hint { font-size: 11px; color: var(--muted); letter-spacing: .04em; text-transform: none; font-weight: 700; }
.hub-list {
  flex: 1; overflow: auto; touch-action: pan-y; margin: 0 0 8px;
  display: grid; gap: 10px; z-index: 2; padding-bottom: 4px;
}
.prov {
  display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center;
  padding: 12px 12px 12px 12px; border-radius: 18px; text-align: left;
  background:
    linear-gradient(180deg, rgba(55,38,20,.88), rgba(18,12,8,.94));
  border: 1.5px solid rgba(240,208,138,.22);
  box-shadow: 0 10px 24px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.08);
  backdrop-filter: blur(10px);
}
.prov.open { border-color: rgba(240,208,138,.4); }
.prov.active {
  border-color: #f0d08a;
  box-shadow:
    0 0 0 1px rgba(240,208,138,.35),
    0 14px 32px rgba(0,0,0,.45),
    0 0 28px rgba(240,208,138,.2),
    inset 0 1px 0 rgba(255,255,255,.12);
}
.prov.locked { opacity: .55; filter: grayscale(.25); }
.prov .code {
  width: 50px; height: 50px; border-radius: 14px; display: grid; place-items: center;
  font-family: var(--font); font-size: 16px; font-weight: 800;
  background:
    linear-gradient(180deg, #fff8e4, #e0b86a 55%, #c9963a);
  color: #1a1206;
  box-shadow: 0 4px 0 #6a4a1a, inset 0 1px 0 rgba(255,255,255,.65);
}
.prov.locked .code {
  background: linear-gradient(180deg, #3a2a18, #1a120a);
  color: rgba(240,208,138,.45);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
  border: 1px solid rgba(240,208,138,.2);
}
.prov .prov-body { min-width: 0; }
.prov b { display: block; font-size: 16px; font-family: var(--font); letter-spacing: .02em; }
.prov small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; font-weight: 700; }
.prov .bar {
  margin-top: 7px; height: 5px; border-radius: 999px; overflow: hidden;
  background: rgba(0,0,0,.35); border: 1px solid rgba(240,208,138,.15);
}
.prov .bar > i {
  display: block; height: 100%; border-radius: inherit;
  background: linear-gradient(90deg, #c9963a, #f0d08a);
  box-shadow: 0 0 8px rgba(240,208,138,.45);
}
.prov .meta {
  width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center; font-size: 16px; font-weight: 800;
  color: #1a1206;
  background: linear-gradient(180deg, #fff8e4, #c9963a);
  box-shadow: 0 4px 12px rgba(0,0,0,.35);
}
.prov.locked .meta {
  background: rgba(12,8,5,.55); color: var(--muted);
  border: 1px solid rgba(240,208,138,.2); box-shadow: none;
}
.prov.done .meta {
  background: linear-gradient(180deg, #9af7f1, #1ab5ab); color: #062826;
}

.footer-nav {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: auto; z-index: 2;
}
.footer-nav button {
  padding: 12px 4px; border-radius: 16px; font-size: 11px; font-weight: 800;
  color: #f0d08a;
  background: linear-gradient(180deg, rgba(55,38,20,.88), rgba(16,10,6,.92));
  border: 1.5px solid rgba(240,208,138,.35);
  box-shadow: 0 6px 16px rgba(0,0,0,.3), inset 0 1px 0 rgba(255,255,255,.08);
}
.footer-nav button.on {
  color: #1a1206;
  background: linear-gradient(180deg, #fff8e4, #e0b86a 60%, #c9963a);
  border-color: rgba(255,246,232,.5);
  box-shadow: 0 6px 0 #6a4a1a, 0 12px 24px rgba(0,0,0,.4), 0 0 20px rgba(240,208,138,.3);
}

/* Play — city photo behind board (real <img>, no CSS url() bugs) */
#play.screen::before { background: transparent; }
.play-bg {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  overflow: hidden; background: #1a1008;
  background-size: cover;
  background-position: center;
}
.play-bg-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; object-position: center 28%;
  /* Keep color vivid so city photos don't read as old engravings */
  filter: saturate(1.25) contrast(1.06) brightness(1.08);
  animation: playBgDrift 22s ease-in-out infinite alternate;
  will-change: transform;
}
.play-bg-veil {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 80% 48% at 50% 20%, rgba(0,0,0,.55), transparent 60%),
    linear-gradient(180deg,
      rgba(0,0,0,.62) 0%,
      rgba(0,0,0,.52) 26%,
      rgba(0,0,0,.58) 55%,
      rgba(0,0,0,.82) 100%);
  pointer-events: none;
}
@keyframes playBgDrift {
  from { transform: scale(1) translate3d(0, 0, 0); }
  to   { transform: scale(1.08) translate3d(-1.2%, 1%, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .play-bg-img { animation: none; }
}
/* flex-direction only — never set display here or it overrides .screen { display:none }
   and leaves an empty play shell permanently on top of home (0/0, no wheel). */
.play-immersive {
  padding-left: 12px; padding-right: 12px;
  padding-bottom: calc(10px + var(--safe-b));
  flex-direction: column;
}
#play.screen.active {
  display: flex;
  flex-direction: column;
}
.play-top {
  display: grid; grid-template-columns: 40px 1fr auto; gap: 8px; align-items: start;
  z-index: 2; margin-bottom: 6px;
}
.play-dest {
  min-width: 0; text-align: center;
  padding: 6px 10px 8px;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(28,18,10,.72), rgba(10,7,4,.78));
  border: 1px solid rgba(240,208,138,.28);
  box-shadow: 0 10px 24px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.08);
  backdrop-filter: blur(14px) saturate(1.15);
  -webkit-backdrop-filter: blur(14px) saturate(1.15);
}
.play-top .plate {
  display: inline-flex; justify-self: center;
  margin: 0 auto;
  font-size: 14px; padding: 7px 14px;
  border-radius: 999px;
  background: linear-gradient(180deg, #fff6e0, #e4bc6a 55%, #b8893a);
  color: #1a1206;
  border: 1px solid rgba(255,246,232,.55);
  box-shadow: 0 3px 0 #6a4a1a, 0 8px 16px rgba(0,0,0,.35);
}
.play-top-right {
  display: flex; flex-direction: column; align-items: flex-end; gap: 6px;
}
.play-tool-top {
  width: 44px;
}
.play-tool-top .play-tool-ico {
  width: 44px; height: 44px; border-radius: 14px;
}
.play-tool-top .play-tool-label { display: none; }
.play-mission {
  margin: 6px 0 0;
  font-size: 11px; font-weight: 700;
  color: rgba(255,246,232,.86);
  letter-spacing: .02em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  text-shadow: 0 1px 8px rgba(0,0,0,.55);
}
.play-top .play-coins { padding: 6px 8px; font-size: 12px; }
.icon-back {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; font-size: 20px;
  background: rgba(12,8,5,.55); border: 1px solid var(--line);
  backdrop-filter: blur(10px);
}
.play-progress { font-variant-numeric: tabular-nums; }

.play-controls {
  display: grid;
  grid-template-columns: 56px 1fr 56px;
  align-items: center;
  justify-items: center;
  gap: 4px;
  width: 100%;
  max-width: none;
  margin: 0;
  padding-top: 2px;
  z-index: 2;
  flex: 0 0 auto;
}
.board-wrap,
#boardWrap.board-wrap {
  position: relative;
  width: min(100%, 92vw, 400px);
  aspect-ratio: 1 / 1;
  max-height: min(52svh, 400px);
  min-height: min(70vw, 300px);
  flex: none;
  border-radius: 0;
  overflow: visible;
  background: transparent;
}
.board-wrap #board,
#boardWrap #board {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}
.wheel-shuffle {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 48px; height: 48px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: #ffe3ad;
  background: linear-gradient(160deg, #2a1c10, #120c08);
  border: 1px solid rgba(240,208,138,.45);
  box-shadow: 0 3px 0 #0a0604, 0 8px 18px rgba(0,0,0,.45);
  z-index: 3;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}
.wheel-shuffle:active { transform: translate(-50%, -50%) scale(.94); }
.wheel-shuffle .n {
  position: absolute; top: -4px; right: -4px;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 800;
  color: #1a1206;
  background: linear-gradient(180deg, #ffe7a8, #e0b86a);
  border: 1px solid rgba(255,246,232,.5);
}
.wheel-shuffle.empty { opacity: .55; }
.play-tool-stack {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.play-tool {
  position: relative;
  width: 56px;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}
.play-tool:active .play-tool-ico { transform: scale(.94); }
.play-tool-ico {
  width: 48px; height: 48px;
  border-radius: 16px;
  display: grid; place-items: center;
  background: linear-gradient(180deg, rgba(40,28,16,.9), rgba(14,10,6,.95));
  border: 1px solid rgba(240,208,138,.35);
  box-shadow: 0 6px 16px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.06);
}
.play-tool.glass .play-tool-ico {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(160deg,
      rgba(255,255,255,.38) 0%,
      rgba(255,246,232,.14) 28%,
      rgba(40,24,12,.28) 62%,
      rgba(10,6,3,.55) 100%);
  border: 1.5px solid rgba(255,236,190,.55);
  box-shadow:
    0 12px 26px rgba(0,0,0,.45),
    0 1px 0 rgba(255,255,255,.45) inset,
    0 -10px 18px rgba(0,0,0,.3) inset,
    0 0 22px rgba(240,208,138,.28);
  backdrop-filter: blur(18px) saturate(1.5);
  -webkit-backdrop-filter: blur(18px) saturate(1.5);
}
.play-tool.glass .play-tool-ico::after {
  content: "";
  position: absolute; left: 10%; right: 10%; top: 8%;
  height: 38%; border-radius: 12px;
  background: linear-gradient(180deg, rgba(255,255,255,.5), rgba(255,255,255,0));
  pointer-events: none;
}
.play-tool.glass.blast .play-tool-ico {
  box-shadow:
    0 12px 26px rgba(0,0,0,.45),
    0 1px 0 rgba(255,230,200,.42) inset,
    0 -10px 18px rgba(90,30,0,.32) inset,
    0 0 26px rgba(255,140,70,.4);
}
.play-tool-ico::before {
  content: "";
  position: relative; z-index: 1;
  width: 22px; height: 22px;
  background: currentColor;
  color: #f0d08a;
}
.play-tool-ico.book::before {
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M4 4.5h7.2c.9 0 1.6.3 2.3.9.6-.6 1.4-.9 2.3-.9H23v14.2c0 .7-.6 1.3-1.3 1.3H15c-.7 0-1.3.3-1.7.7L12 22l-1.3-1.3c-.4-.4-1-.7-1.7-.7H2.3C1.6 20 1 19.4 1 18.7V5.8C1 5.1 1.6 4.5 2.3 4.5H4zm0 1.5H2.5v12.5H9c.7 0 1.4.2 2 .6V7.2C10.2 6.4 9.1 6 8 6H4zm16 0h-4c-1.1 0-2.2.4-3 1.2v11.4c.6-.4 1.3-.6 2-.6h5.5V6z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M4 4.5h7.2c.9 0 1.6.3 2.3.9.6-.6 1.4-.9 2.3-.9H23v14.2c0 .7-.6 1.3-1.3 1.3H15c-.7 0-1.3.3-1.7.7L12 22l-1.3-1.3c-.4-.4-1-.7-1.7-.7H2.3C1.6 20 1 19.4 1 18.7V5.8C1 5.1 1.6 4.5 2.3 4.5H4zm0 1.5H2.5v12.5H9c.7 0 1.4.2 2 .6V7.2C10.2 6.4 9.1 6 8 6H4zm16 0h-4c-1.1 0-2.2.4-3 1.2v11.4c.6-.4 1.3-.6 2-.6h5.5V6z'/%3E%3C/svg%3E") center / contain no-repeat;
  background: #9aead9;
}
.play-tool-ico.hint::before {
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M12 2.2 13.7 8H20l-5.2 3.7L16.6 18 12 14.4 7.4 18l1.8-6.3L4 8h6.3L12 2.2z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M12 2.2 13.7 8H20l-5.2 3.7L16.6 18 12 14.4 7.4 18l1.8-6.3L4 8h6.3L12 2.2z'/%3E%3C/svg%3E") center / contain no-repeat;
  background: #f0d08a;
}
.play-tool-ico.blast::before {
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M13 2 4 14h6l-1 8 11-14h-7l1-6z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M13 2 4 14h6l-1 8 11-14h-7l1-6z'/%3E%3C/svg%3E") center / contain no-repeat;
  background: #ffb070;
}
.play-tool-label {
  font-size: 11px; font-weight: 800;
  color: rgba(255,246,232,.88);
  letter-spacing: .02em;
}
.play-tool .n {
  position: absolute; top: -2px; right: 2px;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 800;
  color: #042a28;
  background: linear-gradient(180deg, #9af0e6, #3fd0c9);
  border: 1px solid rgba(255,255,255,.35);
  z-index: 1;
}
.play-tool.empty .play-tool-ico { opacity: .55; }
.play-tool .book-dot {
  position: absolute; top: 2px; right: 6px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--teal); box-shadow: 0 0 8px rgba(63,208,201,.8);
}
#pathOut.path-bubble,
.play-immersive .path-bubble {
  align-self: center;
  z-index: 2;
  min-height: 28px;
  margin: 2px 0 4px;
  padding: 6px 16px;
  border-radius: 999px;
  font-family: var(--font);
  font-size: 20px; font-weight: 800;
  letter-spacing: .12em;
  text-align: center;
  color: #1a1206;
  text-shadow: none;
  background: linear-gradient(180deg, #fff3c6, #ffbf65);
  border: 1px solid #fff3c7;
  box-shadow: 0 3px 0 #98643c, 0 6px 14px rgba(0,0,0,.35);
}
.play-immersive .path-bubble:empty {
  opacity: 0;
  padding: 0 16px;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.word-book {
  position: absolute; inset: 0; z-index: 40;
  display: flex; align-items: flex-end; justify-content: center;
}
.word-book[hidden] { display: none !important; }
.word-book-backdrop {
  position: absolute; inset: 0; border: 0; padding: 0;
  background: rgba(4, 3, 2, .55); cursor: pointer;
}
.word-book-sheet {
  position: relative; z-index: 1;
  width: min(440px, 100%);
  max-height: min(62vh, 520px);
  display: flex; flex-direction: column;
  padding: 16px 16px calc(16px + var(--safe-b));
  border-radius: 22px 22px 0 0;
  background:
    radial-gradient(90% 60% at 50% 0%, rgba(240,208,138,.14), transparent 55%),
    linear-gradient(180deg, #2a1c10, #120c08 55%);
  border: 1px solid rgba(240,208,138,.32);
  border-bottom: 0;
  box-shadow: 0 -18px 48px rgba(0,0,0,.45);
}
.word-book-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  margin-bottom: 4px;
}
.word-book-kicker {
  margin: 0 0 2px;
  font-size: 10px; font-weight: 800; letter-spacing: .16em;
  text-transform: uppercase; color: rgba(240,208,138,.7);
}
.word-book-head h3 {
  margin: 0; font-family: var(--font); font-size: 22px; color: #f7e7c2;
}
.word-book-x {
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--line); background: rgba(0,0,0,.35);
  color: var(--ink); font-size: 14px; font-weight: 800;
}
.word-book-sub {
  margin: 0 0 12px; font-size: 13px; color: var(--muted); font-weight: 600;
}
.word-book-list {
  flex: 1; overflow: auto; touch-action: pan-y;
  display: flex; flex-wrap: wrap; gap: 8px; align-content: flex-start;
  min-height: 80px;
}
.word-book-list .chip {
  padding: 8px 12px; border-radius: 999px; font-size: 13px; font-weight: 800;
  background: rgba(255,255,255,.06); border: 1px solid rgba(240,208,138,.28);
  color: var(--ink); letter-spacing: .04em;
}
.word-book-list .chip.bonus {
  border-color: rgba(63,208,201,.4); color: var(--teal);
}
.word-book-list .empty {
  width: 100%; text-align: center; color: var(--muted);
  font-size: 13px; font-weight: 700; padding: 28px 8px;
}

.word-meter {
  text-align: center; z-index: 2; margin: 6px 0 0;
  font-size: 12px; font-weight: 800; letter-spacing: .1em;
  color: #f0d08a; text-transform: uppercase;
  text-shadow: 0 1px 10px rgba(0,0,0,.55);
}
.found-strip {
  display: none !important;
}
.found-strip[hidden] { display: none !important; }
.found-chip {
  display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 800; letter-spacing: .04em;
  background: rgba(12,8,5,.55); border: 1px solid rgba(240,208,138,.35); color: var(--gold);
}
.found-chip.bonus {
  border-color: rgba(63,208,201,.45); color: var(--teal);
}
.found-hint {
  font-size: 11px; font-weight: 700; color: rgba(255,246,232,.35);
}
.crossword {
  flex: 1 1 0; display: grid; place-items: center; z-index: 2;
  min-height: 96px; max-height: 34dvh; width: 100%;
  margin: 4px 0 0; overflow: hidden; box-sizing: border-box;
}
.xgrid {
  display: grid; gap: 5px;
  padding: 8px; border-radius: 18px;
  background: rgba(8,6,4,.28);
  box-sizing: border-box;
  max-width: 100%;
  max-height: 100%;
}
.xcell {
  width: var(--cell, 28px); height: var(--cell, 28px);
  border-radius: calc(var(--cell, 28px) * 0.18);
  display: grid; place-items: center;
  font-family: var(--tile-font);
  font-weight: 700; font-size: calc(var(--cell, 28px) * 0.52);
  letter-spacing: -.02em;
  color: transparent;
  /* empty framed tile — logo-style bevel + wood rim */
  background:
    linear-gradient(180deg, rgba(255,255,255,.1), transparent 42%),
    linear-gradient(180deg, #3a2a18, #24180e 55%, #1a120a);
  border: 2px solid #c9a45a;
  box-shadow:
    0 3px 0 #6a4a1e,
    0 6px 14px rgba(0,0,0,.4),
    inset 0 1px 0 rgba(255,240,200,.22),
    inset 0 -2px 0 rgba(0,0,0,.35);
}
.xcell.empty {
  background: transparent; border-color: transparent; box-shadow: none;
}
.xcell.filled {
  color: #1a1206;
  background:
    linear-gradient(180deg, #fff8e8, #f0d9a8 38%, #e0b86a 72%, #c9963a);
  border-color: #8a6428;
  box-shadow:
    0 3px 0 #6a4a1e,
    0 8px 18px rgba(0,0,0,.42),
    inset 0 1px 0 rgba(255,255,255,.75),
    inset 0 -2px 0 rgba(120,80,20,.35),
    inset 0 0 0 1px rgba(255,255,255,.25);
  animation: cellPop .28s cubic-bezier(.2,.9,.2,1.15);
  text-shadow: 0 1px 0 rgba(255,255,255,.35);
}
.xcell.await-drop {
  /* empty slot waiting for rain letter */
  outline: 2px dashed rgba(240,208,138,.45);
  outline-offset: -2px;
}
.xcell.filled.drop-land {
  animation: cellLand .42s cubic-bezier(.2,.9,.2,1.2) both;
  z-index: 3;
}
.xcell.filled.blast-hit {
  animation: cellBlastHit .48s cubic-bezier(.15,.9,.2,1.25) both;
  z-index: 4;
}
.xcell.hint {
  border-color: var(--teal);
  box-shadow:
    0 3px 0 #0d6e68,
    0 0 18px rgba(63,208,201,.55),
    inset 0 1px 0 rgba(255,255,255,.35);
}
@keyframes cellPop { from { transform: scale(.72); opacity: .4; } }
@keyframes cellLand {
  0% { transform: scale(.6); filter: brightness(1.5); }
  55% { transform: scale(1.12); }
  100% { transform: scale(1); filter: none; }
}
@keyframes cellBlastHit {
  0% { transform: scale(.35) rotate(-8deg); filter: brightness(2.2); box-shadow: 0 0 0 0 rgba(255,220,120,.9); }
  40% { transform: scale(1.22) rotate(3deg); filter: brightness(1.6); box-shadow: 0 0 28px 8px rgba(255,200,80,.65); }
  70% { transform: scale(.94) rotate(-1deg); }
  100% { transform: scale(1) rotate(0); filter: none; box-shadow: 0 3px 0 #6a4a1e, 0 8px 18px rgba(0,0,0,.42); }
}

/* Play frame shake on Patlat */
#play.blast-shake {
  animation: blastShake .55s cubic-bezier(.36,.07,.19,.97) both;
}
@keyframes blastShake {
  0%, 100% { transform: translate3d(0, 0, 0); }
  12% { transform: translate3d(-7px, 3px, 0) rotate(-0.6deg); }
  24% { transform: translate3d(8px, -4px, 0) rotate(0.7deg); }
  36% { transform: translate3d(-6px, -2px, 0) rotate(-0.4deg); }
  48% { transform: translate3d(5px, 3px, 0) rotate(0.5deg); }
  60% { transform: translate3d(-3px, 1px, 0); }
  72% { transform: translate3d(3px, -2px, 0); }
  88% { transform: translate3d(-1px, 1px, 0); }
}

/* Patlat strike: off-screen meteors → crossword (layer often reparented to body) */
.fly-layer {
  position: fixed; inset: 0; z-index: 40; pointer-events: none; overflow: visible;
}
body.blast-fx-on .fly-layer,
.fly-layer.blast-active {
  z-index: 12000;
  overflow: visible;
}
.fly-layer.blast-active {
  background: radial-gradient(ellipse at 50% 35%, rgba(255,180,60,.18), transparent 55%);
}
.blast-flash {
  position: fixed; inset: 0;
  background:
    radial-gradient(circle at 50% 30%, rgba(255,230,160,.55), transparent 42%),
    linear-gradient(180deg, rgba(255,200,80,.22), transparent 60%);
  animation: blastFlash .55s ease-out both;
  pointer-events: none;
}
@keyframes blastFlash {
  0% { opacity: 0; }
  18% { opacity: 1; }
  100% { opacity: 0; }
}
.blast-shock {
  position: fixed; width: 24px; height: 24px; margin: -12px 0 0 -12px;
  border-radius: 50%;
  border: 3px solid rgba(255,220,140,.85);
  box-shadow: 0 0 24px rgba(255,180,60,.7), inset 0 0 20px rgba(255,240,180,.35);
  animation: blastShock .7s cubic-bezier(.15,.7,.2,1) .12s both;
  pointer-events: none;
}
@keyframes blastShock {
  0% { transform: scale(.2); opacity: .95; }
  100% { transform: scale(18); opacity: 0; border-width: 0; }
}
.blast-spark {
  position: fixed; width: 10px; height: 10px; margin: -5px 0 0 -5px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff6d0, #f0b040 45%, transparent 70%);
  box-shadow: 0 0 18px 6px rgba(255,200,80,.75);
  animation: blastSpark .4s ease-out both;
  pointer-events: none;
}
@keyframes blastSpark {
  0% { transform: scale(.4); opacity: 1; }
  100% { transform: scale(3.2); opacity: 0; }
}
.fly-tile {
  position: fixed; display: grid; place-items: center;
  border-radius: 22%;
  font-family: var(--tile-font); font-weight: 700; color: #1a1206;
  background: linear-gradient(180deg, #fff8e8, #e0b86a 70%, #c9963a);
  border: 2px solid #8a6428;
  box-shadow:
    0 10px 28px rgba(0,0,0,.55),
    0 0 28px rgba(255,200,80,.7),
    inset 0 1px 0 rgba(255,255,255,.75);
  will-change: transform, opacity;
  opacity: 0;
  z-index: 2;
}
.fly-tile .fly-trail {
  position: absolute;
  left: 50%; top: 50%;
  width: 140%; height: 220%;
  margin: -110% 0 0 -70%;
  border-radius: 40%;
  background: linear-gradient(180deg, transparent 10%, rgba(255,210,100,.55) 45%, rgba(255,160,40,.15) 100%);
  transform: rotate(var(--trail-rot, 0deg));
  filter: blur(1.5px);
  z-index: -1;
  pointer-events: none;
  opacity: .85;
}
.fly-tile.fly-strike { opacity: 0; }
.fly-tile.fly-strike.fly-go {
  animation: flyStrike .64s cubic-bezier(.18,.7,.2,1) forwards;
}
.fly-tile.fly-cube {
  border-radius: 18%;
  box-shadow:
    0 14px 32px rgba(0,0,0,.55),
    0 0 24px rgba(255,200,80,.65),
    inset 0 2px 0 rgba(255,255,255,.7),
    inset 0 -3px 0 rgba(90,55,10,.35);
}
/* From outside the play world / player eyes → shrink into the cell */
.fly-tile.fly-strike.fly-go.fly-fall {
  animation: flyFall .78s cubic-bezier(.45,.05,.55,1) forwards;
  opacity: 1;
}
.fly-tile.fly-strike.fly-go.fly-fall.fly-from-outside {
  animation: flyFromOutside .86s cubic-bezier(.4,.02,.45,1) forwards;
}
.fly-tile .fly-trail-fall {
  width: 70%;
  height: 180%;
  margin: -150% 0 0 -35%;
  background: linear-gradient(180deg, transparent 0%, rgba(255,210,100,.12) 30%, rgba(255,190,70,.6) 100%);
  filter: blur(2.5px);
}
.fly-tile.fly-gone { opacity: 0 !important; transition: opacity .06s; }
@keyframes flyStrike {
  0% {
    opacity: 1;
    transform: translate(0, 0) scale(1.55) rotate(calc(var(--spin) * -1));
    filter: brightness(1.8) blur(.4px);
  }
  55% {
    opacity: 1;
    transform: translate(calc(var(--dx) * .72), calc(var(--dy) * .68)) scale(1.25) rotate(var(--spin));
    filter: brightness(1.45);
  }
  82% {
    opacity: 1;
    transform: translate(calc(var(--dx) * 1.02), calc(var(--dy) * 1.02)) scale(1.08) rotate(calc(var(--spin) * .2));
  }
  100% {
    opacity: 1;
    transform: translate(var(--dx), var(--dy)) scale(.94) rotate(0deg);
    filter: brightness(1.1);
  }
}
@keyframes flyFall {
  0% {
    opacity: 1;
    transform: translate(0, 0) scale(1.2) rotate(var(--spin));
    filter: brightness(1.55);
  }
  35% {
    opacity: 1;
    transform: translate(calc(var(--dx) * .12), calc(var(--dy) * .22)) scale(1.15) rotate(calc(var(--spin) * .7));
  }
  70% {
    opacity: 1;
    transform: translate(calc(var(--dx) * .55), calc(var(--dy) * .72)) scale(1.06) rotate(calc(var(--spin) * .25));
    filter: brightness(1.25);
  }
  92% {
    opacity: 1;
    transform: translate(calc(var(--dx) * 1.01), calc(var(--dy) * 1.02)) scale(1.02) rotate(0deg);
  }
  100% {
    opacity: 1;
    transform: translate(var(--dx), var(--dy)) scale(.94) rotate(0deg);
    filter: brightness(1.05);
  }
}
/* Screen center: huge → shrink into the crossword cell */
@keyframes flyFromOutside {
  0% {
    opacity: 1;
    transform: translate(0, 0) scale(1) rotate(var(--spin));
    filter: brightness(1.9) blur(.8px);
  }
  22% {
    opacity: 1;
    transform: translate(calc(var(--dx) * .12), calc(var(--dy) * .18)) scale(0.82) rotate(calc(var(--spin) * .8));
    filter: brightness(1.6) blur(.3px);
  }
  55% {
    opacity: 1;
    transform: translate(calc(var(--dx) * .52), calc(var(--dy) * .62)) scale(calc(var(--land-scale, .4) * 1.35)) rotate(calc(var(--spin) * .35));
    filter: brightness(1.3);
  }
  88% {
    opacity: 1;
    transform: translate(calc(var(--dx) * 1.01), calc(var(--dy) * 1.02)) scale(var(--land-scale, .38)) rotate(0deg);
  }
  100% {
    opacity: 1;
    transform: translate(var(--dx), var(--dy)) scale(var(--land-scale, .36)) rotate(0deg);
    filter: brightness(1.05);
  }
}
@media (prefers-reduced-motion: reduce) {
  .fly-tile.fly-strike.fly-go,
  .fly-tile.fly-strike.fly-go.fly-fall,
  .fly-tile.fly-strike.fly-go.fly-from-outside { animation: none; opacity: 1; transform: translate(var(--dx), var(--dy)) scale(var(--land-scale, 1)); }
  .xcell.filled.drop-land,
  .xcell.filled.blast-hit { animation: cellPop .28s ease both; }
  #play.blast-shake { animation: none; }
  .blast-flash, .blast-shock, .blast-spark, .fly-tile .fly-trail { display: none; }
}

.word-bank {
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
  min-height: 0; margin: 0; z-index: 2;
}
.word-bank[hidden] { display: none !important; }
.word-slot {
  display: inline-flex; gap: 3px; padding: 6px 8px; border-radius: 12px;
  background: rgba(12,8,5,.45); border: 1px solid rgba(240,208,138,.22);
}
.word-slot.done { border-color: var(--gold); }
.word-slot i {
  width: 24px; height: 28px; border-radius: 7px;
  display: grid; place-items: center;
  font-style: normal; font-family: var(--tile-font); font-weight: 700; font-size: 13px;
  color: rgba(255,246,232,.28);
  background: linear-gradient(180deg, #3a2a18, #1a120a);
  border: 2px solid #c9a45a;
  box-shadow: 0 2px 0 #6a4a1e, inset 0 1px 0 rgba(255,240,200,.18);
}
.word-slot.done i {
  color: #1a1206;
  background: linear-gradient(180deg, #fff8e8, #e0b86a 70%, #c9963a);
  border-color: #8a6428;
  box-shadow: 0 2px 0 #6a4a1e, inset 0 1px 0 rgba(255,255,255,.7);
}

/* legacy boosters kept for smoke CSS hooks — play UI uses .play-controls */
.boosters, .play-boost { display: none !important; }
.boost {
  position: relative; padding: 14px 8px 12px; border-radius: 20px;
  background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(12,8,5,.55));
  border: 1px solid var(--line);
  backdrop-filter: blur(14px);
  display: grid; gap: 4px; justify-items: center; font-size: 11px; font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.14), 0 12px 28px rgba(0,0,0,.35);
}
.boost .ico { font-size: 24px; filter: drop-shadow(0 0 12px rgba(63,208,201,.6)); }
.boost .n {
  position: absolute; top: 6px; right: 8px; min-width: 18px; height: 18px; padding: 0 4px;
  border-radius: 999px; background: var(--gold); color: #1a1206; font-size: 11px;
  display: grid; place-items: center;
}
.boost.flash { animation: boostflash .45s ease; }
.boost.empty { opacity: .55; }
.boost.empty .n { background: #666; color: #ddd; }
@keyframes boostflash { 40% { box-shadow: 0 0 0 8px rgba(63,208,201,.35); } }

.modal {
  position: absolute; inset: 0; display: none; align-items: flex-end; justify-content: center;
  background: rgba(0,0,0,.62); padding: 16px; z-index: 20;
}
.modal.show { display: flex; }

/* Compact clear sheet — board stays visible above */
.win-modal {
  background: transparent;
  padding: 0 10px calc(10px + var(--safe-b));
  pointer-events: none;
}
.win-modal.show { pointer-events: auto; }
.win-backdrop {
  position: absolute; inset: 0; border: 0; padding: 0;
  background: linear-gradient(180deg, rgba(4,2,0,.18) 0%, rgba(4,2,0,.42) 48%, rgba(4,2,0,.72) 100%);
  cursor: pointer;
}
.win-sheet {
  position: relative; z-index: 1;
  width: min(400px, 100%);
  margin: 0 auto;
  padding: 10px 14px 12px;
  border-radius: 22px 22px 18px 18px;
  background:
    linear-gradient(180deg, rgba(48,32,16,.92), rgba(14,10,6,.97));
  border: 1px solid rgba(240,208,138,.28);
  box-shadow: 0 -8px 40px rgba(0,0,0,.45), 0 18px 40px rgba(0,0,0,.4);
  pointer-events: auto;
  animation: winSheetIn .34s cubic-bezier(.2,.85,.2,1) both;
  display: flex;
  flex-direction: column;
  max-height: min(72dvh, 560px);
  overflow: visible;
}
@keyframes winSheetIn {
  from { transform: translateY(28px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.win-sheet-handle {
  width: 36px; height: 4px; border-radius: 999px;
  margin: 0 auto 8px;
  background: rgba(240,208,138,.28);
}
.win-plate.art-stage.is-plate {
  /* Compact stage — only city-letter dump (no top badge) */
  height: min(22dvh, 160px);
  min-height: 112px;
  margin: 2px 0 2px;
  overflow: visible;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
}
.win-head,
.win-rewards,
.win-fact {
  flex: 0 0 auto;
}
.win-actions {
  flex: 0 0 auto;
  margin-top: 4px;
}
.win-links {
  flex: 0 0 auto;
}
.win-fact {
  max-height: 2.6em;
  margin-bottom: 8px;
}
.win-sheet .plate-burst-canvas {
  inset: 0;
  width: 100%;
  height: 100%;
}
.win-sheet .art-stage.is-cutout {
  height: 110px;
  margin: 2px 0 18px;
  overflow: visible;
  background: transparent;
  border: 0;
}
.win-sheet .art-stage.is-cutout .art-breakout {
  max-height: 128px;
  width: min(72%, 240px);
  filter: drop-shadow(0 14px 18px rgba(0,0,0,.55));
}
.win-plate .plate-burst {
  place-items: center;
}
.plate-burst.no-badge .plate-burst-badge { display: none !important; }
.win-head { text-align: center; margin: 0 0 8px; }
.win-head h2 {
  margin: 0;
  font-size: 1.15rem;
  letter-spacing: .02em;
  line-height: 1.15;
}
.win-sub {
  margin: 4px 0 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--muted);
}
.win-rewards {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 8px; margin: 0 0 8px;
}
.win-chip {
  padding: 6px 11px; border-radius: 999px;
  font-size: 12px; font-weight: 800; color: #1a1208;
  background: linear-gradient(180deg, #f0d08a, #c9963a);
  box-shadow: 0 2px 0 rgba(90,60,18,.45);
}
.win-total {
  width: 100%; text-align: center;
  font-size: 11px; font-weight: 600; color: var(--muted);
}
.win-fact {
  margin: 0 0 12px;
  padding: 0 4px;
  font-size: 12px; line-height: 1.4; font-weight: 600;
  color: rgba(255,246,232,.72);
  text-align: center;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.win-fact:empty { display: none; margin: 0; }
.win-actions {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 10px;
  align-items: stretch;
}
.win-next,
.win-share {
  width: 100%;
  min-height: 52px;
  border-radius: 999px;
  font-size: 15px;
  letter-spacing: .02em;
}
.btn-share {
  background:
    linear-gradient(180deg, rgba(255,255,255,.28), transparent 40%),
    linear-gradient(180deg, #7af0e8, #2aa8a1 58%, #0d6e68);
  color: #041816;
  border: 0;
  box-shadow: 0 12px 28px rgba(42,168,161,.38), inset 0 1px 0 rgba(255,255,255,.45);
}
.win-links {
  display: flex; align-items: center; justify-content: center;
  gap: 10px; margin-top: 10px;
  color: rgba(240,208,138,.35);
  font-size: 12px;
}
.win-link {
  border: 0; background: none; padding: 4px 2px;
  font: inherit; font-size: 13px; font-weight: 800;
  color: rgba(240,208,138,.82); letter-spacing: .04em;
  cursor: pointer;
}
.win-link:active { color: #fff6e8; }
@media (prefers-reduced-motion: reduce) {
  .win-sheet { animation: none; }
}

.confirm-modal {
  position: fixed; inset: 0; z-index: 90;
  display: none; align-items: flex-end; justify-content: center;
  padding: 16px; padding-bottom: max(16px, env(safe-area-inset-bottom));
  background: transparent;
}
.confirm-modal.show { display: flex; }
.confirm-modal[hidden] { display: none !important; }
.confirm-backdrop {
  position: absolute; inset: 0; border: 0; padding: 0;
  background: rgba(0,0,0,.62); cursor: pointer;
}
.confirm-card {
  position: relative; z-index: 1;
  width: min(420px, 100%);
  margin-bottom: 4px;
}
.confirm-kicker {
  margin: 0 0 6px;
  font-size: 11px; font-weight: 800; letter-spacing: .14em;
  text-transform: uppercase; color: #efc87e;
}
.confirm-card h3 {
  margin: 0 0 8px;
  font-family: var(--font);
  font-size: 22px; color: var(--ink);
}
.confirm-card .sub { margin: 0 0 16px; }

.account-nudge-modal {
  position: fixed; inset: 0; z-index: 80;
  display: none; align-items: flex-end; justify-content: center;
  padding: 16px; padding-bottom: max(16px, env(safe-area-inset-bottom));
  background: transparent;
}
.account-nudge-modal.show { display: flex; }
.account-nudge-modal[hidden] { display: none !important; }
.account-nudge-backdrop {
  position: absolute; inset: 0; border: 0; padding: 0;
  background: rgba(0,0,0,.58); cursor: pointer;
}
.account-nudge-card {
  position: relative; z-index: 1;
  width: min(420px, 100%);
}
.account-nudge-kicker {
  margin: 0 0 6px;
  font-size: 11px; font-weight: 800; letter-spacing: .14em;
  text-transform: uppercase; color: #efc87e;
}
.account-nudge-card h2 {
  margin: 0 0 8px; font-size: 1.35rem; line-height: 1.2;
}
.card {
  width: min(420px, 100%); border-radius: 24px; padding: 16px;
  background: linear-gradient(180deg, rgba(42,26,12,.94), rgba(12,8,5,.98));
  border: 1px solid var(--line);
  box-shadow: 0 30px 80px rgba(0,0,0,.6);
  animation: pop .28s ease;
  overflow: visible;
}
@keyframes pop { from { transform: translateY(18px) scale(.98); opacity: 0; } }

/* Win hero: default = wide cover banner (portrait play photos crop cleanly) */
.art-stage {
  position: relative;
  height: 132px;
  margin: 0 0 14px;
  border-radius: 16px;
  border: 1px solid rgba(240,208,138,.28);
  background: rgba(0,0,0,.35);
  overflow: hidden;
  z-index: 3;
}
.art-stage.is-plate {
  height: 168px;
  overflow: visible;
  border: 0;
  background: transparent;
  margin: 2px 0 8px;
}
.plate-burst-mount { position: absolute; inset: 0; overflow: visible; }
.plate-burst {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  pointer-events: none;
}
.plate-burst.is-live { visibility: visible; }
.plate-burst.is-settled .plate-burst-badge {
  animation: none;
  transform: scale(1.04);
  box-shadow:
    0 12px 28px rgba(0,0,0,.5),
    0 0 0 1px rgba(80,48,8,.35) inset,
    0 0 36px rgba(240,208,138,.45);
}
.plate-burst-badge {
  position: relative; z-index: 2;
  margin-top: 0;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 22px 13px;
  border-radius: 12px;
  background:
    linear-gradient(180deg, #f3df9a 0%, #d4a84a 42%, #a87928 100%);
  border: 1.5px solid rgba(255, 236, 180, .85);
  box-shadow:
    0 10px 24px rgba(0,0,0,.45),
    0 0 0 1px rgba(80,48,8,.35) inset,
    0 0 28px rgba(240,208,138,.35);
  color: #1a1208;
  font-family: var(--font);
  font-weight: 800;
  letter-spacing: .06em;
  transform-origin: 50% 40%;
}
.plate-burst-badge.pop { animation: platePop .55s cubic-bezier(.2,.9,.2,1) both; }
@keyframes platePop {
  0% { opacity: 0; transform: translateY(12px) scale(.86); }
  60% { opacity: 1; transform: translateY(-2px) scale(1.04); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
.plate-burst-code { font-size: 22px; }
.plate-burst-bar {
  width: 2px; height: 20px; border-radius: 2px;
  background: rgba(40,24,8,.45);
}
.plate-burst-name { font-size: 20px; letter-spacing: .1em; }
.plate-burst-canvas {
  position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1;
}
@media (prefers-reduced-motion: reduce) {
  .plate-burst-badge.pop { animation: none; }
}
.art-breakout {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 28%;
  pointer-events: none;
  animation: artFade .45s ease both;
}
@keyframes artFade {
  from { opacity: 0; transform: scale(1.06); }
  to { opacity: 1; transform: scale(1); }
}
/* Adana authored cutout PNG — floats above the frame */
.art-stage.is-cutout {
  height: 96px;
  margin: 4px 0 28px;
  overflow: visible;
  background: rgba(0,0,0,.22);
}
.art-stage.is-cutout .art-breakout {
  inset: auto;
  left: 50%;
  top: 50%;
  width: min(78%, 280px);
  height: auto;
  max-height: 148px;
  object-fit: contain;
  transform: translate(-50%, -58%);
  filter: drop-shadow(0 12px 16px rgba(0,0,0,.5));
  animation: artRise .55s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes artRise {
  from { opacity: 0; transform: translate(-50%, -40%) scale(.92); }
  to { opacity: 1; transform: translate(-50%, -58%) scale(1); }
}

.facts { margin: 10px 0 14px; display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.facts b { color: var(--gold); }
.rewards {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px;
}
.rewards span {
  text-align: center; padding: 10px; border-radius: 12px;
  background: rgba(255,255,255,.05); font-weight: 800; color: var(--gold);
  border: 1px solid rgba(240,208,138,.2);
}
.rewards .reward-note {
  grid-column: 1 / -1; text-align: center; font-size: 11px; color: var(--muted); font-weight: 600;
}
.share-tease {
  display: grid; gap: 4px; width: 100%; text-align: left;
  margin: 8px 0 4px; padding: 12px 14px; border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(55,38,20,.9), rgba(18,12,8,.95));
  border: 1.5px solid rgba(240,208,138,.42);
  box-shadow: 0 10px 24px rgba(0,0,0,.35), 0 0 20px rgba(240,208,138,.12);
}
.share-tease[hidden] { display: none !important; }
.share-tease-kicker {
  font-size: 11px; font-weight: 800; letter-spacing: .1em;
  text-transform: uppercase; color: var(--gold);
}
.share-tease-msg {
  font-size: 14px; font-weight: 700; line-height: 1.4; color: var(--ink);
}

.toast {
  position: absolute; left: 50%; bottom: calc(96px + var(--safe-b));
  transform: translateX(-50%);
  padding: 10px 14px; border-radius: 999px;
  background: rgba(0,0,0,.78); border: 1px solid var(--line);
  font-size: 13px; font-weight: 700; opacity: 0; pointer-events: none;
  transition: opacity .2s ease; z-index: 30;
}
.toast.show { opacity: 1; }
.inbox-item {
  padding: 12px; border-radius: 14px;
  background: linear-gradient(180deg, rgba(40,28,16,.65), rgba(18,12,8,.78));
  border: 1px solid transparent; margin-bottom: 8px;
}
.inbox-item.unread { border-color: var(--gold); }
.mem-title {
  margin: 18px 0 0; font-family: var(--font); font-size: 20px; color: var(--gold); z-index: 2;
}
.word-memory {
  margin-top: 8px; max-height: 28vh; overflow: auto; touch-action: pan-y; z-index: 2;
  display: flex; flex-wrap: wrap; gap: 6px;
}
.word-memory .chip {
  padding: 6px 10px; border-radius: 999px; font-size: 12px; font-weight: 700;
  background: rgba(255,255,255,.06); border: 1px solid rgba(240,208,138,.22);
  color: var(--ink);
}
.word-memory .chip.bonus { border-color: rgba(63,208,201,.35); color: var(--teal); }
.word-memory .empty { color: var(--muted); font-size: 13px; }
.dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--danger);
  display: inline-block; margin-left: 6px;
}

/* —— Telif & kaynaklar —— */
.credits-screen {
  padding-bottom: calc(12px + var(--safe-b));
}
.credits-top h2 {
  flex: 1;
  text-align: center;
  font-size: 20px;
}
.credits-scroll {
  flex: 1;
  overflow: auto;
  touch-action: pan-y;
  padding-bottom: 24px;
  z-index: 2;
}
.credits-hero {
  margin: 6px 0 18px;
  padding: 18px 16px 16px;
  border-radius: 18px;
  background:
    radial-gradient(120% 80% at 10% 0%, rgba(240,208,138,.18), transparent 55%),
    linear-gradient(165deg, rgba(48,32,18,.92), rgba(14,10,6,.94));
  border: 1px solid rgba(240,208,138,.28);
  box-shadow: 0 16px 40px rgba(0,0,0,.35);
}
.credits-kicker {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: rgba(240,208,138,.75);
}
.credits-hero h3 {
  margin: 0 0 8px;
  font-family: var(--font);
  font-size: clamp(26px, 7vw, 34px);
  color: #f7e7c2;
  letter-spacing: .02em;
}
.credits-lead {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
  color: rgba(245,230,200,.78);
}
.credits-sections {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 22px;
}
.credits-card {
  padding: 14px 14px 12px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(40,28,16,.72), rgba(16,11,7,.88));
  border: 1px solid rgba(240,208,138,.18);
}
.credits-card h4 {
  margin: 0 0 6px;
  font-family: var(--font);
  font-size: 16px;
  color: var(--gold);
}
.credits-card p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: rgba(245,230,200,.82);
}
.credits-card .credits-note {
  margin-top: 8px;
  font-size: 12px;
  color: rgba(245,230,200,.58);
  border-top: 1px solid rgba(255,255,255,.06);
  padding-top: 8px;
}
.credits-list-title {
  margin: 0 0 4px;
  font-family: var(--font);
  font-size: 18px;
  color: var(--gold);
}
.credits-list-sub { margin: 0 0 10px; }
.credits-prov-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.credits-prov {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  text-align: left;
  color: inherit;
  text-decoration: none;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(240,208,138,.14);
}
.credits-prov:active { background: rgba(240,208,138,.1); }
.credits-prov .code {
  font-family: var(--tile-font);
  font-weight: 800;
  font-size: 13px;
  color: #1a1206;
  background: linear-gradient(180deg, #f7e4ad, #c9963a);
  border-radius: 8px;
  padding: 6px 0;
  text-align: center;
}
.credits-prov b {
  font-size: 14px;
  font-weight: 800;
}
.credits-prov small {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}
.credits-prov .go {
  font-size: 12px;
  font-weight: 800;
  color: var(--gold);
  letter-spacing: .04em;
}
.credits-foot {
  margin: 18px 0 8px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}


/* Desktop: keep play in a phone frame so portrait BGs aren\'t landscape-squashed */
@media (min-width: 520px) {
  #play.screen.active.play-phone-frame {
    max-width: 430px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    border-radius: 0;
    box-shadow: 0 0 0 1px rgba(240,208,138,.18), 0 24px 80px rgba(0,0,0,.55);
  }
}

/* Keep play in a true phone aspect so city BGs never look basık/squashed */
#play.screen.active.play-phone-frame {
  /* Shrink width when viewport is short so 9:16 stays true (no basık BG) */
  width: min(430px, 100vw, calc(100dvh * 9 / 16));
  height: min(100dvh, calc(min(430px, 100vw) * 16 / 9));
  max-width: 100vw;
  max-height: 100dvh;
  aspect-ratio: 9 / 16;
  margin-left: auto;
  margin-right: auto;
  border-radius: 0;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(240,208,138,.18), 0 24px 80px rgba(0,0,0,.45);
}
@media (max-width: 480px) {
  #play.screen.active.play-phone-frame {
    width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    aspect-ratio: auto;
    box-shadow: none;
  }
}

/* Rename + how-to (iOS-safe — no window.prompt) */
.rename-modal,
.howto-modal {
  position: fixed; inset: 0; z-index: 80;
  display: flex; align-items: flex-end; justify-content: center;
  padding: 0 12px calc(12px + var(--safe-b));
}
.rename-modal[hidden],
.howto-modal[hidden] { display: none !important; }
.rename-backdrop {
  position: absolute; inset: 0; border: 0; padding: 0;
  background: rgba(4,2,0,.62); cursor: pointer;
}
.rename-sheet,
.howto-sheet {
  position: relative; z-index: 1;
  width: min(420px, 100%);
  padding: 18px 16px 16px;
  border-radius: 22px 22px 18px 18px;
  background:
    radial-gradient(90% 60% at 50% 0%, rgba(240,208,138,.16), transparent 55%),
    linear-gradient(180deg, #2a1c10, #120c08 60%);
  border: 1px solid rgba(240,208,138,.32);
  box-shadow: 0 -18px 48px rgba(0,0,0,.5);
}
.rename-sheet h3,
.howto-head h3 {
  margin: 0 0 6px; font-family: var(--font); font-size: 22px; color: #f7e7c2;
}
.rename-sub {
  margin: 0 0 12px; font-size: 13px; color: var(--muted); font-weight: 600;
}
#renameInput {
  width: 100%; box-sizing: border-box;
  padding: 12px 14px; border-radius: 14px;
  border: 1px solid rgba(240,208,138,.35);
  background: rgba(0,0,0,.35); color: #fff6e8;
  font-family: var(--font); font-size: 17px; font-weight: 700;
  outline: none;
}
.rename-actions {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px;
}
.howto-kicker {
  margin: 0 0 2px; font-size: 10px; font-weight: 800;
  letter-spacing: .16em; text-transform: uppercase; color: rgba(240,208,138,.7);
}
.howto-body {
  max-height: min(52vh, 420px); overflow: auto; touch-action: pan-y;
  display: grid; gap: 12px; margin: 10px 0 14px;
}
.howto-body article {
  padding: 12px 12px 11px; border-radius: 14px;
  background: rgba(0,0,0,.28);
  border: 1px solid rgba(240,208,138,.18);
}
.howto-body h4 {
  margin: 0 0 4px; font-size: 14px; color: #f0d08a; letter-spacing: .04em;
}
.howto-body p {
  margin: 0; font-size: 13px; line-height: 1.45; color: rgba(255,246,232,.82); font-weight: 600;
}
.howto-done { width: 100%; }

/* Avatar preset picker */
.avatar-modal {
  position: fixed; inset: 0; z-index: 80;
  display: flex; align-items: flex-end; justify-content: center;
  padding: 0 12px calc(12px + var(--safe-b));
}
.avatar-modal[hidden] { display: none !important; }
.avatar-sheet {
  position: relative; z-index: 1;
  width: min(420px, 100%);
  padding: 18px 16px 16px;
  border-radius: 22px 22px 18px 18px;
  background:
    radial-gradient(90% 60% at 50% 0%, rgba(240,208,138,.16), transparent 55%),
    linear-gradient(180deg, #2a1c10, #120c08 60%);
  border: 1px solid rgba(240,208,138,.32);
  box-shadow: 0 -18px 48px rgba(0,0,0,.5);
}
.avatar-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 12px 0 16px;
}
.avatar-pick {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 8px 4px;
  border-radius: 16px;
  border: 1.5px solid rgba(240,208,138,.22);
  background: rgba(0,0,0,.28);
}
.avatar-pick.on {
  border-color: #f0d08a;
  box-shadow: 0 0 0 1px rgba(240,208,138,.35), 0 0 18px rgba(240,208,138,.25);
}
.avatar-pick-face {
  width: 52px; height: 52px; border-radius: 18px;
  display: grid; place-items: center;
  font-size: 1.55rem;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 6px 14px rgba(0,0,0,.35);
}
.avatar-pick small {
  font-size: 10px; font-weight: 800; letter-spacing: .02em;
  color: rgba(255,246,232,.78);
}
.settings-av { font-size: 2rem; }
