﻿@charset "UTF-8";

/* =========================================
   馃殌 璺戝緱蹇?路 MIDNIGHT GOLD 濂㈠崕楂樺畾鐗?   - Core Layout: Clean Absolute & Flex
   - Style: Ultra-Premium Glass & Gold
========================================= */

/* 1. RESET & VARIABLES */
:root {
  --bg-dark: #05080c; /* 娣遍們榛戣€€鐭?*/
  --bg-table: #071610; /* 楂樼骇鏆楅噾涓濈粧缁?*/
  --bg-table-glow: #0e2b1d;
  --gold: #d4af37;
  --gold-primary: #d4af37;
  --gold-light: #f9df9f;
  --gold-glow: rgba(212, 175, 55, 0.4);
  --gold-gradient: linear-gradient(135deg, #fbe096 0%, #d4af37 50%, #8b6508 100%);
  --glass-bg: rgba(14, 20, 26, 0.65);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-shadow: 0 24px 48px rgba(0, 0, 0, 0.6), inset 0 1px 1px rgba(255, 255, 255, 0.08);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --transition: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Sora', 'PingFang SC', 'Noto Sans SC', sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-main);
  overflow: hidden;
}

/* 2. DYNAMIC BACKGROUND */
@keyframes ambientGlow {
  0% { transform: scale(1); opacity: 0.7; filter: hue-rotate(0); }
  50% { transform: scale(1.05); opacity: 0.9; filter: hue-rotate(-2deg); }
  100% { transform: scale(1); opacity: 0.7; filter: hue-rotate(0); }
}
#game-container {
  display: grid;
  grid-template-columns: minmax(10px, 1fr) auto minmax(10px, 1fr);
  grid-template-rows: auto minmax(50px, auto) 1fr auto; 
  /* topbar, p-top, center, p-bot */
  grid-template-areas:
    "header header header"
    ". p-top ."
    ". p-center p-right"
    "p-bottom p-bottom p-bottom";
  width: 100vw; height: 100dvh; position: relative;
  background: radial-gradient(circle at 50% 45%, var(--bg-table-glow) 0%, var(--bg-table) 60%, var(--bg-dark) 100%);
}
#game-container::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle at top right, rgba(212,175,55,0.06), transparent 60%),
              radial-gradient(circle at bottom left, rgba(14,43,29,0.3), transparent 60%);
  animation: ambientGlow 15s infinite alternate ease-in-out; z-index: 0;
}

/* 3. STRUCTURAL LAYOUT */
#top-bar { position: absolute; top: 24px; left: 32px; right: 32px; z-index: 30; display: flex; justify-content: space-between; align-items: center; }
.room-debug-strip { position: absolute; top: 80px; left: 32px; right: 32px; z-index: 28; padding: 10px 14px; display: none; flex-direction: column; gap: 8px; }
.room-debug-line { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.room-debug-line span {
  font-size: 11px; line-height: 1.4; color: rgba(255,255,255,0.7);
  padding: 4px 10px; border-radius: 999px;
  background: rgba(255,255,255,0.03); border: 1px solid var(--glass-border);
}
#btn-room-resync { margin-left: auto; }
#player-top { position: absolute; top: 120px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 14px; z-index: 12; }
#player-right { position: absolute; right: 40px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: row-reverse; gap: 18px; align-items: center; z-index: 12; }
#play-area { position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; z-index: 18; width: min(840px, calc(100vw - 320px)); min-height: 260px; pointer-events: none; }
#play-area > * { pointer-events: auto; }
#player-bottom { position: absolute; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 14px; z-index: 15; width: min(1040px, calc(100vw - 48px)); }

/* 4. HIDE OLD CLUTTER & UNUSED */
.dock-copy, .stage-kicker, .ambient-light { display: none !important; }

/* 5. TOP BAR & BRANDING */
.brand { display: flex; align-items: center; gap: 12px; }
.brand-icon { font-size: 26px; color: var(--gold-primary); text-shadow: 0 0 15px var(--gold-glow); }
#game-title { font-size: 22px; font-weight: 800; letter-spacing: 1px; background: var(--gold-gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent;}
.pro-badge { font-size: 10px; padding: 3px 8px; background: var(--gold-gradient); color: #000; border-radius: 6px; font-weight: 900; box-shadow: 0 2px 8px var(--gold-glow); margin-left: 6px; vertical-align: middle; }
.brand-cluster { display: flex; align-items: center; gap: 14px; }
.top-actions { display: flex; gap: 12px; margin-left: auto; }
.room-pill-group { display: none !important; }
.room-pill { font-size: 12px; border: 1px solid var(--glass-border); border-radius: 12px; padding: 4px 10px; background: rgba(0,0,0,0.4); }
#btn-settings { min-width: 140px; }

/* 6. AESTHETICS: BUTTONS & PANELS (GLASSMORPHISM) */
.glass-panel, .settings-card, .glass-modal {
  background: var(--glass-bg);
  backdrop-filter: blur(40px); -webkit-backdrop-filter: blur(40px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  border-radius: 20px;
}
.btn {
  height: 48px; padding: 0 28px; border-radius: 24px; border: none; font-weight: 800;
  font-family: inherit; font-size: 15px; cursor: pointer; transition: var(--transition);
  display: flex; align-items: center; justify-content: center; color: #fff; letter-spacing: 0.5px;
  user-select: none; -webkit-user-select: none;
}
.btn-compact { height: 38px; padding: 0 20px; font-size: 13px; }
.btn-primary { background: var(--gold-gradient); color: #000; box-shadow: 0 6px 20px var(--gold-glow), inset 0 -2px 5px rgba(0,0,0,0.1), inset 0 2px 5px rgba(255,255,255,0.4); }
.btn-primary:active { transform: scale(0.96) translateY(2px); box-shadow: 0 2px 10px var(--gold-glow); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 25px var(--gold-glow); filter: brightness(1.1); }
.btn-secondary { background: rgba(14, 20, 26, 0.8); border: 1px solid rgba(255,255,255,0.15); box-shadow: 0 4px 12px rgba(0,0,0,0.5), inset 0 1px 1px rgba(255,255,255,0.05); }
.btn-secondary:hover { background: rgba(255,255,255,0.1); border-color: var(--gold-primary); color: var(--gold-light); transform: translateY(-2px); }
.btn-outline { background: transparent; border: 1px solid rgba(255,255,255,0.2); color: #fff; }

/* 7. PLAYER PROFILES */
.player-profile { display: flex; align-items: center; gap: 14px; padding: 8px 24px 8px 8px; border-radius: 50px; background: linear-gradient(90deg, rgba(14,20,26,0.8), transparent); border: 1px solid var(--glass-border); box-shadow: 0 8px 24px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.05); position: relative; z-index: 10; }
.my-profile { padding: 10px 32px 10px 10px; border-radius: 60px; margin-top: 16px; background: var(--glass-bg); }
.avatar-ring { width: 56px; height: 56px; border-radius: 50%; padding: 3px; position: relative; background: linear-gradient(135deg, #334, #111); box-shadow: inset 0 2px 4px rgba(0,0,0,0.8), 0 0 0 1px rgba(255,255,255,0.1); }
.my-profile .avatar-ring { width: 68px; height: 68px; }
.player-area.active .avatar-ring { background: var(--gold-gradient); box-shadow: 0 0 25px var(--gold-glow), 0 0 0 2px rgba(255,255,255,0.5); animation: goldPulse 2s infinite alternate; }
@keyframes goldPulse { 0% { filter: brightness(1); } 100% { filter: brightness(1.3); } }
.avatar { width: 100%; height: 100%; background: #0a0a0a; border-radius: 50%; display: flex; justify-content: center; align-items: center; font-weight: 900; font-size: 20px; color: var(--gold-light); box-shadow: inset 0 0 10px rgba(0,0,0,0.8); border: 1px solid rgba(255,255,255,0.05); }
.profile-info { display: flex; flex-direction: column; }
.player-name { font-size: 15px; font-weight: 800; color: #fff; letter-spacing: 0.5px; }
.player-tag { font-size: 11px; color: #e8c973; margin-top: 4px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px;}
.score-badge { font-size: 15px; font-weight: 900; color: #4ade80; margin-top: 4px; font-family: monospace; }
.card-count-badge { position: absolute; right: -6px; top: -6px; width: 26px; height: 26px; border-radius: 50%; background: var(--gold-gradient); color: #000; font-size: 13px; font-weight: 900; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 12px rgba(0,0,0,0.6); }
.timer-ring-container { position: absolute; inset: -3px; border-radius: 50%; z-index: -1; background: conic-gradient(from 0deg, var(--gold-primary) 0%, transparent 0%); }

/* 8. CARDS & DECK */
/* 8. CARDS & DECK */
.player-cards { display: flex; justify-content: center; position: relative; align-items: flex-end; }
#player-bottom .player-cards { min-height: 140px; width: 100%; justify-content: center; }
.vertical-cards { flex-direction: column; align-items: center; }
.card {
  width: 86px; height: 122px; border-radius: 10px; background: #fff;
  box-shadow: -8px 8px 20px rgba(0,0,0,0.6), inset 1px 1px 0 rgba(255,255,255,1), inset -1px -1px 4px rgba(0,0,0,0.1);
  margin-left: -54px; cursor: pointer; transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.2), box-shadow 0.4s;
  position: relative; z-index: 1; border: 1px solid rgba(200,200,200,0.5); flex-shrink: 0;
  display: flex; flex-direction: column; align-items: center;
  user-select: none; -webkit-user-select: none;
}
.card:first-child { margin-left: 0; }
.card-value { position: absolute; top: 8px; left: 6px; width: 30px; display: flex; flex-direction: column; align-items: center; line-height: 0.9; }
.card-rank { font-size: 26px; font-weight: 900; letter-spacing: -1.5px; font-family: "Georgia", serif; }
.card-suit { font-size: 16px; margin-top: 2px; }
.card.red { color: #d91c2b; }
.card.black { color: #1a1a1a; }
.card-center-suit { flex: 1; display: flex; align-items: center; justify-content: center; font-size: 34px; opacity: 0.8; margin-top: 10px; } 
.card:hover { transform: translateY(-20px) scale(1.06); box-shadow: -12px 20px 30px rgba(0,0,0,0.7); z-index: 10; }
.card.selected { transform: translateY(-34px) scale(1.06); box-shadow: 0 12px 40px rgba(0,0,0,0.8), 0 0 0 2px var(--gold-primary); z-index: 20; }
.card.selected + .card:not(.selected) { margin-left: 0; }

.card-back {
  width: 54px; height: 76px; border-radius: 8px; margin-left: -34px; position: relative; flex-shrink: 0; background: #111;
  background-image: repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(255,255,255,0.03) 10px, rgba(255,255,255,0.03) 20px);
  box-shadow: -4px 4px 12px rgba(0,0,0,0.6), inset 0 0 0 1px rgba(255,255,255,0.1);
  user-select: none; -webkit-user-select: none;
}
.card-back::before { content: ''; position: absolute; inset: 5px; border: 1px solid rgba(255,255,255,0.15); border-radius: 4px; background: radial-gradient(circle at center, rgba(212,175,55,0.1), transparent); }
.card-back:first-child { margin-left: 0; }
.vertical-cards .card-back { width: 44px; height: 16px; margin-left: 0; margin-top: -10px; background-image: none; background: #182025; border-radius: 4px; }
.vertical-cards .card-back:first-child { margin-top: 0; }
.vertical-cards .card-back::before { display: none; }

/* 9. PLAY AREA (THE CENTER) */
.played-cards-container { display: flex; justify-content: center; align-items: center; min-height: 122px; padding: 10px 0; }
.played-cards-container .card { cursor: default; transform: scale(0.9) translateY(0); margin-left: -50px; }
.played-cards-container .card:first-child { margin-left: 0; }
.played-cards-container .card:hover { transform: scale(0.9); box-shadow: -8px 8px 20px rgba(0,0,0,0.6); }
.played-cards-container .card.selected { transform: scale(0.9) translateY(0); box-shadow: -8px 8px 20px rgba(0,0,0,0.6); margin-left: -50px; border-color: rgba(255,255,255,0.9); }
.played-cards-container .card.selected:first-child { margin-left: 0; }
.played-cards-container .card.selected + .card:not(.selected) { margin-left: -50px; }

#turn-indicator { font-size: 15px; font-weight: 800; color: #000; background: var(--gold-gradient); padding: 8px 32px; border-radius: 20px; box-shadow: 0 4px 20px var(--gold-glow); margin-bottom: 8px; animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.2); letter-spacing: 1px; }
@keyframes popIn { from{opacity:0;transform:scale(0.8);} to{opacity:1;transform:scale(1);} }

#game-status { font-size: 15px; font-weight: 700; color: var(--text-main); background: rgba(0,0,0,0.6); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); padding: 10px 32px; border-radius: 24px; border: 1px solid var(--glass-border); box-shadow: 0 8px 24px rgba(0,0,0,0.5); margin-top: 4px; text-align: center; letter-spacing: 0.5px; }
.play-info-tag { font-size: 14px; font-weight: 700; color: #fff; background: linear-gradient(135deg, rgba(20,30,25,0.8), rgba(10,15,12,0.8)); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); padding: 8px 28px; border-radius: 20px; margin-top: 8px; border: 1px solid var(--glass-border); box-shadow: 0 8px 24px rgba(0,0,0,0.6); }

.lobby-hero { width: min(600px, calc(100vw - 48px)); padding: 40px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 20px; }
.lobby-hero-kicker { font-size: 13px; letter-spacing: 0.2em; color: var(--gold-primary); text-transform: uppercase; font-weight: 800; }
.lobby-hero-title { font-size: clamp(28px, 3.5vw, 42px); line-height: 1.2; font-weight: 900; background: var(--gold-gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent;}
.lobby-hero-text { font-size: 15px; line-height: 1.8; color: var(--text-muted); max-width: 460px; font-weight: 500;}
.lobby-hero-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; width: 100%; }
.lobby-hero-actions .btn { min-width: 156px; }

.room-invite-strip { width: min(700px, calc(100vw - 48px)); padding: 20px 24px; display: none; align-items: center; justify-content: space-between; gap: 16px; background: rgba(14, 20, 26, 0.4); border: 1px solid var(--glass-border); border-radius: 20px; box-shadow: 0 8px 32px rgba(0,0,0,0.5); }
.room-invite-copy { display: flex; flex-direction: column; gap: 6px; text-align: left; }
.room-invite-kicker { font-size: 12px; color: var(--gold-primary); letter-spacing: 0.08em; font-weight: 700; }
.room-invite-title { font-size: 18px; font-weight: 800; }
.room-invite-title strong { color: var(--gold-primary); }
.room-invite-text { font-size: 13px; line-height: 1.5; color: rgba(255,255,255,0.75); }
.room-invite-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.seat-invite-anchor { position: absolute; left: 50%; transform: translateX(-50%); top: calc(100% + 12px); z-index: 14; }
#player-right .seat-invite-anchor { top: calc(100% + 10px); }
.seat-invite-button { white-space: nowrap; background: rgba(14, 20, 26, 0.8); border-color: rgba(212,175,55,0.4); color: var(--gold-light); box-shadow: 0 4px 12px rgba(0,0,0,0.5); }
.seat-invite-button:hover { background: rgba(212,175,55,0.15); border-color: var(--gold-primary); }

/* 10. CONTROL PANEL (BOTTOM BUTTONS) */
.control-panel { display: flex; justify-content: center; gap: 16px; min-height: 48px; margin-bottom: 2px; flex-wrap: wrap; }
.chat-dock { width: min(720px, 92vw); margin: 0 auto 10px; display: flex; flex-direction: column; gap: 8px; }
.chat-quick-row { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.chat-chip { border: 1px solid rgba(255,255,255,0.1); background: rgba(255,255,255,0.05); color: rgba(255,255,255,0.85); border-radius: 999px; padding: 6px 14px; font-size: 13px; font-weight: 500; cursor: pointer; transition: all 0.2s ease; backdrop-filter: blur(10px); }
.chat-chip:hover { background: rgba(255,255,255,0.15); color: #fff; border-color: rgba(255,255,255,0.3); }
.chat-feed { min-height: 56px; max-height: 92px; overflow: auto; border-radius: 16px; background: rgba(10, 15, 20, 0.4); border: 1px solid rgba(255,255,255,0.06); padding: 10px 14px; display: flex; flex-direction: column; gap: 6px; }
.chat-line { font-size: 13px; line-height: 1.45; color: rgba(255,255,255,0.8); }
.chat-line strong { color: var(--gold-light); margin-right: 6px; }
/* 11. TOASTS & ANIMATIONS */
.action-toast { position: absolute; font-size: 28px; font-weight: 900; color: #fff; text-shadow: 0 4px 20px rgba(0,0,0,0.9), 0 0 30px var(--gold-glow); letter-spacing: 3px; opacity: 0; pointer-events: none; z-index: 100; top: 50%; left: 50%; transform: translate(-50%, -50%); background: linear-gradient(to bottom, #f8fafc, #d4af37); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
#player-top .action-toast { top: 110%; }
#player-right .action-toast { right: 110%; left: auto; }
#player-bottom .action-toast { top: -20px; left: 50%; }

.play-animation { animation: cardPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; }
@keyframes cardPop { from { opacity:0; transform: scale(1.2) translateY(-20px); } to { opacity:1; transform: scale(0.9) translateY(0); } }

.bomb-shake { animation: shake 0.6s cubic-bezier(.36,.07,.19,.97) both; }
@keyframes shake { 0%,100%{transform:translateX(0);} 15%,45%,75%{transform:translateX(-6px);} 30%,60%{transform:translateX(6px);} }
.bomb-flash { position: fixed; inset: 0; background: var(--gold-light); mix-blend-mode: overlay; opacity: 0; z-index: 9999; pointer-events: none; animation: flash 0.8s ease-out forwards; }
@keyframes flash { 0%{opacity:0;} 15%{opacity:0.3;} 100%{opacity:0;} }

.report-single-toast { position: fixed; top: 30%; left: 50%; transform: translateX(-50%); background: #d91c2b; color:#fff; font-weight:800; padding:12px 40px; border-radius:30px; letter-spacing:2px; box-shadow:0 10px 40px rgba(217,28,43,0.6), inset 0 2px 5px rgba(255,255,255,0.4); z-index: 900; animation: popIn 0.3s ease; }

.deal-overlay { position: absolute; inset: 0; pointer-events: none; z-index: 60; overflow: hidden; }
.deal-card-ghost { position: absolute; width: 56px; height: 80px; border-radius: 8px; background: linear-gradient(135deg, #182025, #0a0a0a); border: 1px solid rgba(255,255,255,0.1); box-shadow: 0 10px 24px rgba(0,0,0,0.5); opacity: 0.95; transform: translate(-50%, -50%) scale(0.75); transition: left 420ms cubic-bezier(0.22, 1, 0.36, 1), top 420ms cubic-bezier(0.22, 1, 0.36, 1), transform 420ms cubic-bezier(0.22, 1, 0.36, 1), opacity 420ms ease; }
.deal-card-ghost::before { content: ''; position: absolute; inset: 5px; border: 1px dashed rgba(255,255,255,0.2); border-radius: 5px; }

.card.deal-flip { opacity: 0; transform: translateY(10px) rotateY(90deg) scale(0.9); transform-style: preserve-3d; backface-visibility: hidden; }
.card.deal-flip.is-visible { animation: dealFlipIn 360ms cubic-bezier(0.22, 1, 0.36, 1) forwards; }
@keyframes dealFlipIn { 0% { opacity: 0; transform: translateY(10px) rotateY(90deg) scale(0.9); } 100% { opacity: 1; transform: translateY(0) rotateY(0deg) scale(1); } }

/* 12. OVERLAYS & SETTINGS PANEL */
.overlay-hidden { display: none !important; }
#message-overlay { position: fixed; inset: 0; background: rgba(5,8,12,0.85); backdrop-filter: blur(20px); z-index: 999; display: flex; align-items: center; justify-content: center; }
#message-box { text-align: center; padding: 40px 60px; border: 1px solid var(--glass-border); background: var(--glass-bg); box-shadow: var(--glass-shadow); border-radius: 24px; }
.modal-title { font-size: 26px; margin-bottom: 24px; font-weight: 800; background: var(--gold-gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.modal-subtitle { font-size: 13px; color: rgba(255,255,255,0.72); margin-top: -10px; margin-bottom: 18px; }
.modal-icon { font-size: 60px; margin-bottom: 20px; filter: drop-shadow(0 0 20px var(--gold-glow)); }
.btn-block { width: 100%; margin-top: 10px; }
.score-detail-summary { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.score-summary-chip { flex: 1; border-radius: 16px; padding: 12px; background: rgba(14,20,26,0.5); border: 1px solid rgba(255,255,255,0.1); font-size: 12px; color: rgba(255,255,255,0.76); box-shadow: inset 0 2px 10px rgba(0,0,0,0.5); }
.score-summary-chip strong { display: block; font-size: 20px; color: #fff; margin-top: 6px; font-family: monospace; }
.score-detail-row.is-positive { color: #4ade80; }
.score-detail-row.is-negative { color: #f87171; }

.settings-panel { position: absolute; top: 90px; left: 24px; width: min(860px, calc(100vw - 48px)); z-index: 100; display: none; max-height: calc(100dvh - 120px); overflow-y: auto; }
.settings-panel.is-open { display: block; animation: popIn 0.3s var(--transition); }
.settings-card { padding: 32px; border: 1px solid var(--glass-border); background: var(--glass-bg); backdrop-filter: blur(40px); box-shadow: var(--glass-shadow); border-radius: 24px; }
.settings-head { display: flex; justify-content: space-between; margin-bottom: 24px; }
.settings-head h2 { font-size: 26px; font-weight: 800; color: #fff; }
.settings-head p { font-size: 13px; color: var(--text-muted); margin-top: 6px; }
.settings-section { margin-bottom: 24px; padding-bottom: 24px; border-bottom: 1px solid rgba(255,255,255,0.05); }
.settings-section-head h3 { font-size: 16px; margin-bottom: 6px; color: var(--gold-primary); letter-spacing: 0.5px; }
.settings-section-head p { font-size: 13px; color: var(--text-muted); margin-bottom: 14px; }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.setting-item { display: flex; flex-direction: column; gap: 8px; background: rgba(14,20,26,0.5); padding: 16px; border-radius: 16px; border: 1px solid rgba(255,255,255,0.06); }
.setting-item > span { font-size: 14px; font-weight: 700; color: rgba(255,255,255,0.9); }
.setting-item input[type="text"], .setting-item input[type="number"], .setting-item select { padding: 10px 12px; border-radius: 10px; border: 1px solid rgba(255,255,255,0.15); background: rgba(0,0,0,0.6); color: #fff; font-family: inherit; font-size: 14px; transition: var(--transition); }
.setting-item input:focus, .setting-item select:focus { outline: none; border-color: var(--gold-primary); box-shadow: 0 0 0 2px rgba(212,175,55,0.2); }
.setting-switch { flex-direction: row; justify-content: space-between; align-items: center; }
.chip-group { display: flex; gap: 10px; flex-wrap: wrap; }
.chip { display: flex; align-items: center; gap: 6px; background: rgba(0,0,0,0.6); padding: 8px 14px; border-radius: 20px; font-size: 13px; cursor: pointer; border: 1px solid rgba(255,255,255,0.1); transition: var(--transition); }
.chip:hover { border-color: rgba(255,255,255,0.3); background: rgba(255,255,255,0.05); }
.room-actions { display: flex; gap: 12px; margin-top: 12px; }
.room-actions .is-ready { background: rgba(74, 222, 128, 0.15); color: #4ade80; border: 1px solid rgba(74, 222, 128, 0.4); box-shadow: 0 0 15px rgba(74, 222, 128, 0.2); }
.notes-title { font-size: 13px; color: var(--gold-primary); letter-spacing: 0.5px; }

.rule-pill-group { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.rule-pill { font-size: 12px; padding: 6px 14px; background: linear-gradient(135deg, rgba(212,175,55,0.15), rgba(212,175,55,0.05)); border: 1px solid rgba(212,175,55,0.3); border-radius: 16px; color: var(--gold-light); font-weight: 500; }
.settings-grid-room { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.settings-grid-score { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.settings-dual-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.settings-section-card { margin-bottom: 0; padding: 20px; border: 1px solid rgba(255,255,255,0.08); border-radius: 20px; background: rgba(14,20,26,0.3); }
.lobby-action-card { gap: 12px; }
.lobby-action-buttons { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.lobby-action-button { height: 48px; font-size: 14px; }
.setting-item-wide { grid-column: 1 / -1; }
.room-status-card { gap: 12px; }
.room-status-line { font-size: 13px; line-height: 1.6; color: rgba(255,255,255,0.85); }
.seat-status-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.seat-status-card { padding: 14px; border-radius: 16px; background: rgba(14,20,26,0.5); border: 1px solid rgba(255,255,255,0.08); display: flex; flex-direction: column; gap: 10px; transition: var(--transition); }
.seat-status-card.is-self { border-color: var(--gold-primary); background: linear-gradient(135deg, rgba(212,175,55,0.1), transparent); box-shadow: inset 0 0 0 1px rgba(212,175,55,0.2), 0 4px 15px rgba(212,175,55,0.1); }
.seat-status-card.is-occupied { background: rgba(74, 222, 128, 0.06); border-color: rgba(74, 222, 128, 0.2); }
.seat-status-card.is-waiting { background: rgba(255,255,255,0.02); }
.seat-status-card.is-ai { background: rgba(255,255,255,0.04); }
.seat-status-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.seat-status-name { font-size: 14px; font-weight: 800; color: #fff; }
.seat-status-badge { font-size: 11px; padding: 4px 10px; border-radius: 999px; background: rgba(212,175,55,0.2); color: var(--gold-primary); font-weight: 700; border: 1px solid rgba(212,175,55,0.4); }
.seat-status-body { font-size: 13px; line-height: 1.5; color: rgba(255,255,255,0.8); }
.invite-card { gap: 12px; }
.invite-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.invite-code-shell { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 16px; border-radius: 16px; background: linear-gradient(135deg, rgba(212,175,55,0.15), rgba(0,0,0,0.4)); border: 1px solid rgba(212,175,55,0.3); box-shadow: inset 0 2px 10px rgba(0,0,0,0.5); }
.invite-code-label { font-size: 12px; letter-spacing: 0.1em; color: rgba(255,255,255,0.6); text-transform: uppercase; }
.invite-code-value { font-size: 20px; font-weight: 900; color: var(--gold-light); letter-spacing: 0.1em; word-break: break-all; }
.invite-link-preview { font-size: 12px; line-height: 1.5; color: rgba(255,255,255,0.5); word-break: break-all; background: rgba(0,0,0,0.4); padding: 8px 12px; border-radius: 10px; }
.invite-hint { font-size: 13px; line-height: 1.6; color: rgba(255,255,255,0.85); padding: 12px 16px; border-radius: 16px; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); }
.settings-rules-foldout { margin-top: 20px; border: 1px solid rgba(255,255,255,0.1); border-radius: 16px; background: rgba(10,15,20,0.5); padding: 16px; }
.settings-rules-foldout summary { cursor: pointer; list-style: none; font-size: 14px; font-weight: 800; color: var(--gold-primary); letter-spacing: 0.5px; transition: var(--transition); }
.settings-rules-foldout summary:hover { color: var(--gold-light); }
.settings-rules-foldout summary::-webkit-details-marker { display: none; }
.settings-rules-foldout summary::after { content: '灞曞紑'; float: right; font-size: 12px; color: rgba(255,255,255,0.5); font-weight: 500; }
.settings-rules-foldout[open] summary::after { content: '鏀惰捣'; }

/* 13. RESPONSIVE FOR SMALL SCREENS */
@media (max-width: 768px), (max-height: 700px) {
  #top-bar { top: 12px; left: 16px; right: 16px; }
  .room-debug-strip { top: 64px; left: 16px; right: 16px; padding: 10px 14px; }
  .room-debug-line { gap: 8px; }
  .room-debug-line span { font-size: 11px; padding: 4px 8px; }
  #btn-room-resync { margin-left: 0; }
  .room-pill-group { display: none; }
  .settings-grid-room, .settings-grid-score, .settings-dual-grid { grid-template-columns: 1fr; }
  .lobby-action-buttons { grid-template-columns: 1fr; }
  .seat-status-grid { grid-template-columns: 1fr; }

  .settings-panel { top: auto; bottom: 0; left: 0; width: 100vw; border-radius: 30px 30px 0 0; max-height: 88dvh; }
  .settings-card { border-radius: 30px 30px 0 0; border: none; border-top: 1px solid var(--glass-border); padding: 24px 20px; }

  .chat-dock { width: 100%; margin-bottom: 8px; }
  .chat-quick-row { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; padding-bottom: 6px; -webkit-overflow-scrolling: touch; }
  .chat-quick-row::-webkit-scrollbar { display: none; }
  .chat-chip { white-space: nowrap; flex-shrink: 0; }

  #player-bottom { width: 100vw; bottom: 0; padding-bottom: env(safe-area-inset-bottom, 12px); display: flex; flex-direction: column; justify-content: flex-end; }
  #control-panel { order: 1; z-index: 50; margin-bottom: 8px; }
  #chat-dock { order: 2; padding: 0 16px; }
  #bottom-cards { order: 3; margin-bottom: 0; min-height: 110px; }
  .my-profile { order: 4; margin: 4px auto 12px; max-width: 90vw; padding: 8px 20px; }
  .my-profile .avatar-ring { width: 54px; height: 54px; }

  .card { width: 14.5vw; max-width: 66px; height: calc(14.5vw * 1.45); max-height: 94px; margin-left: -10vw; border-radius: 6px; }
  .card:first-child { margin-left: 0; }
  .card-value { width: 22px; top: 4px; left: 4px; }
  .card-rank { font-size: clamp(16px, 4vw, 22px); }
  .card-suit { font-size: clamp(10px, 2.5vw, 12px); }
  .card.selected { transform: translateY(-26px) scale(1.06); }

  #player-top { top: 76px; left: 16px; transform: none; align-items: flex-start; }
  #player-right { top: 76px; right: 16px; transform: none; display: flex; flex-direction: column; align-items: flex-end; }
  
  #player-right .player-profile { flex-direction: row-reverse; padding: 6px 6px 6px 16px; }
  .player-profile { padding: 6px 16px 6px 6px; }
  .profile-info { text-align: left; }
  #player-right .profile-info { text-align: right; }
  .avatar-ring { width: 48px; height: 48px; }

  #top-cards, #right-cards { align-items: center; justify-content: center; margin-top: 6px; }
  .vertical-cards { flex-direction: row; }
  .card-back { width: 9vw; max-width: 42px; height: calc(9vw * 1.45); max-height: 60px; margin-left: -5.5vw; margin-top: 0; }
  .card-back:first-child { margin-left: 0; margin-top: 0; }

  #play-area { top: 45%; width: calc(100vw - 20px); gap: 10px; min-height: 130px; }
  .played-cards-container .card { margin-left: -32px; transform: scale(0.9); }
  .played-cards-container .card.selected { margin-left: -32px; transform: scale(0.9) translateY(0); }
  .played-cards-container .card.selected + .card:not(.selected) { margin-left: -32px; }

  .btn { height: 44px; font-size: 14px; padding: 0 20px; }
  .control-panel { gap: 12px; min-height: 44px; }
  #game-status { font-size: 13px; padding: 6px 20px; margin-top: 0; }

  .lobby-hero { padding: 24px 20px; gap: 12px; }
  .lobby-hero-title { font-size: 26px; }
  .lobby-hero-text { font-size: 14px; }
  .lobby-hero-actions { flex-direction: column; }
  .lobby-hero-actions .btn { width: 100%; }
  .room-invite-strip { width: calc(100vw - 32px); padding: 16px; flex-direction: column; align-items: stretch; }
  .room-invite-copy { text-align: center; }
  .room-invite-actions { justify-content: center; }
  .seat-invite-anchor { top: calc(100% + 6px); }
}

@keyframes floatSideLeft { 0% { opacity:0; transform: translate(-10px, 0); } 20% { opacity:1; transform: translate(0, 0); } 80% { opacity:1; transform: translate(10px, 0); } 100% { opacity:0; transform: translate(20px, 0); } }
@keyframes floatSideRight { 0% { opacity:0; transform: translate(10px, 0); } 20% { opacity:1; transform: translate(0, 0); } 80% { opacity:1; transform: translate(-10px, 0); } 100% { opacity:0; transform: translate(-20px, 0); } }
#player-top .action-toast.play-anim { animation: floatSideLeft 2s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
#player-right .action-toast.play-anim { animation: floatSideRight 2s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
#player-bottom .action-toast.play-anim { animation: floatUp 2s ease forwards; }
@keyframes floatUp { 0% { opacity:0; transform: translate(-50%, 10px); } 20% { opacity:1; transform: translate(-50%, 0); } 80% { opacity:1; transform: translate(-50%, -10px); } 100% { opacity:0; transform: translate(-50%, -20px); } }

