/* Shared finishing layer: every game keeps its own world while the controls stay familiar. */
body[data-game-world] {
  --world-accent:#684bf6;
  --world-paper:#f4f1e8;
  --world-surface:#fff;
  --world-ink:#17141f;
  --world-muted:#77727e;
  --world-line:rgba(23,20,31,.16);
  color:var(--world-ink);
  -webkit-text-size-adjust:100%;
}
body[data-game-world] :is(button,a,[role="button"],canvas) {
  -webkit-tap-highlight-color:transparent;
  -webkit-touch-callout:none;
}
body[data-game-world] :is(button,[role="button"],canvas,.game-screen) {
  -webkit-user-select:none;
  user-select:none;
}
body[data-game-world] :is(button,a,[role="button"]) { touch-action:manipulation; }
body[data-game-world] :is(canvas,.arena,.battlefield) { touch-action:none; }
body[data-game-world]:has(.game-screen:not([hidden])) { overscroll-behavior:none; }
body[data-game-world] :is(.witty-home-link,.home-link) {
  min-width:44px;
  min-height:44px;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:0 12px;
  border:1px solid var(--world-line);
  border-radius:7px;
  color:inherit;
  background:color-mix(in srgb,var(--world-surface) 82%,transparent);
  backdrop-filter:blur(12px);
  font-size:0;
  box-shadow:none;
}
body[data-game-world] :is(.witty-home-link,.home-link)::before {
  content:"← HOME";
  font-size:8px;
  font-weight:800;
  letter-spacing:.12em;
}
body[data-game-world] :is(button,a) { transition:transform .16s,background-color .16s,border-color .16s,color .16s,box-shadow .16s; }
body[data-game-world] :is(button,a):focus-visible { outline:3px solid color-mix(in srgb,var(--world-accent) 35%,transparent); outline-offset:3px; }
body[data-game-world] :is(.game-brand,.home-link,.brand)>span {
  width:36px;
  height:36px;
  flex:0 0 36px;
  border:0;
  border-radius:10px;
  color:transparent;
  background:var(--world-icon) center/cover no-repeat;
  box-shadow:none;
  overflow:hidden;
}

/* CHESS ROYALE — rigid, regal, and intentionally sparse. */
body[data-game-world="chess-royale"] {
  --world-icon:url("/assets/icons/chess-royale.svg");
  --night:#202334;
  --night-2:#2d3145;
  --ink:#202334;
  --paper:#eee6d7;
  --blue:#42475c;
  --blue-soft:#e3e0d9;
  --red:#8e3f4b;
  --red-soft:#f4e4e5;
  --gold:#eac78a;
  --gold-soft:#f7ecd6;
  --green:#47755f;
  --line:rgba(197,164,93,.23);
  --world-accent:#eac78a;
  --world-paper:#202334;
  --world-surface:#2d3145;
  --world-ink:#f4ecdb;
  --world-muted:#a9a18f;
  --world-line:rgba(234,199,138,.3);
  background:#202334;
}
body[data-game-world="chess-royale"] :is(.witty-home-link,.home-link) { color:#f4dca9; background:rgba(32,35,52,.86); }
body[data-game-world="chess-royale"] .setup-screen { background:linear-gradient(90deg,#202334 0 49.5%,#eee6d7 49.5%); }
body[data-game-world="chess-royale"] .setup-glow,
body[data-game-world="chess-royale"] .rule-preview,
body[data-game-world="chess-royale"] .royal-rule,
body[data-game-world="chess-royale"] .objective-card,
body[data-game-world="chess-royale"] .feed-card,
body[data-game-world="chess-royale"] .captured-card,
body[data-game-world="chess-royale"] .deploy-note { display:none; }
body[data-game-world="chess-royale"] .setup-copy { color:#f4ecdb; }
body[data-game-world="chess-royale"] .setup-copy h1 { color:#f4ecdb; font-size:clamp(62px,7.5vw,108px); }
body[data-game-world="chess-royale"] .setup-copy h1 em { color:#eac78a; }
body[data-game-world="chess-royale"] .setup-tagline { max-width:470px; color:#aaa697; }
body[data-game-world="chess-royale"] .crown-mark span { border-radius:1px; background:#66739f; }
body[data-game-world="chess-royale"] .crown-mark span:nth-child(2) { background:#eac78a; }
body[data-game-world="chess-royale"] .crown-mark span:nth-child(3) { background:#8e3f4b; }
body[data-game-world="chess-royale"] .setup-panel { border:1px solid #cfc5b2; border-radius:3px; color:#1c202c; background:#faf7ef; box-shadow:16px 18px 0 rgba(13,16,24,.12); }
body[data-game-world="chess-royale"] .setup-panel::before { right:0; left:0; height:3px; border-radius:0; background:#eac78a; }
body[data-game-world="chess-royale"] :is(.mode-card,.timer-option,.difficulty-grid,.difficulty-grid button,.online-input,.secondary-button,.primary-button) { border-radius:3px; }
body[data-game-world="chess-royale"] .mode-card.selected { border-color:#39466e; background:#eceaf0; box-shadow:inset 3px 0 #39466e; }
body[data-game-world="chess-royale"] .primary-button { color:#202334; background:#eac78a; box-shadow:none; }
body[data-game-world="chess-royale"] .primary-button b { color:#17150f; }
body[data-game-world="chess-royale"] .game-screen { color:#f4dca9; background:#202334; }
body[data-game-world="chess-royale"] .game-header { border-color:rgba(234,199,138,.32); color:#f4dca9; background:#202334; }
body[data-game-world="chess-royale"] :is(.game-header .square-button,.header-center,.connection-pill) { border-color:rgba(197,164,93,.26); border-radius:3px; color:#dad1bf; background:#1a1e2a; }
body[data-game-world="chess-royale"] .match-layout { background:#202334; }
body[data-game-world="chess-royale"] .rail { border-color:rgba(234,199,138,.18); background:#25293a; }
body[data-game-world="chess-royale"] .rail>section { border-color:rgba(234,199,138,.22); border-radius:3px; color:#eee6d6; background:#2d3145; }
body[data-game-world="chess-royale"] :is(.rail-label,.identity-row small,.energy-card small,.army-row,.active-player-compact small,.deck-heading>span,.piece-card small) { color:#9f9b91; }
body[data-game-world="chess-royale"] .arena { background:radial-gradient(circle at 50% 42%,#42475c,#202334 72%); }
body[data-game-world="chess-royale"] .turn-banner { border-color:rgba(197,164,93,.28); border-radius:3px; color:#eee6d6; background:#171c28; box-shadow:none; }
body[data-game-world="chess-royale"] .turn-banner p { color:#aaa697; }
body[data-game-world="chess-royale"] .state-pill { border-radius:2px; color:#e9d59e; background:#2a2b29; }
body[data-game-world="chess-royale"] .board-frame { border:1px solid rgba(234,199,138,.5); border-radius:2px; background:#2d3145; box-shadow:0 22px 55px rgba(0,0,0,.4); }
body[data-game-world="chess-royale"] .chess-board { border-radius:0; }
body[data-game-world="chess-royale"] .board-cell { background:#e8dfcc; }
body[data-game-world="chess-royale"] .board-cell.dark { background:#6c7693; }
body[data-game-world="chess-royale"] .action-dock { border-color:rgba(197,164,93,.24); }
body[data-game-world="chess-royale"] .end-turn-button { border-radius:3px; color:#202334; background:#eac78a; }
body[data-game-world="chess-royale"] .piece-card { border-color:rgba(197,164,93,.22); border-radius:2px; color:#eee6d6; background:#1c2130; }
body[data-game-world="chess-royale"] .piece-card:hover:not(:disabled),
body[data-game-world="chess-royale"] .piece-card.selected { border-color:#eac78a; background:#42475c; box-shadow:inset 0 -2px #eac78a; }
body[data-game-world="chess-royale"] .piece-glyph { border-radius:1px; color:#eac78a; background:#202334; }
body[data-game-world="chess-royale"] .player-clock { border-color:rgba(234,199,138,.2); border-radius:2px; color:#aaa697; background:#25293a; }
body[data-game-world="chess-royale"] .player-clock b { color:#eee6d6; }

/* BATTLE ROYALE — the icon's hot-orange supply drop and treasure-card energy. */
body[data-game-world="battle-royale"] {
  --world-icon:url("/assets/icons/battle-royale.svg");
  --ink:#722d30;
  --muted:#81574b;
  --line:rgba(114,45,48,.17);
  --panel:#fff0c7;
  --canvas:#f4d5a4;
  --purple:#f17b51;
  --purple-dark:#bf4538;
  --cyan:#bb793e;
  --orange:#ffd38b;
  --green:#318a65;
  --red:#dc4755;
  --blue:#3e78bd;
  --world-accent:#f17b51;
  --world-paper:#f4d5a4;
  --world-surface:#fff0c7;
  --world-ink:#722d30;
  --world-muted:#81574b;
  --world-line:rgba(114,45,48,.19);
  background:#f4d5a4;
}
body[data-game-world="battle-royale"] .setup-screen { background:linear-gradient(110deg,#722d30 0 47%,#f4d5a4 47%); }
body[data-game-world="battle-royale"] .setup-hero { color:#fff0c7; }
body[data-game-world="battle-royale"] .setup-hero::before { border-radius:0; background:rgba(255,211,139,.16); }
body[data-game-world="battle-royale"] .setup-hero::after { border-color:rgba(241,123,81,.22); border-radius:50%; }
body[data-game-world="battle-royale"] .setup-hero h1 { color:#fff0c7; text-shadow:6px 7px 0 rgba(60,20,21,.22); }
body[data-game-world="battle-royale"] .setup-hero h1 span { color:#ffd38b; }
body[data-game-world="battle-royale"] :is(.eyebrow,.step-label,.hero-subtitle) { color:#ffd38b; }
body[data-game-world="battle-royale"] .hero-copy { max-width:470px; color:#efc3a5; }
body[data-game-world="battle-royale"] .rules-strip,
body[data-game-world="battle-royale"] .endgame-note,
body[data-game-world="battle-royale"] .setup-note,
body[data-game-world="battle-royale"] .combat-guide,
body[data-game-world="battle-royale"] .loot-status-card,
body[data-game-world="battle-royale"] .tip-card,
body[data-game-world="battle-royale"] .event-log-wrap { display:none; }
body[data-game-world="battle-royale"] .mode-switch { border-color:rgba(255,255,255,.18); border-radius:6px; background:rgba(255,255,255,.08); }
body[data-game-world="battle-royale"] .mode-switch a { color:#c9cdd3; border-radius:3px; }
body[data-game-world="battle-royale"] .mode-switch a.active { color:#722d30; background:#ffd38b; }
body[data-game-world="battle-royale"] .setup-card { border:2px solid #722d30; border-radius:10px; background:#fff0c7; box-shadow:12px 14px 0 rgba(114,45,48,.17); }
body[data-game-world="battle-royale"] .setup-card::before { right:0; left:0; height:5px; border-radius:0; background:repeating-linear-gradient(90deg,#f17b51 0 28px,#722d30 28px 44px); }
body[data-game-world="battle-royale"] :is(.status-pill,.setting-icon,.stepper,.stepper button,.lobby-summary,.primary-button,.secondary-button,.join-form input,.join-form button) { border-radius:6px; }
body[data-game-world="battle-royale"] .primary-button { color:#722d30; background:#ffd38b; box-shadow:none; }
body[data-game-world="battle-royale"] .game-screen { background:#f0cf9c; }
body[data-game-world="battle-royale"] .game-header { border-bottom:4px solid #f17b51; color:#fff0c7; background:#722d30; }
body[data-game-world="battle-royale"] .round-chip { border-radius:4px; color:#722d30; background:#ffd38b; }
body[data-game-world="battle-royale"] .round-chip b { color:#722d30; }
body[data-game-world="battle-royale"] .game-brand small { color:#ffd38b; }
body[data-game-world="battle-royale"] .panel { background:#fff0c7; }
body[data-game-world="battle-royale"] :is(.players-panel,.inventory-panel) { border-color:rgba(23,33,49,.19); }
body[data-game-world="battle-royale"] .board-area { background:radial-gradient(circle at 50% 44%,#fff0c7,#e4bd87 72%); }
body[data-game-world="battle-royale"] .turn-banner { border:0; border-left:5px solid #f17b51; border-radius:4px; box-shadow:0 8px 22px rgba(114,45,48,.1); }
body[data-game-world="battle-royale"] .status-card { border-radius:4px; }
body[data-game-world="battle-royale"] .board-wrap { border-radius:8px; box-shadow:0 18px 42px rgba(114,45,48,.2); }
body[data-game-world="battle-royale"] :is(.dice-button,.end-turn-button) { border-radius:6px; }
body[data-game-world="battle-royale"] .dice-button { color:#722d30; background:#ffd38b; }
body[data-game-world="battle-royale"] .end-turn-button { background:#722d30; }

/* CHESS — the icon's carved wood, cream pieces, and warm tabletop. */
body[data-game-world="chess"] {
  --world-icon:url("/assets/icons/chess.svg");
  --ink:#51331d;
  --paper:#ead4ae;
  --white:#fff7dc;
  --cream:#f3e4c5;
  --forest:#936337;
  --forest-dark:#51331d;
  --sage:#bc824a;
  --lime:#fff0c8;
  --gold:#e5bc84;
  --line:rgba(81,51,29,.2);
  --world-accent:#bc824a;
  --world-paper:#ead4ae;
  --world-surface:#fff7dc;
  --world-ink:#51331d;
  --world-muted:#866442;
  --world-line:rgba(81,51,29,.22);
  background:#ead4ae;
}
body[data-game-world="chess"] .feature-row,
body[data-game-world="chess"] .rule-reminder { display:none; }
body[data-game-world="chess"] .menu-hero { background:radial-gradient(circle at 72% 34%,rgba(255,247,220,.15),transparent 31%),linear-gradient(145deg,#936337,#51331d 70%); }
body[data-game-world="chess"] .menu-hero::before { opacity:.045; background-size:64px 64px; }
body[data-game-world="chess"] .menu-hero h1 { font-family:Georgia,serif; font-weight:700; letter-spacing:-.065em; }
body[data-game-world="chess"] .menu-hero h1 span { color:#e5bc84; }
body[data-game-world="chess"] .hero-copy { color:#ead4ae; }
body[data-game-world="chess"] .hero-board { border-radius:2px; border-color:rgba(255,247,220,.48); box-shadow:0 38px 70px rgba(45,25,12,.48); }
body[data-game-world="chess"] .hero-grid { border-radius:0; }
body[data-game-world="chess"] .setup-card { color:#51331d; }
body[data-game-world="chess"] .setup-heading h2,
body[data-game-world="chess"] .turn-card h2,
body[data-game-world="chess"] .modal-card h2 { font-family:Georgia,serif; font-weight:700; letter-spacing:-.025em; }
body[data-game-world="chess"] :is(.mode-tab,.mode-panel,.text-input,.segmented,.segmented button,.choice-cards button,.primary-button,.secondary-button) { border-radius:3px; }
body[data-game-world="chess"] .mode-tab { min-height:82px; }
body[data-game-world="chess"] .mode-tab.selected { color:#fff7dc; border-color:#936337; background:#936337; box-shadow:none; }
body[data-game-world="chess"] .mode-tab.selected>span { color:#51331d; background:#e5bc84; }
body[data-game-world="chess"] .primary-button { color:#fff7dc; background:#936337; box-shadow:none; }
body[data-game-world="chess"] .game-screen { background:#d8b986; }
body[data-game-world="chess"] .game-header { border-color:rgba(229,188,132,.35); color:#fff7dc; background:#51331d; }
body[data-game-world="chess"] .game-brand>span { border-radius:2px; color:#51331d; background:#e5bc84; }
body[data-game-world="chess"] :is(.game-mode-pill,.connection-pill,.room-share-button,.game-header .square-button) { border-color:rgba(255,247,220,.2); border-radius:3px; color:#fff7dc; background:#6c472a; }
body[data-game-world="chess"] .game-layout { gap:18px; }
body[data-game-world="chess"] .player-card { border-color:rgba(81,51,29,.22); background:#f3e4c5; }
body[data-game-world="chess"] .player-card.is-turn { box-shadow:inset 4px 0 #bc824a; }
body[data-game-world="chess"] .board-stage { border-radius:2px; background:#51331d; box-shadow:0 20px 48px rgba(81,51,29,.28); }
body[data-game-world="chess"] .chess-board { border-radius:0; }
body[data-game-world="chess"] .game-sidebar>section,
body[data-game-world="chess"] .game-controls { border-radius:3px; }
body[data-game-world="chess"] .turn-card { border-left:4px solid #bc824a; background:#fff7dc; }
body[data-game-world="chess"] .moves-card { background:#f3e4c5; }

/* SHAPE ROYALE — the icon's sea-glass arena and toy-box geometry. */
body[data-game-world="shape-royale"] {
  --world-icon:url("/assets/icons/shape-royale.svg");
  --ink:#20363b;
  --paper:#edf1df;
  --purple:#7972b4;
  --lime:#e5f2bc;
  --blue:#398b8c;
  --blue-dark:#286b70;
  --red:#ffaf88;
  --red-dark:#d77e67;
  --cyan:#78bdb8;
  --muted:#687878;
  --line:rgba(32,54,59,.17);
  --world-accent:#398b8c;
  --world-paper:#edf1df;
  --world-surface:#fff;
  --world-ink:#20363b;
  --world-muted:#687878;
  --world-line:rgba(32,54,59,.19);
  background:#edf1df;
}
body[data-game-world="shape-royale"] .feature-row,
body[data-game-world="shape-royale"] .deck-preview,
body[data-game-world="shape-royale"] .battle-tip,
body[data-game-world="shape-royale"] .room-card,
body[data-game-world="shape-royale"] .share-room-button { display:none; }
body[data-game-world="shape-royale"] .menu-screen { background:radial-gradient(circle at 82% 16%,rgba(120,189,184,.42),transparent 28%),radial-gradient(circle at 12% 86%,rgba(255,175,136,.24),transparent 30%),#edf1df; }
body[data-game-world="shape-royale"] .menu-copy h1 { color:#20363b; text-shadow:5px 6px 0 rgba(121,114,180,.11); }
body[data-game-world="shape-royale"] .menu-copy h1 span { color:#398b8c; }
body[data-game-world="shape-royale"] .intro { max-width:430px; color:#596c6b; }
body[data-game-world="shape-royale"] .menu-circle { background:#e5f2bc; }
body[data-game-world="shape-royale"] .menu-triangle { background:#ffaf88; }
body[data-game-world="shape-royale"] .setup-card { border:3px solid #20363b; border-radius:14px; background:#fff; box-shadow:10px 11px 0 rgba(32,54,59,.14); }
body[data-game-world="shape-royale"] :is(.mode-lockup,.player-lockup,.difficulty-options button,.primary-button,.multiplayer-button,.join-form input,.join-form button) { border-radius:8px; }
body[data-game-world="shape-royale"] .primary-button { background:#398b8c; box-shadow:none; }
body[data-game-world="shape-royale"] .multiplayer-button { color:#20363b; border-color:#20363b; }
body[data-game-world="shape-royale"] .game-screen { background:#dbe8dd; }
body[data-game-world="shape-royale"] .game-header { border-bottom:4px solid #ffaf88; color:#fff; background:#286b70; }
body[data-game-world="shape-royale"] .game-brand>span { color:#20363b; background:#e5f2bc; }
body[data-game-world="shape-royale"] .game-brand small,
body[data-game-world="shape-royale"] .timer-lockup small { color:#aeb6cc; }
body[data-game-world="shape-royale"] .game-header .square-button { border-color:rgba(255,255,255,.2); color:#fff; background:#398b8c; }
body[data-game-world="shape-royale"] .arena { border-color:#20363b; border-radius:8px; box-shadow:9px 10px 0 rgba(32,54,59,.16),0 22px 44px rgba(32,54,59,.17); }
body[data-game-world="shape-royale"] .status-card { border:0; border-left:5px solid #7972b4; border-radius:3px; background:#fff; }
body[data-game-world="shape-royale"] .elixir-card { border-radius:6px; background:#286b70; color:#fff; }
body[data-game-world="shape-royale"] .elixir-heading>span { color:#b7bfd5; }
body[data-game-world="shape-royale"] .shape-card { border-radius:7px; box-shadow:5px 6px 0 rgba(17,24,44,.11); }
body[data-game-world="shape-royale"] .shape-card.selected { box-shadow:5px 6px 0 #7972b4; }
body[data-game-world="shape-royale"] :is(.overlay-card,.rules-dialog) { border:3px solid #20363b; border-radius:12px; box-shadow:10px 11px 0 rgba(32,54,59,.22); }

/* TOWER KINGDOMS — the icon's storybook hills, cream stone, and red roofs. */
body[data-game-world="tower-kingdoms"] {
  --world-icon:url("/assets/icons/tower-kingdoms.svg");
  --ink:#294934;
  --paper:#eee3be;
  --purple:#d9835c;
  --lime:#edbe72;
  --muted:#6e7653;
  --line:rgba(41,73,52,.2);
  --world-accent:#d9835c;
  --world-paper:#eee3be;
  --world-surface:#fff2c9;
  --world-ink:#294934;
  --world-muted:#6e7653;
  --world-line:rgba(41,73,52,.22);
  background:#eee3be;
}
body[data-game-world="tower-kingdoms"] .setup-screen { background:linear-gradient(105deg,#294934 0 48%,#eee3be 48%); }
body[data-game-world="tower-kingdoms"] .hero-copy { color:#fff2c9; }
body[data-game-world="tower-kingdoms"] .hero-copy>p:first-of-type { color:#edbe72; }
body[data-game-world="tower-kingdoms"] .hero-copy h1 { color:#fff2c9; font-family:Georgia,serif; letter-spacing:-.055em; }
body[data-game-world="tower-kingdoms"] .hero-copy h1 span { color:#d9835c; }
body[data-game-world="tower-kingdoms"] .hero-copy .lede { max-width:460px; color:#d9e6b3; }
body[data-game-world="tower-kingdoms"] .rules-row,
body[data-game-world="tower-kingdoms"] .setup-tip,
body[data-game-world="tower-kingdoms"] .crown-objective,
body[data-game-world="tower-kingdoms"] .war-feed { display:none; }
body[data-game-world="tower-kingdoms"] .crown-mark { border-color:rgba(237,190,114,.55); border-radius:50%; color:#edbe72; background:#456e48; box-shadow:none; }
body[data-game-world="tower-kingdoms"] .setup-card { border:1px solid #8c9567; border-radius:5px; background:#fff2c9; box-shadow:14px 16px 0 rgba(41,73,52,.16); }
body[data-game-world="tower-kingdoms"] :is(.player-lockup,.mode-tabs,.mode-tabs a,.difficulty-field span,.primary-button,.join-form input,.join-form button) { border-radius:3px; }
body[data-game-world="tower-kingdoms"] .primary-button { color:#fff2c9; background:#456e48; box-shadow:none; }
body[data-game-world="tower-kingdoms"] .game-screen { background:#d9e6b3; }
body[data-game-world="tower-kingdoms"] .game-header { border-bottom:3px solid #d9835c; color:#fff2c9; background:#294934; }
body[data-game-world="tower-kingdoms"] .game-brand>span { border-radius:50%; color:#fff2c9; background:#d9835c; }
body[data-game-world="tower-kingdoms"] .game-brand small { color:#d9e6b3; }
body[data-game-world="tower-kingdoms"] .game-header .icon-button { border-color:rgba(237,190,114,.3); border-radius:3px; color:#fff2c9; background:#456e48; }
body[data-game-world="tower-kingdoms"] .panel { background:#f8e5ae; }
body[data-game-world="tower-kingdoms"] :is(.kingdom-panel,.command-panel) { border-color:rgba(70,65,46,.2); }
body[data-game-world="tower-kingdoms"] .kingdom-row { border-radius:3px; background:#eee3be; }
body[data-game-world="tower-kingdoms"] .battlefield-column { background:radial-gradient(circle at 50% 46%,#d9e6b3,#acc680 68%); }
body[data-game-world="tower-kingdoms"] .battle-status { border:0; border-left:4px solid var(--player-color,#d9835c); border-radius:3px; background:#fff2c9; box-shadow:none; }
body[data-game-world="tower-kingdoms"] .battlefield { border:5px solid #294934; border-radius:8px; background-color:#acc680; background-image:radial-gradient(circle at 50% 50%,rgba(237,190,114,.48),transparent 31%),linear-gradient(rgba(255,255,255,.2) 1px,transparent 1px),linear-gradient(90deg,rgba(255,255,255,.2) 1px,transparent 1px); box-shadow:0 22px 50px rgba(41,73,52,.28); }
body[data-game-world="tower-kingdoms"] .territory { border-radius:6px; }
body[data-game-world="tower-kingdoms"] .territory.stronghold { border-radius:50% 50% 6px 6px; }
body[data-game-world="tower-kingdoms"] .selection-card,
body[data-game-world="tower-kingdoms"] .send-options button,
body[data-game-world="tower-kingdoms"] .realm-stats>div { border-radius:3px; }
body[data-game-world="tower-kingdoms"] :is(.result-card,.lobby-card,.rules-dialog) { border:1px solid #8c9567; border-radius:5px; background:#fff2c9; box-shadow:14px 16px 0 rgba(41,73,52,.22); }

/* RING KING — the icon's powder-blue ring, coral gloves, and vintage fight-card cream. */
body[data-game-world="ring-king"] {
  --world-icon:url("/assets/icons/ring-king.svg");
  --ink:#263158;
  --paper:#dfe6f8;
  --cream:#f4e6ce;
  --blue:#6480ca;
  --red:#f0807a;
  --gold:#fff0c8;
  --lime:#cbd7fd;
  --line:rgba(38,49,88,.2);
  --world-accent:#f0807a;
  --world-paper:#dfe6f8;
  --world-surface:#f4e6ce;
  --world-ink:#263158;
  --world-muted:#667095;
  --world-line:rgba(38,49,88,.22);
  background:#dfe6f8;
}
body[data-game-world="ring-king"] .ring-header { border-bottom:3px solid #263158; background:#f4e6ce; }
body[data-game-world="ring-king"] .menu-screen { background:radial-gradient(circle at 22% 36%,rgba(244,230,206,.78),transparent 27%),linear-gradient(90deg,transparent 49.8%,rgba(38,49,88,.07) 50%,transparent 50.2%),#dfe6f8; }
body[data-game-world="ring-king"] .hero-copy::before { border-color:#f0807a; opacity:.22; }
body[data-game-world="ring-king"] .hero-copy h1 { color:#263158; text-shadow:7px 7px 0 #cbd7fd; }
body[data-game-world="ring-king"] .hero-copy h1 em { color:#f0807a; text-shadow:7px 7px 0 #384c8f; }
body[data-game-world="ring-king"] .eyebrow { color:#384c8f; }
body[data-game-world="ring-king"] .fight-card { border-color:#263158; border-radius:10px; background:#f4e6ce; box-shadow:10px 10px 0 #384c8f; }
body[data-game-world="ring-king"] .mode-button { border-color:#263158; border-radius:7px; color:#f4e6ce; background:#6480ca; box-shadow:5px 5px 0 #263158; }
body[data-game-world="ring-king"] .mode-button.online { color:#263158; background:#f0807a; }
body[data-game-world="ring-king"] .game-screen { background:radial-gradient(circle at 50% 35%,#6480ca 0 16%,#263158 60%),#263158; }
body[data-game-world="ring-king"] .arena-shell { border-color:#f4e6ce; background:#1d2545; box-shadow:8px 8px 0 rgba(38,49,88,.7); }
body[data-game-world="ring-king"] :is(.primary-button,.result-card,.pause-card,.rules-card) { border-radius:8px; }
body[data-game-world="ring-king"] .primary-button { color:#263158; background:#f0807a; }
body[data-game-world="ring-king"] .result-card { background:#f4e6ce; box-shadow:12px 12px 0 #6480ca; }

/* RIDER RACER — the icon's dusk circuit: muted indigo, sea-glass speed, and dusty-pink risk. */
body[data-game-world="rider-racer"] {
  --world-icon:url("/assets/icons/rider-racer.svg");
  --night:#191d38;
  --night-2:#3a315a;
  --panel:rgba(42,40,72,.9);
  --white:#fff0d3;
  --muted:#9c9dc5;
  --purple:#6b81b2;
  --pink:#e3949c;
  --cyan:#65d5ce;
  --lime:#65d5ce;
  --gold:#fff0d3;
  --line:rgba(255,240,211,.18);
  --world-accent:#65d5ce;
  --world-paper:#191d38;
  --world-surface:#3a315a;
  --world-ink:#fff0d3;
  --world-muted:#9c9dc5;
  --world-line:rgba(255,240,211,.2);
  background:#191d38;
}
body[data-game-world="rider-racer"] .racer-header { background:rgba(25,29,56,.88); }
body[data-game-world="rider-racer"] .menu-screen { background:radial-gradient(circle at 67% 35%,rgba(227,148,156,.2),transparent 29%),linear-gradient(135deg,#3a315a,#191d38 62%); }
body[data-game-world="rider-racer"] .menu-grid,
body[data-game-world="rider-racer"] .online-grid { background-image:linear-gradient(rgba(101,213,206,.18) 1px,transparent 1px),linear-gradient(90deg,rgba(101,213,206,.18) 1px,transparent 1px); }
body[data-game-world="rider-racer"] .sun-disc { background:repeating-linear-gradient(0deg,transparent 0 16px,#191d38 17px 22px),linear-gradient(#e3949c,#6b81b2 65%,transparent 66%); filter:drop-shadow(0 0 50px rgba(227,148,156,.24)); }
body[data-game-world="rider-racer"] .hero-copy h1 em { -webkit-text-stroke-color:#e3949c; text-shadow:8px 8px 0 rgba(107,129,178,.42); }
body[data-game-world="rider-racer"] .race-card,
body[data-game-world="rider-racer"] .online-card { border-color:rgba(255,240,211,.22); background:linear-gradient(145deg,rgba(58,49,90,.96),rgba(25,29,56,.97)); }
body[data-game-world="rider-racer"] .start-button,
body[data-game-world="rider-racer"] .lobby-primary { color:#191d38; background:linear-gradient(110deg,#65d5ce,#fff0d3); box-shadow:0 13px 30px rgba(101,213,206,.2); }
body[data-game-world="rider-racer"] .online-button { border-color:rgba(101,213,206,.48); background:rgba(101,213,206,.08); }
body[data-game-world="rider-racer"] .game-screen { background:#191d38; }
body[data-game-world="rider-racer"] :is(.place-panel,.progress-panel,.boost-panel,.leaderboard) { background:rgba(25,29,56,.76); }
body[data-game-world="rider-racer"] .result-card { border-color:rgba(255,240,211,.24); background:radial-gradient(circle at 50% 0,rgba(227,148,156,.22),transparent 42%),#252646; }

/* The same artwork launches the app and signs the game itself. */
body[data-game-world] :is(.game-brand,.home-link,.brand)>span {
  color:transparent!important;
  background:var(--world-icon) center/cover no-repeat!important;
  box-shadow:none!important;
}

/* ONE LAUNCH LANGUAGE — same hierarchy and behavior, game-specific choices. */
body[data-game-world] .witty-pregame {
  min-height:100dvh;
  overflow:auto;
}
body[data-game-world] .witty-pregame-grid {
  width:100%!important;
  min-height:100dvh!important;
  display:grid!important;
  grid-template-columns:minmax(0,1fr) minmax(420px,500px)!important;
  align-items:center!important;
  gap:clamp(38px,6vw,88px)!important;
  margin:0 auto!important;
  padding:84px max(20px,calc((100vw - 1180px)/2)) 28px!important;
  overflow:visible!important;
}
body[data-game-world] .witty-pregame-hero {
  width:100%;
  min-width:0;
  min-height:520px!important;
  position:relative;
  align-self:center!important;
  display:flex;
  flex-direction:column;
  justify-content:center;
  padding:28px 0!important;
}
body[data-game-world] .witty-pregame-hero h1 {
  max-width:690px;
  margin-top:10px!important;
  margin-bottom:20px!important;
  font-size:clamp(58px,7.2vw,104px)!important;
  line-height:.82!important;
}
body[data-game-world] .witty-pregame-card {
  width:100%!important;
  max-width:500px!important;
  max-height:calc(100dvh - 112px);
  position:relative;
  align-self:center!important;
  justify-self:end!important;
  overflow:auto;
  padding:28px!important;
  border:1px solid var(--world-line)!important;
  border-radius:18px!important;
  color:var(--world-ink);
  background:color-mix(in srgb,var(--world-surface) 96%,white)!important;
  box-shadow:12px 14px 0 color-mix(in srgb,var(--world-accent) 26%,transparent),0 24px 60px rgba(23,20,31,.12)!important;
  scrollbar-width:thin;
}
body[data-game-world] .witty-pregame-card::before {
  content:"";
  height:4px;
  position:absolute;
  inset:0 28px auto!important;
  border-radius:0 0 4px 4px!important;
  background:var(--world-accent)!important;
}
body[data-game-world] .witty-pregame-card :is(.setup-heading,.setup-panel-head,.card-heading,.fight-card-heading,.entry-card-title,.race-card-top) {
  min-height:42px;
  margin-bottom:14px;
}
body[data-game-world] .witty-pregame-card :is(.setup-heading h2,.setup-panel-head h2,.card-heading h2,h2) {
  letter-spacing:-.035em;
}
body[data-game-world] .witty-pregame-card>.witty-player-lockup {
  min-height:58px;
  display:flex;
  align-items:center;
  gap:11px;
  margin:12px 0 16px!important;
  padding:9px 10px;
  border:1px solid var(--world-line);
  border-radius:11px;
  background:color-mix(in srgb,var(--world-surface) 66%,white);
}
body[data-game-world] .witty-pregame-card .witty-player-avatar {
  width:38px;
  height:38px;
  display:grid;
  place-items:center;
  flex:0 0 38px;
  border-radius:10px;
  color:var(--world-surface);
  background:var(--world-ink);
  font:700 11px "Space Grotesk",sans-serif;
}
body[data-game-world] .witty-pregame-card .witty-player-copy { min-width:0; flex:1; }
body[data-game-world] .witty-pregame-card .witty-player-copy :is(small,strong) { display:block; }
body[data-game-world] .witty-pregame-card .witty-player-copy small { margin-bottom:2px; color:var(--world-muted); font-size:6px; font-weight:800; letter-spacing:.13em; }
body[data-game-world] .witty-pregame-card .witty-player-copy strong { overflow:hidden; color:var(--world-ink); font:700 12px "Space Grotesk",sans-serif; text-overflow:ellipsis; white-space:nowrap; }
body[data-game-world] .witty-pregame-card .witty-player-change { min-width:58px; min-height:44px; display:grid; place-items:center; margin-left:auto; padding:0 8px; color:var(--world-accent); font-size:7px; font-weight:800; letter-spacing:.1em; text-decoration:none; }
body[data-game-world] .witty-pregame-card :is(.primary-button,.start-button,.lobby-primary,.create-room-button) {
  min-height:56px;
  border-radius:10px!important;
}
body[data-game-world="chess"] .witty-pregame-hero {
  min-height:520px!important;
  padding:42px!important;
  border-radius:22px;
  overflow:hidden;
}
body[data-game-world="rider-racer"] .witty-pregame-card { color:#fff0d3; background:linear-gradient(145deg,rgba(58,49,90,.97),rgba(25,29,56,.98))!important; }
body[data-game-world="rider-racer"] .witty-pregame-card>.witty-player-lockup { background:rgba(255,240,211,.08); }
body[data-game-world="rider-racer"] .witty-pregame-card .witty-player-copy strong { color:#fff0d3; }
body[data-game-world="rider-racer"] .online-hero h1 { font:700 clamp(58px,7.2vw,104px)/.82 "Space Grotesk"; letter-spacing:-.075em; }
body[data-game-world="rider-racer"] .online-hero h1 em { color:transparent; font-style:normal; -webkit-text-stroke:2px #e3949c; }
body[data-game-world="rider-racer"] .online-card h2 { margin:15px 0 8px; font:700 30px "Space Grotesk"; }
body[data-game-world="rider-racer"] .online-card .online-setup { grid-template-columns:1fr; }
body[data-game-world="rider-racer"] :is(.menu-screen,.online-screen).witty-pregame-grid { overflow-x:clip!important; }
body[data-game-world="ring-king"] .witty-pregame-card .difficulty-picker legend {
  float:none;
  grid-column:1/-1;
  width:auto;
}
body[data-game-world="chess-royale"] .witty-pregame-card .setup-panel-head h2 { color:#f4ecdb; }
body[data-game-world="chess-royale"] .witty-pregame-card fieldset>legend { color:#aaa28e; }
/* One predictable game-level navigation and rules surface. */
body[data-game-world] > .witty-home-link,
body[data-game-world] .witty-pregame > :is(.home-link,.witty-home-link),
body[data-game-world] .witty-pregame .top-nav,
body[data-game-world]:has(.witty-pregame:not([hidden])) > :is(.ring-header,.racer-header) { display:none!important; }
body[data-game-world] .witty-pregame :is(#menu-rules-button,#setup-rules-button) { display:none!important; }
body[data-game-world] > .witty-game-nav {
  min-height:48px;
  position:fixed;
  z-index:900;
  inset:14px max(18px,env(safe-area-inset-right)) auto max(18px,env(safe-area-inset-left));
  display:flex;
  align-items:center;
  justify-content:space-between;
  pointer-events:none;
}
body[data-game-world] .witty-game-nav :is(a,button) {
  min-width:44px;
  min-height:44px;
  display:flex;
  align-items:center;
  gap:9px;
  padding:0 13px;
  border:1px solid var(--world-line);
  border-radius:12px;
  color:var(--world-ink);
  background:color-mix(in srgb,var(--world-surface) 92%,transparent);
  box-shadow:0 8px 24px rgba(20,20,30,.1);
  font:800 8px "DM Sans",sans-serif;
  letter-spacing:.1em;
  text-decoration:none;
  backdrop-filter:blur(14px);
  pointer-events:auto;
}
body[data-game-world] .witty-game-nav-home>span {
  width:28px;
  height:28px;
  display:grid;
  place-items:center;
  border-radius:8px;
  color:var(--world-surface);
  background:var(--world-ink);
  font:700 15px "Space Grotesk",sans-serif;
}
body[data-game-world] .witty-game-nav-rules>span {
  width:24px;
  height:24px;
  display:grid;
  place-items:center;
  border:1px solid currentColor;
  border-radius:50%;
  font-size:12px;
}
body[data-game-world] .witty-game-nav :is(a,button):focus-visible { outline:3px solid var(--world-accent); outline-offset:3px; }
body[data-game-world]:has(.game-screen:not([hidden])) > .witty-game-nav :is(a,button) { width:44px; padding:0; justify-content:center; }
body[data-game-world]:has(.game-screen:not([hidden])) > .witty-game-nav :is(a,button)>b { display:none; }
body[data-game-world]:has(.game-screen:not([hidden])) :is(
  #exit-game-button,#exit-button,#back-to-setup,#leave-button,#exit-link,
  #game-rules-button,#help-button,#rules-button,#header-rules,
  .game-header>.exit-link,.game-header>.back-button,
  .ring-header>.home-link,.racer-header>.home-link
) { visibility:hidden!important; pointer-events:none!important; }

.witty-rules-sheet {
  width:min(620px,calc(100vw - 28px));
  max-height:calc(100dvh - 28px);
  overflow:auto;
  padding:32px;
  border:1px solid var(--world-line);
  border-radius:22px;
  color:var(--world-ink);
  background:var(--world-surface);
  box-shadow:0 30px 90px rgba(16,20,44,.32);
}
.witty-rules-sheet::backdrop { background:rgba(8,10,20,.68); backdrop-filter:blur(8px); }
.witty-rules-sheet>.witty-rules-close {
  width:44px;
  height:44px;
  position:absolute;
  top:12px;
  right:12px;
  border:1px solid var(--world-line);
  border-radius:50%;
  color:var(--world-ink);
  background:transparent;
  font-size:24px;
}
.witty-rules-sheet>p { margin:0 52px 8px 0; color:var(--world-accent); font:800 8px "DM Sans",sans-serif; letter-spacing:.15em; }
.witty-rules-sheet>h2 { margin:0 48px 23px 0; font:700 clamp(28px,5vw,44px)/1 "Space Grotesk",sans-serif; letter-spacing:-.05em; }
.witty-rules-sheet>ol { display:grid; grid-template-columns:1fr 1fr; gap:9px; margin:0; padding:0; list-style:none; }
.witty-rules-sheet li { min-height:112px; display:flex; gap:13px; padding:15px; border:1px solid var(--world-line); border-radius:12px; background:color-mix(in srgb,var(--world-surface) 82%,var(--world-accent)); }
.witty-rules-sheet li>b { color:var(--world-accent); font:700 18px "Space Grotesk",sans-serif; }
.witty-rules-sheet li span { color:var(--world-muted); font:500 11px/1.5 "DM Sans",sans-serif; }
.witty-rules-sheet li strong { display:block; margin:3px 0 6px; color:var(--world-ink); font-size:9px; letter-spacing:.1em; }
.witty-rules-sheet>.witty-rules-done { width:100%; min-height:54px; display:flex; align-items:center; justify-content:space-between; margin-top:12px; padding:0 17px; border:0; border-radius:11px; color:var(--world-surface); background:var(--world-accent); font:800 9px "DM Sans",sans-serif; letter-spacing:.1em; }

/* Every private room presents the same invite actions in the same order. */
body[data-game-world] .witty-lobby-card {
  width:min(480px,100%)!important;
  display:flex!important;
  flex-direction:column;
  align-items:stretch;
  gap:10px;
}
body[data-game-world] .witty-lobby-card>.witty-room-code { order:2; width:100%; min-height:76px; margin:0!important; }
body[data-game-world] .witty-lobby-card>.witty-lobby-share { order:3; width:100%; min-height:50px; margin:0!important; border:1px solid var(--world-accent)!important; border-radius:10px!important; color:var(--world-accent)!important; background:color-mix(in srgb,var(--world-accent) 8%,transparent)!important; font:800 8px "DM Sans",sans-serif!important; letter-spacing:.1em; text-decoration:none; }
body[data-game-world] .witty-lobby-card>.witty-lobby-players { order:4; width:100%; margin:0!important; }
body[data-game-world] .witty-lobby-card>.witty-lobby-ready { order:5; width:100%; min-height:56px; margin:0!important; }
body[data-game-world] .witty-lobby-card>.witty-lobby-leave { order:6; min-height:44px; display:grid; place-items:center; margin:0!important; border:0!important; color:var(--world-muted)!important; background:transparent!important; font:800 7px "DM Sans",sans-serif!important; letter-spacing:.11em; text-decoration:none; }
body[data-game-world] .witty-lobby-card .witty-room-code :is(button,b,strong) { letter-spacing:.12em; }
body[data-game-world] .witty-lobby-card .witty-room-code :is(small:last-child,span:last-child,em,i) { display:inline!important; color:var(--world-muted); font:800 7px "DM Sans",sans-serif; letter-spacing:.09em; text-transform:uppercase; }

body[data-game-world] .witty-pregame-card nav:is(.mode-switch,.mode-tabs) {
  width:100%;
  min-height:54px;
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:4px;
  margin:10px 0 17px!important;
  padding:4px!important;
  border:1px solid var(--world-line);
  border-radius:12px;
  background:color-mix(in srgb,var(--world-surface) 76%,var(--world-muted));
}
body[data-game-world] .witty-pregame-card nav:is(.mode-switch,.mode-tabs)>a {
  min-width:0;
  min-height:44px;
  display:grid;
  place-items:center;
  margin:0!important;
  padding:0 9px!important;
  border:0!important;
  border-radius:9px!important;
  font-size:8px!important;
  font-weight:800;
  letter-spacing:.09em;
  text-decoration:none;
}
body[data-game-world] .witty-pregame-card nav:is(.mode-switch,.mode-tabs)>a.active {
  color:var(--world-surface)!important;
  background:var(--world-ink)!important;
  box-shadow:0 5px 13px rgba(20,20,30,.14);
}

/* The native hidden state must always win over shared grid display rules. */
body[data-game-world] [hidden] { display:none!important; }

/* Phone play keeps the board, current state, and primary action—everything else yields. */
@media(max-width:960px) {
  body[data-game-world] .witty-pregame-grid {
    grid-template-columns:minmax(0,1fr)!important;
    gap:18px!important;
    padding:78px 18px 28px!important;
  }
  body[data-game-world] .witty-pregame-hero {
    min-height:0!important;
    max-width:640px;
    margin:0 auto;
    padding:8px 4px!important;
    text-align:center;
  }
  body[data-game-world] .witty-pregame-hero h1 { max-width:none; margin:4px 0 12px!important; font-size:clamp(48px,12vw,72px)!important; }
  body[data-game-world] .witty-pregame-hero :is(.feature-row,.rules-row,.rules-strip,.rule-preview,.hero-arena,.hero-board,.pixel-marquee) { display:none!important; }
  body[data-game-world="battle-royale"] .witty-pregame-hero::before,
  body[data-game-world="battle-royale"] .witty-pregame-hero::after { display:none; }
  body[data-game-world] .witty-pregame-card { max-height:none; justify-self:center!important; padding:22px!important; }
  body[data-game-world="chess"] .witty-pregame-hero { min-height:0!important; padding:22px!important; }
  body[data-game-world="rider-racer"] .rider-showcase { display:none; }
  body[data-game-world="chess-royale"] .setup-screen { background:#202334; }
  body[data-game-world="chess-royale"] .setup-panel { color:#1c202c; }
  body[data-game-world="battle-royale"] .setup-screen { background:linear-gradient(180deg,#722d30 0 42%,#f4d5a4 42%); }
  body[data-game-world="tower-kingdoms"] .setup-screen { background:linear-gradient(180deg,#294934 0 43%,#eee3be 43%); }
}
@media(max-width:700px) {
  body[data-game-world] > .witty-game-nav { inset:10px 10px auto; }
  body[data-game-world] .witty-game-nav :is(a,button) { padding:0 10px; }
  body[data-game-world] .witty-game-nav :is(a,button)>b { font-size:7px; }
  .witty-rules-sheet { padding:28px 16px 18px; }
  .witty-rules-sheet>ol { grid-template-columns:1fr; }
  .witty-rules-sheet li { min-height:90px; }
  body[data-game-world] :is(.witty-home-link,.home-link) { padding:0 10px; }
  body[data-game-world]:has(.game-screen:not([hidden])) { height:100dvh; overflow:hidden; }
  body[data-game-world] .game-screen:not([hidden]) { height:100dvh; min-height:0; overflow:hidden; }
  body[data-game-world="chess-royale"] .setup-tagline br { display:none; }
  body[data-game-world="chess-royale"] .turn-banner p,
  body[data-game-world="chess-royale"] .turn-progress,
  body[data-game-world="chess"] .turn-card>span,
  body[data-game-world="battle-royale"] .turn-banner p,
  body[data-game-world="shape-royale"] .status-card>span,
  body[data-game-world="shape-royale"] .hand-heading small,
  body[data-game-world="tower-kingdoms"] .battle-status p,
  body[data-game-world="tower-kingdoms"] .send-heading small { display:none; }
  body[data-game-world="battle-royale"] .setup-screen,
  body[data-game-world="tower-kingdoms"] .setup-screen { background-position:center; }
  body[data-game-world="shape-royale"] .shape-card { box-shadow:3px 4px 0 rgba(17,24,44,.1); }

  /* Chess: one compact status row below the board replaces the tall sidebar. */
  body[data-game-world="chess"] .game-screen:not([hidden]) .game-layout {
    width:100%;
    height:calc(100dvh - 60px);
    min-height:0;
    display:flex;
    flex-direction:column;
    justify-content:flex-start;
    gap:0;
    padding:0;
    overflow:hidden;
  }
  body[data-game-world="chess"] .game-screen:not([hidden]) .arena-column { flex:0 0 auto; }
  body[data-game-world="chess"] .game-screen:not([hidden]) .player-card {
    height:48px;
    min-height:48px;
    grid-template-columns:32px minmax(0,1fr) auto;
    gap:8px;
    padding:0 9px;
  }
  body[data-game-world="chess"] .game-screen:not([hidden]) .player-avatar { width:32px; height:32px; border-radius:4px; }
  body[data-game-world="chess"] .game-screen:not([hidden]) .player-identity strong { font-size:10px; }
  body[data-game-world="chess"] .game-screen:not([hidden]) .captured-pieces { font-size:10px; }
  body[data-game-world="chess"] .game-screen:not([hidden]) .chess-clock { min-width:60px; padding:6px 8px; border-radius:3px; font-size:15px; }
  body[data-game-world="chess"] .game-screen:not([hidden]) .board-stage { min-height:0; display:grid; place-items:center; padding:4px; }
  body[data-game-world="chess"] .game-screen:not([hidden]) .chess-board {
    width:min(calc(100vw - 8px),calc(100dvh - 212px));
    height:auto;
  }
  body[data-game-world="chess"] .game-screen:not([hidden]) .game-sidebar {
    height:56px;
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    align-items:center;
    gap:6px;
    padding:6px 8px max(6px,env(safe-area-inset-bottom));
    overflow:hidden;
  }
  body[data-game-world="chess"] .game-screen:not([hidden]) .turn-card {
    grid-column:1;
    grid-row:1;
    height:44px;
    min-height:44px;
    display:flex;
    align-items:center;
    gap:8px;
    padding:7px 10px;
  }
  body[data-game-world="chess"] .game-screen:not([hidden]) .turn-card::after { display:none; }
  body[data-game-world="chess"] .game-screen:not([hidden]) .turn-card p,
  body[data-game-world="chess"] .game-screen:not([hidden]) .turn-card h2 { margin:0; }
  body[data-game-world="chess"] .game-screen:not([hidden]) .turn-card h2 { overflow:hidden; font-size:14px; text-overflow:ellipsis; white-space:nowrap; }
  body[data-game-world="chess"] .game-screen:not([hidden]) .game-controls { grid-template-columns:repeat(3,44px); gap:4px; }
  body[data-game-world="chess"] .game-screen:not([hidden]) .game-controls { grid-column:2; grid-row:1; }
  body[data-game-world="chess"] .game-screen:not([hidden]) .game-controls button { min-height:44px; height:44px; padding:4px; }
  body[data-game-world="chess"] .game-screen:not([hidden]) .moves-card { display:none; }

  /* Chess Royale: the deployment deck becomes a single, always-visible tray. */
  body[data-game-world="chess-royale"] .game-screen:not([hidden]) .match-layout {
    height:calc(100dvh - 60px);
    min-height:0;
    display:flex;
    flex-direction:column;
    overflow:hidden;
  }
  body[data-game-world="chess-royale"] .game-screen:not([hidden]) .left-rail { display:none; }
  body[data-game-world="chess-royale"] .game-screen:not([hidden]) .arena {
    order:1;
    flex:0 0 auto;
    min-height:0;
    padding:6px 6px 0;
  }
  body[data-game-world="chess-royale"] .game-screen:not([hidden]) .turn-banner { min-height:44px; margin-bottom:4px; padding:5px 8px; }
  body[data-game-world="chess-royale"] .game-screen:not([hidden]) .turn-crest { width:30px; height:30px; border-radius:2px; }
  body[data-game-world="chess-royale"] .game-screen:not([hidden]) .board-stage { flex:0 0 auto; padding:0; }
  body[data-game-world="chess-royale"] .game-screen:not([hidden]) .board-frame {
    width:min(calc(100vw - 12px),calc(100dvh - 294px));
    padding:6px;
  }
  body[data-game-world="chess-royale"] .game-screen:not([hidden]) .action-dock {
    min-height:50px;
    grid-template-columns:1fr 1.35fr;
    gap:5px;
    margin-top:4px;
    padding:3px 0;
  }
  body[data-game-world="chess-royale"] .game-screen:not([hidden]) .secondary-button,
  body[data-game-world="chess-royale"] .game-screen:not([hidden]) .end-turn-button { min-height:44px; }
  body[data-game-world="chess-royale"] .game-screen:not([hidden]) .action-dock .secondary-button { grid-column:1; }
  body[data-game-world="chess-royale"] .game-screen:not([hidden]) .action-dock .end-turn-button { grid-column:2; }
  body[data-game-world="chess-royale"] .game-screen:not([hidden]) .right-rail {
    order:2;
    height:110px;
    min-height:110px;
    display:grid;
    grid-template-columns:1fr;
    grid-template-rows:40px 62px;
    gap:4px;
    padding:4px 6px;
    overflow:hidden;
    border:0;
    border-top:1px solid rgba(197,164,93,.18);
  }
  body[data-game-world="chess-royale"] .game-screen:not([hidden]) .right-rail>section { min-width:0; margin:0; padding:4px 7px; }
  body[data-game-world="chess-royale"] .game-screen:not([hidden]) .energy-card { display:flex; align-items:center; gap:7px; }
  body[data-game-world="chess-royale"] .game-screen:not([hidden]) .energy-orb { width:32px; height:32px; flex:0 0 auto; border-radius:2px; }
  body[data-game-world="chess-royale"] .game-screen:not([hidden]) .energy-orb span { font-size:9px; }
  body[data-game-world="chess-royale"] .game-screen:not([hidden]) .energy-orb b { font-size:13px; }
  body[data-game-world="chess-royale"] .game-screen:not([hidden]) .energy-card>div:last-child {
    min-width:0;
    flex:1;
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    align-items:center;
    gap:2px 7px;
  }
  body[data-game-world="chess-royale"] .game-screen:not([hidden]) .energy-card .energy-track { margin:0; }
  body[data-game-world="chess-royale"] .game-screen:not([hidden]) .energy-card small { display:none; }
  body[data-game-world="chess-royale"] .game-screen:not([hidden]) .active-clock { grid-column:2; grid-row:1/3; min-width:74px; margin:0; padding:4px 7px; }
  body[data-game-world="chess-royale"] .game-screen:not([hidden]) .active-clock b { font-size:14px; }
  body[data-game-world="chess-royale"] .game-screen:not([hidden]) .deck-heading { display:none; }
  body[data-game-world="chess-royale"] .game-screen:not([hidden]) .piece-deck { grid-template-columns:repeat(5,minmax(0,1fr)); gap:4px; }
  body[data-game-world="chess-royale"] .game-screen:not([hidden]) .piece-card {
    min-height:54px;
    height:54px;
    display:grid;
    place-items:center;
    padding:3px;
  }
  body[data-game-world="chess-royale"] .game-screen:not([hidden]) .piece-card>span:nth-child(2) { display:none; }
  body[data-game-world="chess-royale"] .game-screen:not([hidden]) .piece-glyph { width:34px; height:34px; }

  /* Battle Royale: compact live vitals and inventory around a height-aware board. */
  body[data-game-world="battle-royale"] .game-screen:not([hidden]) .game-layout {
    height:calc(100dvh - 60px);
    min-height:0;
    overflow:hidden;
  }
  body[data-game-world="battle-royale"] .game-screen:not([hidden]) :is(.players-panel,.inventory-panel) { display:none; }
  body[data-game-world="battle-royale"] .game-screen:not([hidden]) .board-area { height:100%; min-height:0; padding:6px 4px 0; overflow:hidden; }
  body[data-game-world="battle-royale"] .game-screen:not([hidden]) .turn-banner { min-height:42px; margin-bottom:4px; padding:5px 9px; }
  body[data-game-world="battle-royale"] .game-screen:not([hidden]) .match-status { margin:0 auto 4px; }
  body[data-game-world="battle-royale"] .game-screen:not([hidden]) .status-card { min-height:32px; padding:4px 8px; }
  body[data-game-world="battle-royale"] .game-screen:not([hidden]) .status-card>span { width:22px; height:22px; }
  body[data-game-world="battle-royale"] .game-screen:not([hidden]) .battle-mobile-arranged .mobile-vitals-slot {
    min-height:50px;
    grid-template-columns:minmax(112px,.7fr) 1fr;
    gap:9px;
    margin:0 auto 4px;
    padding:5px 9px;
    border-radius:4px;
  }
  body[data-game-world="battle-royale"] .game-screen:not([hidden]) .battle-mobile-arranged .mobile-vitals-slot .current-player-card {
    padding:0 9px 0 0;
    border:0;
    border-right:1px solid var(--line);
  }
  body[data-game-world="battle-royale"] .game-screen:not([hidden]) .battle-mobile-arranged .mobile-vitals-slot .large-avatar { width:34px; height:34px; border-radius:4px; }
  body[data-game-world="battle-royale"] .game-screen:not([hidden]) .battle-mobile-arranged .mobile-vitals-slot .vitals {
    display:grid;
    grid-template-columns:1fr;
    gap:1px;
    padding:0;
    border:0;
  }
  body[data-game-world="battle-royale"] .game-screen:not([hidden]) .battle-mobile-arranged .mobile-vitals-slot .vital-row { margin:1px 0; }
  body[data-game-world="battle-royale"] .game-screen:not([hidden]) .board-wrap {
    min-height:0;
    flex:1 1 auto;
    overflow:hidden;
    padding:0;
  }
  body[data-game-world="battle-royale"] .game-screen:not([hidden]) .board-area {
    display:grid;
    grid-template-rows:auto auto auto minmax(0,1fr) auto auto;
  }
  body[data-game-world="battle-royale"] .game-screen:not([hidden]) .game-board {
    --tile:auto;
    width:min(100%,calc(100dvh - 310px));
    max-width:100%;
    max-height:100%;
    aspect-ratio:1;
    grid-template-columns:repeat(var(--cols),minmax(0,1fr));
    grid-auto-rows:minmax(0,1fr);
  }
  body[data-game-world="battle-royale"] .game-screen:not([hidden]) .battle-mobile-arranged .mobile-inventory-slot {
    flex:0 0 auto;
    max-height:96px;
    margin:4px auto 0;
    padding:5px 7px 2px;
    border-radius:4px;
    overflow:auto;
  }
  body[data-game-world="battle-royale"] .game-screen:not([hidden]) .inventory-heading { padding:0; }
  body[data-game-world="battle-royale"] .game-screen:not([hidden]) .inventory-heading p { display:none; }
  body[data-game-world="battle-royale"] .game-screen:not([hidden]) .inventory-list { grid-template-columns:repeat(3,minmax(0,1fr)); gap:4px; margin:3px 0; }
  body[data-game-world="battle-royale"] .game-screen:not([hidden]) .inventory-item { min-height:44px; padding:4px; }
  body[data-game-world="battle-royale"] .game-screen:not([hidden]) .empty-inventory { min-height:34px; padding:8px 6px; }
  body[data-game-world="battle-royale"] .game-screen:not([hidden]) .action-bar { min-height:56px; gap:7px; margin-top:3px; padding-bottom:env(safe-area-inset-bottom); }
  body[data-game-world="battle-royale"] .game-screen:not([hidden]) .dice-button { min-width:132px; min-height:46px; padding:5px 8px; }
  body[data-game-world="battle-royale"] .game-screen:not([hidden]) .dice-face { width:32px; height:32px; }

  /* Tower Kingdoms: the live map owns the screen; troop controls stay docked below it. */
  body[data-game-world="tower-kingdoms"] .game-screen:not([hidden]) .game-layout {
    height:calc(100dvh - 64px);
    min-height:0;
    display:grid;
    grid-template-columns:1fr;
    grid-template-rows:minmax(0,1fr) 56px;
    overflow:hidden;
  }
  body[data-game-world="tower-kingdoms"] .game-screen:not([hidden]) .battlefield-column {
    grid-column:1;
    grid-row:1;
    min-height:0;
    display:flex;
    flex-direction:column;
    padding:6px 8px;
    overflow:hidden;
  }
  body[data-game-world="tower-kingdoms"] .game-screen:not([hidden]) .battle-status { min-height:44px; margin-bottom:5px; padding:6px 9px; }
  body[data-game-world="tower-kingdoms"] .game-screen:not([hidden]) .battlefield {
    width:min(calc(100vw - 16px),calc(100dvh - 225px));
    flex:0 0 auto;
  }
  body[data-game-world="tower-kingdoms"] .game-screen:not([hidden]) .mobile-kingdom-strip {
    min-height:38px;
    height:38px;
    margin:5px auto 0;
    padding:4px 9px;
    border-radius:3px;
  }
  body[data-game-world="tower-kingdoms"] .game-screen:not([hidden]) .mobile-kingdom-strip>span { height:28px; border-radius:2px; }
  body[data-game-world="tower-kingdoms"] .game-screen:not([hidden]) .command-panel {
    grid-column:1;
    grid-row:2;
    min-height:56px;
    display:grid;
    grid-template-columns:82px minmax(0,1fr);
    align-items:center;
    gap:8px;
    padding:6px 8px max(6px,env(safe-area-inset-bottom));
    overflow:hidden;
  }
  body[data-game-world="tower-kingdoms"] .game-screen:not([hidden]) .command-panel>:is(.panel-heading,.selection-card,.realm-stats,.war-feed,.forfeit-button) { display:none; }
  body[data-game-world="tower-kingdoms"] .game-screen:not([hidden]) .send-heading { margin:0; }
  body[data-game-world="tower-kingdoms"] .game-screen:not([hidden]) .send-options { width:100%; margin:0; gap:5px; }
  body[data-game-world="tower-kingdoms"] .game-screen:not([hidden]) .send-options button { min-height:44px; height:44px; }
}

/* Rotated phones keep the play surface and primary controls in one viewport. */
@media (orientation:landscape) and (max-height:600px) and (max-width:1000px) {
  body[data-game-world]:has(.game-screen:not([hidden])) {
    width:100%;
    height:100dvh;
    overflow:hidden;
  }
  body[data-game-world] .game-screen:not([hidden]) {
    width:100%;
    height:100dvh;
    min-height:0;
    overflow:hidden;
  }
  body[data-game-world] > .witty-game-nav {
    inset:max(4px,env(safe-area-inset-top)) max(6px,env(safe-area-inset-right)) auto max(6px,env(safe-area-inset-left));
  }
  body[data-game-world] .witty-game-nav :is(a,button) {
    width:44px;
    padding:0;
    justify-content:center;
  }
  body[data-game-world] .witty-game-nav :is(a,button)>b { display:none; }
  body[data-game-world] :is(.game-header,.ring-header,.racer-header) {
    height:52px;
    min-height:52px;
    padding-top:0;
    padding-bottom:0;
  }
  body[data-game-world] .game-header :is(.game-brand small,.game-logo small) { display:none; }

  body[data-game-world] .witty-pregame-grid {
    min-height:100dvh!important;
    grid-template-columns:minmax(0,1fr) minmax(310px,.92fr)!important;
    align-items:center!important;
    gap:18px!important;
    padding:max(58px,calc(48px + env(safe-area-inset-top))) max(14px,env(safe-area-inset-right)) max(10px,env(safe-area-inset-bottom)) max(14px,env(safe-area-inset-left))!important;
  }
  body[data-game-world] .witty-pregame-hero {
    min-height:0!important;
    margin:0!important;
    padding:4px!important;
    text-align:left;
  }
  body[data-game-world] .witty-pregame-hero h1 {
    margin:2px 0 9px!important;
    font-size:clamp(42px,8vw,68px)!important;
  }
  body[data-game-world] .witty-pregame-hero :is(.feature-row,.rules-row,.rules-strip,.rule-preview,.hero-arena,.hero-board,.pixel-marquee,.rider-showcase) { display:none!important; }
  body[data-game-world] .witty-pregame-card {
    max-height:calc(100dvh - 68px)!important;
    padding:16px!important;
    overflow:auto;
  }
  body[data-game-world] .witty-pregame-card :is(.setup-heading,.setup-panel-head,.card-heading,.fight-card-heading,.entry-card-title,.race-card-top) { margin-bottom:8px; }
  body[data-game-world] .witty-pregame-card>.witty-player-lockup { min-height:50px; margin:7px 0 9px!important; }
  body[data-game-world="chess"] .witty-pregame-hero { padding:18px!important; }

  /* Chess */
  body[data-game-world="chess"] .game-screen:not([hidden]) .game-layout {
    width:100%;
    height:calc(100dvh - 52px);
    display:grid;
    grid-template-columns:minmax(0,1fr) 188px;
    gap:4px;
    margin:0;
    padding:4px max(4px,env(safe-area-inset-right)) 4px max(4px,env(safe-area-inset-left));
    overflow:hidden;
  }
  body[data-game-world="chess"] .game-screen:not([hidden]) .arena-column {
    min-height:0;
    display:grid;
    grid-template-columns:minmax(0,1fr) 156px;
    grid-template-rows:1fr 1fr;
    gap:4px;
  }
  body[data-game-world="chess"] .game-screen:not([hidden]) .board-stage {
    grid-column:1;
    grid-row:1/3;
    min-height:0;
    display:grid;
    place-items:center;
    padding:3px;
  }
  body[data-game-world="chess"] .game-screen:not([hidden]) .chess-board {
    width:min(calc(100dvh - 62px),calc(100vw - 370px));
    height:auto;
  }
  body[data-game-world="chess"] .game-screen:not([hidden]) .player-card {
    height:auto;
    min-height:0;
    grid-template-columns:34px minmax(0,1fr);
    grid-template-rows:auto auto;
    gap:6px;
    padding:7px;
    border-radius:3px;
  }
  body[data-game-world="chess"] .game-screen:not([hidden]) .player-avatar { width:32px; height:32px; border-radius:4px; }
  body[data-game-world="chess"] .game-screen:not([hidden]) .chess-clock { grid-column:1/-1; min-width:0; padding:6px; font-size:15px; }
  body[data-game-world="chess"] .game-screen:not([hidden]) .captured-pieces { display:none; }
  body[data-game-world="chess"] .game-screen:not([hidden]) .game-sidebar {
    min-height:0;
    display:grid;
    grid-template-rows:minmax(0,1fr) auto;
    gap:4px;
    padding:0;
    overflow:hidden;
  }
  body[data-game-world="chess"] .game-screen:not([hidden]) .turn-card { min-height:0; padding:12px; }
  body[data-game-world="chess"] .game-screen:not([hidden]) .turn-card h2 { font-size:18px; }
  body[data-game-world="chess"] .game-screen:not([hidden]) .game-controls { grid-template-columns:repeat(3,minmax(0,1fr)); gap:4px; }
  body[data-game-world="chess"] .game-screen:not([hidden]) .game-controls button { min-height:48px; }
  body[data-game-world="chess"] .game-screen:not([hidden]) :is(.moves-card,.rule-reminder) { display:none; }

  /* Chess Royale */
  body[data-game-world="chess-royale"] .game-screen:not([hidden]) .match-layout {
    width:100%;
    height:calc(100dvh - 52px);
    min-height:0;
    display:grid;
    grid-template-columns:minmax(0,1fr) 230px;
    grid-template-rows:minmax(0,1fr);
    overflow:hidden;
  }
  body[data-game-world="chess-royale"] .game-screen:not([hidden]) .left-rail { display:none; }
  body[data-game-world="chess-royale"] .game-screen:not([hidden]) .arena {
    grid-column:1;
    grid-row:1;
    min-height:0;
    display:flex;
    flex-direction:column;
    padding:4px 7px;
    overflow:hidden;
  }
  body[data-game-world="chess-royale"] .game-screen:not([hidden]) .turn-banner { min-height:38px; margin-bottom:3px; padding:4px 7px; }
  body[data-game-world="chess-royale"] .game-screen:not([hidden]) .turn-banner p { display:none; }
  body[data-game-world="chess-royale"] .game-screen:not([hidden]) .board-stage { flex:1 1 auto; min-height:0; display:grid; place-items:center; padding:0; }
  body[data-game-world="chess-royale"] .game-screen:not([hidden]) .board-frame {
    width:min(calc(100dvh - 154px),calc(100vw - 252px));
    padding:4px;
  }
  body[data-game-world="chess-royale"] .game-screen:not([hidden]) .action-dock {
    min-height:48px;
    grid-template-columns:1fr 1.25fr;
    gap:5px;
    margin-top:3px;
    padding:2px 0;
  }
  body[data-game-world="chess-royale"] .game-screen:not([hidden]) .action-dock :is(.active-player-compact,.turn-progress) { display:none; }
  body[data-game-world="chess-royale"] .game-screen:not([hidden]) .action-dock :is(.secondary-button,.end-turn-button) { min-height:44px; }
  body[data-game-world="chess-royale"] .game-screen:not([hidden]) .right-rail {
    grid-column:2;
    grid-row:1;
    height:100%;
    min-height:0;
    display:grid;
    grid-template-columns:1fr;
    grid-template-rows:48px minmax(0,1fr);
    gap:4px;
    padding:4px max(4px,env(safe-area-inset-right)) 4px 4px;
    overflow:hidden;
    border:0;
    border-left:1px solid rgba(197,164,93,.18);
  }
  body[data-game-world="chess-royale"] .game-screen:not([hidden]) .right-rail>section { min-width:0; margin:0; padding:4px 6px; overflow:hidden; }
  body[data-game-world="chess-royale"] .game-screen:not([hidden]) .energy-card { display:flex; align-items:center; gap:6px; }
  body[data-game-world="chess-royale"] .game-screen:not([hidden]) .energy-orb { width:34px; height:34px; flex:0 0 34px; border-radius:3px; }
  body[data-game-world="chess-royale"] .game-screen:not([hidden]) .energy-card small { display:none; }
  body[data-game-world="chess-royale"] .game-screen:not([hidden]) .deck-heading { display:none; }
  body[data-game-world="chess-royale"] .game-screen:not([hidden]) .piece-deck { grid-template-columns:repeat(2,minmax(0,1fr)); gap:4px; }
  body[data-game-world="chess-royale"] .game-screen:not([hidden]) .piece-card { min-height:52px; height:52px; padding:3px; }
  body[data-game-world="chess-royale"] .game-screen:not([hidden]) .piece-card>span:nth-child(2) { display:none; }

  /* Battle Royale */
  body[data-game-world="battle-royale"] .game-screen:not([hidden]) .game-layout {
    width:100%;
    height:calc(100dvh - 52px);
    min-height:0;
    display:block;
    overflow:hidden;
  }
  body[data-game-world="battle-royale"] .game-screen:not([hidden]) :is(.players-panel,.inventory-panel) { display:none; }
  body[data-game-world="battle-royale"] .game-screen:not([hidden]) .board-area {
    width:100%;
    height:100%;
    display:grid;
    grid-template-columns:minmax(0,1fr) 216px;
    grid-template-rows:40px auto minmax(0,1fr) auto;
    gap:4px;
    padding:4px max(4px,env(safe-area-inset-right)) 4px max(4px,env(safe-area-inset-left));
    overflow:hidden;
  }
  body[data-game-world="battle-royale"] .game-screen:not([hidden]) .turn-banner { grid-column:1/-1; grid-row:1; min-height:40px; margin:0; padding:4px 8px; }
  body[data-game-world="battle-royale"] .game-screen:not([hidden]) .turn-banner p,
  body[data-game-world="battle-royale"] .game-screen:not([hidden]) .match-status { display:none; }
  body[data-game-world="battle-royale"] .game-screen:not([hidden]) .board-wrap {
    grid-column:1;
    grid-row:2/5;
    min-height:0;
    display:grid;
    place-items:center;
    overflow:hidden;
    padding:0;
  }
  body[data-game-world="battle-royale"] .game-screen:not([hidden]) .game-board {
    --tile:auto;
    width:min(100%,calc(100dvh - 104px));
    max-height:100%;
    aspect-ratio:1;
    grid-template-columns:repeat(var(--cols),minmax(0,1fr));
    grid-auto-rows:minmax(0,1fr);
    gap:2px;
    padding:5px;
  }
  body[data-game-world="battle-royale"] .game-screen:not([hidden]) .battle-mobile-arranged .mobile-vitals-slot {
    grid-column:2;
    grid-row:2;
    min-height:48px;
    display:grid;
    grid-template-columns:94px 1fr;
    gap:5px;
    margin:0;
    padding:4px 6px;
    overflow:hidden;
  }
  body[data-game-world="battle-royale"] .game-screen:not([hidden]) .mobile-vitals-slot .current-player-card { min-width:0; padding:0 5px 0 0; border:0; border-right:1px solid var(--line); }
  body[data-game-world="battle-royale"] .game-screen:not([hidden]) .mobile-vitals-slot .large-avatar { width:30px; height:30px; flex:0 0 30px; border-radius:4px; }
  body[data-game-world="battle-royale"] .game-screen:not([hidden]) .mobile-vitals-slot .current-player-card small { display:none; }
  body[data-game-world="battle-royale"] .game-screen:not([hidden]) .mobile-vitals-slot .current-player-card strong { overflow:hidden; font-size:9px; text-overflow:ellipsis; white-space:nowrap; }
  body[data-game-world="battle-royale"] .game-screen:not([hidden]) .mobile-vitals-slot .vitals { padding:0; border:0; }
  body[data-game-world="battle-royale"] .game-screen:not([hidden]) .battle-mobile-arranged .mobile-inventory-slot {
    grid-column:2;
    grid-row:3;
    min-height:0;
    margin:0;
    padding:5px;
    overflow:auto;
  }
  body[data-game-world="battle-royale"] .game-screen:not([hidden]) .mobile-inventory-slot .inventory-heading { display:none; }
  body[data-game-world="battle-royale"] .game-screen:not([hidden]) .mobile-inventory-slot .inventory-list { grid-template-columns:repeat(2,minmax(0,1fr)); gap:3px; margin:0; }
  body[data-game-world="battle-royale"] .game-screen:not([hidden]) .mobile-inventory-slot .inventory-item { min-height:44px; padding:3px; }
  body[data-game-world="battle-royale"] .game-screen:not([hidden]) .mobile-inventory-slot .empty-inventory { min-height:32px; padding:6px; }
  body[data-game-world="battle-royale"] .game-screen:not([hidden]) .action-bar {
    grid-column:2;
    grid-row:4;
    min-height:92px;
    display:grid;
    grid-template-columns:1fr;
    gap:4px;
    margin:0;
    padding:0;
    border:0;
  }
  body[data-game-world="battle-royale"] .game-screen:not([hidden]) .dice-zone { display:block; }
  body[data-game-world="battle-royale"] .game-screen:not([hidden]) .dice-zone>p { display:none; }
  body[data-game-world="battle-royale"] .game-screen:not([hidden]) :is(.dice-button,.end-turn-button) { width:100%; min-width:0; min-height:44px; padding:4px 8px; }
  body[data-game-world="battle-royale"] .game-screen:not([hidden]) .dice-face { width:32px; height:32px; }

  /* Shape Royale */
  body[data-game-world="shape-royale"] .game-screen:not([hidden]) .battle-layout {
    width:100%;
    height:calc(100dvh - 52px);
    display:grid;
    grid-template-columns:minmax(190px,.8fr) minmax(280px,1.2fr);
    align-items:stretch;
    gap:8px;
    padding:4px max(5px,env(safe-area-inset-right)) 4px max(5px,env(safe-area-inset-left));
    overflow:hidden;
  }
  body[data-game-world="shape-royale"] .game-screen:not([hidden]) .arena-column {
    min-height:0;
    display:grid;
    grid-template-rows:34px minmax(0,1fr) 34px;
  }
  body[data-game-world="shape-royale"] .game-screen:not([hidden]) .competitor-strip { min-height:34px; padding:2px 6px; }
  body[data-game-world="shape-royale"] .game-screen:not([hidden]) .competitor-avatar { width:28px; height:28px; border-radius:5px; }
  body[data-game-world="shape-royale"] .game-screen:not([hidden]) .arena {
    width:min(100%,calc((100dvh - 128px) * .5625));
    max-height:100%;
    border-width:4px;
    border-radius:7px;
  }
  body[data-game-world="shape-royale"] .game-screen:not([hidden]) .battle-sidebar {
    min-height:0;
    display:grid;
    grid-template-rows:48px 38px minmax(0,1fr);
    gap:4px;
    padding:0;
    overflow:hidden;
  }
  body[data-game-world="shape-royale"] .game-screen:not([hidden]) .status-card { min-height:48px; padding:5px 9px; }
  body[data-game-world="shape-royale"] .game-screen:not([hidden]) .status-card p,
  body[data-game-world="shape-royale"] .game-screen:not([hidden]) .status-card>span { display:none; }
  body[data-game-world="shape-royale"] .game-screen:not([hidden]) .status-card h2 { margin:0; font-size:15px; }
  body[data-game-world="shape-royale"] .game-screen:not([hidden]) .elixir-card { min-height:38px; margin:0; padding:5px 8px; }
  body[data-game-world="shape-royale"] .game-screen:not([hidden]) .elixir-heading { margin-bottom:2px; }
  body[data-game-world="shape-royale"] .game-screen:not([hidden]) .hand-section { min-height:0; margin:0; overflow:auto; }
  body[data-game-world="shape-royale"] .game-screen:not([hidden]) .hand-heading { display:none; }
  body[data-game-world="shape-royale"] .game-screen:not([hidden]) .card-hand { grid-template-columns:repeat(4,minmax(0,1fr)); gap:4px; }
  body[data-game-world="shape-royale"] .game-screen:not([hidden]) .shape-card { min-height:72px; padding:4px; }
  body[data-game-world="shape-royale"] .game-screen:not([hidden]) .card-art { height:38px; margin:-4px -4px 3px; }
  body[data-game-world="shape-royale"] .game-screen:not([hidden]) :is(.battle-tip,.restart-button) { display:none; }

  /* Tower Kingdoms */
  body[data-game-world="tower-kingdoms"] .game-screen:not([hidden]) .game-layout {
    width:100%;
    height:calc(100dvh - 52px);
    min-height:0;
    display:grid;
    grid-template-columns:minmax(0,1fr) 220px;
    grid-template-rows:minmax(0,1fr);
    overflow:hidden;
  }
  body[data-game-world="tower-kingdoms"] .game-screen:not([hidden]) .kingdom-panel { display:none; }
  body[data-game-world="tower-kingdoms"] .game-screen:not([hidden]) .battlefield-column {
    grid-column:1;
    grid-row:1;
    min-height:0;
    display:flex;
    flex-direction:column;
    padding:4px 6px;
    overflow:hidden;
  }
  body[data-game-world="tower-kingdoms"] .game-screen:not([hidden]) .battle-status { min-height:40px; margin-bottom:4px; padding:4px 8px; }
  body[data-game-world="tower-kingdoms"] .game-screen:not([hidden]) .battle-status p { display:none; }
  body[data-game-world="tower-kingdoms"] .game-screen:not([hidden]) .battlefield {
    width:min(calc(100dvh - 104px),calc(100vw - 236px));
    flex:0 0 auto;
    border-width:3px;
    border-radius:8px;
  }
  body[data-game-world="tower-kingdoms"] .game-screen:not([hidden]) .mobile-kingdom-strip { display:none; }
  body[data-game-world="tower-kingdoms"] .game-screen:not([hidden]) .command-panel {
    grid-column:2;
    grid-row:1;
    min-height:0;
    display:flex;
    flex-direction:column;
    padding:7px max(7px,env(safe-area-inset-right)) 7px 7px;
    overflow:auto;
    border:0;
    border-left:1px solid var(--line);
  }
  body[data-game-world="tower-kingdoms"] .game-screen:not([hidden]) .command-panel>.panel-heading { display:none; }
  body[data-game-world="tower-kingdoms"] .game-screen:not([hidden]) .selection-card { min-height:58px; padding:6px; }
  body[data-game-world="tower-kingdoms"] .game-screen:not([hidden]) .selection-icon { width:36px; height:36px; border-radius:4px; }
  body[data-game-world="tower-kingdoms"] .game-screen:not([hidden]) .send-heading { margin:9px 0 5px; }
  body[data-game-world="tower-kingdoms"] .game-screen:not([hidden]) .send-options { gap:4px; }
  body[data-game-world="tower-kingdoms"] .game-screen:not([hidden]) .send-options button { min-height:50px; }
  body[data-game-world="tower-kingdoms"] .game-screen:not([hidden]) .realm-stats { gap:4px; margin:7px 0 0; }
  body[data-game-world="tower-kingdoms"] .game-screen:not([hidden]) .realm-stats>div { padding:7px; }
  body[data-game-world="tower-kingdoms"] .game-screen:not([hidden]) :is(.war-feed,.forfeit-button) { display:none; }

  /* Ring King */
  body[data-game-world="ring-king"] .game-screen:not([hidden]) {
    grid-template-rows:54px minmax(0,1fr) 58px;
    gap:4px;
    padding:58px max(6px,env(safe-area-inset-right)) max(4px,env(safe-area-inset-bottom)) max(6px,env(safe-area-inset-left));
  }
  body[data-game-world="ring-king"] .game-screen:not([hidden]) .scoreboard { min-height:54px; grid-template-columns:1fr 82px 1fr; gap:7px; }
  body[data-game-world="ring-king"] .game-screen:not([hidden]) .fighter-name { margin-bottom:3px; }
  body[data-game-world="ring-king"] .game-screen:not([hidden]) .fighter-name small { display:none; }
  body[data-game-world="ring-king"] .game-screen:not([hidden]) .corner-dot { width:22px; height:22px; border-width:2px; }
  body[data-game-world="ring-king"] .game-screen:not([hidden]) .meter { height:12px; padding:2px; }
  body[data-game-world="ring-king"] .game-screen:not([hidden]) .stamina-line { margin-top:3px; }
  body[data-game-world="ring-king"] .game-screen:not([hidden]) .fight-clock { border-width:2px; box-shadow:2px 2px 0 #080a10; }
  body[data-game-world="ring-king"] .game-screen:not([hidden]) .fight-clock small { margin-bottom:3px; font-size:4px; }
  body[data-game-world="ring-king"] .game-screen:not([hidden]) .fight-clock strong { font-size:13px; }
  body[data-game-world="ring-king"] .game-screen:not([hidden]) .arena-shell { border-width:3px; box-shadow:3px 3px 0 rgba(0,0,0,.65); }
  body[data-game-world="ring-king"] .game-screen:not([hidden]) .control-deck { min-height:58px; gap:5px; }
  body[data-game-world="ring-king"] .game-screen:not([hidden]) :is(.move-controls,.punch-controls) { gap:4px; }
  body[data-game-world="ring-king"] .game-screen:not([hidden]) .control-deck button { width:auto; min-width:48px; min-height:54px; border-width:2px; box-shadow:2px 2px 0 #07080d; }
  body[data-game-world="ring-king"] .game-screen:not([hidden]) .move-controls button { width:54px; }
  body[data-game-world="ring-king"] .game-screen:not([hidden]) .punch-controls button { width:clamp(62px,8.2vw,72px); }

  /* Rider Racer */
  body[data-game-world="rider-racer"] .game-screen:not([hidden]) .race-hud { top:58px; }
  body[data-game-world="rider-racer"] .game-screen:not([hidden]) .leaderboard { top:58px; }
  body[data-game-world="rider-racer"] .game-screen:not([hidden]) .control-dock { height:108px; grid-template-columns:1fr 100px 1fr; padding-bottom:max(6px,env(safe-area-inset-bottom)); }
  body[data-game-world="rider-racer"] .game-screen:not([hidden]) .control-dock>:not(#throttle-button) { display:none; }
  body[data-game-world="rider-racer"] .game-screen:not([hidden]) #throttle-button { width:88px; height:88px; min-width:88px; min-height:88px; }
  body[data-game-world="rider-racer"] .game-screen:not([hidden]) .speedometer { bottom:96px; }
  body[data-game-world="rider-racer"] .game-screen:not([hidden]) .button-copy strong { font-size:18px; }
}
@media(max-width:700px) and (max-height:650px) {
  body[data-game-world="battle-royale"] .game-screen:not([hidden]) .turn-banner { min-height:38px; }
  body[data-game-world="battle-royale"] .game-screen:not([hidden]) .status-card { min-height:28px; }
  body[data-game-world="battle-royale"] .game-screen:not([hidden]) .status-card>span { width:20px; height:20px; }
  body[data-game-world="battle-royale"] .game-screen:not([hidden]) .battle-mobile-arranged .mobile-vitals-slot { min-height:44px; }
  body[data-game-world="battle-royale"] .game-screen:not([hidden]) .current-player-card { min-width:0; }
  body[data-game-world="battle-royale"] .game-screen:not([hidden]) .current-player-card .large-avatar { flex:0 0 34px; }
  body[data-game-world="battle-royale"] .game-screen:not([hidden]) .current-player-card>div { min-width:0; }
  body[data-game-world="battle-royale"] .game-screen:not([hidden]) .current-player-card small { display:none; }
  body[data-game-world="battle-royale"] .game-screen:not([hidden]) .current-player-card strong { overflow:hidden; margin:0; font-size:11px; text-overflow:ellipsis; white-space:nowrap; }
  body[data-game-world="battle-royale"] .game-screen:not([hidden]) .empty-inventory { min-height:28px; padding:5px; }
  body[data-game-world="shape-royale"] .game-screen:not([hidden]) .arena {
    width:min(calc(100vw - 10px),calc((100dvh - 287px) * .79));
  }
  body[data-game-world="shape-royale"] .game-screen:not([hidden]) .battle-sidebar { gap:3px; padding:3px 8px; }
  body[data-game-world="shape-royale"] .game-screen:not([hidden]) .status-card { min-height:36px; height:36px; padding:4px 8px; }
  body[data-game-world="shape-royale"] .game-screen:not([hidden]) .status-card p { display:none; }
  body[data-game-world="shape-royale"] .game-screen:not([hidden]) .status-card h2 { font-size:14px; }
  body[data-game-world="shape-royale"] .game-screen:not([hidden]) .elixir-card { min-height:34px; height:34px; padding:4px 8px; }
  body[data-game-world="shape-royale"] .game-screen:not([hidden]) .elixir-heading { margin-bottom:2px; }
  body[data-game-world="shape-royale"] .game-screen:not([hidden]) :is(.hand-section,.card-hand,.shape-card) { min-height:56px; height:56px; }
  body[data-game-world="shape-royale"] .game-screen:not([hidden]) .shape-card { padding:3px; }
  body[data-game-world="shape-royale"] .game-screen:not([hidden]) .card-art { height:31px; margin:-3px -3px 2px; }
}
@media(prefers-reduced-motion:reduce) {
  body[data-game-world] *,body[data-game-world] *::before,body[data-game-world] *::after { scroll-behavior:auto!important; animation-duration:.001ms!important; animation-iteration-count:1!important; transition-duration:.001ms!important; }
}

/* POCKET PUTT — sun-washed greens, coral flags, and a cream island edge. */
body[data-game-world="pocket-putt"] {
  --world-icon:url("/assets/icons/pocket-putt.svg");
  --world-accent:#287252;
  --world-paper:#f7f3e5;
  --world-surface:#fffbed;
  --world-ink:#174c40;
  --world-muted:#61736a;
  --world-line:rgba(23,76,64,.18);
}

/* RICOCHET RUMBLE — cool steel, toy-tank teal, and warm shell casings. */
body[data-game-world="ricochet-rumble"] {
  --world-icon:url("/assets/icons/ricochet-rumble.svg");
  --world-accent:#ffcc67; --world-paper:#202e44; --world-surface:#25384d;
  --world-ink:#f5eed9; --world-muted:#b1c1cc; --world-line:rgba(169,198,209,.24);
  --button-ink:#233448;
}
/* ROOFTOP RUSH — peach sunsets, violet skylines, and mint-green momentum. */
body[data-game-world="rooftop-rush"] {
  --world-icon:url("/assets/icons/rooftop-rush.svg");
  --world-accent:#ffa776; --world-paper:#302c53; --world-surface:#3e365b;
  --world-ink:#fff0d7; --world-muted:#c8bfd3; --world-line:rgba(218,195,213,.24);
  --button-ink:#302c53;
}
