/* ============================================================
   HOME — ROYAL GAME LOBBY
   ============================================================ */
.screen.home.royal {
  max-width: none; display: grid; grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr) auto; gap: 6px;
  padding-top: calc(8px + var(--safe-top)); padding-bottom: calc(6px + var(--safe-bottom));
  background:
    url("img/lobby-pattern.svg"),
    radial-gradient(ellipse 80% 70% at 30% 40%, #3b1f7a 0%, #24124f 45%, #120a2a 100%);
}
.royal-bg { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.royal-bg .rays {
  position: absolute; left: 27%; top: 42%; width: 760px; height: 760px; transform: translate(-50%, -50%);
  background: repeating-conic-gradient(from var(--spin), rgba(255, 214, 120, 0.10) 0deg 8deg, transparent 8deg 20deg);
  -webkit-mask: radial-gradient(circle, #000 10%, transparent 62%); mask: radial-gradient(circle, #000 10%, transparent 62%);
  animation: spinGrad 40s linear infinite;
}
.royal-bg .spark { position: absolute; width: 6px; height: 6px; border-radius: 50%; background: #fff3b0; box-shadow: 0 0 10px 3px rgba(255, 214, 120, 0.8); animation: twinkle 3.2s ease-in-out infinite; }
.royal-bg .s1 { left: 12%; top: 22%; } .royal-bg .s2 { left: 40%; top: 14%; animation-delay: 0.8s; }
.royal-bg .s3 { left: 8%; top: 70%; animation-delay: 1.6s; } .royal-bg .s4 { left: 46%; top: 78%; animation-delay: 2.2s; }
.royal-bg .s5 { left: 60%; top: 30%; animation-delay: 1.1s; }
@keyframes twinkle { 0%, 100% { opacity: 0.1; transform: scale(0.6); } 50% { opacity: 1; transform: scale(1.3); } }
.royal > *:not(.royal-bg) { position: relative; z-index: 1; }

/* top bar */
.royal .home-head { gap: 12px; }
.royal-chip { padding: 3px 14px 3px 3px; background: linear-gradient(180deg, rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.25)); border: 1px solid rgba(255, 214, 120, 0.35); }
.royal-chip .frame { position: relative; width: 44px; height: 44px; border-radius: 50%; padding: 3px; background: conic-gradient(from 200deg, #fff3b0, #ffc83d, #b8860b, #ffe27a, #fff3b0); box-shadow: 0 0 12px rgba(255, 200, 61, 0.45); }
.royal-chip .frame .avatar { width: 38px; height: 38px; box-shadow: none; }
.royal-chip .level {
  position: absolute; right: -6px; bottom: -4px; min-width: 20px; height: 20px; padding: 0 4px; border-radius: 10px;
  display: grid; place-items: center; font-size: 0.68rem; font-weight: 900; color: #2b1d00;
  background: linear-gradient(180deg, #ffe27a, #f2b308); border: 2px solid #3b1f7a;
}
.wallet { display: flex; gap: 10px; margin-right: auto; }
.currency {
  display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px 0 4px; border-radius: 17px; font-weight: 900; font-size: 0.95rem;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.35)); border: 1px solid rgba(255, 255, 255, 0.12); box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.5);
}
.currency i { font-style: normal; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 1.05rem; background: radial-gradient(circle at 35% 30%, #fff3b0, #ffc83d 60%, #b8860b); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5); }
.currency.trophy-c i { background: radial-gradient(circle at 35% 30%, #d9f1ff, #5aa9ff 60%, #1f4f9c); }
.round-btn {
  position: relative; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; font-size: 1.1rem;
  border: 2px solid rgba(255, 255, 255, 0.25); background: radial-gradient(circle at 35% 30%, #6a4cc9, #3b1f7a 70%); box-shadow: 0 4px 0 #1d0f40, 0 6px 12px rgba(0, 0, 0, 0.5);
}
.round-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 #1d0f40; }
.round-btn.small { width: 32px; height: 32px; font-size: 0.9rem; }

/* stage */
.stage { display: grid; grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.25fr); gap: 18px; align-items: center; min-height: 0; max-width: 1000px; width: 100%; margin: 0 auto; }
.stage-left { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.royal-hero { grid-template-columns: auto auto; justify-content: center; }
.royal-hero .hero-logo { animation: logoFloat 3.5s ease-in-out infinite; }
.royal-hero h1 {
  font-size: clamp(1.7rem, 7vh, 2.5rem); background: linear-gradient(180deg, #fff6c8, #ffc83d 55%, #e08a00);
  -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-stroke: 1.5px #5a2400; text-shadow: none;
  filter: drop-shadow(0 3px 0 #3a1500) drop-shadow(0 8px 14px rgba(0, 0, 0, 0.6));
}
.royal-hero p { color: #d7c9ff; }
@keyframes logoFloat { 50% { transform: translateY(-5px) rotate(-2deg); } }
.play-now {
  position: relative; overflow: hidden; width: min(320px, 100%); padding: 12px 18px 10px; border-radius: 22px; cursor: pointer; text-align: center;
  border: 3px solid #fff3b0; color: #3a1500; background: linear-gradient(180deg, #ffe680 0%, #ffc83d 45%, #f29500 100%);
  box-shadow: 0 6px 0 #a35a00, 0 10px 24px rgba(0, 0, 0, 0.55); display: flex; flex-direction: column; animation: playPulse 1.8s ease-in-out infinite;
}
.play-now b { font-size: clamp(1.25rem, 5.5vh, 1.6rem); font-weight: 900; letter-spacing: 0.04em; text-shadow: 0 2px 0 rgba(255, 255, 255, 0.5); }
.play-now small { font-weight: 700; opacity: 0.75; }
.play-now:active { transform: translateY(4px); box-shadow: 0 2px 0 #a35a00, 0 6px 14px rgba(0, 0, 0, 0.5); }
.pn-shine { position: absolute; top: -20%; left: -60%; width: 40%; height: 140%; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.75), transparent); transform: skewX(-20deg); animation: shine 2.8s ease-in-out infinite; pointer-events: none; }
@keyframes shine { 0%, 55% { left: -60%; } 100% { left: 130%; } }
@keyframes playPulse {
  0%, 100% { box-shadow: 0 6px 0 #a35a00, 0 10px 24px rgba(0, 0, 0, 0.55), 0 0 0 0 rgba(255, 200, 61, 0.6); }
  50% { box-shadow: 0 6px 0 #a35a00, 0 10px 24px rgba(0, 0, 0, 0.55), 0 0 0 10px rgba(255, 200, 61, 0); }
}

/* room tiles */
.room-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.room-tile {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 10px 12px; border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.03)); border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 10px 24px rgba(0, 0, 0, 0.4);
}
.house { width: clamp(84px, 24vh, 120px); height: auto; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.45)); animation: logoFloat 4s ease-in-out infinite; }
.create-tile .house { animation-delay: 1.2s; filter: drop-shadow(0 0 14px rgba(255, 200, 61, 0.55)) drop-shadow(0 8px 10px rgba(0, 0, 0, 0.45)); }
.join-form { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 100%; padding: 6px 6px 0; border-radius: 14px; background: rgba(126, 217, 87, 0.18); border: 2px solid rgba(126, 217, 87, 0.55); }
.code-label { font-weight: 900; color: #b6f59a; font-size: 0.85rem; }
.code-boxes { display: flex; gap: 5px; }
.code-box {
  width: 30px !important; height: 36px; padding: 0 !important; text-align: center; font-weight: 900; font-size: 1.15rem; text-transform: uppercase;
  border-radius: 8px !important; border: 2px solid #4fc34a !important; background: #fff !important; color: #1b3d12 !important;
}
.join-form .game-btn { margin: 4px 0 8px; }
.tile-sub { margin: 0; text-align: center; font-size: 0.78rem; color: #e9dcff; }
.game-btn {
  min-width: 140px; padding: 9px 18px; border-radius: 14px; cursor: pointer; font-weight: 900; font-size: 1rem; color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.6); text-shadow: 0 2px 0 rgba(0, 0, 0, 0.3);
}
.game-btn.green { background: linear-gradient(180deg, #8ee36a, #3fae2a); box-shadow: 0 4px 0 #2a7a1a, 0 8px 14px rgba(0, 0, 0, 0.4); }
.game-btn.gold { background: linear-gradient(180deg, #ffe27a, #f2a900); color: #4a2600; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6); box-shadow: 0 4px 0 #a35a00, 0 8px 14px rgba(0, 0, 0, 0.4); }
.game-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0, 0, 0, 0.4); }

/* live tables as a horizontal strip */
section.live-strip { flex-direction: row; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 16px; background: rgba(0, 0, 0, 0.35); border: 1px solid rgba(255, 255, 255, 0.1); min-height: 0; }
.live-strip .section-head { margin: 0; gap: 8px; flex: none; }
.live-strip .section-head h2 { color: #ffd27a; white-space: nowrap; }
.live-strip .room-list { display: flex; gap: 8px; overflow-x: auto; overflow-y: hidden; flex: 1; scrollbar-width: none; }
.live-strip .room-list li { flex: none; padding: 6px 8px 6px 10px; background: rgba(255, 255, 255, 0.06); }
.live-strip .room-list li.empty { padding: 4px 8px; text-align: left; white-space: nowrap; }
.live-strip .room-list li.empty br { display: none; }
.live-strip .room-info { max-width: 150px; }

@media (orientation: portrait) {
  .screen.home.royal { display: flex; flex-direction: column; gap: 12px; }
  .stage { grid-template-columns: 1fr; }
  .royal .wallet { order: 3; width: 100%; justify-content: center; margin: 0; }
  .royal .home-head { flex-wrap: wrap; }
  section.live-strip { flex-direction: column; align-items: stretch; }
}
@media (orientation: landscape) and (max-height: 420px) {
  .royal-hero p { display: none; }
}

/* ---------- leaderboard & history ---------- */
.wallet { cursor: pointer; }
.stat-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; border-radius: 14px; background: rgba(0, 0, 0, 0.35); }
.stat-tab { border: 0; background: none; padding: 8px 4px; border-radius: 10px; font-weight: 800; font-size: 0.8rem; color: var(--muted); cursor: pointer; }
.stat-tab.on { background: linear-gradient(180deg, #ffe27a, #f2b308); color: #2b1d00; }
.stats-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.stats-summary:empty { display: none; }
.stat { display: flex; flex-direction: column; align-items: center; padding: 8px 4px; border-radius: 12px; background: rgba(255, 255, 255, 0.05); }
.stat b { font-size: 1.05rem; color: var(--accent); }
.stat span { font-size: 0.68rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.stats-list { list-style: none; margin: 0; padding: 0; flex: 1; overflow-y: auto; display: grid; gap: 6px; align-content: start; grid-template-columns: minmax(0, 1fr); }
.stats-list li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 14px; background: rgba(255, 255, 255, 0.04); }
.stats-list li.empty { background: none; color: var(--muted); text-align: center; display: block; }
.stats-list li.top { background: linear-gradient(90deg, rgba(255, 200, 61, 0.16), rgba(255, 255, 255, 0.04)); }
.stats-list li.me { outline: 1px solid var(--accent); }
.stats-list li.won { background: linear-gradient(90deg, rgba(79, 195, 74, 0.18), rgba(255, 255, 255, 0.04)); }
.stats-list li[onclick], .stats-list li:not(.empty):not(.me) { cursor: pointer; }
.stats-list .rk { width: 34px; text-align: center; font-weight: 900; font-size: 1.05rem; flex: none; }
.stats-list .avatar { width: 34px; height: 34px; }
.stats-list .pts { font-weight: 900; color: var(--accent); white-space: nowrap; }
.create-tile { justify-content: center; }

/* ---------- voice link health on each player's speaker button ---------- */
.voice-ok .pmute { box-shadow: 0 0 0 2px #4ade80 !important; }
.voice-wait .pmute { box-shadow: 0 0 0 2px #ffc83d !important; animation: pulse 1s infinite; }
.voice-bad .pmute { box-shadow: 0 0 0 2px #ff4d4d !important; background: rgba(120, 0, 0, 0.7) !important; }

/* ============================================================
   ROOM DASHBOARD — numbered seats, player menu, friends / watching panel
   ============================================================ */
.screen.lobby {
  gap: 6px; padding-top: calc(8px + var(--safe-top)); padding-bottom: calc(8px + var(--safe-bottom));
  background: url("img/lobby-pattern.svg"), radial-gradient(ellipse 80% 70% at 35% 40%, #3b1f7a 0%, #24124f 45%, #120a2a 100%);
}
.lobby-top { display: flex; align-items: center; gap: 10px; flex: none; }
.lt-title { flex: 1; min-width: 0; font-weight: 900; font-size: 1.05rem; color: #ffe27a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.5); }
.room-id { display: flex; align-items: center; gap: 6px; padding: 6px 10px 6px 12px; border-radius: 12px; border: 1px solid rgba(255, 214, 120, 0.45); background: rgba(0, 0, 0, 0.35); color: #fff; font-weight: 800; font-size: 0.86rem; cursor: pointer; white-space: nowrap; }
.room-id b { color: var(--accent); letter-spacing: 0.18em; font-size: 1.05rem; }
.rid-copy { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #4fc34a; color: #fff; font-size: 0.75rem; }
.rule-strip { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; flex: none; }
.rule-strip::-webkit-scrollbar { display: none; }
.rule-strip .sum-chip { flex: none; border: 0; color: inherit; font: inherit; font-size: 0.72rem; font-weight: 700; cursor: pointer; }
.rule-strip .sum-chip.strong { color: var(--accent-ink); }

.screen.lobby .lobby-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) clamp(196px, 29vw, 270px); gap: 10px; max-width: none; margin: 0; }
.table-zone {
  position: relative; min-height: 0; display: flex; flex-direction: column; border-radius: 22px; padding: 8px 10px;
  background: radial-gradient(ellipse at 50% 40%, rgba(255, 255, 255, 0.08), rgba(0, 0, 0, 0.25) 70%); border: 1px solid rgba(255, 214, 120, 0.2);
}
.seat-grid { list-style: none; margin: 0; padding: 8px 0 0; flex: 1; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: repeat(var(--cols, 5), auto); justify-content: center; align-content: center; gap: 10px 12px; --av: 64px; }
.seat-grid[data-n="2"], .seat-grid[data-n="3"], .seat-grid[data-n="4"] { --av: 78px; gap: 14px 24px; }
.seat-grid[data-n="9"], .seat-grid[data-n="10"] { --av: 54px; gap: 8px 10px; }
.seat-tile { position: relative; width: calc(var(--av) + 26px); display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; border-radius: 16px; padding: 6px 2px 4px; transition: transform 0.12s; }
.seat-tile:active { transform: scale(0.96); }
.seat-no { position: absolute; left: 0; top: 0; z-index: 2; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: rgba(0, 0, 0, 0.7); color: #ffe27a; font-size: 0.66rem; font-weight: 900; display: grid; place-items: center; }
.st-av { position: relative; width: var(--av); height: var(--av); border-radius: 18px; padding: 3px; background: linear-gradient(180deg, #8fd16a, #3d9a2c); box-shadow: 0 4px 0 rgba(0, 0, 0, 0.35); display: grid; place-items: center; }
.st-av .avatar { width: 100%; height: 100%; border-radius: 14px; font-size: calc(var(--av) * 0.36); box-shadow: none; }
.st-name { max-width: 100%; padding: 2px 10px; border-radius: 999px; background: linear-gradient(180deg, #3d8ff0, #2369c9); color: #fff; font-weight: 800; font-size: 0.76rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-shadow: 0 2px 0 rgba(0, 0, 0, 0.35); }
.st-sub { font-size: 0.66rem; color: #e9dcff; opacity: 0.85; white-space: nowrap; }
.seat-tile.me .st-av { background: linear-gradient(180deg, #fff3b0, #f2b308); }
.seat-tile.me .st-name { background: linear-gradient(180deg, #ffd45e, #f2b308); color: var(--accent-ink); box-shadow: 0 0 0 2px #fff3b0, 0 2px 0 rgba(0, 0, 0, 0.35); }
.host-badge { position: absolute; right: -9px; top: -11px; font-size: 1.1rem; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.6)); }
.seat-tile .vi { position: absolute; right: -6px; bottom: -4px; font-size: 0.8rem; }
.seat-tile .pmute { position: absolute !important; left: -8px; bottom: -6px; width: 24px; height: 24px; padding: 0 !important; border-radius: 50% !important; border: 0 !important; background: rgba(0, 0, 0, 0.7) !important; font-size: 0.7rem !important; display: grid; place-items: center; }
.seat-tile.offline .st-av { filter: grayscale(0.8); opacity: 0.55; }
.seat-tile.empty .st-av { background: rgba(255, 255, 255, 0.06); border: 2px dashed rgba(255, 255, 255, 0.32); box-shadow: none; color: rgba(255, 255, 255, 0.6); font-size: calc(var(--av) * 0.45); font-weight: 300; }
.seat-tile.empty .st-name { background: rgba(255, 255, 255, 0.1); color: #cfc3ee; box-shadow: none; }
.seat-tile.team-a .st-av { background: linear-gradient(180deg, #ff7a6e, #c9241f); }
.seat-tile.team-b .st-av { background: linear-gradient(180deg, #6fb2ff, #1f5fc0); }
.seat-tile.team-a.empty .st-av { background: rgba(229, 50, 45, 0.14); border-color: rgba(255, 122, 110, 0.65); }
.seat-tile.team-b.empty .st-av { background: rgba(31, 111, 209, 0.18); border-color: rgba(111, 178, 255, 0.65); }
.seat-tile.swap-src .st-av { box-shadow: 0 0 0 3px #ffe27a, 0 0 18px rgba(255, 214, 120, 0.85); }
.seat-tile.swap-target { animation: seatWiggle 1s ease-in-out infinite; }
.seat-tile.swap-target .st-av { outline: 2px solid rgba(255, 214, 120, 0.75); outline-offset: 2px; }
@keyframes seatWiggle { 25% { transform: rotate(-2deg); } 75% { transform: rotate(2deg); } }
.swap-bar { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 3px 10px; border-radius: 12px; background: rgba(255, 200, 61, 0.16); color: #ffe27a; font-weight: 800; font-size: 0.82rem; }
.lobby-foot { display: flex; align-items: center; justify-content: center; gap: 10px; padding-top: 6px; flex: none; min-width: 0; }
.lobby-foot .lobby-hint { margin: 0; min-width: 0; font-size: 0.82rem; color: #e9dcff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lobby-foot .btn { flex: none; }
.seat-grid { scrollbar-width: thin; scrollbar-color: rgba(255, 214, 120, 0.4) transparent; }
.screen.lobby #startBtn { width: auto; display: inline-block; padding: 9px 22px; font-weight: 900; font-size: 1rem; }

.seat-menu {
  position: fixed; z-index: 30; display: flex; flex-direction: column; gap: 6px; padding: 8px; border-radius: 16px;
  background: linear-gradient(180deg, #d9f0ff, #a9d4ff); border: 2px solid #fff; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.55); animation: popIn 0.15s ease-out;
}
.sm-item { border: 0; border-radius: 12px; padding: 9px 16px; min-width: 136px; font-weight: 900; font-size: 0.88rem; color: #fff; background: linear-gradient(180deg, #7ed957, #3fae2a); box-shadow: 0 3px 0 #2a7a1a; text-align: left; cursor: pointer; white-space: nowrap; text-shadow: 0 1px 0 rgba(0, 0, 0, 0.3); }
.sm-item:active { transform: translateY(2px); box-shadow: 0 1px 0 #2a7a1a; }
.sm-item.danger { background: linear-gradient(180deg, #f0656a, #c9373c); box-shadow: 0 3px 0 #8e2226; }

.side-panel { min-height: 0; display: flex; flex-direction: column; gap: 8px; padding: 8px; border-radius: 18px; background: rgba(0, 0, 0, 0.35); border: 1px solid rgba(255, 255, 255, 0.12); }
.side-panel.flash { animation: panelFlash 0.9s ease-out; }
@keyframes panelFlash { 0% { box-shadow: 0 0 0 0 rgba(255, 214, 120, 0.9); } 100% { box-shadow: 0 0 0 16px rgba(255, 214, 120, 0); } }
.sp-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; flex: none; }
.sp-tab { border: 0; border-radius: 12px 12px 6px 6px; padding: 7px 4px; font-weight: 800; font-size: 0.76rem; color: #cfe6ff; background: rgba(61, 143, 240, 0.3); cursor: pointer; white-space: nowrap; }
.sp-tab.on { background: linear-gradient(180deg, #6fb2ff, #2f7fe0); color: #fff; box-shadow: 0 3px 0 #1d5bb0; }
.sp-list { list-style: none; margin: 0; padding: 2px 2px 0; flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.sp-list li { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 12px; background: rgba(255, 255, 255, 0.06); cursor: pointer; flex: none; }
.sp-list li.offline { opacity: 0.6; }
.sp-list .avatar { width: 34px; height: 34px; border-radius: 10px; font-size: 0.85rem; }
.sp-list .avatar .dot { border-color: #1b1036; }
.sp-list li:not(.offline) .avatar .dot { background: var(--ok); }
.sp-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sp-info strong { font-size: 0.82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-info .small { font-size: 0.68rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-list .btn.small { flex: none; padding: 5px 10px; font-size: 0.74rem; }
.sp-list .btn.sp-go { background: linear-gradient(180deg, #7ed957, #3fae2a); color: #fff; border: 0; box-shadow: 0 2px 0 #2a7a1a; font-weight: 800; }
.sp-tag { flex: none; padding: 4px 9px; border-radius: 9px; font-size: 0.7rem; font-weight: 800; }
.sp-tag.busy { background: #8b97a6; color: #fff; }
.sp-tag.here { background: rgba(74, 222, 128, 0.2); color: #b4f0b0; }
.sp-tag.sent { background: rgba(255, 200, 61, 0.18); color: #ffe27a; }
.sp-list li.sp-empty { display: block; cursor: default; background: none; text-align: center; color: #cfc3ee; font-size: 0.76rem; line-height: 1.45; }
.sp-list > .btn { align-self: center; }
.invite-big { flex: none; width: 100%; padding: 10px; font-weight: 900; font-size: 1rem; color: #fff; border: 0; border-radius: 14px; background: linear-gradient(180deg, #7ed957, #3fae2a); box-shadow: 0 4px 0 #2a7a1a; text-shadow: 0 1px 0 rgba(0, 0, 0, 0.3); }
.invite-big:hover { background: linear-gradient(180deg, #8ee667, #45b92f); }

@media (orientation: landscape) and (max-height: 400px) {
  .seat-grid { --av: 54px; gap: 6px 10px; }
  .seat-grid[data-n="2"], .seat-grid[data-n="3"], .seat-grid[data-n="4"] { --av: 66px; }
  .seat-grid[data-n="9"], .seat-grid[data-n="10"] { --av: 46px; }
  .st-sub { display: none; }
}
@media (orientation: portrait) {
  .screen.lobby .lobby-body { grid-template-columns: minmax(0, 1fr); }
  .table-zone { min-height: 320px; }
  .lobby-foot { flex-wrap: wrap; }
  .side-panel { max-height: 380px; }
  .room-id { font-size: 0.78rem; padding: 5px 8px; }
  .room-id b { font-size: 0.95rem; }
}

/* ---------- watching a game ---------- */
.watch-banner {
  position: absolute; z-index: 6; left: calc(50% - var(--rail) / 2); bottom: calc(16px + var(--safe-bottom)); transform: translateX(-50%);
  padding: 8px 18px; border-radius: 999px; background: rgba(0, 0, 0, 0.62); border: 1px solid rgba(255, 214, 120, 0.45); color: #ffe27a; font-weight: 800; font-size: 0.85rem; white-space: nowrap;
}
body.spectating .hand, body.spectating .drawn-panel { display: none !important; }

/* ---------- UNO! call / catch ---------- */
.seat.uno-risk .ring-wrap::after {
  content: "UNO?"; position: absolute; left: 50%; top: -15px; transform: translateX(-50%); padding: 1px 6px; border-radius: 8px; z-index: 3;
  background: #e5322d; color: #ffd84d; font-weight: 900; font-size: 0.62rem; font-style: italic; white-space: nowrap; animation: pulse 0.6s infinite;
}
.seat.uno-risk .avatar { box-shadow: 0 0 0 3px #ff4d4d, 0 0 16px rgba(255, 77, 77, 0.85) !important; }
.uno-btn.catch { background: radial-gradient(circle at 35% 30%, #fff1a8, #f2b308 55%, #b87a00); color: #e5322d; -webkit-text-stroke: 1px #fff; }
.uno-btn:not([data-sub=""])::after {
  content: attr(data-sub); position: absolute; left: 50%; top: 100%; transform: translate(-50%, 8px); padding: 2px 8px; border-radius: 8px;
  background: rgba(0, 0, 0, 0.78); color: #fff; font: 800 0.66rem system-ui, sans-serif; -webkit-text-stroke: 0; white-space: nowrap;
}

/* ---------- Room options: a smaller popup ---------- */
.room-box { width: min(620px, 94vw); max-height: calc(100vh - 36px); max-height: calc(100dvh - 36px); }
.rm-head { padding: 8px 12px 4px; }
.rm-head h2 { font-size: 1.05rem; padding: 4px 18px; margin: 0; }
.rm-head .icon-btn { width: 32px; height: 32px; top: 6px; right: 8px; }
.rm-scroll { padding: 4px 14px 8px; gap: 8px; }
.rm-grid { gap: 6px 12px; }
.rm-label { font-size: 0.8rem; }
.room-box .chip { padding: 4px 10px; font-size: 0.76rem; }
.stepper .icon-btn { width: 32px; height: 32px; }
.rm-section { font-size: 0.9rem; margin: 2px 0 0; }
.rm-section .help-btn { width: 20px; height: 20px; font-size: 0.75rem; }
.tile-grid { grid-template-columns: repeat(auto-fill, minmax(74px, 1fr)); gap: 8px; }
.tile { padding: 5px 4px 4px; font-size: 0.64rem; border-radius: 12px; gap: 2px; }
.tile-art { width: 30px; height: 40px; }
.tile-art.emoji { font-size: 1.15rem; }
.tile.on::after { width: 18px; height: 18px; font-size: 0.65rem; right: -5px; bottom: -5px; }
.room-box > .btn.big { margin: 0 14px 10px; padding: 9px; font-size: 1rem; }
@media (orientation: landscape) and (max-height: 520px) {
  .tile-grid { grid-template-columns: repeat(6, 1fr); }
  .tile-art { width: 28px; height: 36px; }
}
.lobby-foot .lobby-hint:empty { display: none; }

/* ============================================================
   LOADING SCREEN — cards deal out into a fan, then the app opens
   ============================================================ */
.splash {
  position: fixed; inset: 0; z-index: 200; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; overflow: hidden;
  background: radial-gradient(ellipse 80% 70% at 50% 40%, #3b1f7a 0%, #24124f 45%, #120a2a 100%); transition: opacity 0.5s ease, transform 0.5s ease;
}
.splash.out { opacity: 0; transform: scale(1.06); pointer-events: none; }
.splash-rays {
  position: absolute; left: 50%; top: 40%; width: 900px; height: 900px; transform: translate(-50%, -50%);
  background: repeating-conic-gradient(rgba(255, 214, 120, 0.1) 0deg 8deg, transparent 8deg 20deg);
  -webkit-mask: radial-gradient(circle, #000 10%, transparent 62%); mask: radial-gradient(circle, #000 10%, transparent 62%);
  animation: splashSpin 18s linear infinite;
}
@keyframes splashSpin { to { transform: translate(-50%, -50%) rotate(360deg); } }
.splash-fan { position: relative; width: 74px; height: 111px; margin-bottom: 6px; }
.sf-card {
  position: absolute; inset: 0; border-radius: 9px; background: #fff center / cover no-repeat; box-shadow: 0 8px 18px rgba(0, 0, 0, 0.5);
  transform-origin: 50% 125%; animation: sfDeal 2.6s cubic-bezier(0.3, 1.3, 0.5, 1) infinite;
}
.sf-card:nth-child(1) { --r: -40deg; background-color: #e5322d; }
.sf-card:nth-child(2) { --r: -20deg; background-color: #f7c815; animation-delay: 0.08s; }
.sf-card:nth-child(3) { --r: 0deg; background-color: #2fa84f; animation-delay: 0.16s; }
.sf-card:nth-child(4) { --r: 20deg; background-color: #1f6fd1; animation-delay: 0.24s; }
.sf-card:nth-child(5) { --r: 40deg; background-color: #222; animation-delay: 0.32s; }
@keyframes sfDeal {
  0% { transform: translateY(-60px) rotate(-90deg) scale(0.6); opacity: 0; }
  18% { opacity: 1; }
  35%, 75% { transform: rotate(var(--r)) translateY(-4px); opacity: 1; }
  100% { transform: rotate(0deg) translateY(0) scale(0.92); opacity: 1; }
}
.splash-title {
  margin: 0; font-family: 'Arial Black', Roboto, sans-serif; font-style: italic; font-weight: 900; font-size: clamp(2rem, 7vmin, 3rem); letter-spacing: 0.02em;
  color: #ffd84d; -webkit-text-stroke: 1.5px #5a0a00; text-shadow: 0 4px 0 #a51510, 0 10px 24px rgba(0, 0, 0, 0.6); animation: titlePop 0.7s cubic-bezier(0.2, 1.6, 0.4, 1) both;
}
.splash-title span { color: #fff; -webkit-text-stroke: 1.5px #1d4f8f; text-shadow: 0 4px 0 #1d4f8f, 0 10px 24px rgba(0, 0, 0, 0.6); }
@keyframes titlePop { from { transform: scale(0.4); opacity: 0; } }
.splash-bar { width: min(280px, 62vw); height: 10px; border-radius: 6px; background: rgba(0, 0, 0, 0.45); border: 1px solid rgba(255, 214, 120, 0.4); overflow: hidden; }
.splash-bar i { display: block; height: 100%; width: 0; border-radius: 6px; background: linear-gradient(90deg, #ffd45e, #f2b308); box-shadow: 0 0 12px rgba(255, 200, 61, 0.7); transition: width 0.3s ease; }
.splash-text { margin: 0; max-width: 86vw; color: #ffe27a; font-weight: 800; font-size: 0.9rem; text-align: center; min-height: 1.3em; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.5); }
@media (orientation: landscape) and (max-height: 420px) {
  .splash { gap: 9px; }
  .splash-fan { width: 60px; height: 90px; }
}

/* Live tables sheet */
.sheet-note { margin: 0 0 8px; }
#liveSheet .room-list { display: grid; gap: 8px; }
#liveSheet .room-list li .btn { flex: none; }

/* ============================================================
   TABLE — a round island arena under the open sky
   ============================================================ */
.table-rim {
  padding: 12px; border-radius: 50% / 46%;
  background: repeating-conic-gradient(from 2deg, #c08445 0 6deg, #9a6230 6deg 6.6deg), #a96f36;
  box-shadow: 0 0 0 4px #6b3d1a, 0 16px 0 #7a5233, 0 20px 0 #5c3c22, 0 30px 40px rgba(0, 0, 0, 0.4), inset 0 3px 0 rgba(255, 255, 255, 0.35);
}
.felt {
  border: 9px solid transparent;
  background:
    radial-gradient(ellipse 58% 52% at 50% 46%, #c4f08a 0%, #9ddc66 42%, #78c34a 72%, #5ea93a 100%) padding-box,
    linear-gradient(180deg, #e8d3ac, #b39467) border-box;
  box-shadow: inset 0 12px 24px rgba(0, 0, 0, 0.22), inset 0 -8px 18px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.25);
}
.felt::before { border: 3px solid rgba(255, 255, 255, 0.28); box-shadow: 0 0 0 12px rgba(255, 255, 255, 0.06); }
.felt::after { border: 2px dotted rgba(255, 255, 255, 0.25); }
.floor-logo {
  position: absolute; left: 50%; top: 52%; translate: -50% -50%; transform: perspective(420px) rotateX(40deg); pointer-events: none; white-space: nowrap;
  font-family: 'Arial Black', Roboto, sans-serif; font-weight: 900; font-style: italic; font-size: min(18vh, 9vw, 8rem); line-height: 1; letter-spacing: 0.04em;
  color: #ffd84d; -webkit-text-stroke: 2px #b77d00; text-shadow: 0 4px 0 #e0a100, 0 8px 0 #b77d00, 0 12px 0 #8a5a00, 0 18px 18px rgba(0, 0, 0, 0.3);
}
.color-aura { z-index: 0; }
.dir-ring { z-index: 1; filter: drop-shadow(0 4px 3px rgba(0, 0, 0, 0.35)) drop-shadow(0 0 8px var(--dir-color, #ffc83d)); }
.piles { position: relative; z-index: 2; }
.dir-ring .a-edge { fill: none; stroke: rgba(0, 0, 0, 0.35); stroke-width: 19; stroke-linecap: round; }
.dir-ring .a-body { fill: none; stroke: currentColor; stroke-width: 14; stroke-linecap: round; }
.dir-ring .a-shine { fill: none; stroke: rgba(255, 255, 255, 0.65); stroke-width: 3.5; stroke-linecap: round; }
.dir-ring .a-head { fill: currentColor; stroke: rgba(0, 0, 0, 0.35); stroke-width: 2.5; stroke-linejoin: round; }

/* Opponents: square portraits in a gold frame, name plate, fanned cards */
.seat { width: 96px; }
.ring-wrap { width: 54px; height: 54px; }
.ring-wrap .avatar { width: 54px; height: 54px; border-radius: 14px; border: 3px solid #fff; box-shadow: 0 0 0 2px #ffc83d, 0 6px 12px rgba(0, 0, 0, 0.45); font-size: 1.2rem; }
.turn-ring { left: -8px; top: -8px; width: 70px; height: 70px; transform: none; }
.turn-ring rect { fill: none; stroke: #ffe066; stroke-width: 5; stroke-linecap: round; }
.seat.turn .avatar { box-shadow: 0 0 0 2px #ffc83d, 0 0 22px rgba(255, 214, 90, 0.95); }
.seat .oname { margin-top: 6px; padding: 2px 10px; border-radius: 8px; max-width: 96px; color: #fff; background: linear-gradient(180deg, rgba(25, 60, 110, 0.92), rgba(12, 32, 66, 0.92)); border: 1px solid rgba(255, 255, 255, 0.3); }
.seat .mini-fan { left: calc(50% + 22px); top: 24px; }
.seat.flip .mini-fan { right: calc(50% + 22px); }
.seat .mini-fan img { width: 16px; height: 24px; }
.seat .pmute { left: -12px; top: -8px; }

/* My own seat (bottom-left) */
.me-seat { position: absolute; z-index: 5; left: calc(8px + var(--safe-left)); bottom: calc(10px + var(--safe-bottom)); width: 64px; display: flex; flex-direction: column; align-items: center; gap: 3px; pointer-events: none; }
.me-av { padding: 3px; border-radius: 14px; background: linear-gradient(180deg, #ffffff, #ffd6e0); box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4); transition: box-shadow 0.2s; }
.me-av .avatar { width: 48px; height: 48px; border-radius: 11px; box-shadow: none; }
.me-seat.turn .me-av { background: linear-gradient(180deg, #fff3b0, #f2b308); box-shadow: 0 0 0 3px #ffc83d, 0 0 20px rgba(255, 214, 90, 0.95); }
.me-seat.team-a .me-av { background: linear-gradient(180deg, #ff9a90, #e5322d); }
.me-seat.team-b .me-av { background: linear-gradient(180deg, #9ccaff, #1f6fd1); }
.me-name { max-width: 72px; padding: 1px 8px; border-radius: 7px; background: rgba(12, 32, 66, 0.9); color: #fff; font-size: 0.68rem; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.spectating .me-seat { display: none; }

/* CALL UNO: a big glossy red button on the right */
.uno-btn {
  left: auto; right: calc(var(--rail) + 14px + var(--safe-right)); bottom: calc(12px + var(--safe-bottom)); width: 94px; height: 94px; border: 4px solid #ffe27a;
  display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 0.88; font-size: 1.55rem; color: #ffd84d; -webkit-text-stroke: 1.5px #5a0a00;
  background: radial-gradient(circle at 35% 26%, #ff9a8e, #e5322d 48%, #9c1410); box-shadow: 0 6px 0 #7a0e0a, 0 10px 22px rgba(0, 0, 0, 0.5), 0 0 0 6px rgba(255, 214, 90, 0.35);
}
.uno-btn small { font-size: 0.55em; color: #fff; -webkit-text-stroke: 1px #5a0a00; }
.uno-btn:active { translate: 0 4px; box-shadow: 0 2px 0 #7a0e0a, 0 6px 14px rgba(0, 0, 0, 0.5); }
.uno-btn.catch small { color: #fff; }

/* Clock and turn timer on the sky */
.game-clock { font-size: 1rem; color: #fff; padding: 4px 10px; border-radius: 999px; background: rgba(12, 32, 66, 0.7); text-shadow: 0 1px 0 rgba(0, 0, 0, 0.5); }

@media (orientation: portrait) {
  .neon-sign { display: none; }
  .me-seat { display: none; }
  .uno-btn { right: 14px; bottom: calc(var(--ch) + 80px + var(--safe-bottom)); width: 80px; height: 80px; font-size: 1.3rem; }
}
@media (orientation: landscape) and (max-height: 400px) {
  .sky-chip .frame { width: 40px; height: 40px; }
  .sky-chip .frame .avatar { width: 34px; height: 34px; }
  .ring-wrap, .ring-wrap .avatar { width: 48px; height: 48px; }
  .turn-ring { width: 64px; height: 64px; }
  .uno-btn { width: 84px; height: 84px; font-size: 1.4rem; }
}

/* Lobby: the seats sit on a green card table in the games room. */
.table-zone {
  background: radial-gradient(ellipse 70% 65% at 50% 45%, #2fa865 0%, #1f8048 45%, #155f35 80%, #0f4a28 100%);
  border: 7px solid #8a5426; box-shadow: 0 0 0 2px #4d2a10, inset 0 0 0 2px rgba(255, 255, 255, 0.12), inset 0 10px 30px rgba(0, 0, 0, 0.35), 0 14px 30px rgba(0, 0, 0, 0.45);
}
.side-panel { background: rgba(18, 8, 36, 0.78); backdrop-filter: blur(3px); }
@media (orientation: landscape) and (max-height: 400px) {
  .table-zone { padding: 4px 8px; }
  .seat-grid { padding-top: 4px; --av: 50px; }
  .seat-grid[data-n="2"], .seat-grid[data-n="3"], .seat-grid[data-n="4"] { --av: 62px; }
}
/* Bigger arrow ring around the piles; floor letters spread so they frame the cards. */
.dir-ring { inset: -16%; width: 132%; height: 132%; }
.floor-logo { letter-spacing: 0.75em; padding-left: 0.75em; font-size: min(16vh, 8vw, 7rem); opacity: 0.92; }
.uno-btn:not([data-sub=""])::after { top: auto; bottom: 100%; transform: translate(-50%, -8px); }
@media (orientation: portrait) {
  .home-nav { justify-content: space-around; gap: 6px; }
  .nav-gap { display: none; }
}

/* ============================================================
   READY CHECK, LOCK, COMPUTER PLAYERS, INVITE, DAILY REWARD, BADGES, TEAM TALK
   ============================================================ */
#lockBtn.on { background: linear-gradient(180deg, #ffe27a, #f2a900); border-color: #fff3b0; }
.rule-strip .sum-chip.locked { background: rgba(229, 72, 77, 0.85); color: #fff; }
.ready-btn { font-weight: 900; color: #fff; border: 0; background: linear-gradient(180deg, #8ee36a, #3fae2a); box-shadow: 0 4px 0 #2a7a1a; animation: playPulse 1.8s ease-in-out infinite; }
.ready-btn.on { animation: none; background: rgba(74, 222, 128, 0.18); color: #b4f0b0; box-shadow: inset 0 0 0 2px #4ade80; }
.ready-badge { position: absolute; right: -8px; top: -8px; z-index: 2; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: #3fae2a; color: #fff; font-size: 0.8rem; font-weight: 900; border: 2px solid #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4); }
.seat-tile.ready .st-av { box-shadow: 0 0 0 3px #4ade80, 0 4px 0 rgba(0, 0, 0, 0.35); }
.seat-tile.bot .st-av { background: linear-gradient(180deg, #dfe8f3, #8ea3bd); }
.seat-tile.bot .st-name { background: linear-gradient(180deg, #8ea3bd, #5d7290); }

/* Invite popup */
.invite-box { width: min(560px, 94vw); display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; align-items: center; text-align: left; }
.invite-qr { width: min(42vh, 200px); aspect-ratio: 1; border-radius: 16px; background: #fff; padding: 6px; box-shadow: 0 0 0 3px #ffd84d, 0 10px 24px rgba(0, 0, 0, 0.45); }
.invite-side { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.invite-side h2 { margin: 0; }
.invite-side p { margin: 0; }
.invite-link { width: 100%; padding: 8px 10px; border-radius: 10px; border: 1px dashed rgba(255, 214, 120, 0.6); background: rgba(0, 0, 0, 0.35); color: var(--accent); font-weight: 800; font-size: 0.78rem; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.invite-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.invite-actions .btn { padding: 9px 6px; font-size: 0.82rem; font-weight: 800; }
.wa-btn { background: linear-gradient(180deg, #3ee57a, #1ea952); color: #fff; border-color: transparent; }
@media (orientation: portrait) {
  .invite-box { grid-template-columns: 1fr; justify-items: center; text-align: center; }
}

/* Daily reward */
.gift-btn {
  position: relative; width: 46px; height: 46px; border: 0; background: none; cursor: pointer; padding: 0; font-size: 1.9rem; line-height: 1;
  filter: drop-shadow(0 3px 0 #a3004a) drop-shadow(0 4px 6px rgba(0, 0, 0, 0.35));
}
.gift-btn.ready { animation: giftWobble 1.6s ease-in-out infinite; }
.gift-dot { position: absolute; right: 2px; top: 2px; width: 12px; height: 12px; border-radius: 50%; background: #ff3b3b; border: 2px solid #fff; }
@keyframes giftWobble { 0%, 60%, 100% { rotate: 0deg; } 70% { rotate: -12deg; } 80% { rotate: 10deg; } 90% { rotate: -6deg; } }
.daily-box { width: min(560px, 94vw); }
.daily-box h2 { margin: 0; }
.daily-days { list-style: none; margin: 4px 0; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.daily-days li {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 2px; border-radius: 12px;
  background: linear-gradient(180deg, #3d8ff0, #2369c9); box-shadow: 0 3px 0 #1d4f9c; font-weight: 900;
}
.daily-days li small { font-size: 0.62rem; opacity: 0.9; }
.daily-days li b { font-size: 1.2rem; font-weight: 400; }
.daily-days li span { font-size: 0.85rem; }
.daily-days li.today { background: linear-gradient(180deg, #ffe27a, #f2a900); color: #3a1500; box-shadow: 0 3px 0 #a35a00, 0 0 16px rgba(255, 214, 90, 0.85); animation: playPulse 1.8s ease-in-out infinite; }
.daily-days li.done { opacity: 0.55; }
.daily-days li.done::after { content: '✓'; position: absolute; inset: 0; display: grid; place-items: center; font-size: 1.6rem; color: #4ade80; text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6); }
.daily-days li.done.today { opacity: 1; animation: none; }

/* Badges tab */
.stat-tabs { grid-template-columns: repeat(4, 1fr); }
.badge-row .rk { font-size: 1.4rem; filter: grayscale(1); opacity: 0.55; }
.badge-row.got .rk { filter: none; opacity: 1; }
.badge-row.got { background: rgba(255, 200, 61, 0.12); }
.bprog { display: block; height: 5px; margin-top: 4px; border-radius: 3px; background: rgba(255, 255, 255, 0.12); overflow: hidden; }
.bprog i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, #ffe27a, #f2a900); }
.badge-row.got .bprog { display: none; }

/* Team talk: hold to talk to your partner only */
.roombar .team-talk.talking { background: linear-gradient(180deg, #ff6b6b, #d63a3a); box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.4), 0 0 16px rgba(255, 107, 107, 0.7); }

/* ============================================================
   ART SCENES — Home and Play with Friends are the artwork pictures; live buttons sit exactly on
   the painted ones. The scene keeps the pictures' shape (1874 x 839) and covers the screen.
   Sizes inside use cqw (calc(var(--cqw) * 1) = 1% of the scene width) so everything scales with the picture.
   ============================================================ */
.screen.skin { display: block; max-width: none; margin: 0; padding: 0; overflow: hidden; }
.screen.home.skin { background: #2f86e6 url("img/bg-home-3d.jpg") center / cover no-repeat; }
.screen.pwf-skin { background: #1a0d33 url("img/bg-friends-3d.jpg") center / cover no-repeat; }
.scene-box {
  position: absolute; left: 50%; top: 50%; width: max(100vw, calc(100vh * 2.2336)); aspect-ratio: 1874 / 839; translate: -50% -50%;
  background: center / 100% 100% no-repeat; container-type: inline-size;
}
.home-scene { background-image: url("img/bg-home-3d.jpg"); }
.friends-scene { background-image: url("img/bg-friends-3d.jpg"); }
.hs { position: absolute; margin: 0; padding: 0; border: 0; background: none; color: #fff; font-family: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.hot { border-radius: calc(var(--cqw) * 2); transition: background 0.15s; }
.hot:active { background: radial-gradient(circle, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0) 70%); }
.scene-fx { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }

/* profile panel (where the sample profile was painted) */
.skin-chip { display: flex; align-items: center; gap: calc(var(--cqw) * 0.8); text-align: left; }
.skin-chip .frame { position: relative; height: 100%; aspect-ratio: 1; flex: none; padding: calc(var(--cqw) * 0.35); border-radius: calc(var(--cqw) * 1.3); background: linear-gradient(180deg, #ffffff, #ffd6e0); box-shadow: 0 calc(var(--cqw) * 0.3) calc(var(--cqw) * 0.8) rgba(0, 0, 0, 0.35); }
.skin-chip .frame .avatar { width: 100%; height: 100%; border-radius: calc(var(--cqw) * 1); font-size: calc(var(--cqw) * 2.6); box-shadow: none; }
.skin-chip .level {
  position: absolute; right: calc(var(--cqw) * -0.7); bottom: calc(var(--cqw) * -0.5); min-width: calc(var(--cqw) * 2); height: calc(var(--cqw) * 2); padding: 0 calc(var(--cqw) * 0.3); border-radius: calc(var(--cqw) * 1); display: grid; place-items: center;
  font-size: calc(var(--cqw) * 1.1); font-weight: 900; color: #2b1d00; background: linear-gradient(180deg, #ffe27a, #f2b308); border: calc(var(--cqw) * 0.2) solid #1c5fc4;
}
.skin-chip .pc-text {
  flex: 1; min-width: 0; height: 84%; display: flex; flex-direction: column; justify-content: center; gap: calc(var(--cqw) * 0.5); padding: 0 calc(var(--cqw) * 1.2); border-radius: calc(var(--cqw) * 1.4);
  background: linear-gradient(180deg, #2f8df0, #1c5fc4); border: calc(var(--cqw) * 0.2) solid #9fd0ff; box-shadow: 0 calc(var(--cqw) * 0.35) 0 #123f8a;
}
.skin-chip .pc-text b { font-size: calc(var(--cqw) * 1.6); line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 calc(var(--cqw) * 0.12) 0 rgba(0, 0, 0, 0.35); }
.skin-chip .xp { gap: calc(var(--cqw) * 0.5); }
.skin-chip .xp i { font-size: calc(var(--cqw) * 1.6); }
.skin-chip .xp-bar { flex: 1; width: auto; height: calc(var(--cqw) * 1.1); border-radius: calc(var(--cqw) * 0.6); }

/* points + wins (where the sample coins were painted) and the daily reward (where BANK was) */
.wallet-skin { display: flex; gap: calc(var(--cqw) * 1.2); cursor: pointer; }
.wallet-skin .pill {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: calc(var(--cqw) * 0.8); padding: 0 calc(var(--cqw) * 1.2) 0 calc(var(--cqw) * 0.3); border-radius: calc(var(--cqw) * 4);
  background: linear-gradient(180deg, rgba(10, 40, 90, 0.85), rgba(10, 40, 90, 0.62)); border: calc(var(--cqw) * 0.15) solid rgba(255, 255, 255, 0.5); box-shadow: inset 0 calc(var(--cqw) * 0.2) calc(var(--cqw) * 0.6) rgba(0, 0, 0, 0.4);
}
.wallet-skin .pill i {
  height: 90%; aspect-ratio: 1; flex: none; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: calc(var(--cqw) * 2);
  background: radial-gradient(circle at 35% 30%, #fff3b0, #ffc83d 60%, #b8860b); box-shadow: 0 calc(var(--cqw) * 0.2) calc(var(--cqw) * 0.5) rgba(0, 0, 0, 0.45); animation: coinSpin 4s ease-in-out infinite;
}
.wallet-skin .trophy i { background: radial-gradient(circle at 35% 30%, #d9f1ff, #5aa9ff 60%, #1f4f9c); animation: none; }
.wallet-skin .pill b { flex: 1; text-align: center; font-size: calc(var(--cqw) * 2.1); font-weight: 900; text-shadow: 0 calc(var(--cqw) * 0.15) 0 rgba(0, 0, 0, 0.5); }
@keyframes coinSpin { 0%, 70%, 100% { transform: rotateY(0deg); } 85% { transform: rotateY(180deg); } }
.daily-skin {
  display: flex; align-items: center; justify-content: center; gap: calc(var(--cqw) * 0.6); border-radius: calc(var(--cqw) * 4); background: linear-gradient(180deg, #ff74ad, #d6246b);
  border: calc(var(--cqw) * 0.15) solid #ffd0e2; box-shadow: 0 calc(var(--cqw) * 0.3) 0 #8e1038, 0 calc(var(--cqw) * 0.4) calc(var(--cqw) * 0.8) rgba(0, 0, 0, 0.3);
}
.daily-skin i { font-style: normal; font-size: calc(var(--cqw) * 2.7); line-height: 1; }
.daily-skin b { font-size: calc(var(--cqw) * 1.8); font-weight: 900; letter-spacing: 0.03em; text-shadow: 0 calc(var(--cqw) * 0.12) 0 rgba(0, 0, 0, 0.35); }
.daily-skin.ready i { animation: giftWobble 1.6s ease-in-out infinite; }
.daily-skin .gift-dot { right: calc(var(--cqw) * -0.3); top: calc(var(--cqw) * -0.3); width: calc(var(--cqw) * 1.3); height: calc(var(--cqw) * 1.3); }
.daily-skin:active { translate: 0 calc(var(--cqw) * 0.2); box-shadow: 0 calc(var(--cqw) * 0.1) 0 #8e1038; }

/* Live tables (on the chat tab) */
.live-tag {
  position: absolute; left: 50%; bottom: calc(var(--cqw) * -1.4); translate: -50% 0; padding: calc(var(--cqw) * 0.15) calc(var(--cqw) * 0.6); border-radius: calc(var(--cqw) * 1); white-space: nowrap;
  font-size: calc(var(--cqw) * 1); font-weight: 900; color: #fff; background: #7b2ff0; box-shadow: 0 calc(var(--cqw) * 0.2) calc(var(--cqw) * 0.4) rgba(0, 0, 0, 0.35);
}
.live-tag.on { background: #e5322d; animation: pulse 1.2s infinite; }

/* the three mode cards: float, glow, shine; press to play */
.mode-card { border-radius: calc(var(--cqw) * 1.5); overflow: hidden; animation: cardBob 4.2s ease-in-out infinite; transition: scale 0.15s; }
.mode-card:nth-of-type(2) { animation-delay: -1.4s; }
.mode-card:nth-of-type(3) { animation-delay: -2.8s; }
.mode-card img { display: block; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.mode-card::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; animation: cardGlow 2.8s ease-in-out infinite; }
.mode-card:hover { scale: 1.04; }
.mode-card:active { scale: 0.95; }
@keyframes cardBob { 50% { translate: 0 calc(var(--cqw) * -0.55); } }
@keyframes cardGlow { 0%, 100% { box-shadow: inset 0 0 0 0 rgba(255, 245, 190, 0); } 50% { box-shadow: inset 0 0 calc(var(--cqw) * 2.2) calc(var(--cqw) * 0.2) rgba(255, 245, 190, 0.5); } }
.card-shine {
  position: absolute; top: -20%; left: -70%; width: 34%; height: 140%; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.65), transparent); transform: skewX(-20deg); animation: shine 3.6s ease-in-out infinite;
}
.mode-card:nth-of-type(2) .card-shine { animation-delay: 1.2s; }
.mode-card:nth-of-type(3) .card-shine { animation-delay: 2.4s; }
.card-tag {
  position: absolute; right: -0.4%; top: 3.2%; width: 54%; height: 18%; display: grid; place-items: center; border-radius: calc(var(--cqw) * 0.6) 0 0 calc(var(--cqw) * 0.6); text-align: center;
  font-family: 'Arial Black', Roboto, sans-serif; font-size: calc(var(--cqw) * 1.25); font-weight: 900; line-height: 1.05; color: #fff; background: linear-gradient(180deg, #ff5a4d, #d4261c);
  box-shadow: 0 calc(var(--cqw) * 0.2) 0 rgba(0, 0, 0, 0.25);
}

/* bottom buttons */
.nav-hot .badge { position: absolute; top: 2%; right: 4%; }
.skin-nav { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; }
.skin-nav i { font-style: normal; font-size: calc(var(--cqw) * 5.2); line-height: 1; filter: drop-shadow(0 calc(var(--cqw) * 0.35) 0 rgba(140, 80, 0, 0.85)) drop-shadow(0 calc(var(--cqw) * 0.4) calc(var(--cqw) * 0.6) rgba(0, 0, 0, 0.35)); animation: iconBob 3s ease-in-out infinite; }
.skin-nav:nth-of-type(2) i { animation-delay: -1.5s; }
.skin-nav b, .skin-caption {
  font-family: 'Arial Black', Roboto, sans-serif; font-weight: 900; font-size: calc(var(--cqw) * 1.5); letter-spacing: 0.02em; color: #fff; white-space: nowrap;
  text-shadow: 0 calc(var(--cqw) * 0.2) 0 #1a2c50, calc(var(--cqw) * 0.12) 0 0 #1a2c50, calc(var(--cqw) * -0.12) 0 0 #1a2c50, 0 calc(var(--cqw) * -0.12) 0 #1a2c50, 0 calc(var(--cqw) * 0.4) calc(var(--cqw) * 0.6) rgba(0, 0, 0, 0.4);
}
.skin-nav:active { translate: 0 calc(var(--cqw) * 0.3); }
@keyframes iconBob { 50% { translate: 0 calc(var(--cqw) * -0.5); } }

/* Play with Friends */
.live-skin {
  display: flex; align-items: center; justify-content: center; gap: calc(var(--cqw) * 1); border-radius: calc(var(--cqw) * 1.6);
  background: linear-gradient(180deg, #b675ff, #7b2ff0); border: calc(var(--cqw) * 0.25) solid #e6ccff; box-shadow: 0 calc(var(--cqw) * 0.35) 0 #4b1a99, 0 0 calc(var(--cqw) * 1.6) rgba(190, 120, 255, 0.6);
}
.live-skin i { font-style: normal; font-size: calc(var(--cqw) * 3); animation: iconBob 2.4s ease-in-out infinite; }
.live-skin b { font-family: 'Arial Black', Roboto, sans-serif; font-size: calc(var(--cqw) * 2); color: #ffe27a; text-shadow: 0 calc(var(--cqw) * 0.15) 0 #4b1a99; }
.live-skin:active { translate: 0 calc(var(--cqw) * 0.25); }
.join-skin { display: contents; }
.join-skin .code-boxes { position: absolute; display: flex; justify-content: space-between; gap: 0; }
.join-skin .code-box {
  width: 17.1% !important; height: 100% !important; border-radius: calc(var(--cqw) * 0.6) !important; border: calc(var(--cqw) * 0.3) solid #3fae2a !important; background: #fff !important;
  color: #1b3d12 !important; font-size: calc(var(--cqw) * 2.8) !important; font-weight: 900; text-align: center; text-transform: uppercase; box-shadow: inset 0 calc(var(--cqw) * 0.2) calc(var(--cqw) * 0.4) rgba(0, 0, 0, 0.15);
}
.join-skin .code-box:focus { outline: none; border-color: #ffb300 !important; box-shadow: 0 0 0 calc(var(--cqw) * 0.3) rgba(255, 179, 0, 0.45); }
.btn-hot { border-radius: calc(var(--cqw) * 2.6); overflow: hidden; }
.btn-hot .card-shine { animation-duration: 2.8s; }
.house-hot { border-radius: calc(var(--cqw) * 4); }
.skin-caption { display: grid; place-items: center; pointer-events: none; font-size: calc(var(--cqw) * 1.4); color: #fff3b0; }

/* Screen controls are real UI; the artwork underneath contains scenery only. */
.mode-card {
  display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: clamp(3px, calc(var(--cqw) * 0.35), 7px);
  padding: clamp(9px, calc(var(--cqw) * 1.2), 16px) clamp(8px, calc(var(--cqw) * 1.1), 14px); border: 2px solid rgba(255,255,255,.92); text-align: center; color: #fff;
  box-shadow: 0 calc(var(--cqw) * .75) 0 rgba(21,25,47,.58), 0 calc(var(--cqw) * 1.5) calc(var(--cqw) * 3) rgba(6,19,35,.45), inset 0 calc(var(--cqw) * .2) calc(var(--cqw) * .5) rgba(255,255,255,.45);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.mode-classic { background: linear-gradient(155deg, rgba(255,94,88,.97), rgba(206,31,54,.97) 52%, rgba(111,20,47,.98)); }
.mode-wild { background: linear-gradient(155deg, rgba(110,63,177,.97), rgba(79,36,139,.98) 54%, rgba(46,27,84,.99)); animation-delay: -1.4s; }
.mode-friends { background: linear-gradient(155deg, rgba(31,155,171,.97), rgba(23,105,140,.98) 56%, rgba(20,59,91,.99)); animation-delay: -2.8s; }
.mode-card::before { content: ''; position: absolute; inset: calc(var(--cqw) * .75); border: calc(var(--cqw) * .14) solid rgba(255,255,255,.34); border-radius: calc(var(--cqw) * 1.1); pointer-events: none; }
.mode-card > *:not(.card-shine) { position: relative; z-index: 2; }
.mode-card .card-shine { z-index: 3; }
.mode-visual { position: relative; display: block; width: 62%; height: 24%; flex: none; margin-top: 1%; filter: drop-shadow(0 calc(var(--cqw) * .8) calc(var(--cqw) * .6) rgba(0,0,0,.42)); }
.classic-visual::before, .friends-visual::before {
  content: ''; position: absolute; left: 27%; top: 7%; width: 45%; height: 82%; border: calc(var(--cqw) * .35) solid rgba(255,255,255,.95); border-radius: 13%;
  background: linear-gradient(145deg,#fff 0 45%,#eaf1ff 46%); box-shadow: calc(var(--cqw) * -3) calc(var(--cqw) * .4) 0 calc(var(--cqw) * -.2) rgba(255,255,255,.82); rotate: 9deg;
}
.classic-visual::after {
  content: 'UNO\A PLAY'; position: absolute; left: 10%; top: 18%; width: 80%; height: 64%; display: grid; place-items: center; border-radius: 50%;
  border: calc(var(--cqw) * .35) solid #fff; background: linear-gradient(145deg,#ff574f,#d91534); color: #fff; font-family: 'Arial Black',Roboto,sans-serif;
  font-size: clamp(9px, calc(var(--cqw) * 1.45), 17px); font-weight: 1000; font-style: italic; line-height: .9; white-space: pre-line; text-shadow: 0 2px 0 #871629; box-shadow: 0 calc(var(--cqw) * .35) calc(var(--cqw) * .8) rgba(0,0,0,.3); rotate: -12deg;
}
.wild-visual::before {
  content: ''; position: absolute; left: 19%; top: 0; width: 62%; height: 100%; border: calc(var(--cqw) * .4) solid #fff; border-radius: 50%;
  background: conic-gradient(#f44336 0 25%,#ffd33d 25% 50%,#2fc768 50% 75%,#2384f5 75%); box-shadow: inset 0 0 0 calc(var(--cqw) * .7) rgba(25,20,40,.24), 0 calc(var(--cqw) * .45) calc(var(--cqw) * 1) rgba(0,0,0,.35); rotate: -14deg;
}
.wild-visual::after { content: none; }
.friends-visual::after { content: '👥'; position: absolute; inset: 0; display: grid; place-items: center; font-size: calc(var(--cqw) * 6.4); filter: drop-shadow(0 calc(var(--cqw) * .4) calc(var(--cqw) * .3) rgba(0,0,0,.35)); }
.mode-kicker { max-width: 100%; padding: clamp(4px, calc(var(--cqw) * .4), 7px) clamp(7px, calc(var(--cqw) * .8), 12px); border: 1px solid rgba(255,255,255,.62); border-radius: 999px; background: rgba(8,18,38,.48); font-size: clamp(9px, calc(var(--cqw) * 1.05), 14px); font-weight: 900; line-height: 1.1; }
.mode-name { max-width: 100%; font-family: 'Arial Black',Roboto,sans-serif; font-size: clamp(16px, calc(var(--cqw) * 2.45), 32px); line-height: .98; font-weight: 1000; text-shadow: 0 2px 0 rgba(0,0,0,.48), 0 4px 8px rgba(0,0,0,.36); overflow-wrap: anywhere; }
.mode-detail { width: 100%; min-height: 1.3em; font-size: clamp(11px, calc(var(--cqw) * 1.18), 16px); line-height: 1.2; color: #f4f7ff; text-shadow: 0 1px 4px rgba(0,0,0,.75); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.mode-action { display: flex; align-items: center; justify-content: center; gap: clamp(4px, calc(var(--cqw) * .5), 8px); width: 100%; min-height: clamp(34px, calc(var(--cqw) * 3.2), 44px); padding: clamp(5px, calc(var(--cqw) * .45), 8px) clamp(8px, calc(var(--cqw) * .7), 12px); border: 2px solid #fff2b5; border-radius: 999px; background: linear-gradient(180deg,#fff08d 0%,#ffc638 58%,#f29a1d 100%); color: #3b2600; box-shadow: inset 0 1px 0 rgba(255,255,255,.85), 0 4px 0 #9b570d, 0 6px 12px rgba(0,0,0,.3); font-size: clamp(11px, calc(var(--cqw) * 1.12), 15px); font-weight: 950; white-space: nowrap; text-shadow: 0 1px 0 rgba(255,255,255,.4); transition: filter .15s, translate .15s; }
.mode-action b { font-size: clamp(15px, calc(var(--cqw) * 1.8), 22px); line-height: .8; }
.mode-card:hover .mode-action, .mode-card:focus-visible .mode-action { filter: brightness(1.08); translate: 0 -1px; }
.mode-friends .mode-visual::before { background: linear-gradient(135deg,#ffe38a,#f8b52b); }
.gear-hot { display: grid; place-items: center; border: calc(var(--cqw) * .2) solid rgba(255,255,255,.8); border-radius: calc(var(--cqw) * 2); background: linear-gradient(145deg,#ffdb64,#ef901e); box-shadow: 0 calc(var(--cqw) * .4) 0 #9f5716, 0 calc(var(--cqw) * .7) calc(var(--cqw) * 1) rgba(0,0,0,.35), inset 0 calc(var(--cqw) * .2) calc(var(--cqw) * .45) rgba(255,255,255,.72); }
.gear-hot span { font-size: calc(var(--cqw) * 4.5); line-height: 1; filter: drop-shadow(0 calc(var(--cqw) * .18) 0 #9e591a); }
.live-hot { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: calc(var(--cqw) * .7); border: calc(var(--cqw) * .2) solid rgba(255,255,255,.7); border-radius: 999px; background: linear-gradient(180deg,rgba(16,102,169,.9),rgba(10,57,116,.88)); box-shadow: 0 calc(var(--cqw) * .3) 0 rgba(7,34,74,.7),0 calc(var(--cqw) * .6) calc(var(--cqw) * 1) rgba(0,0,0,.35); }
.live-orb { color: #ff453c; font-size: calc(var(--cqw) * 2.2); line-height: 1; text-shadow: 0 0 calc(var(--cqw) * 1) rgba(255,64,57,.95); animation: liveBlink 1.4s ease-in-out infinite; }
@keyframes liveBlink { 50% { opacity: .45; scale: .82; } }
.nav-hot { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: calc(var(--cqw) * .55); padding: calc(var(--cqw) * .75) calc(var(--cqw) * .35) calc(var(--cqw) * 1.1); border: calc(var(--cqw) * .14) solid rgba(255,255,255,.5); border-radius: calc(var(--cqw) * 1.6); background: linear-gradient(180deg,rgba(14,49,76,.18),rgba(12,28,50,.78)); box-shadow: inset 0 calc(var(--cqw) * .12) calc(var(--cqw) * .4) rgba(255,255,255,.28), 0 calc(var(--cqw) * .35) calc(var(--cqw) * .7) rgba(0,0,0,.32); text-shadow: 0 calc(var(--cqw) * .18) calc(var(--cqw) * .25) rgba(0,0,0,.8); }
.nav-hot i { font-style: normal; font-size: calc(var(--cqw) * 3.6); line-height: 1; filter: drop-shadow(0 calc(var(--cqw) * .22) 0 rgba(0,0,0,.4)); animation: iconBob 3s ease-in-out infinite; }
.nav-hot b { font-size: calc(var(--cqw) * 1.2); line-height: 1.1; font-weight: 900; white-space: nowrap; }
.nav-hot:active { translate: 0 calc(var(--cqw) * .2); }

.pwf-back { display: flex; align-items: center; justify-content: flex-start; gap: calc(var(--cqw) * .7); padding: 0 calc(var(--cqw) * 1.2); border: calc(var(--cqw) * .15) solid rgba(255,255,255,.48); border-radius: calc(var(--cqw) * 2); background: linear-gradient(180deg,rgba(12,27,47,.84),rgba(12,27,47,.62)); box-shadow: 0 calc(var(--cqw) * .3) calc(var(--cqw) * .6) rgba(0,0,0,.28); font-size: calc(var(--cqw) * 1.8); font-weight: 900; }
.pwf-back span { font-size: calc(var(--cqw) * 3.3); line-height: .8; color: #ffd65b; }
.room-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: calc(var(--cqw) * .8); padding: calc(var(--cqw) * 1.2); border: calc(var(--cqw) * .25) solid rgba(255,255,255,.84); border-radius: calc(var(--cqw) * 2.1); text-align: center; color: #fff; box-shadow: 0 calc(var(--cqw) * .65) 0 rgba(14,31,49,.55),0 calc(var(--cqw) * 1) calc(var(--cqw) * 2) rgba(0,0,0,.35),inset 0 calc(var(--cqw) * .2) calc(var(--cqw) * .55) rgba(255,255,255,.65); -webkit-backdrop-filter: blur(7px); backdrop-filter: blur(7px); }
.join-tile { background: linear-gradient(150deg,rgba(42,166,202,.92),rgba(20,96,153,.94) 55%,rgba(26,62,112,.96)); }
.create-tile { background: linear-gradient(150deg,rgba(255,204,64,.95),rgba(238,143,25,.96) 56%,rgba(174,77,32,.97)); }
.room-icon { display: grid; place-items: center; width: calc(var(--cqw) * 7.4); aspect-ratio: 1; border: calc(var(--cqw) * .28) solid rgba(255,255,255,.82); border-radius: 50%; background: radial-gradient(circle at 32% 25%,rgba(255,255,255,.95),rgba(255,255,255,.24) 35%,rgba(0,0,0,.18) 100%); box-shadow: inset 0 calc(var(--cqw) * .3) calc(var(--cqw) * .7) rgba(255,255,255,.45),0 calc(var(--cqw) * .45) calc(var(--cqw) * .8) rgba(0,0,0,.3); color: #fff; font-family: Arial,sans-serif; font-size: calc(var(--cqw) * 5.8); font-weight: 700; line-height: 1; animation: iconBob 3.5s ease-in-out infinite; }
.room-tile strong { font-family: 'Arial Black',Roboto,sans-serif; font-size: calc(var(--cqw) * 2.2); line-height: 1.05; text-shadow: 0 calc(var(--cqw) * .25) 0 rgba(0,0,0,.34); }
.room-tile small { font-size: calc(var(--cqw) * 1.45); line-height: 1.2; color: rgba(255,255,255,.92); }
.room-action { display: grid; place-items: center; overflow: hidden; border: calc(var(--cqw) * .2) solid rgba(255,255,255,.88); border-radius: calc(var(--cqw) * 2.2); color: #fff; box-shadow: 0 calc(var(--cqw) * .55) 0 rgba(32,33,37,.58),0 calc(var(--cqw) * .8) calc(var(--cqw) * 1.4) rgba(0,0,0,.35),inset 0 calc(var(--cqw) * .25) calc(var(--cqw) * .5) rgba(255,255,255,.68); text-shadow: 0 calc(var(--cqw) * .2) 0 rgba(0,0,0,.38); }
.join-action { background: linear-gradient(180deg,#49d97d,#129b56); }
.create-action { background: linear-gradient(180deg,#ffe35e,#f3a91a); color: #fff; }
.room-action-label { position: relative; z-index: 2; font-size: calc(var(--cqw) * 2.4); font-weight: 1000; }
.room-action .card-shine { z-index: 3; }
.room-tile:hover, .room-action:hover, .gear-hot:hover { filter: brightness(1.08); }

/* ---------- living scene: clouds, gulls, balloon, sparkles, neon, light ---------- */
.fx-cloud {
  position: absolute; left: -16%; width: 12%; aspect-ratio: 3; border-radius: 50%; opacity: 0.85;
  background: radial-gradient(ellipse at 50% 60%, #ffffff 0 30%, rgba(255, 255, 255, 0.85) 45%, rgba(255, 255, 255, 0) 70%); animation: fxCloud 90s linear infinite;
}
.fx-cloud::before, .fx-cloud::after { content: ''; position: absolute; border-radius: 50%; background: radial-gradient(circle, #ffffff 0 35%, rgba(255, 255, 255, 0) 70%); }
.fx-cloud::before { width: 55%; aspect-ratio: 1; left: 14%; top: -45%; }
.fx-cloud::after { width: 42%; aspect-ratio: 1; right: 16%; top: -30%; }
.fx-cloud.k1 { top: 8%; }
.fx-cloud.k2 { top: 21%; width: 8%; opacity: 0.7; animation-duration: 120s; animation-delay: -55s; }
.fx-cloud.k3 { top: 2%; width: 10%; animation-duration: 105s; animation-delay: -30s; }
@keyframes fxCloud { from { left: -16%; } to { left: 112%; } }
.fx-gull { position: absolute; left: -4%; width: calc(var(--cqw) * 1.8); height: calc(var(--cqw) * 0.8); animation: gullFly 26s linear infinite; }
.fx-gull::before, .fx-gull::after { content: ''; position: absolute; top: 0; width: 55%; height: 100%; border-top: calc(var(--cqw) * 0.25) solid #2b3a55; border-radius: 60% 60% 0 0; animation: gullFlap 0.5s ease-in-out infinite alternate; }
.fx-gull::before { left: 0; transform-origin: 100% 0; }
.fx-gull::after { right: 0; transform-origin: 0 0; }
.fx-gull.g1 { top: 14%; }
.fx-gull.g2 { top: 19%; scale: 0.7; animation-duration: 32s; animation-delay: -12s; }
@keyframes gullFly { 0% { left: -4%; translate: 0 0; } 25% { translate: 0 calc(var(--cqw) * -1.2); } 50% { translate: 0 calc(var(--cqw) * 0.4); } 75% { translate: 0 calc(var(--cqw) * -0.8); } 100% { left: 104%; translate: 0 0; } }
@keyframes gullFlap { from { rotate: 18deg; } to { rotate: -14deg; } }
.fx-balloon {
  position: absolute; top: 10%; left: 108%; width: calc(var(--cqw) * 2.6); aspect-ratio: 0.82; border-radius: 50% 50% 44% 44%;
  background: radial-gradient(circle at 35% 28%, #fff 0, #ffe680 22%, #f2a900 72%); animation: balloonDrift 70s linear infinite, balloonBob 6s ease-in-out infinite;
}
.fx-balloon::before { content: ''; position: absolute; inset: 0; border-radius: inherit; background: repeating-linear-gradient(90deg, transparent 0 22%, rgba(229, 50, 45, 0.55) 22% 34%); }
.fx-balloon::after { content: ''; position: absolute; left: 32%; top: 96%; width: 36%; height: 30%; border-left: calc(var(--cqw) * 0.12) solid #6b4a2a; border-right: calc(var(--cqw) * 0.12) solid #6b4a2a; }
.fx-balloon i { position: absolute; left: 30%; top: 124%; width: 40%; height: 22%; border-radius: calc(var(--cqw) * 0.15) calc(var(--cqw) * 0.15) calc(var(--cqw) * 0.3) calc(var(--cqw) * 0.3); background: #a0682f; }
@keyframes balloonDrift { from { left: 108%; } to { left: -10%; } }
.twinkle {
  position: absolute; width: calc(calc(var(--cqw) * 2.2) * var(--s, 1)); aspect-ratio: 1; translate: -50% -50%; mix-blend-mode: screen;
  background: radial-gradient(circle, #fffbe0 0 18%, #ffe27a 40%, rgba(255, 226, 122, 0) 70%);
  clip-path: polygon(50% 0, 58% 42%, 100% 50%, 58% 58%, 50% 100%, 42% 58%, 0 50%, 42% 42%);
  animation: twinkle 2.8s ease-in-out infinite; animation-delay: var(--d, 0s); opacity: 0;
}
@keyframes twinkle { 0%, 100% { opacity: 0; scale: 0.2; rotate: 0deg; } 40% { opacity: 1; scale: 1; rotate: 45deg; } 70% { opacity: 0; scale: 0.4; rotate: 90deg; } }
.neon-glow { position: absolute; border-radius: 30%; mix-blend-mode: screen; background: radial-gradient(ellipse, rgba(255, 90, 200, 0.55), rgba(80, 140, 255, 0.25) 45%, transparent 70%); animation: neonFlicker 5s infinite; }
.halo { position: absolute; border-radius: 50%; mix-blend-mode: screen; border: calc(var(--cqw) * 0.3) solid rgba(170, 255, 120, 0.7); box-shadow: 0 0 calc(var(--cqw) * 1.6) rgba(170, 255, 120, 0.7), inset 0 0 calc(var(--cqw) * 1.6) rgba(170, 255, 120, 0.45); opacity: 0.5; animation: haloRing 3s ease-in-out infinite; }
.halo.gold { border-color: rgba(255, 214, 90, 0.8); box-shadow: 0 0 calc(var(--cqw) * 1.6) rgba(255, 214, 90, 0.75), inset 0 0 calc(var(--cqw) * 1.6) rgba(255, 214, 90, 0.5); animation-delay: -1.5s; }
@keyframes haloRing { 0%, 100% { scale: 0.92; opacity: 0.25; } 50% { scale: 1.04; opacity: 0.65; } }
@keyframes neonFlicker { 0%, 17%, 21%, 61%, 64%, 100% { opacity: 0.85; } 19%, 62% { opacity: 0.35; } }
.bokeh { position: absolute; bottom: -4%; width: calc(var(--cqw) * 1.3); aspect-ratio: 1; border-radius: 50%; mix-blend-mode: screen; background: radial-gradient(circle, rgba(255, 220, 150, 0.95), rgba(255, 220, 150, 0) 70%); animation: bokehRise 11s linear infinite; }
.bokeh.b1 { left: 8%; } .bokeh.b2 { left: 24%; animation-delay: -3s; animation-duration: 13s; } .bokeh.b3 { left: 47%; animation-delay: -6s; }
.bokeh.b4 { left: 63%; animation-delay: -2s; animation-duration: 14s; } .bokeh.b5 { left: 79%; animation-delay: -8s; } .bokeh.b6 { left: 93%; animation-delay: -5s; animation-duration: 12s; }
@keyframes bokehRise { 0% { bottom: -4%; opacity: 0; translate: 0 0; } 15% { opacity: 0.9; } 50% { translate: calc(var(--cqw) * 1.5) 0; } 85% { opacity: 0.6; } 100% { bottom: 96%; opacity: 0; translate: calc(var(--cqw) * -1) 0; } }

/* behind the game table and the lobby */
.screen.game { background: #5fb2f5 url("img/bg-table-3d.jpg") center / cover no-repeat; }
.game-sky { position: absolute; inset: 0; overflow: hidden; pointer-events: none; container-type: inline-size; }
.game-sky .fx-cloud.k1 { top: 3%; }
.game-sky .fx-cloud.k2 { top: 9%; }
.game-sky .fx-balloon { top: 4%; width: calc(var(--cqw) * 2); }
.screen.lobby { background: #1a0d33 url("img/bg-lobby.jpg") center / cover no-repeat; }
.splash { background: linear-gradient(rgba(36, 18, 79, 0.45), rgba(18, 10, 42, 0.78)), url("img/bg-home-3d.jpg") center / cover no-repeat, #24124f; }

/* upright phones: show the whole picture across the top */
@media (orientation: portrait) {
  .scene-box { width: 100vw; top: 38%; }
}
@keyframes balloonBob { 50% { translate: 0 calc(var(--cqw) * -0.8); } }
.skin-chip .xp { display: flex; align-items: center; }
#xpFill { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, #ffe27a, #f2a900); transition: width 0.6s; }
.skin-chip .xp-bar { background: #0d3a7a; overflow: hidden; box-shadow: inset 0 calc(var(--cqw) * 0.1) calc(var(--cqw) * 0.2) rgba(0, 0, 0, 0.5); }
.skin-nav b { font-size: calc(var(--cqw) * 1.2); }
.rim-fx { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.rim-fx .twinkle { width: calc(2.4vmin * var(--s, 1)); }

/* ============================================================
   ROOM LOBBY — like the reference: dark card-pattern wall, Room ID + rules row, big seat portraits,
   Friends / Spectate panel, Invite button, Chat, "Waiting for the host to start…"
   ============================================================ */
.screen.lobby.lobby-skin {
  display: flex; flex-direction: column; gap: 6px;
  padding: calc(6px + var(--safe-top)) calc(var(--rail) + 10px + var(--safe-right)) calc(6px + var(--safe-bottom)) calc(12px + var(--safe-left));
  background: url("img/lobby-pattern.svg"), url("img/lobby-pattern.svg") 70px 70px, radial-gradient(ellipse at 45% 40%, #3b3b3f 0%, #29292c 55%, #1c1c1f 100%);
  background-color: #232326;
}
.lb-top { display: flex; align-items: center; gap: 12px; flex: none; min-height: 42px; }
.lb-back { display: flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border: 0; border-radius: 12px; background: rgba(0, 0, 0, 0.35); cursor: pointer; max-width: 34%; min-width: 0; }
.lb-arrow { width: 42px; height: 30px; flex: none; background: linear-gradient(180deg, #ffe680, #f2a900); clip-path: polygon(0 50%, 44% 0, 44% 27%, 100% 27%, 100% 73%, 44% 73%, 44% 100%); filter: drop-shadow(0 2px 0 #a35a00); }
.lb-title { font-family: 'Arial Black', Roboto, sans-serif; font-weight: 900; font-size: 0.82rem; line-height: 1.05; color: #ffe27a; text-transform: uppercase; text-align: left; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.5); }
.lb-back:active { translate: -2px 0; }
.lb-wallet { margin: 0 auto; width: min(300px, 34vw); height: 34px; }
.lb-wallet .pill i { font-size: 1rem; }
.lb-wallet .pill b { font-size: 1rem; }
.lb-tools { display: flex; gap: 8px; }
.lb-icon { width: 40px; height: 40px; border: 0; border-radius: 10px; cursor: pointer; font-size: 1.35rem; background: linear-gradient(180deg, #ffe27a, #f2a900); box-shadow: 0 3px 0 #a35a00; }
.lb-icon:active { translate: 0 2px; box-shadow: 0 1px 0 #a35a00; }
#lockBtn.lb-icon.on { background: linear-gradient(180deg, #ff8a7a, #e0453a); box-shadow: 0 3px 0 #8e2226; }

.lb-info { display: flex; align-items: center; gap: 10px; flex: none; min-width: 0; }
.lb-roomid { border: 0; background: none; padding: 0; cursor: pointer; color: #ffe9a8; font-weight: 900; font-size: 1.15rem; white-space: nowrap; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.5); }
.lb-roomid b { color: #fff; font-size: 1.35rem; letter-spacing: 0.08em; }
.lb-share { width: 30px; height: 30px; flex: none; border: 2px solid #fff; border-radius: 50%; cursor: pointer; color: #fff; font-size: 0.95rem; font-weight: 900; background: linear-gradient(180deg, #7ed957, #3fae2a); box-shadow: 0 2px 0 #2a7a1a; }
.lb-rules-label { margin-left: 10px; color: #ffe9a8; font-weight: 900; font-size: 1.05rem; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.5); }
.lb-rules { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; min-width: 0; padding: 2px; }
.lb-rules::-webkit-scrollbar { display: none; }
.rule-ico {
  position: relative; flex: none; width: 34px; height: 34px; border-radius: 7px; border: 2px solid #ffe27a; cursor: pointer; padding: 0;
  background: linear-gradient(180deg, #4aa3ff, #1f6fd1) center / cover no-repeat; display: grid; place-items: center; box-shadow: 0 2px 0 rgba(0, 0, 0, 0.45);
}
.rule-ico.card { background-color: #fff; background-size: 80% auto; }
.rule-ico i { font-style: normal; font-size: 1.05rem; line-height: 1; }
.rule-ico.timer { width: 40px; background: linear-gradient(180deg, #ffe680, #f2a900); }
.rule-ico.timer i { font-size: 0.9rem; }
.rule-ico small { position: absolute; left: 0; right: 0; bottom: 1px; font-size: 0.55rem; font-weight: 900; color: #3a1500; }
.rule-ico.timer i { translate: 0 -4px; }
.rule-ico.locked { background: linear-gradient(180deg, #ff8a7a, #e0453a); }

/* seats */
.lobby-skin .lobby-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) clamp(210px, 31vw, 300px); gap: 12px; }
.lobby-skin .table-zone { background: none; border: 0; box-shadow: none; padding: 0; }
.lobby-skin .seat-grid { gap: 10px 16px; --av: 70px; }
.lobby-skin .seat-grid[data-n="2"], .lobby-skin .seat-grid[data-n="3"], .lobby-skin .seat-grid[data-n="4"] { --av: 84px; gap: 12px 22px; }
.lobby-skin .seat-tile { width: calc(var(--av) + 34px); }
.lobby-skin .st-av { border-radius: 14px; padding: 4px; background: #fff; box-shadow: 0 5px 0 rgba(0, 0, 0, 0.35), 0 8px 14px rgba(0, 0, 0, 0.35); }
.lobby-skin .st-av .avatar { border-radius: 10px; background-color: #6fd36a; }
.lobby-skin .st-name { width: 100%; padding: 3px 8px; border-radius: 10px; background: linear-gradient(180deg, #3b9cff, #1a6fd6); border: 2px solid #9fd0ff; font-size: 0.8rem; text-align: center; }
.lobby-skin .seat-tile.me .st-av { background: #fff3b0; }
.lobby-skin .seat-tile.me .st-name { background: linear-gradient(180deg, #3b9cff, #1a6fd6); color: #fff; border-color: #ffe066; box-shadow: 0 0 0 2px #ffe066, 0 0 10px rgba(255, 224, 102, 0.7); }
.lobby-skin .host-badge { left: -10px; right: auto; top: -12px; font-size: 1.35rem; }
.lobby-skin .seat-no { left: auto; right: -4px; top: 0; }
.lobby-skin .seat-tile.empty .st-av { background: rgba(255, 255, 255, 0.06); border: 3px dashed rgba(255, 255, 255, 0.28); color: rgba(255, 255, 255, 0.45); }
.lobby-skin .seat-tile.empty .st-name { background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.2); color: #d6d6dc; }
.lobby-skin .seat-tile.team-a .st-av { background: #ff7a6e; }
.lobby-skin .seat-tile.team-b .st-av { background: #6fb2ff; }
.lobby-skin .seat-tile.bot .st-av { background: #dfe8f3; }
.lobby-skin .seat-tile.bot .st-name { background: linear-gradient(180deg, #8ea3bd, #5d7290); }

/* the player menu (Spectate / Kick out …) */
.seat-menu { background: linear-gradient(180deg, #e3f3ff, #b9ddff); border: 3px solid #fff; border-radius: 18px; }
.sm-item { font-size: 0.95rem; padding: 10px 18px; border-radius: 12px; }
.sm-item.danger { background: linear-gradient(180deg, #b9c3cf, #8b97a6); box-shadow: 0 3px 0 #5d6773; color: #fff; }

/* Friends / Spectate panel */
.lobby-skin .side-panel { padding: 0; gap: 0; border-radius: 16px; background: rgba(20, 20, 24, 0.55); border: 2px solid rgba(255, 255, 255, 0.28); overflow: hidden; }
.lobby-skin .sp-tabs { gap: 0; }
.lobby-skin .sp-tab { border-radius: 0; padding: 9px 4px; font-size: 0.85rem; background: #1a8fe3; color: #fff; }
.lobby-skin .sp-tab.on { background: #5ab4dc; box-shadow: none; }
.lobby-skin .sp-list { padding: 8px; gap: 8px; }
.lobby-skin .sp-list li { background: none; padding: 2px 0; }
.lobby-skin .sp-list .avatar { width: 42px; height: 42px; border-radius: 10px; border: 2px solid #fff; }
.lobby-skin .sp-info strong { font-size: 0.88rem; }
.lobby-skin .sp-list .btn.sp-go { padding: 7px 14px; border-radius: 10px; font-size: 0.82rem; }
.lobby-skin .sp-tag.busy { padding: 7px 12px; border-radius: 10px; background: linear-gradient(180deg, #b9c3cf, #8b97a6); }

/* bottom row: Chat, status / start, Invite */
.lb-foot { display: grid; grid-template-columns: auto minmax(0, 1fr) clamp(210px, 31vw, 300px); align-items: center; gap: 12px; flex: none; }
.lb-chat { display: flex; flex-direction: column; align-items: center; border: 0; background: none; cursor: pointer; padding: 0; color: #fff; }
.lb-chat i { font-style: normal; font-size: 1.9rem; line-height: 1; filter: drop-shadow(0 2px 0 rgba(140, 80, 0, 0.8)); }
.lb-chat span { font-weight: 900; font-size: 0.78rem; text-shadow: 0 2px 0 #000; }
.lobby-skin .lobby-foot { padding: 0; justify-content: center; }
.lb-pad { width: 36px; height: 36px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 1.1rem; background: rgba(0, 0, 0, 0.6); box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.15); }
.lobby-skin .lobby-hint { color: #fff; font-weight: 800; font-size: 0.95rem; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.5); }
.lb-invite {
  height: 46px; border: 3px solid #d8ffcc; border-radius: 14px; cursor: pointer; color: #fff; font-family: 'Arial Black', Roboto, sans-serif; font-weight: 900; font-size: 1.15rem;
  background: linear-gradient(180deg, #8ee36a, #3fae2a); box-shadow: 0 4px 0 #2a7a1a, 0 8px 14px rgba(0, 0, 0, 0.35); text-shadow: 0 2px 0 rgba(0, 0, 0, 0.3);
}
.lb-invite:active { translate: 0 3px; box-shadow: 0 1px 0 #2a7a1a; }

@media (orientation: landscape) and (max-height: 400px) {
  .lb-top { min-height: 38px; }
  .lb-icon { width: 36px; height: 36px; font-size: 1.15rem; }
  .lb-roomid { font-size: 1rem; }
  .lb-roomid b { font-size: 1.15rem; }
  .lobby-skin .seat-grid { --av: 56px; gap: 6px 12px; }
  .lobby-skin .seat-grid[data-n="2"], .lobby-skin .seat-grid[data-n="3"], .lobby-skin .seat-grid[data-n="4"] { --av: 70px; }
  .lobby-skin .seat-grid[data-n="9"], .lobby-skin .seat-grid[data-n="10"] { --av: 44px; }
  .lb-invite { height: 40px; }
}
@media (orientation: portrait) {
  .lobby-skin .lobby-body { grid-template-columns: minmax(0, 1fr); }
  .lb-foot { grid-template-columns: auto minmax(0, 1fr); }
  .lb-invite { grid-column: 1 / -1; }
  .lb-info { flex-wrap: wrap; }
}

/* Portrait web play: use the whole phone viewport instead of shrinking the panoramic hit map. */
@media (orientation: portrait) and (max-width: 800px) {
  .screen.home.skin, .screen.pwf-skin { overflow-x: hidden; overflow-y: auto; background: #12334e; }
  .screen.home.skin .scene-box, .screen.pwf-skin .scene-box {
    position: relative; left: 0; top: 0; translate: none; width: 100%; height: max(100vh, 660px); height: max(100dvh, 660px); min-height: 660px;
    aspect-ratio: auto; background-size: cover; background-position: center;
  }
  .home-scene { background-image: linear-gradient(180deg, rgba(6, 23, 48, .34), rgba(3, 29, 42, .08) 48%, rgba(7, 25, 29, .35)), url("img/bg-home-3d.jpg"); }
  .friends-scene { background-image: linear-gradient(180deg, rgba(7, 19, 44, .48), rgba(7, 18, 30, .22)), url("img/bg-friends-3d.jpg"); }
  .home-scene .scene-fx, .friends-scene .scene-fx { opacity: .48; }

  .home-scene #profileChip { left: 4% !important; top: 2% !important; width: 51% !important; height: 8.5% !important; gap: 8px; }
  .home-scene #profileChip .frame { height: 90%; padding: 2px; border-radius: 12px; }
  .home-scene #profileChip .frame .avatar { border-radius: 9px; font-size: 20px; }
  .home-scene #profileChip .level { right: -6px; bottom: -4px; min-width: 19px; height: 19px; padding: 0 3px; border-radius: 10px; font-size: 10px; border-width: 2px; }
  .home-scene #profileChip .pc-text { height: 80%; gap: 4px; padding: 0 8px; border-radius: 10px; }
  .home-scene #profileChip .pc-text b { font-size: 13px; }
  .home-scene #profileChip .xp { gap: 4px; }
  .home-scene #profileChip .xp i { font-size: 13px; }
  .home-scene #profileChip .xp-bar { height: 7px; border-radius: 5px; }
  .home-scene #wallet { left: 57% !important; top: 2.8% !important; width: 29% !important; height: 5.5% !important; gap: 5px; }
  .home-scene #wallet .pill { gap: 4px; padding: 0 5px 0 2px; border-radius: 22px; }
  .home-scene #wallet .pill i { font-size: 15px; }
  .home-scene #wallet .pill b { font-size: 12px; }
  .home-scene #dailyBtn { left: 57% !important; top: 10% !important; width: 29% !important; height: 5.5% !important; gap: 5px; border-radius: 18px; }
  .home-scene #dailyBtn i { font-size: 16px; }
  .home-scene #dailyBtn b { font-size: 11px; }
  .home-scene #settingsBtn { left: 89% !important; top: 3% !important; width: 9% !important; height: 7% !important; border-radius: 14px; }
  .home-scene #settingsBtn span { font-size: 24px; }
  .home-scene #liveBtn { left: 4% !important; top: 11% !important; width: 48% !important; height: 5.5% !important; flex-direction: row; gap: 8px; border-radius: 20px; }
  .home-scene #liveBtn .live-orb { font-size: 12px; }
  .home-scene #liveBtn .live-tag { position: static; translate: none; padding: 2px 7px; border-radius: 9px; font-size: 9px; }

  .home-scene .mode-card { left: 5% !important; width: 90% !important; height: 16.3% !important; display: grid; grid-template-columns: 22% minmax(0, 1fr) auto; grid-template-rows: 24% 40% 24%; gap: 2px 8px; padding: 9px 12px; border-width: 2px; border-radius: 16px; text-align: left; }
  .home-scene #quickPlayBtn { top: 21% !important; }
  .home-scene #wildBtn { top: 40% !important; }
  .home-scene #friendsPlayBtn { top: 59% !important; }
  .home-scene .mode-card::before { inset: 5px; border-width: 1px; border-radius: 11px; }
  .home-scene .mode-visual { grid-column: 1; grid-row: 1 / 4; width: 90%; height: 78%; margin: 0; justify-self: center; align-self: center; }
  .home-scene .classic-visual::after { font-size: 18px; border-width: 2px; }
  .home-scene .wild-visual::after { font-size: 34px; }
  .home-scene .friends-visual::after { font-size: 27px; }
  .home-scene .mode-kicker { grid-column: 2; grid-row: 1; justify-self: start; align-self: end; padding: 3px 7px; border-radius: 10px; font-size: 9px; }
  .home-scene .mode-name { grid-column: 2; grid-row: 2; align-self: center; font-size: 21px; line-height: 1; }
  .home-scene .mode-detail { grid-column: 2; grid-row: 3; align-self: start; font-size: 11px; line-height: 1.2; min-height: 0; }
  .home-scene .mode-action { grid-column: 3; grid-row: 1 / 4; align-self: center; width: auto; min-width: 82px; min-height: 38px; padding: 6px 8px; border-radius: 12px; font-size: 10px; }
  .home-scene .mode-action b { font-size: 16px; }
  .home-scene .card-shine { display: none; }

  .home-scene #homeFriendsBtn, .home-scene #rulesBtn, .home-scene #historyBtn, .home-scene #shopBtn {
    top: 82.5% !important; width: 20% !important; height: 13.5% !important; justify-content: center; gap: 5px; padding: 8px 2px;
    border: 1px solid rgba(255,255,255,.72); border-radius: 14px; background: linear-gradient(160deg, rgba(17,79,113,.94), rgba(11,35,63,.96));
    box-shadow: 0 4px 0 rgba(4,23,43,.75), inset 0 1px 0 rgba(255,255,255,.35);
  }
  .home-scene #homeFriendsBtn { left: 3.5% !important; }
  .home-scene #rulesBtn { left: 27.5% !important; }
  .home-scene #historyBtn { left: 51.5% !important; }
  .home-scene #shopBtn { left: 75.5% !important; }
  .home-scene #homeFriendsBtn i, .home-scene #rulesBtn i, .home-scene #historyBtn i, .home-scene #shopBtn i { font-size: 23px; animation: none; }
  .home-scene #homeFriendsBtn b, .home-scene #rulesBtn b, .home-scene #historyBtn b, .home-scene #shopBtn b { font-size: 9px; white-space: normal; text-align: center; }

  .friends-scene #pwfBack { left: 4% !important; top: 2% !important; width: 28% !important; height: 7% !important; gap: 5px; border-radius: 14px; font-size: 14px; }
  .friends-scene #pwfBack span { font-size: 24px; }
  .friends-scene .pwf-wallet { left: 37% !important; top: 2.5% !important; width: 33% !important; height: 5.5% !important; gap: 5px; }
  .friends-scene .pwf-wallet .pill { gap: 3px; padding: 0 4px; }
  .friends-scene .pwf-wallet .pill i { font-size: 14px; }
  .friends-scene .pwf-wallet .pill b { font-size: 11px; }
  .friends-scene #pwfLiveBtn { left: 72% !important; top: 2% !important; width: 24% !important; height: 7% !important; gap: 3px; border-radius: 14px; }
  .friends-scene #pwfLiveBtn i { font-size: 14px; }
  .friends-scene #pwfLiveBtn b { font-size: 9px; }
  .friends-scene #joinHouse { left: 6% !important; top: 18% !important; width: 88% !important; height: 12% !important; flex-direction: row; gap: 10px; border-radius: 18px; }
  .friends-scene #joinHouse .room-icon { width: 42px; font-size: 28px; }
  .friends-scene #joinHouse strong, .friends-scene #createHouse strong { font-size: 16px; }
  .friends-scene #joinHouse small, .friends-scene #createHouse small { font-size: 11px; }
  .friends-scene .code-boxes { left: 7% !important; top: 33% !important; width: 86% !important; height: 7% !important; gap: 8px; }
  .friends-scene .join-skin .code-box { border-radius: 9px !important; border-width: 2px !important; font-size: 19px !important; }
  .friends-scene #joinBtn { left: 7% !important; top: 42% !important; width: 86% !important; height: 8% !important; border-radius: 14px; }
  .friends-scene .room-action-label { font-size: 15px; }
  .friends-scene #createHouse { left: 6% !important; top: 56% !important; width: 88% !important; height: 12% !important; flex-direction: row; gap: 10px; border-radius: 18px; }
  .friends-scene #createHouse .room-icon { width: 42px; font-size: 28px; }
  .friends-scene .skin-caption { display: none; }
  .friends-scene #createBtn { left: 7% !important; top: 72% !important; width: 86% !important; height: 9% !important; border-radius: 14px; }
}

/* Keep actions inside the lobby footer on both short landscape phones and portrait browsers. */
@media (orientation: portrait) {
  .screen.lobby.lobby-skin { padding: calc(6px + var(--safe-top)) calc(8px + var(--safe-right)) calc(10px + var(--safe-bottom)) calc(8px + var(--safe-left)); gap: 7px; }
  .lb-top { gap: 6px; min-height: 38px; }
  .lb-back { max-width: 42%; }
  .lb-arrow { width: 30px; height: 24px; }
  .lb-wallet { width: min(170px, 35vw); }
  .lb-wallet .pill { gap: 3px; padding: 0 4px 0 2px; }
  .lb-wallet .pill b { font-size: .82rem; }
  .lb-tools { gap: 5px; }
  .lb-icon { width: 34px; height: 34px; }
  .lb-info { gap: 6px; }
  .lb-roomid { font-size: .9rem; }
  .lb-roomid b { font-size: 1rem; }
  .lb-rules-label { margin-left: 2px; font-size: .85rem; }
  .lb-rules { width: 100%; }
  .lobby-skin .lobby-body { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(180px, 1fr) minmax(112px, 30%); gap: 7px; }
  .lobby-skin .side-panel { min-height: 0; }
  .lb-foot { grid-template-columns: 42px minmax(0, 1fr); grid-template-rows: minmax(42px, auto) 44px; gap: 6px 8px; padding-bottom: 2px; }
  .lb-chat { grid-column: 1; grid-row: 1; }
  .lobby-skin .lobby-foot { grid-column: 2; grid-row: 1; min-width: 0; flex-wrap: wrap; gap: 5px; justify-content: flex-end; }
  .lobby-skin .lobby-foot .lobby-hint { display: none; }
  .lobby-skin .lobby-foot .btn { min-height: 38px; padding: 7px 10px; font-size: .78rem; }
  .lb-invite { grid-column: 1 / -1; grid-row: 2; width: 100%; height: 42px; font-size: 1rem; }
}
@media (orientation: landscape) and (max-height: 520px) {
  .lb-foot { grid-template-columns: 42px minmax(0, 1fr) minmax(130px, 23vw); gap: 8px; }
  .lobby-skin .lobby-foot { flex-wrap: wrap; gap: 5px; }
  .lobby-skin .lobby-foot .lobby-hint { flex: 1 1 120px; font-size: .75rem; }
  .lobby-skin .lobby-foot .btn { padding: 7px 10px; font-size: .78rem; }
  .lb-invite { height: 40px; font-size: .95rem; }
}

/* Softer direction track and concise in-table callouts leave the played cards readable. */
.dir-ring { inset: -5%; width: 110%; height: 110%; opacity: .82; filter: drop-shadow(0 2px 2px rgba(0,0,0,.52)) drop-shadow(0 0 7px var(--dir-color, #ffc83d)); }
.dir-ring .a-edge { stroke-width: 14; }
.dir-ring .a-body { stroke-width: 9; }
.dir-ring .a-shine { stroke-width: 2.5; }
.floor-logo { font-size: clamp(28px, 5vw, 64px); letter-spacing: .04em; padding: 0; opacity: .18; -webkit-text-stroke-width: 1px; text-shadow: 0 2px 0 rgba(70,45,0,.7), 0 4px 8px rgba(0,0,0,.22); }
.color-aura { inset: 14%; opacity: .38; }
.fx-banner { max-width: calc(100vw - 32px); white-space: normal; text-align: center; font-size: clamp(1.15rem, 4.5vh, 2rem); line-height: 1.05; -webkit-text-stroke-width: 1px; }
#turnText.turn-flash { animation: turnFlash .7s ease-out; }
@keyframes turnFlash { 0% { color: #fff; text-shadow: 0 0 0 transparent; } 35% { color: #ffe27a; text-shadow: 0 0 14px rgba(255,200,61,.8); } 100% { color: inherit; text-shadow: none; } }

/* Higher-contrast, compact surfaces for profile, rules, history, live tables and room setup. */
.drawer { background: linear-gradient(160deg, #173650 0%, #142238 55%, #101923 100%); border-color: rgba(135,196,242,.28); }
.sheet-head h2, .drawer > .row h2 { color: #fff; font-size: 1.2rem; }
.sheet-section { padding: 12px; border: 1px solid rgba(255,255,255,.1); border-radius: 14px; background: rgba(255,255,255,.045); }
.sheet-section h3 { color: #f9d66d; font-size: .88rem; }
.sheet-section p, .sheet-note { color: #d0dbe7; line-height: 1.45; }
.stat-tabs { grid-template-columns: repeat(5, minmax(0,1fr)); }
.stat-tab { padding: 9px 4px; color: #cfdeec; font-size: .73rem; }
.stat-tab.on { background: linear-gradient(180deg, #52b5dc, #247bb5); color: #fff; }
.stats-summary .stat { border: 1px solid rgba(255,255,255,.1); background: rgba(255,255,255,.06); }
.stats-list li, .room-list li, .friend-list li, .help-row { border: 1px solid rgba(255,255,255,.09); background: rgba(255,255,255,.055); }
.room-box { background: linear-gradient(155deg, #153e5d, #14283f 64%, #17223a); border-color: rgba(130,211,248,.55); }
.rm-grid { grid-template-columns: minmax(88px, auto) minmax(0,1fr); }
.rm-label, .rm-section { color: #ffd76a; }
.room-box .chip { min-height: 36px; border-color: rgba(255,255,255,.24); background: rgba(4,16,32,.64); }
.room-box .chip.on { background: linear-gradient(180deg,#ffe17a,#f4af2e); color: #332000; border-color: #fff0b3; }
.room-box .tile { border-radius: 9px; background: linear-gradient(160deg,#d8f1ff,#8cc9ec); border-color: rgba(255,255,255,.8); box-shadow: 0 3px 0 #367fae; }
.room-box .tile.on { background: linear-gradient(160deg,#fff3be,#f9c95a); box-shadow: 0 3px 0 #b47c11; }
.room-box .rm-head h2 { background: linear-gradient(180deg,#39b7d8,#187fae); box-shadow: 0 3px 0 #0d547f; text-shadow: 0 1px 0 rgba(0,0,0,.4); }
.room-box > .btn.big { background: linear-gradient(180deg,#4ed686,#1f9e60); box-shadow: 0 4px 0 #116542; }
.invite-box { background: linear-gradient(155deg,#16405d,#15233a); border-color: rgba(120,202,237,.6); }
.invite-link { overflow-wrap: anywhere; background: rgba(3,12,25,.55); border: 1px solid rgba(255,255,255,.2); border-radius: 10px; padding: 10px; }
.level-row .level-medal { width: 34px; text-align: center; flex: none; font-weight: 900; color: #ffd76a; }
.level-row.current { border-color: rgba(255,215,106,.65); background: linear-gradient(90deg,rgba(244,181,47,.16),rgba(255,255,255,.05)); }
.level-row.complete .level-medal, .level-row.complete .pts { color: #5ee0a1; }
.level-row .finfo { flex: 1; min-width: 0; display: grid; gap: 3px; }
.level-row .bprog { height: 5px; border-radius: 5px; background: rgba(255,255,255,.13); overflow: hidden; }
.level-row .bprog i { display: block; height: 100%; background: linear-gradient(90deg,#40cde6,#ffd76a); border-radius: inherit; }
.level-row .pts { min-width: 34px; text-align: right; color: #ffd76a; font-size: .65rem; font-weight: 900; }

/* The storefront is preview-only until verified Play Billing products are configured. */
.store-sheet { gap: 12px; }
.store-hero { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 14px; background: linear-gradient(115deg,#174c69,#374775 60%,#743f74); border: 1px solid rgba(255,255,255,.2); }
.store-mark { display: grid; place-items: center; width: 46px; aspect-ratio: 1; flex: none; border-radius: 13px; background: linear-gradient(145deg,#fff2a6,#edaa2b); color: #4a2c00; font-size: 25px; box-shadow: 0 4px 0 #9a5f18; }
.store-hero div { display: grid; gap: 4px; min-width: 0; }
.store-hero strong { font-size: .9rem; }
.store-hero span:not(.store-mark) { color: #e1e9f2; font-size: .76rem; }
.store-wallet { display: flex; justify-content: space-between; gap: 8px; padding: 9px 12px; border-radius: 12px; background: rgba(3,14,26,.48); font-size: .78rem; }
.store-wallet b { color: #ffd76a; }
.store-tabs { display: grid; grid-template-columns: repeat(4,1fr); gap: 4px; padding: 4px; border-radius: 12px; background: rgba(0,0,0,.24); }
.store-tab { min-width: 0; padding: 8px 4px; border: 0; border-radius: 9px; background: transparent; color: #cfdeec; font-weight: 800; font-size: .74rem; }
.store-tab.on { background: linear-gradient(180deg,#49b9dc,#247bb5); color: #fff; }
.store-scroll { min-height: 0; overflow: auto; }
.store-panel { display: grid; gap: 10px; }
.store-feature { display: flex; align-items: flex-start; gap: 10px; padding: 12px; border-radius: 12px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); }
.store-feature > span { font-size: 23px; }
.store-feature div { display: grid; gap: 4px; }
.store-feature p { margin: 0; color: #d0dbe7; font-size: .8rem; line-height: 1.4; }
.store-offers { display: grid; gap: 8px; }
.store-offer { display: grid; grid-template-columns: 46px minmax(0,1fr) auto; grid-template-rows: auto auto; align-items: center; gap: 2px 10px; padding: 9px; border-radius: 12px; background: rgba(255,255,255,.045); border: 1px solid rgba(255,255,255,.1); }
.offer-art { grid-row: 1 / 3; display: grid; place-items: center; width: 44px; aspect-ratio: 1; border-radius: 10px; font-size: 22px; background: linear-gradient(145deg,#44bdd3,#175b88); }
.offer-deck { background: linear-gradient(145deg,#b567d8,#583b91); }
.offer-reaction { background: linear-gradient(145deg,#eb9f40,#c94c55); }
.store-offer b { font-size: .8rem; }
.store-offer small { color: #c9d8e5; font-size: .68rem; line-height: 1.25; }
.store-offer button { grid-column: 3; grid-row: 1 / 3; border: 1px solid rgba(255,255,255,.15); border-radius: 9px; padding: 7px 8px; background: rgba(255,255,255,.08); color: #d5e1ec; font-size: .67rem; font-weight: 800; }
.store-note { margin: 0; padding: 10px 12px; border-radius: 10px; background: rgba(237,168,55,.1); color: #f5d89a; font-size: .74rem; line-height: 1.45; }
.gem-banner { min-height: 150px; display: grid; place-content: center; justify-items: center; gap: 8px; border-radius: 16px; background: radial-gradient(circle at 50% 30%,#28668d,#172848 72%); border: 1px solid rgba(128,213,243,.35); }
.gem-banner span { font-size: 48px; }
.gem-banner small { color: #d1dcea; }
@media (max-width: 430px) {
  .store-offer { grid-template-columns: 40px minmax(0,1fr); }
  .offer-art { width: 38px; }
  .store-offer button { grid-column: 2; grid-row: 3; justify-self: start; margin-top: 4px; }
  .store-wallet { font-size: .7rem; }
  .stat-tabs { gap: 2px; }
  .stat-tab { font-size: .65rem; }
}

/* Card-led rules guide and the live coin/gem wallet. */
.help-body { gap: 8px; padding-right: 3px; }
.help-row { grid-template-columns: 88px minmax(0, 1fr); align-items: center; gap: 12px; min-height: 76px; padding: 10px 12px; border-color: rgba(255,255,255,.11); background: linear-gradient(110deg,rgba(255,255,255,.075),rgba(255,255,255,.025)); }
.help-cards { min-height: 54px; display: flex; align-items: center; justify-content: center; font-size: 2rem; }
.help-cards img { width: 35px; height: 51px; object-fit: contain; filter: drop-shadow(0 3px 3px rgba(0,0,0,.38)); transform: rotate(-7deg); }
.help-cards img + img { margin-left: -16px; transform: rotate(7deg) translateY(2px); }
.help-cards img:nth-child(3) { transform: rotate(13deg) translateY(-1px); }
.help-copy { display: grid; gap: 4px; min-width: 0; }
.help-copy b { font-size: .91rem; line-height: 1.15; color: #fff; }
.help-copy span { color: #c7d4ce; font-size: .77rem; line-height: 1.35; }
.wallet-skin .gem i { background: radial-gradient(circle at 34% 25%,#efffff,#53d5dc 45%,#3871cb 78%); font-style: normal; }
.wallet-skin .coin i { background: radial-gradient(circle at 34% 25%,#fff3b0,#ffc432 54%,#b96617); font-style: normal; }
.store-tabs { grid-template-columns: repeat(4,minmax(0,1fr)); }
.store-wallet span { display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.store-wallet span:last-child b { color: #8ee8ef; }
.store-offer.offer-featured { position: relative; padding-top: 17px; }
.store-offer.offer-featured em { position: absolute; top: 4px; right: 8px; color: #ffe18a; font-style: normal; font-size: .56rem; letter-spacing: .04em; font-weight: 900; }
.store-offer.offer-featured button { grid-column: 2 / 4; grid-row: 3; justify-self: end; max-width: 100%; }
.convert-label { color: #d5e3ef; font-size: .76rem; font-weight: 800; }
.convert-row { display: grid; grid-template-columns: minmax(58px,.6fr) minmax(0,1fr) auto; align-items: center; gap: 8px; }
.convert-row input { width: 100%; min-width: 0; padding: 10px; border: 1px solid rgba(131,201,235,.38); border-radius: 9px; background: rgba(3,14,26,.65); color: white; font: inherit; font-weight: 800; }
.convert-rate { display: flex; align-items: center; justify-content: center; gap: 5px; color: #d9edf5; font-size: .76rem; white-space: nowrap; }
.convert-rate b { color: #ffd76a; }
.convert-button { min-height: 38px; padding: 7px 12px; border: 0; border-radius: 9px; background: linear-gradient(180deg,#74e0cf,#28a88e); color: #092b29; font-size: .75rem; font-weight: 900; box-shadow: 0 3px 0 #16755f; }
.convert-button:disabled { opacity: .6; }
.wallet-history-head { display: flex; align-items: center; justify-content: space-between; color: #f3f8f5; }
.wallet-refresh { width: 34px; height: 34px; border: 1px solid rgba(255,255,255,.15); border-radius: 9px; background: rgba(255,255,255,.07); color: #fff; font-size: 1.25rem; }
.wallet-history { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.wallet-entry { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 10px; border: 1px solid rgba(255,255,255,.09); border-radius: 10px; background: rgba(255,255,255,.045); }
.wallet-entry > span { display: grid; gap: 3px; min-width: 0; }
.wallet-entry b { font-size: .76rem; }
.wallet-entry small { color: #aebfc7; font-size: .65rem; }
.wallet-entry strong { flex: none; color: #8ee8bd; font-size: .75rem; }
.wallet-entry.debit strong { color: #ff8f91; }
.wallet-history-empty { padding: 20px 10px; color: #c5d3dc; text-align: center; font-size: .8rem; }
@media (max-width: 430px) {
  .help-row { grid-template-columns: 62px minmax(0,1fr); gap: 8px; padding: 9px; }
  .help-cards img { width: 29px; height: 44px; }
  .help-cards img + img { margin-left: -14px; }
  .help-copy b { font-size: .83rem; }
  .help-copy span { font-size: .71rem; }
  .convert-row { grid-template-columns: 56px minmax(0,1fr); }
  .convert-rate { justify-content: flex-start; }
  .convert-button { grid-column: 1 / 3; }
}

.match-box { position: relative; width: min(440px, 100%); gap: 12px; padding: 24px; text-align: left; border-color: rgba(255,225,125,.34); background: linear-gradient(160deg,#182e3b,#101a1d 72%); }
.match-close { position: absolute; top: 12px; right: 12px; }
.match-icon { display: grid; place-items: center; width: 50px; height: 50px; border: 1px solid rgba(255,255,255,.48); border-radius: 14px; background: linear-gradient(145deg,#ffdc68,#ec8c24); font-size: 27px; box-shadow: 0 4px 0 #975324; }
.match-box h2 { margin: 2px 0 0; font-size: 1.35rem; }
.match-subtitle { margin: 0; color: #cad8dd; font-size: .84rem; line-height: 1.4; }
.match-count-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; }
.match-count { display: grid; place-items: center; gap: 1px; min-height: 58px; border: 1px solid rgba(255,255,255,.14); border-radius: 10px; background: rgba(255,255,255,.06); color: #eff7fb; }
.match-count b { font-size: 1.15rem; line-height: 1; }
.match-count small { color: #bfd0d5; font-size: .62rem; }
.match-count.on { border-color: #ffe27a; background: linear-gradient(160deg,#ffe890,#edae2c); color: #3b2607; box-shadow: 0 3px 0 #9a5e15,0 0 16px rgba(255,213,83,.25); }
.match-count.on small { color: #64420e; }
.match-footer { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-radius: 10px; background: rgba(2,10,15,.38); color: #d9e8eb; }
.match-footer b { color: #ffe27a; font-size: 1.1rem; }
.match-confirm { min-height: 48px; background: linear-gradient(180deg,#ffdb55,#f2a700); color: #382300; box-shadow: 0 4px 0 #a45e09,0 9px 20px rgba(242,167,0,.23); font-weight: 950; }
.match-confirm:disabled { opacity: .65; }
.match-status { display: flex; align-items: center; justify-content: center; gap: 8px; align-self: center; width: fit-content; max-width: 100%; padding: 7px 14px; border: 1px solid rgba(255,226,122,.45); border-radius: 999px; background: linear-gradient(100deg,rgba(13,47,70,.94),rgba(20,74,83,.94)); color: #f8f4df; box-shadow: 0 4px 14px rgba(0,0,0,.3); font-size: .78rem; font-weight: 850; }
.match-pulse { width: 9px; height: 9px; flex: none; border-radius: 50%; background: #70f0ad; box-shadow: 0 0 0 4px rgba(112,240,173,.16),0 0 12px #70f0ad; animation: matchPulse 1.2s ease-in-out infinite; }
@keyframes matchPulse { 50% { opacity: .45; transform: scale(.78); } }

/* Signature raised island table with matching variants for larger quick-match seats. */
#game .table-rim {
  --stone-hi: #d6bd8b;
  --stone-mid: #a88a5d;
  --stone-low: #68472b;
  padding: 13px;
  background: linear-gradient(180deg,rgba(255,255,255,.34),transparent 15%),repeating-conic-gradient(from 0deg,var(--stone-hi) 0 5.3deg,var(--stone-mid) 5.3deg 5.9deg,#80603e 5.9deg 11deg),linear-gradient(145deg,#a77b48,#56381f);
  box-shadow: 0 0 0 4px #51351f,0 13px 0 #765034,0 18px 0 #4a311f,0 30px 44px rgba(0,0,0,.5),inset 0 3px 0 rgba(255,255,255,.52);
}
#game .felt {
  border: 10px solid transparent;
  background: url("img/felt-noise.svg") padding-box,radial-gradient(ellipse 58% 54% at 50% 42%,rgba(235,255,166,.86),rgba(175,227,103,.88) 52%,rgba(91,173,63,.96) 100%) padding-box,linear-gradient(180deg,#d8d0a6,#876847) border-box;
  box-shadow: inset 0 14px 26px rgba(14,49,21,.25),inset 0 -12px 22px rgba(31,61,23,.22),0 0 0 1px rgba(255,255,255,.2);
}
#game .felt::before { border-color: rgba(244,255,199,.52); box-shadow: 0 0 0 11px rgba(235,255,195,.13),0 0 26px rgba(195,244,132,.18); }
#game .felt::after { border-color: rgba(238,255,197,.42); }
#game[data-player-count="3"] .table-rim { --stone-hi:#d7c28d;--stone-mid:#ac8b58;--stone-low:#63442b; }
#game[data-player-count="4"] .table-rim { --stone-hi:#e2ca91;--stone-mid:#b18c56;--stone-low:#68452a; }
#game[data-player-count="5"] .table-rim { --stone-hi:#9dd3cb;--stone-mid:#548f83;--stone-low:#254c44; }
#game[data-player-count="5"] .felt { background: url("img/felt-noise.svg") padding-box,radial-gradient(ellipse at 50% 42%,#a9ead0,#4cba91 55%,#1f705d 100%) padding-box,linear-gradient(180deg,#b6d2be,#476f65) border-box; }
#game[data-player-count="6"] .table-rim { --stone-hi:#edbf75;--stone-mid:#b9753d;--stone-low:#67361e; }
#game[data-player-count="6"] .felt { background: url("img/felt-noise.svg") padding-box,radial-gradient(ellipse at 50% 42%,#c9df8b,#80b755 56%,#416f3b 100%) padding-box,linear-gradient(180deg,#d7b273,#78513a) border-box; }
#game[data-player-count="7"] .table-rim,#game[data-player-count="8"] .table-rim { --stone-hi:#b8a8db;--stone-mid:#716393;--stone-low:#382c5b; }
#game[data-player-count="7"] .felt,#game[data-player-count="8"] .felt { background: url("img/felt-noise.svg") padding-box,radial-gradient(ellipse at 50% 42%,#b9d5c0,#5e9c82 56%,#294c53 100%) padding-box,linear-gradient(180deg,#9e91bd,#54456c) border-box; }
#game[data-player-count="3"] { background-image: linear-gradient(180deg,rgba(14,52,90,.1),rgba(7,34,47,.2)),url("img/bg-table-3d.jpg"); }
#game[data-player-count="4"] { background-image: linear-gradient(180deg,rgba(25,97,133,.08),rgba(17,53,56,.2)),url("img/bg-home-3d.jpg"); }
#game[data-player-count="5"] { background-image: linear-gradient(180deg,rgba(19,70,83,.22),rgba(11,51,50,.28)),url("img/bg-home.jpg"); }
#game[data-player-count="6"] { background-image: linear-gradient(180deg,rgba(31,17,65,.16),rgba(14,15,37,.3)),url("img/bg-friends-3d.jpg"); }
#game[data-player-count="7"],#game[data-player-count="8"] { background-image: linear-gradient(180deg,rgba(20,23,77,.36),rgba(9,31,53,.42)),url("img/bg-table-3d.jpg"); }
#game[data-table-mode="wild"] .table-rim { filter: saturate(1.15) drop-shadow(0 0 10px rgba(246,209,90,.22)); }
#game .dir-ring { opacity: .98; filter: drop-shadow(0 2px 2px rgba(8,28,29,.8)) drop-shadow(0 0 8px var(--dir-color,#ffc83d)); }
#game .color-aura { opacity: .43; mix-blend-mode: screen; }
#game .floor-logo { display: block; font-size: clamp(24px,4.4vw,58px); opacity: .15; letter-spacing: .04em; padding: 0; }
@media (max-width: 430px) {
  .match-box { padding: 20px 16px; }
  .match-count-grid { gap: 6px; }
  .match-count { min-height: 52px; }
  .match-status { border-radius: 12px; text-align: center; font-size: .69rem; }
}

/* Range controls must size to the space between their labels, not overflow it. */
.volume-row { width: 100%; min-width: 0; }
.volume-row input[type="range"] {
  appearance: none; -webkit-appearance: none; flex: 1 1 0; width: auto; min-width: 0; height: 32px;
  padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; cursor: pointer; touch-action: pan-y;
}
.volume-row input[type="range"]::-webkit-slider-runnable-track {
  height: 7px; border-radius: 999px;
  background: linear-gradient(90deg,#ffda55,#f39d30) 0 0 / var(--volume-fill, 60%) 100% no-repeat, #46525d;
  box-shadow: inset 0 1px 2px rgba(0,0,0,.55);
}
.volume-row input[type="range"]::-webkit-slider-thumb {
  appearance: none; -webkit-appearance: none; width: 21px; height: 21px; margin-top: -7px; border: 2px solid #fff1b5;
  border-radius: 50%; background: #ffc83d; box-shadow: 0 2px 5px rgba(0,0,0,.55);
}
.volume-row input[type="range"]::-moz-range-track {
  height: 7px; border-radius: 999px;
  background: linear-gradient(90deg,#ffda55,#f39d30) 0 0 / var(--volume-fill, 60%) 100% no-repeat, #46525d;
  box-shadow: inset 0 1px 2px rgba(0,0,0,.55);
}
.volume-row input[type="range"]::-moz-range-thumb { width: 17px; height: 17px; border: 2px solid #fff1b5; border-radius: 50%; background: #ffc83d; box-shadow: 0 2px 5px rgba(0,0,0,.55); }
.volume-row input[type="range"]:focus-visible { outline: 2px solid #8de0f2; outline-offset: 3px; border-radius: 999px; }

/* The match itself is landscape-only, including when someone opens the web URL upright. */
.rotate-notice { display: none; }
@media (orientation: portrait) {
  .screen.game:not(.hidden) .rotate-notice {
    position: fixed; inset: 0; z-index: 100; display: grid; align-content: center; justify-items: center; gap: 14px;
    padding: 28px max(24px, env(safe-area-inset-right)) 28px max(24px, env(safe-area-inset-left));
    background: radial-gradient(ellipse at 50% 34%,#22526b,#101d30 68%,#0a121b); text-align: center; color: #f7fbff;
  }
  .rotate-phone { position: relative; width: 74px; height: 112px; margin: 0 0 12px; border: 4px solid #b8e9f3; border-radius: 17px; rotate: 90deg; box-shadow: 0 0 0 8px rgba(83,190,218,.12),0 0 30px rgba(83,190,218,.24); }
  .rotate-phone::before { content: ''; position: absolute; left: 50%; bottom: 6px; width: 18px; height: 3px; translate: -50% 0; border-radius: 3px; background: #b8e9f3; }
  .rotate-notice strong { font-size: clamp(1.25rem,5vw,1.7rem); }
  .rotate-notice > span:last-child { max-width: 290px; color: #c7d9e5; line-height: 1.5; }
}

/* Controls stay readable on the bright scenery: solid round buttons with a light rim. */
.roombar { background: linear-gradient(90deg, transparent, rgba(8, 20, 40, 0.38) 45%); }
.roombar .btn {
  color: #fff; border: 2px solid rgba(255, 255, 255, 0.8);
  background: radial-gradient(circle at 35% 30%, rgba(52, 92, 150, 0.97), rgba(12, 28, 60, 0.97));
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.45), 0 4px 10px rgba(0, 0, 0, 0.4);
}
.roombar .btn:active { translate: 0 2px; box-shadow: 0 1px 0 rgba(0, 0, 0, 0.45); }
.roombar .btn.live { background: linear-gradient(180deg, #ff6b6b, #d63a3a); }
.roombar .btn.warn { background: linear-gradient(180deg, #ff9a4d, #e5531a); }
.game-bar #menuBtn {
  color: #fff; border: 2px solid rgba(255, 255, 255, 0.8); background: radial-gradient(circle at 35% 30%, rgba(52, 92, 150, 0.97), rgba(12, 28, 60, 0.97));
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.45), 0 4px 10px rgba(0, 0, 0, 0.4);
}
/* A drawn coin (the 🪙 emoji is missing on Android 10 and older). */
.pill.coin i.coin-face, .coin-face {
  color: #a86b00; font-style: normal; font-weight: 900; text-shadow: 0 1px 0 rgba(255, 243, 176, 0.9);
  box-shadow: inset 0 0 0 0.12em #e0a100, 0 0.08em 0.2em rgba(0, 0, 0, 0.45);
}
.coin-face.inline {
  display: inline-grid; place-items: center; width: 1.25em; height: 1.25em; border-radius: 50%; font-size: 0.9em; vertical-align: -0.2em;
  background: radial-gradient(circle at 35% 30%, #fff3b0, #ffc83d 60%, #b8860b);
}
/* LIVE tab: a real icon instead of a tiny dot */
.live-icon { font-size: calc(var(--cqw) * 2.7); line-height: 1; filter: drop-shadow(0 calc(var(--cqw) * 0.15) 0 rgba(0, 0, 0, 0.45)); animation: iconBob 2.2s ease-in-out infinite; }
@media (orientation: portrait) and (max-width: 800px) { .home-scene #liveBtn .live-icon { font-size: 18px; } }
/* Rule tiles drawn as a small fan of cards */
.tile-art.fan { position: relative; }
.tile-art.fan img { position: absolute; left: 22%; top: 4%; width: 56%; height: 92%; object-fit: contain; transform-origin: 50% 95%; rotate: var(--r, 0deg); filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.45)); }


/* ============================================================
   OLDER ANDROID WEBVIEWS
   1cqw (1% of the scene width) is a variable so it works without container queries (Chrome 105+).
   Layout that uses the standalone translate property (Chrome 104+) gets a transform fallback.
   ============================================================ */
:root { --cqw: 1vw; }
.scene-box { --cqw: calc(max(100vw, 100vh * 2.2336) / 100); }
@media (orientation: portrait) { .scene-box { --cqw: 1vw; } }
@supports not (translate: 0) {
  .scene-box { transform: translate(-50%, -50%); }
  .live-tag { transform: translateX(-50%); }
  .twinkle { transform: translate(-50%, -50%); }
  .floor-logo { transform: translate(-50%, -50%) perspective(420px) rotateX(40deg); }
  .rotate-phone::before { transform: translateX(-50%); }
  @media (orientation: portrait) {
    .scene-box { transform: none; }
  }
  @media (orientation: portrait) and (max-width: 800px) {
    .home-scene #liveBtn .live-tag { transform: none; }
  }
}

/* iPhone: in landscape the notch and rounded corners sit at the screen sides, so the home and
   Play with Friends scenes stay inside the safe area (the blurred backdrop fills the rest). */
html.ios .scene-box {
  --safe-w: calc(100vw - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px));
  width: min(var(--safe-w), calc(100vh * 2.2336));
  left: calc(50% + (env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)) / 2);
  --cqw: calc(min(var(--safe-w), 100vh * 2.2336) / 100);
}
@media (orientation: portrait) { html.ios .scene-box { left: 50%; width: 100vw; --cqw: 1vw; } }

/* ---------- DEV badge: the test server and the UNO PLAY DEV app (never on the live game) ---------- */
html.dev-server body::after {
  content: 'DEV';
  position: fixed; z-index: 9999; top: 6px; left: 50%; transform: translateX(-50%);
  padding: 2px 10px; border-radius: 999px; pointer-events: none;
  font: 900 11px/1.4 system-ui, sans-serif; letter-spacing: .18em; color: #1b0d00;
  background: linear-gradient(180deg, #ffe36b, #ff9f1a); box-shadow: 0 2px 8px rgba(0, 0, 0, .45);
}
