/* Dharmakshetra - a hand-painted summer: watercolour skies, drifting clouds,
   rolling hills, cream paper and sunflower gold. Anime comic panels on top. */

:root {
  --sky-1: #7DB9E3;
  --sky-2: #BFE0F2;
  --sky-3: #FFE7C2;
  --cream: #FFFBF0;
  --paper: #FBF4E4;
  --paper-2: #F3E7CC;
  --line: #E4D4B2;
  --ink: #3B3A36;
  --ink-soft: #6E6A5E;
  --ink-faint: #9A9484;
  --leaf: #4E8C4A;
  --leaf-2: #78B25F;
  --leaf-soft: #DCEFD2;
  --sun: #FFCB5C;
  --sun-2: #FFDF8F;
  --sun-deep: #DD9531;
  --peach: #F6B48F;
  --rose: #EE87A3;
  --rose-soft: #FBD3DF;
  --river: #4F9FC4;
  --river-soft: #D6ECF6;
  --clay: #C8573C;
  --night: #4D9DE0;
  --outline: #2E2A26;
  --dots: radial-gradient(rgba(46, 42, 38, .13) 1.1px, transparent 1.5px);
  --gold: #E9B949;
  --display: 'Yatra One', 'Georgia', serif;
  --body: 'Baloo 2', 'Nunito', 'Segoe UI', system-ui, sans-serif;
  --comic: 'Bangers', 'Impact', sans-serif;
  --radius: 14px;
  --wobble: 18px 22px 20px 24px / 22px 18px 24px 20px;
  --top: 60px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --shadow-soft: 0 10px 30px rgba(60, 80, 110, .16), 0 2px 6px rgba(60, 80, 110, .10);
  --shadow-lift: 0 18px 40px rgba(60, 80, 110, .22), 0 4px 10px rgba(60, 80, 110, .12);
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .36 0 0 0 0 .2 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.45;
  color: var(--ink);
  background: linear-gradient(180deg, var(--sky-1) 0%, var(--sky-2) 48%, var(--sky-3) 100%) fixed;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
#app { position: relative; z-index: 1; }
[hidden] { display: none !important; }
button, input, select { font: inherit; color: inherit; }
button { touch-action: manipulation; }
:focus-visible { outline: 3px solid var(--river); outline-offset: 2px; border-radius: 8px; }
::selection { background: var(--sun-2); }

/* ---------- sky ---------- */
.sky { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.sun {
  position: absolute; right: 8%; top: 6%; width: 340px; height: 340px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 250, 225, .95) 0 14%, rgba(255, 236, 170, .55) 30%, rgba(255, 236, 170, 0) 68%);
  animation: sun-breathe 9s ease-in-out infinite;
}
@keyframes sun-breathe { 50% { transform: scale(1.06); opacity: .9; } }
.cloud { position: absolute; left: 0; animation: drift linear infinite; will-change: transform; filter: drop-shadow(0 10px 18px rgba(90, 120, 160, .12)); }
.cloud svg { display: block; }
@keyframes drift { from { transform: translateX(-40vw); } to { transform: translateX(110vw); } }
.hills { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 38vh; min-height: 220px; display: block; }
.motes { position: absolute; inset: 0; }
.mote {
  position: absolute; width: 6px; height: 6px; border-radius: 50%;
  background: radial-gradient(circle, #FFFBE0 0 30%, rgba(255, 240, 180, 0) 70%);
  animation: mote ease-in-out infinite;
  opacity: 0;
}
@keyframes mote {
  0% { transform: translate(0, 0) scale(.6); opacity: 0; }
  25% { opacity: .9; }
  50% { transform: translate(24px, -40px) scale(1.1); opacity: .7; }
  75% { opacity: .9; }
  100% { transform: translate(-10px, -90px) scale(.6); opacity: 0; }
}
body[data-screen="game"] .sun { opacity: .6; }

/* ---------- surfaces ---------- */
.card {
  background: rgba(255, 251, 240, .92);
  background-image: var(--grain);
  border: 2px solid rgba(255, 255, 255, .8);
  border-radius: 26px;
  box-shadow: var(--shadow-lift);
  backdrop-filter: blur(6px);
}

/* ---------- controls ---------- */
.btn {
  appearance: none;
  display: inline-flex; align-items: center; justify-content: center; gap: .45em;
  border: 2px solid var(--line);
  background: var(--cream);
  color: var(--ink);
  padding: .5em 1.15em;
  min-height: 42px;
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 3px 0 var(--line), 0 6px 14px rgba(80, 90, 110, .08);
  transition: transform .12s, box-shadow .12s, background .15s, border-color .15s;
  white-space: nowrap;
}
.btn:hover { background: #FFFFFF; border-color: #D7C49C; transform: translateY(-1px); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--line); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn .uic { width: 1.15em; height: 1.15em; }
.btn.primary {
  background: linear-gradient(180deg, var(--sun-2), var(--sun));
  border-color: var(--sun-deep);
  color: #4A3410;
  box-shadow: 0 4px 0 var(--sun-deep), 0 10px 22px rgba(221, 149, 49, .3);
  text-shadow: 0 1px 0 rgba(255, 255, 255, .5);
}
.btn.primary:hover { background: linear-gradient(180deg, #FFE7A8, #FFD06C); }
.btn.primary:active { box-shadow: 0 1px 0 var(--sun-deep); transform: translateY(3px); }
.btn.danger { border-color: var(--rose); color: var(--clay); box-shadow: 0 3px 0 var(--rose-soft); }
.btn.small { padding: .3em .85em; min-height: 36px; font-size: .9rem; }
.btn.icon-btn { padding: 0; width: 40px; min-height: 40px; }
.btn.soft { background: rgba(255, 255, 255, .7); border-color: rgba(255, 255, 255, .9); backdrop-filter: blur(4px); }
.btn.power { border-color: #B9A6E8; background: linear-gradient(180deg, #FFFFFF, #F1ECFF); box-shadow: 0 3px 0 #CFC3F0; }
.btn.power .medallion { width: 1.4em; height: 1.4em; }
.btn.ink { border-color: var(--line); color: var(--ink); background: var(--cream); }
.btn.ink.primary { background: linear-gradient(180deg, var(--sun-2), var(--sun)); border-color: var(--sun-deep); color: #4A3410; box-shadow: 0 4px 0 var(--sun-deep); }
.btn.danger-ink { border-color: var(--rose); color: var(--clay); }
.btn.build-btn { border-color: #9CCB88; background: linear-gradient(180deg, #FFFFFF, var(--leaf-soft)); box-shadow: 0 3px 0 #9CCB88; color: #2F5E2C; }
.uic { width: 1.25em; height: 1.25em; flex: none; }
.link {
  background: none; border: 0; padding: .35em 0; cursor: pointer;
  color: var(--ink-soft); font-weight: 600; display: inline-flex; align-items: center; gap: .35em;
}
.link:hover { color: var(--ink); }
.link .uic { width: 1.1em; height: 1.1em; }
input {
  background: #FFFFFF;
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: .5em .9em;
  color: var(--ink);
  min-width: 0;
  min-height: 44px;
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder { color: var(--ink-faint); }
input:focus { outline: none; border-color: var(--river); box-shadow: 0 0 0 4px rgba(79, 159, 196, .18); }

.logo {
  font-family: var(--display); font-weight: 400; margin: 0; line-height: 1.05; color: #FFFFFF;
  text-shadow: 0 2px 0 #5C8FC0, 0 4px 0 rgba(60, 100, 150, .35), 0 10px 24px rgba(40, 80, 130, .3);
  letter-spacing: .01em;
}
.coin { width: 1em; height: 1em; vertical-align: -.14em; margin-right: .2em; }
.medallion { display: inline-block; flex: none; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .2)); }
.tag {
  display: inline-flex; align-items: center; gap: 2px; font-size: .72rem; font-weight: 700; padding: 0 .6em; border-radius: 999px; line-height: 1.7;
  background: var(--paper-2); color: var(--ink-soft); margin-left: .4em; vertical-align: .1em;
}
.tag.off { background: var(--rose-soft); color: var(--clay); }
.tag.voice .uic { width: 1em; height: 1em; }
.tag.voice.muted { opacity: .6; }

/* ---------- characters ---------- */
.portrait { position: relative; display: block; width: 100%; height: 100%; overflow: hidden; isolation: isolate; }
.portrait img { display: block; width: 100%; height: 100%; object-fit: cover; user-select: none; transition: filter .4s; filter: saturate(.94) contrast(.97); }
.portrait.bust img { animation: breathe 5s ease-in-out infinite; transform-origin: 50% 70%; }
.portrait.bust::before {
  content: ''; position: absolute; inset: -20%; z-index: 1; pointer-events: none;
  background: linear-gradient(115deg, transparent 40%, rgba(255, 248, 220, .4) 50%, transparent 60%);
  transform: translateX(-120%); animation: shine 7s ease-in-out infinite;
}
.portrait::after { content: ''; position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: 0; transition: opacity .3s; }
.portrait.mood-happy::after {
  opacity: 1;
  background:
    radial-gradient(circle at 18% 22%, #fff 0 1.5px, transparent 3px),
    radial-gradient(circle at 82% 18%, #FFF0B8 0 2px, transparent 4px),
    radial-gradient(circle at 74% 70%, #fff 0 1.5px, transparent 3px),
    radial-gradient(circle at 26% 78%, #FFF0B8 0 2px, transparent 4px),
    radial-gradient(circle at 50% 40%, rgba(255, 230, 150, .25), transparent 65%);
  animation: twinkle 1.2s ease-in-out infinite alternate;
}
.portrait.mood-happy img { filter: brightness(1.06) saturate(1.05); }
.portrait.mood-sad img { filter: saturate(.45) brightness(.85); }
.portrait.mood-sad::after { opacity: 1; background: linear-gradient(180deg, rgba(70, 110, 170, .5), rgba(70, 110, 170, .08) 70%), repeating-linear-gradient(100deg, transparent 0 9px, rgba(210, 228, 255, .4) 9px 10px); animation: rain .9s linear infinite; background-size: 100% 100%, 40px 40px; }
.portrait.mood-shock img { filter: contrast(1.1) brightness(1.08); animation: shudder .32s ease-in-out 3; }
.portrait.mood-shock::after {
  opacity: 1;
  background: repeating-conic-gradient(from 0deg at 50% 45%, rgba(255, 255, 255, .6) 0 3deg, transparent 3deg 14deg);
  -webkit-mask: radial-gradient(circle at 50% 45%, transparent 38%, #000 62%); mask: radial-gradient(circle at 50% 45%, transparent 38%, #000 62%);
  animation: burst-lines .5s ease-out;
}
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.035); } }
@keyframes shine { 0%, 70% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }
@keyframes twinkle { from { opacity: .55; } to { opacity: 1; } }
@keyframes rain { to { background-position: 0 0, -8px 40px; } }
@keyframes burst-lines { from { transform: scale(.6); opacity: 0; } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4%); } }
@keyframes shudder { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-4%); } 75% { transform: translateX(4%); } }

.face {
  --c: var(--night);
  display: inline-block; flex: none; width: 40px; height: 40px; border-radius: 50%;
  background: var(--c);
  box-shadow: 0 0 0 2.5px #FFFFFF, 0 0 0 4.5px var(--c), 0 4px 10px rgba(60, 80, 110, .25);
  overflow: hidden;
}
.face .portrait { width: 100%; height: 100%; border-radius: 50%; }
.face.bob .portrait { animation: bob 2.8s ease-in-out infinite; }
[data-seat].speaking .face, .speaking.face { box-shadow: 0 0 0 2.5px #fff, 0 0 0 5px var(--leaf-2), 0 0 18px var(--leaf-2); }

/* ---------- home ---------- */
.screen { min-height: 100vh; min-height: 100dvh; }
#screen-home { display: flex; flex-direction: column; }
.home-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 24px 0; position: relative; z-index: 2; }
.home-tools { display: flex; gap: 8px; }
.profile-chip {
  display: flex; align-items: center; gap: 10px; padding: 6px 14px 6px 6px; border-radius: 999px;
  background: rgba(255, 251, 240, .85); border: 2px solid rgba(255, 255, 255, .9); box-shadow: var(--shadow-soft);
  cursor: pointer; text-align: left; backdrop-filter: blur(6px); transition: transform .15s;
}
.profile-chip:hover { transform: translateY(-1px); }
.profile-chip .face { width: 44px; height: 44px; }
.pc-txt { display: flex; flex-direction: column; line-height: 1.15; min-width: 120px; }
.pc-txt b { font-size: .98rem; max-width: 10em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-txt > span:not(.xpbar) { font-size: .78rem; color: var(--ink-soft); font-weight: 600; }
.pc-txt .xpbar { margin-top: 4px; }
.pc-badges { display: flex; align-items: center; gap: 4px; font-weight: 800; font-size: .85rem; color: #9A6A12; padding-left: 10px; border-left: 2px solid var(--line); }
.pc-badges .uic { width: 1.1em; height: 1.1em; }

.xpbar { display: block; height: 7px; border-radius: 99px; background: rgba(59, 58, 54, .12); overflow: hidden; position: relative; }
.xpbar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--leaf-2), #A8D86A, var(--sun)); transition: width 1.2s cubic-bezier(.2, .8, .2, 1); position: relative; }
.xpbar i::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .7), transparent); transform: translateX(-100%); animation: bar-shine 2.6s ease-in-out infinite; }
@keyframes bar-shine { 60%, 100% { transform: translateX(100%); } }
.xpbar.big { height: 12px; }
.xpbar.light { background: rgba(255, 255, 255, .35); }
.lvl-badge {
  display: inline-grid; place-items: center; width: 30px; height: 30px; flex: none;
  font-weight: 800; font-size: .9rem; color: #4A3410;
  background: radial-gradient(circle at 35% 30%, #FFF3C4, var(--sun) 60%, var(--sun-deep));
  clip-path: polygon(50% 0, 61% 12%, 77% 8%, 80% 24%, 95% 30%, 89% 46%, 100% 58%, 87% 69%, 89% 85%, 73% 86%, 63% 100%, 50% 91%, 37% 100%, 27% 86%, 11% 85%, 13% 69%, 0 58%, 11% 46%, 5% 30%, 20% 24%, 23% 8%, 39% 12%);
}

.home {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 460px);
  gap: 40px;
  align-items: center;
  width: min(1240px, 100%);
  margin: 0 auto;
  padding: 18px 28px 48px;
}
.home-stage { text-align: center; }
.verse { font-style: italic; color: #4C6E95; margin: 0 0 .2em; font-size: .95rem; font-weight: 600; }
.home-stage .logo { font-size: clamp(2.8rem, 5.6vw, 4.8rem); animation: title-in .9s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes title-in { from { transform: translateY(18px) scale(.94); opacity: 0; } }
.lede { font-size: 1.12rem; color: #33506F; max-width: 34em; margin: .4em auto 1.1em; font-weight: 500; }

.showcase { display: flex; justify-content: center; }
.hero-card {
  --c: var(--night);
  position: relative;
  display: grid; grid-template-columns: auto 220px minmax(0, 1fr) auto; gap: 18px; align-items: center;
  width: min(640px, 100%);
  padding: 18px 14px; border-radius: 30px; text-align: left;
  background: rgba(255, 251, 240, .9);
  background-image: radial-gradient(circle at 18% 50%, color-mix(in srgb, var(--c) 22%, transparent), transparent 55%), var(--grain);
  border: 2px solid rgba(255, 255, 255, .9);
  box-shadow: var(--shadow-lift);
  animation: hero-in .45s cubic-bezier(.2, .8, .2, 1);
}
@keyframes hero-in { from { transform: translateY(10px) scale(.98); opacity: .2; } }
.hero-frame {
  position: relative; width: 220px; height: 220px; border-radius: 28px; padding: 6px;
  background: linear-gradient(140deg, #FFFFFF, color-mix(in srgb, var(--c) 40%, #FFFFFF));
  box-shadow: 0 12px 30px color-mix(in srgb, var(--c) 35%, transparent);
  transform: rotate(-2deg);
}
.hero-frame::after { content: ''; position: absolute; inset: -14px; border-radius: 40px; background: radial-gradient(circle, color-mix(in srgb, var(--c) 30%, transparent), transparent 70%); z-index: -1; animation: halo 4s ease-in-out infinite; }
@keyframes halo { 50% { transform: scale(1.06); opacity: .7; } }
.hero-portrait { width: 100%; height: 100%; border-radius: 22px; overflow: hidden; background: var(--c); }
.hero-portrait .portrait { animation: bob 3s ease-in-out infinite; }
.hero-title { display: block; font-size: .85rem; font-weight: 700; color: color-mix(in srgb, var(--c) 70%, var(--ink)); text-transform: uppercase; letter-spacing: .06em; }
.hero-txt > b { display: block; font-family: var(--display); font-weight: 400; font-size: 2.3rem; line-height: 1.05; color: var(--ink); margin: .1em 0 .3em; }
.hero-power { display: flex; gap: 10px; align-items: flex-start; margin: 0; padding: 10px 12px; border-radius: 16px; background: rgba(255, 255, 255, .75); border: 1.5px dashed color-mix(in srgb, var(--c) 40%, var(--line)); font-size: .95rem; line-height: 1.35; }
.hero-power b { display: block; color: color-mix(in srgb, var(--c) 75%, var(--ink)); font-weight: 800; }
.hero-nav { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--line); background: var(--cream); display: grid; place-items: center; cursor: pointer; color: var(--ink-soft); transition: transform .15s, color .15s; }
.hero-nav:hover { color: var(--ink); transform: scale(1.08); }
.hero-nav .uic { width: 20px; height: 20px; }

.char-row { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.char-opt {
  --c: var(--night);
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: transparent; border: 0; border-radius: 16px;
  padding: 8px 6px 4px; cursor: pointer; color: #33506F; font-size: .82rem; font-weight: 700;
  transition: transform .18s, background .18s;
}
.char-opt .face { width: 54px; height: 54px; transition: transform .2s, box-shadow .2s; }
.char-opt:hover .face { transform: translateY(-3px) scale(1.04); }
.char-opt[aria-checked="true"] { background: rgba(255, 255, 255, .6); color: var(--ink); }
.char-opt[aria-checked="true"] .face { transform: translateY(-3px) scale(1.1); box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--c), 0 10px 20px color-mix(in srgb, var(--c) 45%, transparent); }
.char-opt[aria-checked="true"] .face .portrait { animation: bob 2.4s ease-in-out infinite; }
.char-opt[disabled] { opacity: .35; cursor: not-allowed; }
.char-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.char-grid .char-opt { color: var(--ink); }

.home-panel { padding: 24px; display: flex; flex-direction: column; gap: 12px; animation: panel-in .6s .1s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes panel-in { from { transform: translateX(24px); opacity: 0; } }
.field { display: flex; flex-direction: column; gap: .3em; }
.field > span { font-weight: 800; font-size: .9rem; color: var(--ink-soft); }
.btn.big { min-height: 68px; border-radius: 22px; justify-content: flex-start; padding: 10px 18px; gap: 14px; text-align: left; }
.btn.big .btn-ico { width: 44px; height: 44px; border-radius: 50%; background: rgba(255, 255, 255, .55); display: grid; place-items: center; flex: none; }
.btn.big .btn-ico .uic { width: 22px; height: 22px; fill: currentColor; }
.btn-txt { display: flex; flex-direction: column; line-height: 1.15; }
.btn-txt b { font-size: 1.25rem; font-weight: 800; }
.btn-txt small { font-size: .85rem; font-weight: 600; opacity: .8; }
#btn-quick { animation: beckon-soft 2.8s ease-in-out infinite; }
@keyframes beckon-soft { 0%, 100% { box-shadow: 0 4px 0 var(--sun-deep), 0 10px 22px rgba(221, 149, 49, .3), 0 0 0 0 rgba(255, 203, 92, .55); } 50% { box-shadow: 0 4px 0 var(--sun-deep), 0 10px 22px rgba(221, 149, 49, .3), 0 0 0 10px rgba(255, 203, 92, 0); } }
.btn.resume { background: linear-gradient(180deg, #FFFFFF, var(--river-soft)); border-color: #9CC8DD; box-shadow: 0 4px 0 #9CC8DD; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile-btn { flex-direction: column; align-items: flex-start; gap: 2px; border-radius: 20px; padding: 12px 14px; min-height: 0; white-space: normal; text-align: left; }
.tile-btn .uic { width: 26px; height: 26px; color: var(--river); margin-bottom: 4px; }
.tile-btn b { font-size: 1.02rem; }
.tile-btn small { font-weight: 500; color: var(--ink-soft); font-size: .8rem; line-height: 1.25; }
.join { display: flex; gap: 8px; }
.join input { flex: 1; text-transform: uppercase; letter-spacing: .14em; font-weight: 700; }
.home-links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 14px; padding-top: 4px; border-top: 2px dashed var(--line); }

/* ---------- lobby ---------- */
.lobby { max-width: 780px; margin: 0 auto; padding: 24px 16px calc(40px + var(--safe-b)); }
.lobby-head { padding: 16px 20px 18px; margin-bottom: 16px; }
.lobby-title { font-family: var(--display); font-weight: 400; color: var(--ink); font-size: 2.2rem; margin: .25em 0 .1em; }
.room { display: flex; align-items: center; gap: 10px 12px; flex-wrap: wrap; margin: 8px 0; padding: 10px 14px; border-radius: 18px; background: var(--river-soft); }
.room > span { font-weight: 700; color: var(--ink-soft); }
.room strong { font-family: var(--display); font-size: 1.9rem; color: var(--ink); letter-spacing: .16em; font-weight: 400; }
.status-line { color: var(--ink-soft); margin: .4em 0 0; font-weight: 600; }
.seats { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 12px; }
.seat {
  --c: var(--night);
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px;
  padding: 14px 16px; border-radius: 24px;
  background: rgba(255, 251, 240, .92);
  background-image: linear-gradient(100deg, color-mix(in srgb, var(--c) 16%, transparent), transparent 50%), var(--grain);
  border: 2px solid rgba(255, 255, 255, .9);
  box-shadow: var(--shadow-soft);
  animation: seat-in .4s cubic-bezier(.2, .8, .2, 1) both;
}
.seat:nth-child(2) { animation-delay: .05s; } .seat:nth-child(3) { animation-delay: .1s; } .seat:nth-child(4) { animation-delay: .15s; }
@keyframes seat-in { from { transform: translateY(12px) scale(.97); opacity: 0; } }
.seat-pick { position: relative; background: none; border: 0; padding: 0; cursor: pointer; border-radius: 50%; }
.seat-pick .face { width: 64px; height: 64px; }
.seat-pick:disabled { cursor: default; }
.seat-edit { position: absolute; left: 50%; bottom: -8px; transform: translateX(-50%); font-size: .68rem; background: var(--sun); color: #4A3410; border-radius: 999px; padding: 0 .55em; font-weight: 800; box-shadow: 0 2px 0 var(--sun-deep); }
.seat-body { min-width: 0; }
.seat-name { font-weight: 800; font-size: 1.1rem; }
.seat-tags .tag:first-child { margin-left: 0; }
.seat-meta { font-size: .88rem; color: var(--ink-soft); margin-top: 2px; }
.seat-meta b { color: color-mix(in srgb, var(--c) 70%, var(--ink)); font-weight: 800; }
.seat input { width: 100%; max-width: 14em; font-weight: 700; }
.lobby-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.lobby-actions .primary { margin-left: auto; }
.big-ish { min-height: 52px; font-size: 1.1rem; padding: .5em 1.6em; }
.voice-slot { display: inline-flex; gap: 6px; align-items: center; }
.lobby .voice-slot { margin-top: 8px; }
.voice-btn { position: relative; }
.voice-btn b { font-weight: inherit; }
.voice-btn .vb-short { display: none; }
.voice-btn.join { background: linear-gradient(180deg, #E4F6DC, #BFE6AE); color: #24502A; }
.voice-btn.join.others { animation: voice-call 1.6s ease-in-out infinite; }
@keyframes voice-call { 0%, 100% { box-shadow: 0 4px 0 var(--outline), 0 0 0 0 rgba(120, 178, 95, .7); } 50% { box-shadow: 0 4px 0 var(--outline), 0 0 0 9px rgba(120, 178, 95, 0); } }
.vb-count { position: absolute; top: -8px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--rose); color: #fff; font-style: normal; font-size: .72rem; font-weight: 800; display: grid; place-items: center; border: 2px solid var(--outline); }
.voice-btn.on { background: linear-gradient(180deg, #E4F6DC, #BFE6AE); color: #24502A; }
.voice-btn.muted { background: var(--rose-soft); color: var(--clay); }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: #3DB45A; box-shadow: 0 0 0 0 rgba(61, 180, 90, .7); animation: live 1.4s ease-out infinite; font-style: normal; }
.voice-btn.muted .live-dot { background: var(--clay); animation: none; }
@keyframes live { to { box-shadow: 0 0 0 7px rgba(61, 180, 90, 0); } }
.lobby .voice-btn { min-height: 44px; font-size: 1rem; padding: .4em 1.1em; }

.chat { margin-top: 20px; padding: 14px 16px; }
.chat-list { list-style: none; margin: 0 0 8px; padding: 0; max-height: 200px; overflow: auto; font-size: .94rem; }
.chat-list li { padding: 3px 0; }
.chat-list li b, .log li b { color: var(--clay); font-weight: 700; }
.chat-form { display: flex; gap: 8px; }
.chat-form input { flex: 1; padding: .35em .8em; font-size: .95rem; min-height: 40px; }

/* ---------- game layout ---------- */
.topbar {
  display: flex; align-items: center; gap: 12px; padding: 0 16px; height: var(--top);
  background: rgba(255, 251, 240, .78);
  border-bottom: 2px solid rgba(255, 255, 255, .85);
  box-shadow: 0 6px 20px rgba(60, 80, 110, .1);
  backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 20;
}
.logo.small { font-size: 1.5rem; color: var(--ink); text-shadow: none; }
.top-room { font-size: .9rem; color: var(--ink-soft); white-space: nowrap; font-weight: 600; }
.top-room b { color: var(--ink); letter-spacing: .1em; }
.net-status { font-size: .85rem; color: var(--clay); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; font-weight: 600; }
.top-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.xp-chip {
  display: flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: 999px;
  background: #FFFFFF; border: 2px solid var(--line); cursor: pointer; min-width: 128px;
}
.xp-chip .xpbar { flex: 1; }
.xp-chip.glow { animation: chip-glow .9s ease-out; }
@keyframes chip-glow { 0% { box-shadow: 0 0 0 0 rgba(255, 203, 92, .9); transform: scale(1.06); } 100% { box-shadow: 0 0 0 14px rgba(255, 203, 92, 0); transform: scale(1); } }

.table {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  grid-template-areas: "board side";
  gap: 18px;
  padding: 14px 18px;
  height: calc(100vh - var(--top));
  height: calc(100dvh - var(--top));
}
.pstrip { grid-area: strip; display: none; }
.board-wrap { grid-area: board; display: flex; align-items: center; justify-content: center; min-width: 0; min-height: 0; }
.side { grid-area: side; display: flex; flex-direction: column; gap: 12px; min-height: 0; overflow: auto; padding: 2px 4px 8px 2px; }
.dock { grid-area: dock; display: none; }
.feed { grid-area: feed; display: none; list-style: none; margin: 0; padding: 4px 12px; font-size: .9rem; color: var(--ink); overflow: hidden; align-content: start; background: rgba(255, 251, 240, .75); border-radius: 18px; }
.feed li { padding: 5px 0 5px 16px; position: relative; border-bottom: 1px dashed var(--line); line-height: 1.3; }
.feed li:last-child { border-bottom: 0; }
.feed li::before { content: ''; position: absolute; left: 0; top: .75em; width: 7px; height: 7px; border-radius: 50%; background: var(--sun); box-shadow: 0 0 0 2px #fff; }
.feed li.new { animation: feed-in .4s ease-out; }
@keyframes feed-in { from { transform: translateX(-12px); opacity: 0; } }
.panel {
  background: rgba(255, 251, 240, .9);
  background-image: var(--grain);
  border: 2px solid rgba(255, 255, 255, .9);
  border-radius: 22px;
  padding: 12px 14px 14px;
  box-shadow: var(--shadow-soft);
}
.panel h3 { font-family: var(--display); font-weight: 400; color: var(--ink); margin: 0 0 8px; font-size: 1.2rem; display: flex; align-items: center; gap: 8px; }
.panel h3::before { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--sun); box-shadow: 0 0 0 3px var(--sun-2); }
.chronicle { flex: 1; min-height: 180px; display: flex; flex-direction: column; }
.log { list-style: none; margin: 0; padding: 0; overflow: auto; flex: 1; font-size: .9rem; max-height: 340px; }
.log li { padding: 5px 0; border-bottom: 1px dashed var(--line); color: var(--ink-soft); }
.log li:first-child { color: var(--ink); font-weight: 600; }
.log li.chat-line { color: var(--ink); }
.chronicle .chat-form { margin-top: 8px; }

/* players */
.players { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.pl {
  display: grid; grid-template-columns: auto 1fr auto; gap: 4px 10px; align-items: center;
  padding: 8px 10px; border-radius: 18px; border: 2px solid transparent; transition: background .3s, border-color .3s, transform .3s;
}
.pl.now { border-color: var(--sun); background: linear-gradient(100deg, #FFF6D8, rgba(255, 246, 216, .3)); transform: translateX(2px); }
.pl.out { opacity: .45; }
.pl-face { background: none; border: 0; padding: 0; cursor: pointer; border-radius: 50%; grid-row: span 2; }
.pl-face .face { width: 44px; height: 44px; }
.pl.now .pl-face .face .portrait { animation: bob 2.4s ease-in-out infinite; }
.pl-name { font-weight: 800; line-height: 1.25; }
.pl-meta { font-size: .78rem; color: var(--ink-soft); line-height: 1.3; }
.pl-cash { font-weight: 800; font-variant-numeric: tabular-nums; transition: color .3s, transform .3s; white-space: nowrap; }
.pl-cash.gain { color: var(--leaf); transform: scale(1.1); }
.pl-cash.loss { color: var(--clay); transform: scale(.95); }
.pl-sets { display: flex; gap: 2px; margin-top: 3px; flex-wrap: wrap; }
.pl-sets i { width: 9px; height: 9px; border-radius: 3px; display: block; box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .15); }
.race { grid-column: 2 / -1; height: 5px; border-radius: 9px; background: rgba(59, 58, 54, .08); overflow: hidden; }
.race i { display: block; height: 100%; border-radius: inherit; transition: width .8s cubic-bezier(.2, .8, .2, 1); opacity: .85; }
.pl-actions { grid-column: 1 / -1; display: flex; gap: 6px; }

/* phone player strip */
.pstrip { gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 4px 2px 6px; scroll-snap-type: x proximity; }
.pstrip::-webkit-scrollbar { display: none; }
.chip {
  position: relative; flex: none; scroll-snap-align: start;
  display: flex; align-items: center; gap: 8px; padding: 5px 12px 5px 5px;
  border-radius: 999px; border: 2px solid rgba(255, 255, 255, .9);
  background: rgba(255, 251, 240, .9); cursor: pointer; text-align: left; box-shadow: var(--shadow-soft);
  transition: border-color .3s, background .3s, transform .3s;
}
.chip .face { width: 36px; height: 36px; }
.chip.now { border-color: var(--sun); background: #FFF6D8; transform: translateY(-2px); }
.chip.now .face .portrait { animation: bob 2.4s ease-in-out infinite; }
.chip.me .chip-txt b::after { content: ' (you)'; font-weight: 600; color: var(--ink-faint); font-size: .75em; }
.chip.out { opacity: .45; }
.chip-txt { display: flex; flex-direction: column; line-height: 1.15; }
.chip-txt b { font-size: .86rem; font-weight: 800; max-width: 8em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-txt .pl-cash { font-size: .82rem; }
.chip-mic { position: absolute; left: 30px; top: -2px; width: 18px; height: 18px; border-radius: 50%; background: var(--leaf-2); color: #fff; display: grid; place-items: center; }
.chip-mic .uic { width: 11px; height: 11px; }
.chip-mic.muted { background: var(--rose); }
.chip-flag { position: absolute; right: 6px; top: -8px; font-size: .62rem; background: var(--leaf); color: #fff; border-radius: 999px; padding: 0 .5em; font-weight: 700; }

/* realms list */
.realms { display: flex; flex-direction: column; gap: 6px; }
.realms .empty { color: var(--ink-soft); font-size: .92rem; margin: 0; }
.realm-row {
  display: grid; grid-template-columns: 8px 1fr auto; gap: 10px; align-items: center;
  background: #FFFFFF; border-radius: 12px; padding: 6px 10px 6px 0; overflow: hidden;
  border: 1.5px solid var(--line); text-align: left; cursor: pointer; width: 100%; min-height: 42px; color: var(--ink);
  transition: transform .15s, box-shadow .15s;
}
.realm-row:hover { transform: translateX(2px); box-shadow: 0 4px 10px rgba(60, 80, 110, .1); }
.realm-row .sw { align-self: stretch; width: 8px; height: auto; border-radius: 0; }
.realm-row .nm { font-size: .94rem; font-weight: 700; }
.realm-row .st { font-size: .78rem; color: var(--ink-soft); font-weight: 600; }
.realm-row.mort .nm { text-decoration: line-through; opacity: .6; }
.realm-row.note { cursor: default; }

/* ---------- board ---------- */
.board {
  container-type: size;
  aspect-ratio: 1;
  width: min(100%, calc(100vh - var(--top) - 32px));
  width: min(100%, calc(100dvh - var(--top) - 32px));
  display: grid;
  grid-template-columns: 1.55fr repeat(9, 1fr) 1.55fr;
  grid-template-rows: 1.55fr repeat(9, 1fr) 1.55fr;
  gap: .35cqw;
  padding: .9cqw;
  background: linear-gradient(145deg, #D9B07A, #B98552 55%, #A06E40);
  border-radius: 2.4cqw;
  box-shadow:
    inset 0 0 0 .3cqw rgba(255, 240, 210, .45),
    0 0 0 .5cqw #FFF7E6,
    0 1.6cqw 4cqw rgba(50, 70, 100, .35),
    0 .4cqw 0 .5cqw #E2CDA4;
  position: relative;
}
.tile {
  position: relative;
  background: #FFF9EC;
  color: var(--ink);
  display: flex;
  overflow: hidden;
  cursor: pointer;
  padding: 0;
  border: 0;
  border-radius: .6cqw;
  font-size: 1.28cqw;
  line-height: 1.1;
  text-align: center;
  transition: background .2s, transform .15s, box-shadow .15s;
  box-shadow: inset 0 -.25cqw 0 rgba(160, 120, 70, .14);
}
.tile:hover { background: #FFFFFF; transform: scale(1.06); z-index: 3; box-shadow: 0 .6cqw 1.6cqw rgba(60, 50, 30, .3); }
.tile.flash { animation: flash 1.1s ease-out; }
@keyframes flash { 0% { box-shadow: inset 0 0 0 .5cqw var(--sun); background: #FFF0C4; } 100% { box-shadow: inset 0 0 0 0 transparent; } }
.tile .band { flex: none; position: relative; display: flex; align-items: center; justify-content: center; gap: 1px; background-image: linear-gradient(180deg, rgba(255, 255, 255, .28), rgba(0, 0, 0, .06)) !important; }
.tile .band.grow .bld { animation: grow .6s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes grow { from { transform: scale(0) translateY(40%); } }
.tile .body { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: .35em .2em .3em; min-width: 0; min-height: 0; }
.tile .nm { font-weight: 700; overflow-wrap: anywhere; }
.tile .pr { font-size: .92em; color: var(--ink-soft); font-variant-numeric: tabular-nums; font-weight: 600; }
.tile .ico { width: 2.6em; height: 2.6em; color: var(--ink-soft); flex: none; }
.tile.leela { background: #F1F4FF; }
.tile.leela .ico { color: #5B7FD6; }
.tile.ashirvad { background: #FFF1F5; }
.tile.ashirvad .ico { color: #C8467A; }
.tile.tax .ico { color: var(--clay); }
.tile.tirtha { background: #EFF8FC; }
.tile.tirtha .ico { color: var(--river); }
.tile.util { background: #FFF7E2; }
.tile.util .ico { color: #A9781C; }

.tile.s-bottom { flex-direction: column; }
.tile.s-top { flex-direction: column-reverse; }
.tile.s-left { flex-direction: row-reverse; }
.tile.s-right { flex-direction: row; }
.tile.s-bottom .band, .tile.s-top .band { height: 22%; width: 100%; }
.tile.s-left .band, .tile.s-right .band { width: 22%; height: 100%; flex-direction: column; }

.bld { width: 1.1em; height: 1.1em; display: block; filter: drop-shadow(0 1px 0 rgba(0, 0, 0, .25)); }
.bld.temple { color: #FFE9A8; }
.bld.palace { width: 1.6em; height: 1.4em; }

.owner-mark {
  position: absolute; width: 1.6em; height: 1.6em; border-radius: 50%;
  border: .22em solid #FFFFFF; box-shadow: 0 .15em .4em rgba(0, 0, 0, .3);
}
.owner-mark::after { content: ''; position: absolute; inset: 22%; border-radius: 50%; background: rgba(255, 255, 255, .45); }
.owner-mark.stamp { animation: stamp .55s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes stamp { 0% { transform: scale(3) rotate(-30deg); opacity: 0; } 60% { opacity: 1; } 100% { transform: scale(1); } }
.s-bottom .owner-mark { top: .25em; right: .25em; }
.s-top .owner-mark { bottom: .25em; right: .25em; }
.s-left .owner-mark { right: .25em; bottom: .25em; }
.s-right .owner-mark { left: .25em; bottom: .25em; }
.tile.mortgaged .body { opacity: .45; }
.tile.mortgaged::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(135deg, transparent 0 6px, rgba(59, 58, 54, .1) 6px 8px);
}

.tile.corner { background: linear-gradient(160deg, #FFFDF4, #F6EBD0); flex-direction: column; align-items: center; justify-content: center; gap: .3em; padding: .4em; border-radius: 1cqw; }
.tile.corner .ico { width: 4.6em; height: 4.6em; }
.tile.corner .nm { font-family: var(--display); font-weight: 400; font-size: 1.35em; color: var(--ink); }
.tile.corner .sub { font-size: .85em; color: var(--ink-soft); font-weight: 600; }
.tile.corner.go { background: linear-gradient(160deg, #FFF4E8, #FAD9C8); }
.tile.corner.go .ico { color: var(--clay); }
.tile.corner.exile { background: linear-gradient(160deg, #F2FAEC, #D6EBC8); }
.tile.corner.exile .ico { color: var(--leaf); }
.tile.corner.rest { background: linear-gradient(160deg, #FFFBEA, #F7E6B5); }
.tile.corner.rest .ico { color: #B8892E; }
.tile.corner.dice { background: linear-gradient(160deg, #F1F4FF, #D9DFF7); }
.tile.corner.dice .ico { color: #5B7FD6; }

/* tokens: character heads that hop from tile to tile */
.tok-layer { position: absolute; inset: 0; pointer-events: none; z-index: 5; }
.token {
  --c: var(--night);
  position: absolute; width: 5cqw; height: 5cqw; margin: -2.5cqw 0 0 -2.5cqw;
  transition: left .14s ease-out, top .14s ease-out;
  z-index: 1;
}
.token::after { content: ''; position: absolute; left: 12%; right: 12%; bottom: -14%; height: 22%; border-radius: 50%; background: rgba(40, 40, 30, .28); filter: blur(1px); z-index: -1; transition: transform .2s; }
.token .tk-in {
  width: 100%; height: 100%; border-radius: 50%; overflow: hidden;
  background: var(--c);
  border: .3cqw solid #FFFFFF;
  box-shadow: 0 0 0 .3cqw var(--c), 0 .4cqw .8cqw rgba(30, 30, 20, .35);
}
.token.cur { z-index: 3; }
.token.cur .tk-in { box-shadow: 0 0 0 .3cqw var(--c), 0 0 0 .8cqw rgba(255, 203, 92, .6), 0 .4cqw .8cqw rgba(30, 30, 20, .35); animation: pulse 1.6s ease-in-out infinite; }
.token.hop .tk-in { animation: hop .24s ease-out; }
.token.hop::after { animation: hop-shadow .24s ease-out; }
.token.jailed .tk-in { outline: .3cqw dashed var(--leaf); outline-offset: .3cqw; }
@keyframes hop { 0% { transform: translateY(0) scale(1.08, .9); } 40% { transform: translateY(-55%) scale(.94, 1.08); } 85% { transform: translateY(0) scale(1.1, .88); } 100% { transform: translateY(0) scale(1); } }
@keyframes hop-shadow { 40% { transform: scale(.6); opacity: .5; } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.07); } }
.puff { position: absolute; width: 6cqw; height: 2.4cqw; margin: -.6cqw 0 0 -3cqw; pointer-events: none; }
.puff::before, .puff::after { content: ''; position: absolute; top: 0; width: 2.2cqw; height: 2.2cqw; border-radius: 50%; background: rgba(255, 250, 235, .9); animation: puff .6s ease-out forwards; }
.puff::before { left: 0; --dx: -1.4cqw; }
.puff::after { right: 0; --dx: 1.4cqw; }
@keyframes puff { from { transform: scale(.4); opacity: 1; } to { transform: translateX(var(--dx)) scale(1.3); opacity: 0; } }

/* ---------- board centre ---------- */
.centre {
  grid-row: 2 / 11;
  grid-column: 2 / 11;
  position: relative;
  overflow: hidden;
  border-radius: 1.4cqw;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  padding: 3.2cqw 3cqw 3cqw;
  gap: 1cqw;
  text-align: center;
  box-shadow: inset 0 0 0 .3cqw rgba(255, 255, 255, .5);
}
.centre-art { position: absolute; inset: 0; width: 100%; height: 100%; }
.cs-clouds { animation: cs-drift 30s ease-in-out infinite alternate; }
@keyframes cs-drift { to { transform: translateX(40px); } }
.centre > :not(.centre-art) { position: relative; }
.centre .logo { font-size: 6cqw; text-shadow: 0 .3cqw 0 #5C8FC0, 0 .8cqw 1.6cqw rgba(40, 80, 130, .3); }
.centre .round { font-size: 1.5cqw; color: #33506F; font-weight: 800; margin-top: -.4cqw; background: rgba(255, 255, 255, .7); padding: 0 1.2cqw; border-radius: 99px; }
.dice-zone { position: relative; width: 22cqw; height: 18cqw; display: grid; place-items: center; }
.chakra { position: absolute; inset: -2cqw 0; width: 100%; height: calc(100% + 4cqw); opacity: .55; }
.chakra g { stroke: #FFFFFF; }
.chakra.spin { animation: spin 1s cubic-bezier(.2, .7, .2, 1); }
@keyframes spin { to { transform: rotate(540deg); } }
.dice { display: flex; gap: 2.4cqw; position: relative; z-index: 1; perspective: 70cqw; }
.die { --d: 7cqw; position: relative; width: var(--d); height: var(--d); }
.cube { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform .85s cubic-bezier(.2, .75, .25, 1.06); }
.cube.instant { transition: none; }
.face-d {
  position: absolute; inset: 0;
  background: radial-gradient(circle at 30% 25%, #FFFFFF, #FFF6E2 70%, #F2E3C2);
  border-radius: 1.3cqw;
  display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); padding: 1cqw;
  box-shadow: inset 0 0 0 .2cqw rgba(200, 170, 120, .55), inset 0 -.5cqw 1cqw rgba(170, 130, 70, .2);
  backface-visibility: hidden;
}
.face-d i { width: 1.3cqw; height: 1.3cqw; border-radius: 50%; background: var(--ink); place-self: center; visibility: hidden; box-shadow: inset 0 .2cqw 0 rgba(255, 255, 255, .25); }
.face-d i.on { visibility: visible; }
.face-d.red i.on { background: var(--clay); width: 1.8cqw; height: 1.8cqw; }
.f1 { transform: translateZ(calc(var(--d) / 2)); }
.f6 { transform: rotateY(180deg) translateZ(calc(var(--d) / 2)); }
.f2 { transform: rotateY(90deg) translateZ(calc(var(--d) / 2)); }
.f5 { transform: rotateY(-90deg) translateZ(calc(var(--d) / 2)); }
.f3 { transform: rotateX(90deg) translateZ(calc(var(--d) / 2)); }
.f4 { transform: rotateX(-90deg) translateZ(calc(var(--d) / 2)); }
.die-shadow { position: absolute; left: 6%; right: 6%; bottom: -1.6cqw; height: 1.4cqw; border-radius: 50%; background: rgba(40, 50, 40, .28); filter: blur(.3cqw); transform: translateZ(-10px); }
.dice.rolling .die { animation: toss .82s cubic-bezier(.3, .6, .4, 1); }
.dice.rolling .die:nth-child(2) { animation-delay: .04s; }
.dice.rolling .die-shadow { animation: toss-shadow .82s cubic-bezier(.3, .6, .4, 1); }
@keyframes toss { 0% { transform: translateY(0); } 35% { transform: translateY(-5cqw); } 70% { transform: translateY(0); } 85% { transform: translateY(-1cqw); } 100% { transform: translateY(0); } }
@keyframes toss-shadow { 35% { transform: translateY(5cqw) scale(.55); opacity: .4; } }
.dice.settle .die { animation: settle .35s ease-out; }
.dice.doubles .face-d { box-shadow: inset 0 0 0 .3cqw var(--sun), 0 0 2cqw rgba(255, 203, 92, .9); }
@keyframes settle { 50% { transform: scale(1.12); } }

.centre-ui {
  display: flex; flex-direction: column; align-items: center; gap: 1cqw;
  margin-top: auto;
  padding: 1.6cqw 2.2cqw 1.8cqw;
  border-radius: 2.4cqw;
  background: rgba(255, 251, 240, .9);
  border: .25cqw solid rgba(255, 255, 255, .95);
  box-shadow: 0 1cqw 3cqw rgba(50, 70, 100, .22);
  backdrop-filter: blur(4px);
  max-width: 70cqw;
  animation: card-up .35s cubic-bezier(.2, .8, .2, 1);
}
@keyframes card-up { from { transform: translateY(8px); opacity: .4; } }
.trade-note {
  display: flex; align-items: center; gap: .6em; flex-wrap: wrap; justify-content: center;
  padding: .4em .8em; border-radius: 16px; font-size: max(12px, 1.45cqw); font-weight: 600;
  background: #FFF6D8; border: 2px solid var(--sun-2);
  animation: rise .3s ease-out;
}
.trade-note.in { background: var(--leaf-soft); border-color: #9CCB88; animation: rise .3s ease-out, glow-in 1.6s ease-in-out infinite; }
.trade-note .face { width: 28px; height: 28px; }
.trade-note b { color: var(--clay); font-weight: 800; }
.trade-note .btn { min-height: 30px; }
.dock .trade-note { margin-bottom: 8px; font-size: .85rem; justify-content: flex-start; }
@keyframes glow-in { 0%, 100% { box-shadow: 0 0 0 0 rgba(120, 178, 95, .5); } 50% { box-shadow: 0 0 0 6px rgba(120, 178, 95, 0); } }
.waiting-dots span { animation: dots 1.4s infinite; opacity: .2; }
.waiting-dots span:nth-child(2) { animation-delay: .2s; }
.waiting-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes dots { 50% { opacity: 1; } }
.turn-line { display: flex; align-items: center; gap: 1.2cqw; font-size: 2.1cqw; font-weight: 800; color: var(--ink); }
.turn-line .face { width: 5.4cqw; height: 5.4cqw; }
.prompt { font-size: 1.7cqw; color: var(--ink-soft); max-width: 60cqw; margin: 0; font-weight: 500; }
.prompt b { color: var(--clay); font-weight: 800; }
.acts { display: flex; flex-wrap: wrap; gap: 1cqw; justify-content: center; max-width: 64cqw; }
.centre .acts .btn { font-size: 1.7cqw; padding: .45em 1.05em; min-height: 0; }
.centre .acts .btn.primary { font-size: 2.1cqw; padding: .5em 1.7em; }
.roll-btn { animation: beckon 2.2s ease-in-out infinite; }
@keyframes beckon { 0%, 100% { box-shadow: 0 4px 0 var(--sun-deep), 0 0 0 0 rgba(255, 203, 92, .7); } 50% { box-shadow: 0 4px 0 var(--sun-deep), 0 0 0 12px rgba(255, 203, 92, 0); } }
.krishna-pick { display: flex; flex-wrap: wrap; gap: .6cqw; justify-content: center; max-width: 54cqw; }
.centre .krishna-pick .btn { font-size: 1.7cqw; padding: .3em .7em; min-width: 3.4em; }

/* ---------- dock (phones) ---------- */
.dock {
  background: rgba(255, 251, 240, .96);
  background-image: var(--grain);
  border-top: 2px solid #FFFFFF;
  border-radius: 26px 26px 0 0;
  box-shadow: 0 -12px 34px rgba(50, 70, 100, .2);
  padding: 12px 14px 0;
  z-index: 15;
}
.dock-head { display: flex; gap: 12px; align-items: center; }
.dock-head .face { width: 48px; height: 48px; }
.dock-head b { display: block; font-size: 1.02rem; line-height: 1.2; font-weight: 800; }
.dock-head p { margin: 1px 0 0; font-size: .88rem; color: var(--ink-soft); line-height: 1.3; }
.dock-head p b { display: inline; color: var(--clay); font-size: inherit; }
.dock .acts { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 2px; justify-content: stretch; max-width: none; }
.dock .acts .btn { flex: 1 1 auto; min-height: 46px; font-size: .98rem; }
.dock .acts .btn.primary { flex: 1 1 100%; min-height: 54px; font-size: 1.15rem; border-radius: 18px; }
.dock .krishna-pick { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; flex: 1 1 100%; max-width: none; }
.dock .krishna-pick .btn { min-height: 44px; padding: 0; }
.dock-nav { display: flex; justify-content: space-around; margin-top: 8px; border-top: 2px dashed var(--line); padding-bottom: var(--safe-b); }
.dock-nav button {
  flex: 1; background: none; border: 0; color: var(--ink-soft); cursor: pointer; font-weight: 700;
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0; font-size: .74rem; position: relative;
}
.dock-nav button .uic { width: 22px; height: 22px; }
.dock-nav button:active { color: var(--ink); transform: scale(.94); }
.dock-nav .badge { position: absolute; top: 4px; left: calc(50% + 6px); background: var(--rose); color: #fff; font-style: normal; font-size: .65rem; min-width: 16px; height: 16px; border-radius: 8px; display: grid; place-items: center; padding: 0 4px; }
body:not(.online) .online-only { display: none !important; }

/* ---------- guide tips ---------- */
.coach {
  position: fixed; z-index: 35; left: 50%; bottom: 24px; transform: translateX(-50%);
  width: min(440px, calc(100vw - 24px));
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px; border-radius: 22px;
  background: #FFFFFF; border: 2.5px solid var(--sun);
  box-shadow: 0 16px 40px rgba(50, 70, 100, .28), 0 0 0 6px rgba(255, 223, 143, .35);
}
.coach.in { animation: coach-in .45s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes coach-in { from { translate: 0 24px; scale: .92; opacity: 0; } }
@keyframes coach-down { from { translate: 0 -24px; scale: .92; opacity: 0; } }
@media (min-width: 1101px) {
  .coach { left: auto; right: 22px; bottom: 22px; transform: none; width: 356px; }
}
.coach .face { width: 52px; height: 52px; }
.coach-body b { display: block; font-size: 1.05rem; font-weight: 800; }
.coach-body p { margin: 2px 0 8px; font-size: .92rem; color: var(--ink-soft); line-height: 1.35; }
.coach-acts { display: flex; gap: 14px; align-items: center; }
.coach-acts .link { font-size: .85rem; }

/* ---------- rewards ---------- */
.rewards { position: fixed; inset: 0; pointer-events: none; z-index: 70; }
.xp-pop {
  position: absolute; transform: translateX(-50%);
  font-weight: 800; font-size: 1rem; color: #4A3410;
  padding: 2px 10px; border-radius: 99px; background: var(--sun-2); border: 2px solid var(--sun-deep);
  animation: xp-pop 1.5s ease-out forwards;
}
@keyframes xp-pop { 0% { opacity: 0; transform: translate(-50%, -6px) scale(.6); } 20% { opacity: 1; transform: translate(-50%, 6px) scale(1.1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, 24px) scale(1); } }
.badge-pop {
  position: absolute; left: 50%; top: 76px; transform: translateX(-50%);
  display: flex; gap: 12px; align-items: center; padding: 10px 18px 10px 10px; border-radius: 22px;
  width: max-content; max-width: calc(100vw - 24px);
  background: linear-gradient(120deg, #FFFFFF, #FFF6D8);
  border: 2.5px solid var(--sun); box-shadow: 0 16px 40px rgba(50, 70, 100, .3);
  animation: badge-in .6s cubic-bezier(.2, 1.5, .4, 1);
  overflow: hidden;
}
.badge-pop::after { content: ''; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 35%, rgba(255, 255, 255, .9) 50%, transparent 65%); transform: translateX(-100%); animation: shine 2.2s .4s ease-in-out; }
.badge-pop.out { animation: badge-out .4s ease-in forwards; }
@keyframes badge-in { from { transform: translate(-50%, -40px) scale(.7); opacity: 0; } }
@keyframes badge-out { to { transform: translate(-50%, -30px); opacity: 0; } }
.bp-ico { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; flex: none; color: #FFFFFF; background: radial-gradient(circle at 35% 30%, #FFE6A0, var(--sun) 50%, var(--sun-deep)); box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--sun-deep); animation: spin-badge .8s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes spin-badge { from { transform: rotate(-200deg) scale(.4); } }
.bp-ico .bdg-ico { width: 30px; height: 30px; }
.badge-pop small { display: block; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--sun-deep); }
.badge-pop b { display: block; font-size: 1.1rem; line-height: 1.15; }
.badge-pop span { font-size: .85rem; color: var(--ink-soft); }
.level-up { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: auto; background: rgba(255, 248, 225, .35); animation: fade .3s ease-out; }
.level-up.out { animation: fade-out .5s ease-in forwards; }
@keyframes fade-out { to { opacity: 0; } }
.lu-rays { position: absolute; width: 140vmax; height: 140vmax; background: repeating-conic-gradient(from 0deg, rgba(255, 223, 143, .55) 0 8deg, transparent 8deg 22deg); -webkit-mask: radial-gradient(circle, #000 0, transparent 55%); mask: radial-gradient(circle, #000 0, transparent 55%); animation: rays 8s linear infinite; }
@keyframes rays { to { transform: rotate(360deg); } }
.lu-card { position: relative; display: flex; flex-direction: column; align-items: center; padding: 22px 44px 24px; border-radius: 30px; background: #FFFFFF; border: 3px solid var(--sun); box-shadow: 0 24px 60px rgba(50, 70, 100, .35); animation: pop-hero .7s cubic-bezier(.2, 1.6, .4, 1); }
.lu-card small { font-family: var(--comic); font-size: 1.8rem; letter-spacing: .06em; color: var(--clay); }
.lu-num { font-family: var(--display); font-size: 5rem; line-height: 1; color: var(--sun-deep); text-shadow: 0 4px 0 #FFE6A0; }
.lu-card b { font-size: 1.3rem; }

/* ---------- comic layer ---------- */
.comic-layer { position: fixed; inset: 0; pointer-events: none; z-index: 40; overflow: hidden; }
.comic-panel {
  --c: var(--night);
  position: absolute; transform: translate(-50%, -50%) rotate(-1.2deg);
  width: min(420px, 88vw);
  padding: 24px 18px 16px;
  background: #FFFDF6;
  background-image: radial-gradient(circle at 25% 70%, color-mix(in srgb, var(--c) 22%, transparent), transparent 55%), radial-gradient(circle at 80% 20%, rgba(255, 223, 143, .45), transparent 45%), var(--grain);
  color: var(--ink);
  border: 3.5px solid var(--ink);
  border-radius: 26px;
  box-shadow: 6px 7px 0 var(--ink), 0 30px 60px rgba(40, 60, 90, .3);
  pointer-events: auto; cursor: pointer;
  animation: pop-in .42s cubic-bezier(.3, 1.5, .5, 1) both;
  overflow: visible;
}
.comic-panel.out { animation: pop-out .26s ease-in forwards; }
@keyframes pop-in { from { transform: translate(-50%, -50%) rotate(-8deg) scale(.4); opacity: 0; } }
@keyframes pop-out { to { transform: translate(-50%, -60%) rotate(4deg) scale(.7); opacity: 0; } }
.comic-panel.k-mini { width: min(310px, 80vw); padding: 20px 12px 12px; }
.cp-fx { position: absolute; inset: 0; border-radius: 22px; pointer-events: none; overflow: hidden; }
.cp-fx.speed { background: repeating-conic-gradient(from 0deg at 50% 60%, rgba(59, 58, 54, .07) 0 2deg, transparent 2deg 9deg); animation: speed-in .5s ease-out; }
.cp-fx.sparkle {
  background:
    radial-gradient(circle at 12% 30%, #FFE08A 0 2px, transparent 3px), radial-gradient(circle at 88% 40%, #fff 0 2px, transparent 3px),
    radial-gradient(circle at 70% 85%, #FFE08A 0 2.5px, transparent 4px), radial-gradient(circle at 30% 88%, #fff 0 2px, transparent 3px),
    radial-gradient(circle at 50% 12%, #FFE08A 0 2px, transparent 3px);
  animation: twinkle .8s ease-in-out infinite alternate;
}
@keyframes speed-in { from { transform: scale(1.4); opacity: 0; } }
.cp-burst {
  position: absolute; top: -28px; left: -14px; transform: rotate(-8deg); z-index: 2;
  padding: 14px 24px; min-width: 120px; text-align: center;
  background: linear-gradient(180deg, #FFE48A, #FFC94D); color: var(--clay);
  clip-path: polygon(50% 0%, 61% 16%, 80% 6%, 78% 27%, 100% 30%, 85% 47%, 98% 66%, 77% 68%, 80% 92%, 61% 80%, 50% 100%, 39% 80%, 20% 92%, 23% 68%, 2% 66%, 15% 47%, 0% 30%, 22% 27%, 20% 6%, 39% 16%);
  filter: drop-shadow(3px 3px 0 var(--ink));
  animation: burst .5s cubic-bezier(.3, 1.8, .5, 1) .08s both;
}
.cp-burst span { font-family: var(--comic); font-size: 1.75rem; letter-spacing: .04em; line-height: 1; -webkit-text-stroke: 1px var(--ink); white-space: nowrap; color: #FFFFFF; text-shadow: 2px 2px 0 var(--clay); }
.k-mini .cp-burst span { font-size: 1.4rem; }
.k-jail .cp-burst, .k-tax .cp-burst, .k-rent .cp-burst { background: linear-gradient(180deg, #BFE0F2, #7DB9E3); }
.k-jail .cp-burst span, .k-tax .cp-burst span, .k-rent .cp-burst span { text-shadow: 2px 2px 0 #2F6FA8; }
@keyframes burst { from { transform: rotate(-30deg) scale(0); } }
.cp-cast { position: relative; display: flex; justify-content: space-between; align-items: flex-end; gap: 8px; }
.cp-actor { display: flex; align-items: flex-end; gap: 6px; flex: 1; min-width: 0; }
.cp-actor:only-child { flex: 0 1 auto; margin: 0 auto; }
.cp-actor.right { flex-direction: row-reverse; text-align: right; }
.cp-face {
  flex: none; width: 96px; height: 96px; border-radius: 22px; overflow: hidden;
  background: color-mix(in srgb, var(--c) 35%, var(--cream));
  border: 3px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  animation: actor .5s cubic-bezier(.3, 1.6, .5, 1) .1s both;
}
.k-mini .cp-face { width: 66px; height: 66px; border-radius: 18px; }
.cp-actor.right .cp-face { animation-delay: .25s; }
@keyframes actor { from { transform: translateY(30%) scale(.6); opacity: 0; } }
.k-jail .cp-face .portrait img, .k-tax .cp-face .portrait img { animation: shudder .4s ease-in-out 2; }
.k-buy .cp-face .portrait, .k-set .cp-face .portrait, .k-win .cp-face .portrait, .k-power .cp-face .portrait { animation: bob 1.1s ease-in-out infinite; }
.bubble {
  position: relative; background: #fff; color: var(--ink); border: 2.5px solid var(--ink); border-radius: 18px;
  padding: 7px 11px; font-weight: 700; font-size: .92rem; line-height: 1.25; margin-bottom: 42px;
  box-shadow: 2px 3px 0 rgba(59, 58, 54, .25);
  animation: bubble .35s ease-out .3s both;
}
.bubble::after { content: ''; position: absolute; left: -11px; bottom: 8px; border: 7px solid transparent; border-right: 9px solid var(--ink); }
.bubble::before { content: ''; position: absolute; left: -6px; bottom: 9px; border: 6px solid transparent; border-right: 7px solid #fff; z-index: 1; }
.cp-actor.right .bubble::after { left: auto; right: -11px; border-right: 7px solid transparent; border-left: 9px solid var(--ink); }
.cp-actor.right .bubble::before { left: auto; right: -6px; border-right: 6px solid transparent; border-left: 7px solid #fff; }
@keyframes bubble { from { transform: scale(.4); opacity: 0; } }
.cp-text { position: relative; margin: 10px 0 0; text-align: center; font-weight: 800; font-size: 1.02rem; }
.cp-card { position: relative; display: flex; gap: 10px; align-items: center; background: linear-gradient(140deg, #DCEBFF, #BFDDF7); color: var(--ink); border: 3px solid var(--ink); border-radius: 16px; padding: 10px 12px; margin: 6px 0 10px; animation: flip .5s ease-out .1s both; transform-origin: top; }
.k-ashirvad .cp-card { background: linear-gradient(140deg, #FFF1F5, #FBD3DF); color: var(--ink); }
.cp-card .ico { width: 40px; height: 40px; flex: none; color: #3E7CC4; }
.k-ashirvad .cp-card .ico { color: #C8467A; }
.cp-card p { margin: 0; font-weight: 700; font-size: .96rem; line-height: 1.3; }
@keyframes flip { from { transform: perspective(500px) rotateX(-90deg); opacity: 0; } }

.turn-banner {
  --c: var(--night);
  position: absolute; transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px;
  padding: 6px 20px 6px 6px; border-radius: 999px;
  background: linear-gradient(90deg, var(--c), color-mix(in srgb, var(--c) 65%, #FFFFFF));
  border: 3px solid #FFFFFF; box-shadow: 0 10px 30px color-mix(in srgb, var(--c) 45%, transparent), 0 0 0 3px color-mix(in srgb, var(--c) 60%, var(--ink));
  color: #fff; white-space: nowrap; max-width: 92vw;
  animation: banner 1.9s cubic-bezier(.2, .8, .2, 1) both;
}
.turn-banner .tb-face { width: 48px; height: 48px; border-radius: 50%; overflow: hidden; background: var(--cream); border: 3px solid #FFFFFF; flex: none; }
.turn-banner b { display: block; font-family: var(--comic); font-size: 1.6rem; letter-spacing: .05em; line-height: 1; text-shadow: 2px 2px 0 rgba(0, 0, 0, .25); }
.turn-banner span { font-size: .88rem; opacity: .95; overflow: hidden; text-overflow: ellipsis; display: block; font-weight: 600; }
@keyframes banner {
  0% { transform: translateX(-160%) skewX(-12deg); opacity: 0; }
  18% { transform: translateX(-50%) skewX(0); opacity: 1; }
  82% { transform: translateX(-50%); opacity: 1; }
  100% { transform: translateX(80%) skewX(10deg); opacity: 0; }
}

.float {
  position: absolute; transform: translate(-50%, -100%);
  font-family: var(--comic); font-size: 1.7rem; letter-spacing: .04em;
  -webkit-text-stroke: 1.2px var(--ink);
  animation: float-up 1.6s ease-out forwards;
  pointer-events: none;
}
.float.up { color: #FFD45C; }
.float.down { color: #FF9EB5; }
@keyframes float-up { 0% { opacity: 0; transform: translate(-50%, -60%) scale(.5); } 15% { opacity: 1; transform: translate(-50%, -110%) scale(1.15); } 100% { opacity: 0; transform: translate(-50%, -260%) scale(1); } }

.petal {
  position: absolute; top: -30px; width: 12px; height: 18px;
  border-radius: 50% 50% 50% 50% / 65% 65% 35% 35%;
  animation-name: fall; animation-timing-function: linear; animation-fill-mode: forwards;
  opacity: .95; box-shadow: inset -2px -2px 0 rgba(0, 0, 0, .06);
}
@keyframes fall { to { transform: translate(var(--sway), 110vh) rotate(var(--rot)); } }

/* ---------- modals and sheets ---------- */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; }
.modal-back { position: absolute; inset: 0; background: rgba(60, 90, 130, .35); backdrop-filter: blur(4px); animation: fade .2s ease-out; }
@keyframes fade { from { opacity: 0; } }
.modal-box {
  position: relative;
  width: min(480px, 100%);
  max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px);
  overflow: auto; overscroll-behavior: contain;
  border-radius: 28px;
  animation: rise .3s cubic-bezier(.2, 1.2, .4, 1);
}
.modal-box.wide { width: min(780px, 100%); }
@keyframes rise { from { transform: translateY(16px) scale(.97); opacity: 0; } }

.sheet {
  position: relative;
  background: var(--cream);
  background-image: var(--grain);
  color: var(--ink);
  border-radius: 28px;
  border: 3px solid #FFFFFF;
  box-shadow: 0 30px 70px rgba(40, 60, 90, .35);
  padding: 0 0 20px;
  overflow: hidden;
}
.sheet h2 { font-family: var(--display); font-weight: 400; margin: 0; font-size: 1.9rem; line-height: 1.1; }
.sheet .pad { padding: 0 24px; }
.sheet p { margin: .6em 0; }
.sheet .muted { color: var(--ink-soft); font-size: .93rem; }
.sheet .grp { font-size: .88rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.sheet-head { padding: 18px 24px 16px; color: #fff; margin-bottom: 14px; }
.sheet-head .grp { opacity: .92; }
.sheet-head.plain { background: linear-gradient(120deg, #9FD0EC, #CFE8F6 60%, #FFF0D6); color: var(--ink); position: relative; overflow: hidden; }
.sheet-head.plain::after { content: ''; position: absolute; right: -20px; top: -10px; width: 160px; height: 70px; background: radial-gradient(circle at 30% 60%, #fff 0 22px, transparent 23px), radial-gradient(circle at 55% 45%, #fff 0 30px, transparent 31px), radial-gradient(circle at 80% 60%, #fff 0 22px, transparent 23px); opacity: .8; }
.char-head {
  display: flex; gap: 16px; align-items: center;
  background: linear-gradient(120deg, var(--c), color-mix(in srgb, var(--c) 55%, #FFFFFF));
}
.char-head h2 { color: #fff; text-shadow: 0 2px 0 rgba(0, 0, 0, .18); }
.char-hero { flex: none; width: 96px; height: 96px; border-radius: 22px; overflow: hidden; background: var(--cream); border: 3px solid #fff; box-shadow: 0 8px 20px rgba(0, 0, 0, .2); }
.char-hero.small { width: 76px; height: 76px; }
.char-hero .portrait { animation: bob 2.6s ease-in-out infinite; }
.hero-cash { margin: .2em 0 0 !important; font-weight: 700; }
.sheet-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 24px 0; }
.sheet-actions .hint { width: 100%; margin: .2em 0 0; }
.menu-actions { flex-direction: column; }
.menu-actions .btn { width: 100%; }
.rent { width: 100%; border-collapse: collapse; font-size: .95rem; margin: .4em 0; font-variant-numeric: tabular-nums; }
.rent td { padding: 4px 0; border-bottom: 1px dashed var(--line); }
.rent td:last-child { text-align: right; font-weight: 800; }
.rent tr.on td { color: var(--clay); background: #FFF6D8; }
.owner-line { display: flex; align-items: center; gap: 8px; margin: .6em 0; font-weight: 700; }
.owner-line .face { width: 32px; height: 32px; }
.sec { font-family: var(--display); font-weight: 400; font-size: 1.25rem; margin: 1em 0 .4em; }

/* menu preferences */
.pref-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-weight: 700; }
.seg { display: inline-flex; background: var(--paper-2); border-radius: 99px; padding: 3px; gap: 2px; }
.seg-btn { border: 0; background: transparent; padding: 6px 12px; border-radius: 99px; font-weight: 700; font-size: .88rem; cursor: pointer; color: var(--ink-soft); }
.seg-btn[aria-pressed="true"] { background: #FFFFFF; color: var(--ink); box-shadow: 0 2px 6px rgba(60, 80, 110, .15); }
.seg-btn.solo { background: var(--paper-2); min-width: 64px; }
.seg-btn.solo[aria-pressed="true"] { background: var(--leaf-soft); color: #2F5E2C; }

/* place sheet */
.place .sketch-wrap { position: relative; background: #BFE0F2; border-bottom: 3px solid var(--outline); }
.sketch { display: block; width: 100%; height: auto; }
.sketch .ink { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw .9s ease-out forwards; }
.sketch .ink.dash { stroke-dasharray: .02 .02; stroke-dashoffset: 0; animation: none; }
.sketch .wash { animation: wash .7s ease-out both; }
.sketch .sk-cloud { animation: sk-drift 14s ease-in-out infinite alternate; }
@keyframes sk-drift { to { translate: 12px 0; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes wash { from { opacity: 0; } }
.place-band { position: absolute; left: 0; right: 0; bottom: 0; height: 7px; }
.place .pad { padding-top: 14px; }
.place h2 { margin-bottom: .2em; }
.story { font-size: 1.04rem; line-height: 1.6; margin-top: .4em !important; }
.story::first-letter { font-family: var(--display); font-size: 2.6em; float: left; line-height: .9; margin: .06em .1em 0 0; color: var(--clay); }
.why { font-style: italic; color: var(--ink-soft); border-left: 4px solid var(--sun); padding: 4px 0 4px 12px; background: #FFF9E8; border-radius: 0 12px 12px 0; }

/* trade */
.trade-who { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.who { display: flex; align-items: center; gap: 6px; padding: 4px 14px 4px 4px; border-radius: 999px; border: 2px solid var(--line); background: #fff; cursor: pointer; color: var(--ink); font-weight: 700; }
.who .face { width: 30px; height: 30px; }
.who.on { border-color: var(--sun-deep); background: #FFF6D8; }
.trade-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.trade-col { background: #FFFFFF; border-radius: 18px; padding: 10px 12px; border: 1.5px solid var(--line); }
.trade-col h4 { margin: .1em 0 .5em; font-size: 1rem; display: flex; align-items: center; gap: 8px; }
.trade-col h4 .face { width: 28px; height: 28px; }
.trade-list { display: flex; flex-direction: column; gap: 3px; max-height: 260px; overflow: auto; margin-bottom: 8px; }
.trade-list label { display: flex; align-items: center; gap: 8px; font-size: .95rem; padding: 6px; border-radius: 10px; cursor: pointer; min-height: 40px; font-weight: 600; }
.trade-list label:hover { background: var(--paper); }
.trade-list label.no { opacity: .45; cursor: not-allowed; }
.trade-list input { width: 20px; height: 20px; min-height: 0; accent-color: var(--sun-deep); }
.sw { width: 10px; height: 14px; border-radius: 3px; flex: none; display: inline-block; }
.offer { list-style: none; padding: 0; margin: .3em 0 .8em; }
.offer li { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-weight: 600; }
.cash-in { display: flex; align-items: center; gap: 8px; font-size: .92rem; margin-bottom: 6px; font-weight: 700; }
.cash-in input { width: 7em; padding: .3em .6em; min-height: 38px; }
.bid-row input { width: 9em; }
.ink-log { max-height: 55vh; color: var(--ink); }
.ink-log li { color: var(--ink); }
.sheet .chat-form { margin-top: 10px; }

/* settings */
.settings fieldset { border: 2px solid var(--line); border-radius: 16px; padding: 8px 12px 10px; margin: 0 0 10px; background: #FFFFFF; }
.settings legend { font-weight: 800; padding: 0 4px; }
.settings label { display: flex; flex-direction: column; gap: 3px; font-size: .88rem; font-weight: 700; margin-bottom: 8px; }
.settings .two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.settings label.check { flex-direction: row; align-items: flex-start; gap: 8px; font-weight: 600; margin: 12px 0 4px; }
.settings label.check input { width: 20px; height: 20px; min-height: 0; flex: none; margin-top: 2px; accent-color: var(--sun-deep); }
.test-res { list-style: none; padding: 10px 12px; margin: 10px 0 0; background: var(--paper); border-radius: 12px; font-size: .92rem; }
.test-res li::before { content: ''; display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #A8987C; margin-right: 8px; }
.test-res li.good::before { background: var(--leaf-2); }
.test-res li.bad::before { background: var(--clay); }
p.test-res.bad { color: var(--clay); }

/* results */
.win { text-align: center; padding: 30px 0 22px; }
.win-rays { position: absolute; left: 50%; top: 100px; width: 520px; height: 520px; margin: -260px 0 0 -260px; background: repeating-conic-gradient(from 0deg, rgba(255, 223, 143, .5) 0 8deg, transparent 8deg 20deg); -webkit-mask: radial-gradient(circle, #000 0, transparent 60%); mask: radial-gradient(circle, #000 0, transparent 60%); animation: rays 14s linear infinite; pointer-events: none; }
.win > *:not(.win-rays) { position: relative; }
.win-hero { width: 156px; height: 156px; margin: 0 auto 12px; border-radius: 30px; overflow: hidden; background: var(--c); border: 4px solid #FFFFFF; box-shadow: 0 0 0 4px var(--sun), 0 18px 40px rgba(40, 60, 90, .3); animation: pop-hero .7s cubic-bezier(.3, 1.6, .5, 1); }
.win-hero .portrait { animation: bob 1.2s ease-in-out infinite; }
@keyframes pop-hero { from { transform: scale(.3) rotate(-12deg); } }
.standings { list-style: none; padding: 0 24px; margin: 14px 0 12px; text-align: left; counter-reset: rank; }
.standings li { display: grid; grid-template-columns: 26px auto 1fr auto; align-items: center; gap: 10px; padding: 8px 10px; counter-increment: rank; border-radius: 14px; font-weight: 700; }
.standings li + li { margin-top: 4px; }
.standings li::before { content: counter(rank); font-weight: 800; color: var(--ink-soft); display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--paper-2); }
.standings li.gold { background: #FFF3CC; } .standings li.gold::before { background: var(--sun); color: #4A3410; }
.standings li.silver::before { background: #DDE3EA; }
.standings li.bronze::before { background: #F2C9A8; }
.standings .face { width: 34px; height: 34px; }
.reward-box { margin: 6px 24px 4px; padding: 14px 16px; border-radius: 20px; background: #FFFFFF; border: 2px solid var(--sun-2); text-align: left; }
.reward-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.reward-head .lvl-badge { width: 46px; height: 46px; font-size: 1.2rem; }
.reward-head b { display: block; font-size: 1.4rem; line-height: 1.1; color: var(--sun-deep); }
.reward-head span { font-size: .9rem; color: var(--ink-soft); font-weight: 700; }
.reward-box .xpbar i { width: 0; }
.xp-items { list-style: none; padding: 0; margin: 10px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 2px 18px; font-size: .9rem; }
.xp-items li { display: flex; justify-content: space-between; border-bottom: 1px dashed var(--line); padding: 2px 0; }
.xp-items b { color: var(--leaf); }
.new-badges { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.new-badges p { margin: 0 6px 0 0; font-weight: 800; font-size: .85rem; }
.badge-pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 4px; border-radius: 99px; background: #FFF3CC; font-weight: 700; font-size: .85rem; }
.badge-pill .bdg-ico { width: 22px; height: 22px; padding: 3px; border-radius: 50%; background: var(--sun); color: #fff; }

/* trophy hall */
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stat-row > div { background: #FFFFFF; border-radius: 16px; padding: 10px 6px; text-align: center; border: 1.5px solid var(--line); }
.stat-row b { display: block; font-size: 1.4rem; line-height: 1.1; }
.stat-row span { font-size: .78rem; color: var(--ink-soft); font-weight: 700; }
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.bdg { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; padding: 12px 8px; border-radius: 18px; background: rgba(59, 58, 54, .05); color: var(--ink-faint); border: 2px dashed rgba(59, 58, 54, .12); }
.bdg .bdg-ico { width: 44px; height: 44px; padding: 8px; border-radius: 50%; background: rgba(59, 58, 54, .08); margin-bottom: 4px; }
.bdg b { font-size: .92rem; color: var(--ink-soft); }
.bdg span { font-size: .76rem; line-height: 1.25; }
.bdg.got { background: linear-gradient(160deg, #FFFFFF, #FFF6D8); border: 2px solid var(--sun-2); color: var(--ink-soft); }
.bdg.got .bdg-ico { color: #fff; background: radial-gradient(circle at 35% 30%, #FFE6A0, var(--sun) 50%, var(--sun-deep)); box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--sun-2); }
.bdg.got b { color: var(--ink); }

.rules h3 { font-family: var(--display); font-weight: 400; margin: 1em 0 .2em; font-size: 1.25rem; color: var(--clay); }
.rules ul { padding-left: 1.2em; margin: .3em 0; }
.rules li { margin: .25em 0; }

/* toasts */
.toasts { position: fixed; left: 50%; bottom: calc(20px + var(--safe-b)); transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: max-content; max-width: 92vw; }
.toast {
  background: #FFFFFF; color: var(--ink); padding: .55em 1.2em; border-radius: 999px;
  border: 2px solid var(--leaf-2); box-shadow: 0 12px 30px rgba(40, 60, 90, .25);
  font-weight: 700; animation: rise .25s cubic-bezier(.2, 1.3, .4, 1); text-align: center;
}
.toast.err { border-color: var(--rose); }


/* ---------- comic ink layer ----------
   Inked outlines, hard offset shadows, halftone dots and comic lettering,
   laid over the painted world. */
.card, .panel, .hero-card, .seat, .home-panel {
  border: 3px solid var(--outline);
  box-shadow: 6px 6px 0 var(--outline), 0 18px 34px rgba(60, 80, 110, .18);
  border-radius: 22px;
}
.panel { box-shadow: 5px 5px 0 var(--outline); border-radius: 20px; }
.panel { background-image: var(--grain); }
.panel h3, .sec {
  display: inline-flex; align-self: flex-start;
  font-family: var(--comic); font-size: 1.25rem; letter-spacing: .06em; line-height: 1;
  padding: 5px 12px 4px; margin: -24px 0 10px -6px;
  background: var(--sun-2); border: 2.5px solid var(--outline); border-radius: 6px;
  box-shadow: 3px 3px 0 var(--outline); transform: rotate(-2deg);
}
.panel h3::before { display: none; }
.panel { margin-top: 14px; }
.side .panel:first-child { margin-top: 12px; }
.sec { margin: 1.2em 0 .7em; }

.btn { border: 2.5px solid var(--outline); box-shadow: 0 4px 0 var(--outline); }
.btn:hover { border-color: var(--outline); }
.btn:active { box-shadow: 0 1px 0 var(--outline); }
.btn.primary, .btn.ink.primary {
  border-color: var(--outline); box-shadow: 0 4px 0 var(--outline), 0 10px 20px rgba(221, 149, 49, .28);
  font-family: var(--comic); font-weight: 400; letter-spacing: .06em; font-size: 1.15em; text-shadow: 1.5px 1.5px 0 #FFF4D0;
}
.btn.primary:active, .btn.ink.primary:active { box-shadow: 0 1px 0 var(--outline); }
.btn.big .btn-txt b { font-family: var(--comic); font-weight: 400; letter-spacing: .06em; font-size: 1.6rem; }
.btn.big { font-family: var(--body); font-size: 1rem; }
.btn.danger, .btn.danger-ink { border-color: var(--outline); background: #FFEFF3; }
.btn.power { border-color: var(--outline); box-shadow: 0 4px 0 var(--outline); }
.btn.build-btn { border-color: var(--outline); box-shadow: 0 4px 0 var(--outline); }
.btn.resume { border-color: var(--outline); box-shadow: 0 4px 0 var(--outline); }
.btn.soft { border-color: var(--outline); background: var(--cream); }
.tile-btn { background-image: var(--dots); background-size: 9px 9px; }
.hero-nav { border: 2.5px solid var(--outline); box-shadow: 0 3px 0 var(--outline); color: var(--ink); }
#btn-quick { animation: none; }
input { border: 2.5px solid var(--outline); }
input:focus { border-color: var(--outline); box-shadow: 0 0 0 4px rgba(255, 203, 92, .55); }

.logo {
  color: var(--sun-2);
  -webkit-text-stroke: .06em var(--outline); paint-order: stroke fill;
  text-shadow: .06em .07em 0 var(--outline), .1em .14em 0 rgba(46, 42, 38, .18);
}
.logo.small { color: var(--sun-2); -webkit-text-stroke: 1.5px var(--outline); text-shadow: 2px 2px 0 var(--outline); }
.centre .logo { -webkit-text-stroke: .5cqw var(--outline); text-shadow: .6cqw .7cqw 0 var(--outline); }
.verse { color: var(--ink); background: rgba(255, 255, 255, .7); display: inline-block; padding: 1px 12px; border-radius: 99px; border: 2px solid var(--outline); font-size: .85rem; }
.lede { color: var(--ink); font-weight: 600; text-shadow: 0 1px 0 rgba(255, 255, 255, .7); }

.hero-card { background-image: radial-gradient(circle at 18% 50%, color-mix(in srgb, var(--c) 26%, transparent), transparent 55%), var(--dots), var(--grain); background-size: auto, 10px 10px, auto; }
.hero-frame { background: var(--outline); padding: 4px; box-shadow: 5px 5px 0 color-mix(in srgb, var(--c) 70%, var(--outline)); }
.hero-frame::after { display: none; }
.hero-txt > b { font-family: var(--comic); letter-spacing: .05em; font-size: 2.6rem; color: var(--ink); text-shadow: 3px 3px 0 color-mix(in srgb, var(--c) 45%, #FFFFFF); }
.hero-power { border: 2px solid var(--outline); background: #FFFFFF; box-shadow: 3px 3px 0 var(--outline); }

.face { box-shadow: 0 0 0 2.5px var(--outline), 0 0 0 5px var(--c), 0 0 0 7px var(--outline); }
.char-opt[aria-checked="true"] .face { box-shadow: 0 0 0 2.5px var(--outline), 0 0 0 6px var(--c), 0 0 0 8.5px var(--outline), 4px 6px 0 9px rgba(46, 42, 38, .25); }
.char-opt > span:last-child { background: rgba(255, 255, 255, .7); padding: 0 6px; border-radius: 6px; border: 2px solid transparent; }
.char-opt[aria-checked="true"] { background: transparent; }
.char-opt[aria-checked="true"] > span:last-child { background: var(--sun-2); border-color: var(--outline); }
.profile-chip, .chip, .xp-chip { border: 2.5px solid var(--outline); box-shadow: 3px 3px 0 var(--outline); }
.chip.now { border-color: var(--outline); background: var(--sun-2); }
.pl { border-radius: 14px; }
.pl.now { border: 2.5px solid var(--outline); background: #FFF3C4; box-shadow: 3px 3px 0 var(--outline); }
.realm-row { border: 2px solid var(--outline); box-shadow: 2px 2px 0 var(--outline); }
.pc-badges { border-left-color: var(--outline); }
.room { border: 2.5px solid var(--outline); background: #E3F2FB; box-shadow: 3px 3px 0 var(--outline); }

.topbar { border-bottom: 3px solid var(--outline); background: rgba(255, 251, 240, .94); box-shadow: 0 4px 0 rgba(46, 42, 38, .15); }

.board { box-shadow: 0 0 0 .45cqw var(--outline), .9cqw 1cqw 0 .45cqw var(--outline), 0 2cqw 4cqw rgba(50, 70, 100, .3); }
.tile { box-shadow: inset 0 0 0 .2cqw var(--outline); border-radius: .5cqw; }
.tile:hover { box-shadow: inset 0 0 0 .2cqw var(--outline), .5cqw .6cqw 0 var(--outline); }
.tile .band { border-bottom: .2cqw solid var(--outline); border-top: .2cqw solid var(--outline); }
.tile.s-left .band, .tile.s-right .band { border: 0; border-left: .2cqw solid var(--outline); border-right: .2cqw solid var(--outline); }
.tile.corner { box-shadow: inset 0 0 0 .25cqw var(--outline); background-image: var(--dots); background-size: 1.2cqw 1.2cqw; }
.tile.corner .nm { font-family: var(--comic); letter-spacing: .03em; font-size: 1.3em; overflow-wrap: normal; white-space: nowrap; }
.owner-mark { border-color: var(--outline); border-width: .2em; box-shadow: .12em .14em 0 var(--outline); }
.centre { box-shadow: inset 0 0 0 .4cqw var(--outline); }
.centre .round { border: .2cqw solid var(--outline); font-family: var(--comic); letter-spacing: .08em; font-weight: 400; }
.centre-ui { border: .35cqw solid var(--outline); box-shadow: .8cqw .8cqw 0 var(--outline); background-image: var(--dots); background-size: 1.1cqw 1.1cqw; background-color: rgba(255, 251, 240, .96); }
.turn-line { font-family: var(--comic); font-weight: 400; letter-spacing: .05em; font-size: 2.5cqw; }
.face-d { box-shadow: inset 0 0 0 .25cqw var(--outline), inset 0 -.5cqw 1cqw rgba(170, 130, 70, .2); }
.token .tk-in { border-color: var(--outline); box-shadow: 0 0 0 .3cqw var(--c), 0 0 0 .55cqw var(--outline), .35cqw .45cqw 0 .55cqw rgba(46, 42, 38, .45); }
.token.cur .tk-in { box-shadow: 0 0 0 .3cqw var(--c), 0 0 0 .55cqw var(--outline), 0 0 0 1.1cqw rgba(255, 203, 92, .7); }

.dock { border-top: 3px solid var(--outline); box-shadow: 0 -5px 0 rgba(46, 42, 38, .2); }
.dock-head b { font-family: var(--comic); font-weight: 400; letter-spacing: .05em; font-size: 1.25rem; }
.feed { border: 2.5px solid var(--outline); box-shadow: 3px 3px 0 var(--outline); }

/* guide tips read as speech bubbles */
.coach { border: 3px solid var(--outline); box-shadow: 6px 6px 0 var(--outline); overflow: visible; }
.coach-body b { font-family: var(--comic); font-weight: 400; letter-spacing: .05em; font-size: 1.3rem; }
.coach .face { margin-top: 2px; }

.sheet { border: 3px solid var(--outline); box-shadow: 8px 8px 0 var(--outline), 0 30px 60px rgba(40, 60, 90, .3); }
.sheet h2 { font-family: var(--comic); letter-spacing: .05em; font-size: 2.1rem; }
.sheet-head { border-bottom: 3px solid var(--outline); }
.sheet-head.plain { background: linear-gradient(120deg, #A9D6F0, #D3EBF8 60%, #FFF0D6); background-image: var(--dots), linear-gradient(120deg, #A9D6F0, #D3EBF8 60%, #FFF0D6); background-size: 10px 10px, auto; }
.char-head { background-image: var(--dots), linear-gradient(120deg, var(--c), color-mix(in srgb, var(--c) 45%, #FFFFFF)); background-size: 10px 10px, auto; }
.char-head h2 { color: #FFFFFF; -webkit-text-stroke: 1.5px var(--outline); paint-order: stroke fill; text-shadow: 3px 3px 0 var(--outline); }
.char-hero { border: 3px solid var(--outline); box-shadow: 4px 4px 0 var(--outline); }
.trade-col, .stat-row > div, .reward-box, .settings fieldset { border: 2.5px solid var(--outline); box-shadow: 3px 3px 0 var(--outline); }
.who { border: 2.5px solid var(--outline); }
.who.on { background: var(--sun-2); }
.bdg.got { border: 2.5px solid var(--outline); box-shadow: 3px 3px 0 var(--outline); }
.win-hero { border: 4px solid var(--outline); box-shadow: 6px 6px 0 var(--outline); }
.standings li.gold { border: 2px solid var(--outline); }
.lu-card, .badge-pop { border: 3px solid var(--outline); box-shadow: 6px 6px 0 var(--outline); }
.lu-num { -webkit-text-stroke: 2px var(--outline); paint-order: stroke fill; text-shadow: 5px 5px 0 var(--outline); color: var(--sun); }
.xp-pop { border-color: var(--outline); font-family: var(--comic); letter-spacing: .06em; font-weight: 400; font-size: 1.2rem; }
.toast { border: 2.5px solid var(--outline); box-shadow: 4px 4px 0 var(--outline); border-radius: 18px; }
.toast.err { border-color: var(--outline); background: #FFEFF3; }
.seg { border: 2px solid var(--outline); }
.seg-btn[aria-pressed="true"] { background: var(--sun-2); color: var(--ink); box-shadow: none; }
.modal-back { background: rgba(255, 236, 200, .35); }
.seat-edit { border: 2px solid var(--outline); box-shadow: none; }
.lobby-title { font-family: var(--comic); letter-spacing: .05em; font-size: 2.5rem; }
.turn-banner { border: 3px solid var(--outline); box-shadow: 5px 5px 0 var(--outline); }
.turn-banner .tb-face { border-color: var(--outline); }

/* ---------- responsive ---------- */

@container (max-width: 620px) {
  .tile .nm { display: none; }
  .tile .pr { font-size: 2.1cqw; }
  .tile .ico { width: 3.4em; height: 3.4em; }
  .tile.corner .nm, .tile.corner .sub { display: none; }
  .tile.corner .ico { width: 6em; height: 6em; }
  .tile:hover { transform: none; }
  .token { width: 6cqw; height: 6cqw; margin: -3cqw 0 0 -3cqw; }
  .centre { justify-content: center; }
  .centre .logo { font-size: 7.4cqw; }
  .centre .round { font-size: 2.6cqw; }
  .dice-zone { width: 30cqw; height: 24cqw; }
  .die { --d: 9cqw; }
  .face-d i { width: 1.7cqw; height: 1.7cqw; }
  .face-d.red i.on { width: 2.3cqw; height: 2.3cqw; }
  .turn-line { font-size: 3.4cqw; }
  .turn-line .face { width: 7.6cqw; height: 7.6cqw; }
  .prompt { font-size: 2.8cqw; max-width: 70cqw; }
  .acts { max-width: 74cqw; }
  .centre .acts .btn, .centre .krishna-pick .btn { font-size: 2.8cqw; }
  .centre .acts .btn.primary { font-size: 3.2cqw; }
  .centre .krishna-pick { max-width: 70cqw; }
}

@media (max-width: 1100px) {
  .table { grid-template-columns: 1fr; grid-template-areas: "board" "side"; height: auto; }
  .board { width: min(100%, 860px, calc(100dvh - var(--top) - 24px)); min-width: min(100%, 560px); }
  .side { display: grid; grid-template-columns: 1fr 1fr; overflow: visible; }
  .chronicle { grid-column: 1 / -1; }
  .log { max-height: 280px; }
  .home { grid-template-columns: 1fr; max-width: 680px; gap: 22px; }
}

@media (max-width: 760px) {
  :root { --top: 54px; }
  .topbar { padding: 0 8px; gap: 6px; }
  .logo.small { display: none; }
  .xp-chip { min-width: 0; flex: 1; max-width: 160px; }
  .top-room { display: none; }
  .top-actions { gap: 6px; }
  .wide-only { display: none !important; }
  .topbar [data-music-btn], .topbar [data-sound-btn] { display: none; }
  .topbar .voice-btn { padding: .3em .7em; }
  .topbar .voice-btn .vb-long { display: none; }
  .topbar .voice-btn .vb-short { display: inline; }
  .topbar .voice-btn.on span { display: none; }
  .topbar .voice-btn.on { padding: 0 .6em; }
  .table { grid-template-columns: minmax(0, 1fr); grid-template-areas: "strip" "board" "feed"; gap: 8px; padding: 8px 6px calc(240px + var(--safe-b)); height: auto; }
  .feed { display: grid; }
  .pstrip { display: flex; }
  .side { display: none; }
  .board { width: 100%; min-width: 0; }
  .dock { display: block; position: fixed; left: 0; right: 0; bottom: 0; }
  .centre .centre-ui { display: none; }
  .coach { bottom: auto; top: calc(var(--top) + 60px); }
  .coach.in { animation-name: coach-down; }

  .home-top { padding: 12px 12px 0; }
  .pc-txt { min-width: 0; }
  .home { padding: 8px 14px 32px; gap: 18px; }
  .lede { font-size: 1rem; }
  .verse { font-size: .8rem; }
  .hero-card { grid-template-columns: 112px minmax(0, 1fr); padding: 12px; gap: 12px; border-radius: 24px; }
  .hero-frame { width: 112px; height: 112px; border-radius: 22px; padding: 4px; }
  .hero-portrait { border-radius: 18px; }
  .hero-nav { display: none; }
  .hero-txt > b { font-size: 1.6rem; margin-bottom: .2em; }
  .hero-title { font-size: .72rem; }
  .hero-power { font-size: .84rem; padding: 8px 10px; gap: 8px; }
  .hero-power .medallion { width: 22px; height: 22px; }
  .char-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; margin-top: 10px; }
  .char-opt { padding: 6px 2px 2px; font-size: .74rem; }
  .char-opt .face { width: 46px; height: 46px; }
  .home-panel { padding: 18px 16px; }
  .split { grid-template-columns: 1fr 1fr; }
  .tile-btn small { display: none; }
  .trade-cols { grid-template-columns: 1fr; }
  .lobby-title { font-size: 1.8rem; }
  .seat { grid-template-columns: auto 1fr; }
  .seat > .btn { grid-column: 1 / -1; justify-self: end; }
  .lobby-actions .btn { flex: 1 1 auto; }
  .settings .two { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .xp-items { grid-template-columns: 1fr; }

  .modal { place-items: end stretch; padding: 0; }
  .modal-box, .modal-box.wide { width: 100%; max-height: 92dvh; border-radius: 28px 28px 0 0; animation: sheet-up .32s cubic-bezier(.2, .9, .2, 1); }
  .modal-box > .sheet, .modal-box > form.sheet { border-radius: 28px 28px 0 0; padding-bottom: calc(20px + var(--safe-b)); }
  .modal-box::before { content: ''; position: sticky; top: 8px; display: block; width: 46px; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, .9); box-shadow: 0 1px 3px rgba(0, 0, 0, .2); margin: 0 auto -13px; z-index: 2; }
  .sheet-actions .btn { flex: 1 1 auto; min-height: 48px; }
  .comic-panel { width: 92vw; }
  .cp-face { width: 78px; height: 78px; }
  .toasts { bottom: calc(250px + var(--safe-b)); }
}
@keyframes sheet-up { from { transform: translateY(100%); } }

@media (orientation: landscape) and (max-height: 560px) {
  :root { --top: 46px; }
  .topbar { height: var(--top); }
  .logo.small, .top-room { display: none; }
  .wide-only { display: none !important; }
  .table {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: auto auto 1fr;
    grid-template-areas: "board strip" "board dock" "board feed";
    gap: 8px; padding: 6px 10px calc(6px + var(--safe-b));
    height: calc(100dvh - var(--top));
  }
  .board { width: calc(100dvh - var(--top) - 22px); min-width: 0; }
  .side { display: none; }
  .pstrip { display: flex; flex-wrap: wrap; overflow: visible; }
  .chip { padding: 3px 10px 3px 3px; }
  .chip .face { width: 30px; height: 30px; }
  .dock { display: flex; flex-direction: column; position: static; border-radius: 20px; min-height: 0; }
  .feed { display: grid; min-height: 0; font-size: .82rem; }
  .dock-nav { padding-bottom: 0; }
  .centre .centre-ui { display: none; }
  .coach { bottom: 12px; left: auto; right: 12px; transform: none; width: min(380px, 50vw); }
  .modal { place-items: center; padding: 8px; }
  .modal-box, .modal-box.wide { max-height: calc(100dvh - 16px); border-radius: 22px; }
  .toasts { bottom: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .cloud { display: none; }
  .sketch .ink { stroke-dashoffset: 0; }
}
