/* ============================================================
   game.css — Game Center, Werewolf Online Room & 7 Board/Card Games
   100% Unified with Homepage Liquid Glass & 3D Three.js Dark Scene
   ============================================================ */

body.game-page {
    background: transparent !important;
    min-height: 100vh;
    overflow-x: hidden;
}

.game-container {
    max-width: var(--max-width, 1100px);
    margin: 0 auto;
    padding: calc(var(--nav-height, 64px) + 38px) 24px 100px;
    position: relative;
    z-index: 1;
}

.game-container button,
.game-container .glass-card,
button.glass-card {
    color: var(--text-primary);
    font-family: inherit;
}

.game-container .glass-pill {
    white-space: normal;
    text-align: center;
    max-width: 100%;
    word-break: break-word;
    line-height: 1.45;
}

/* --- Hero Banner --- */
.game-hero {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 56px 40px;
    margin-bottom: 32px;
    border-radius: 32px !important;
    position: relative;
    overflow: hidden;
    background: var(--hero-liquid-bg) !important;
    backdrop-filter: blur(16px) saturate(185%) contrast(102%) !important;
    -webkit-backdrop-filter: blur(16px) saturate(185%) contrast(102%) !important;
    border: 1px solid var(--glass-border-strong) !important;
    box-shadow:
        0 20px 50px -12px rgba(0, 0, 0, 0.18),
        inset 0 1.5px 1px 0 rgba(255, 255, 255, 0.65),
        inset 0 -1px 2px 0 rgba(255, 255, 255, 0.18) !important;
}

.game-hero-inner {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 580px;
    margin: 0 auto;
}

.game-hero-title {
    font-size: clamp(2.6rem, 5.5vw, 3.8rem);
    font-weight: 800;
    letter-spacing: -0.035em;
    line-height: 1.15;
    margin-bottom: 24px;
    color: var(--text-primary);
}

/* --- Quick Join Bar --- */
.game-quick-join {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    max-width: 440px;
    margin: 0 auto;
}

.game-quick-input {
    flex: 1;
    padding: 13px 22px;
    font-size: 1rem;
    border-radius: var(--radius-full) !important;
    background: var(--liquid-bg) !important;
    backdrop-filter: blur(14px) !important;
    -webkit-backdrop-filter: blur(14px) !important;
    border: 1px solid var(--glass-border-strong) !important;
    color: var(--text-primary);
    outline: none;
    text-align: center;
    letter-spacing: 0.12em;
    font-weight: 600;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.game-quick-input::placeholder {
    letter-spacing: normal;
    color: var(--text-tertiary);
    font-weight: 400;
}

.game-quick-input:focus {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 4px var(--accent-dim), inset 0 1px 3px rgba(0, 0, 0, 0.05);
    background: var(--liquid-bg-hover) !important;
}

/* --- Filter & Category Controls Capsule --- */
.game-controls-capsule {
    padding: 24px 30px;
    margin-bottom: 32px;
    border-radius: 28px !important;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: var(--liquid-bg) !important;
    backdrop-filter: var(--glass-blur) !important;
    -webkit-backdrop-filter: var(--glass-blur) !important;
    border: 1px solid var(--glass-border) !important;
    box-shadow: var(--glass-shadow), var(--liquid-inner-glow) !important;
}

.game-search-box {
    position: relative;
    width: 100%;
}

.game-search-input {
    width: 100%;
    padding: 13px 20px 13px 46px;
    font-size: 0.95rem;
    border-radius: var(--radius-full) !important;
    background: var(--liquid-bg) !important;
    backdrop-filter: blur(14px) !important;
    -webkit-backdrop-filter: blur(14px) !important;
    border: 1px solid var(--glass-border) !important;
    color: var(--text-primary);
    outline: none;
    transition: all 0.25s ease;
}

.game-search-input::placeholder {
    color: var(--text-tertiary);
}

.game-search-input:focus {
    border-color: var(--accent) !important;
    background: var(--liquid-bg-hover) !important;
    box-shadow: 0 0 0 4px var(--accent-dim);
}

.game-search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    fill: none;
    stroke: var(--text-tertiary);
    stroke-width: 2;
    pointer-events: none;
}

.game-filter-group {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.game-filter-label {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-tertiary);
    min-width: 70px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.game-pill-btn {
    padding: 7px 16px;
    font-size: 0.88rem;
    font-weight: 500;
    border-radius: var(--radius-full) !important;
    background: var(--liquid-pill-bg) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border: 1px solid var(--glass-border) !important;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04), var(--liquid-inner-glow);
}

.game-pill-btn:hover {
    background: var(--liquid-bg-hover) !important;
    color: var(--text-primary);
    border-color: var(--glass-border-strong) !important;
    transform: translateY(-1px);
}

.game-pill-btn.active {
    background: var(--accent) !important;
    color: #ffffff !important;
    border-color: var(--accent) !important;
    box-shadow: 0 4px 14px var(--accent-dim);
}

/* --- Games Grid --- */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
    gap: 22px;
}

.game-card-item {
    padding: 26px 28px;
    border-radius: 28px !important;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 200px;
    position: relative;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    background: var(--liquid-bg) !important;
    backdrop-filter: var(--glass-blur) !important;
    -webkit-backdrop-filter: var(--glass-blur) !important;
    border: 1px solid var(--glass-border) !important;
    box-shadow: var(--glass-shadow), var(--liquid-inner-glow) !important;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.35s cubic-bezier(0.16, 1, 0.3, 1),
                border-color 0.35s ease,
                background 0.35s ease;
}

.game-card-item:hover {
    transform: translateY(-5px) scale(1.008);
    box-shadow: var(--glass-shadow-hover), var(--liquid-inner-glow);
    border-color: var(--glass-border-strong);
    background: var(--liquid-bg-hover) !important;
}

.game-card-top {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 14px;
}

.game-card-hex-icon {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px !important;
    border: 1px solid rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: var(--liquid-inner-glow);
}

.game-card-hex-icon svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
}

.hex-gold { background: rgba(245, 158, 11, 0.16); color: #f59e0b; border-color: rgba(245, 158, 11, 0.35); }
.hex-red { background: rgba(239, 68, 68, 0.16); color: #ef4444; border-color: rgba(239, 68, 68, 0.35); }
.hex-blue { background: rgba(56, 152, 236, 0.16); color: var(--accent); border-color: rgba(56, 152, 236, 0.35); }
.hex-green { background: rgba(52, 199, 89, 0.16); color: var(--success); border-color: rgba(52, 199, 89, 0.35); }

.game-card-info { flex: 1; }
.game-card-title { font-size: 1.22rem; font-weight: 700; margin-bottom: 4px; color: var(--text-primary); }
.game-card-meta { display: flex; align-items: center; gap: 8px; font-size: 0.84rem; color: var(--text-tertiary); font-weight: 500; }
.game-card-desc { font-size: 0.88rem; color: var(--text-secondary); line-height: 1.55; margin-bottom: 18px; flex: 1; }

.game-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.82rem;
    border-top: 1px solid var(--divider);
    padding-top: 14px;
}

.game-status-badge {
    padding: 4px 10px;
    border-radius: var(--radius-full) !important;
    font-weight: 600;
    font-size: 0.78rem;
}

.status-active {
    background: rgba(52, 199, 89, 0.16);
    color: var(--success);
    border: 1px solid rgba(52, 199, 89, 0.35);
}

.status-soon {
    background: var(--liquid-pill-bg);
    color: var(--text-tertiary);
    border: 1px solid var(--glass-border);
}

.game-card-action-btn {
    font-weight: 700;
    color: var(--accent);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: transform 0.2s ease;
}

.game-card-item:hover .game-card-action-btn {
    transform: translateX(3px);
}

/* --- Non-intrusive Floating Toast Pill --- */
.game-toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--glass-bg-strong, rgba(25, 30, 45, 0.92));
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border-strong);
    border-radius: var(--radius-full);
    padding: 12px 26px;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-primary);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25), var(--liquid-inner-glow);
    z-index: 99999;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.game-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ============================================================
   WEREWOLF (LRS) REFERENCE-IMAGE ALIGNED CONFIGURATOR & ROOM
   ============================================================ */

.werewolf-shell {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.werewolf-header {
    padding: 18px 26px;
    border-radius: 26px !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    background: var(--liquid-bg) !important;
    backdrop-filter: var(--glass-blur) !important;
    -webkit-backdrop-filter: var(--glass-blur) !important;
    border: 1px solid var(--glass-border-strong) !important;
    box-shadow: var(--glass-shadow), var(--liquid-inner-glow) !important;
}

.werewolf-back-btn {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--liquid-pill-bg) !important;
    border: 1px solid var(--glass-border) !important;
    padding: 8px 16px;
    border-radius: var(--radius-full) !important;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.werewolf-back-btn:hover {
    background: var(--liquid-bg-hover) !important;
    color: var(--text-primary);
    border-color: var(--glass-border-strong) !important;
}

.werewolf-room-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--liquid-pill-bg) !important;
    border: 1px solid var(--glass-border-strong) !important;
    padding: 7px 16px;
    border-radius: var(--radius-full) !important;
    font-weight: 700;
    font-size: 0.92rem;
}

.werewolf-timeline-capsule {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    border-radius: var(--radius-full) !important;
    font-size: 0.88rem;
    font-weight: 700;
}

.phase-night {
    background: rgba(99, 102, 241, 0.20) !important;
    color: #818cf8 !important;
    border: 1px solid rgba(99, 102, 241, 0.4) !important;
}

.phase-day {
    background: rgba(245, 158, 11, 0.20) !important;
    color: #fbbf24 !important;
    border: 1px solid rgba(245, 158, 11, 0.4) !important;
}

.werewolf-setup-box {
    padding: 30px 34px;
    border-radius: 30px !important;
    display: flex;
    flex-direction: column;
    gap: 22px;
    background: var(--liquid-bg) !important;
    backdrop-filter: var(--glass-blur) !important;
    -webkit-backdrop-filter: var(--glass-blur) !important;
    border: 1px solid var(--glass-border-strong) !important;
    box-shadow: var(--glass-shadow), var(--liquid-inner-glow) !important;
}

.lrs-ref-section-label {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.lrs-ref-subnote {
    font-size: 0.86rem;
    color: var(--text-secondary);
    margin-top: 8px;
    font-weight: 500;
}

.lrs-ref-header-row {
    display: flex;
    align-items: baseline;
    gap: 12px;
}

.lrs-ref-counter {
    font-size: 1.25rem;
    font-weight: 800;
}

.lrs-ref-counter.unmatched { color: #ef4444; }
.lrs-ref-counter.matched { color: #10b981; }

.lrs-pill-Selector-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.lrs-radio-pill,
.lrs-check-pill,
.lrs-action-pill {
    padding: 8px 18px;
    font-size: 0.92rem;
    font-weight: 600;
    border-radius: var(--radius-full) !important;
    background: var(--liquid-pill-bg) !important;
    border: 1px solid var(--glass-border-strong) !important;
    color: var(--text-primary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    user-select: none;
}

.lrs-radio-pill:hover:not(:disabled),
.lrs-check-pill:hover:not(:disabled),
.lrs-action-pill:hover:not(:disabled) {
    background: var(--liquid-bg-hover) !important;
    transform: translateY(-1px);
}

.lrs-radio-pill.active {
    background: #ef4444 !important;
    color: #ffffff !important;
    border-color: #ef4444 !important;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.35);
}

.lrs-radio-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid currentColor;
    display: inline-block;
    position: relative;
}

.lrs-radio-pill.active .lrs-radio-dot::after {
    content: '';
    position: absolute;
    inset: 2px;
    border-radius: 50%;
    background: #ffffff;
}

.lrs-check-pill.active {
    background: rgba(239, 68, 68, 0.18) !important;
    color: #ef4444 !important;
    border-color: #ef4444 !important;
    font-weight: 700;
}

.lrs-check-box {
    width: 15px;
    height: 15px;
    border-radius: 4px;
    border: 1.8px solid currentColor;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    line-height: 1;
}

.lrs-action-pill.active {
    border-color: var(--accent) !important;
    color: var(--accent) !important;
}

.lrs-remove-custom-btn {
    background: none;
    border: none;
    color: #ef4444;
    font-size: 1.05rem;
    font-weight: 800;
    cursor: pointer;
    padding: 0 4px;
}

.lrs-camp-block {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.lrs-camp-heading {
    font-size: 0.98rem;
    font-weight: 800;
    color: var(--text-primary);
}

.lrs-camp-sublabel {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.lrs-ref-footer-notice {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--divider);
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.75;
    color: var(--text-primary);
    text-align: center;
}

/* --- Seating Layout --- */
.werewolf-seating-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
    gap: 12px;
    margin: 12px 0;
}

.werewolf-seat-card {
    padding: 15px 14px;
    border-radius: 20px !important;
    background: var(--liquid-bg) !important;
    border: 1px solid var(--glass-border) !important;
    backdrop-filter: var(--glass-blur) !important;
    -webkit-backdrop-filter: var(--glass-blur) !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    transition: all 0.22s ease;
    cursor: pointer;
    box-shadow: var(--liquid-inner-glow);
}

.werewolf-seat-card:hover {
    background: var(--liquid-bg-hover) !important;
    border-color: var(--glass-border-strong) !important;
    transform: translateY(-2px);
}

.werewolf-seat-card.is-me {
    border-color: var(--accent) !important;
    box-shadow: 0 0 18px var(--accent-dim), var(--liquid-inner-glow) !important;
}

.werewolf-seat-card.is-god {
    border-color: #f59e0b !important;
    background: rgba(245, 158, 11, 0.12) !important;
}

.werewolf-seat-card.is-dead {
    opacity: 0.5;
    filter: grayscale(0.85);
}

.werewolf-seat-num { font-size: 1.08rem; font-weight: 800; margin-bottom: 3px; }
.werewolf-seat-name { font-size: 0.84rem; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.werewolf-seat-role-badge { margin-top: 6px; padding: 3px 10px; border-radius: var(--radius-full) !important; font-size: 0.76rem; font-weight: 700; }

.werewolf-sheriff-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 26px;
    height: 26px;
    border-radius: 50% !important;
    background: #f59e0b;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 10px rgba(245, 158, 11, 0.5);
}

.werewolf-sheriff-badge svg { width: 15px; height: 15px; }

/* --- Secret Card --- */
.werewolf-secret-card-container {
    max-width: 380px;
    margin: 12px auto;
    user-select: none;
    -webkit-user-select: none;
}

.werewolf-secret-card {
    min-height: 230px;
    border-radius: 28px !important;
    padding: 26px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    background: var(--hero-liquid-bg) !important;
    backdrop-filter: blur(20px) saturate(185%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(185%) !important;
    border: 2px solid var(--glass-border-strong) !important;
    box-shadow: var(--glass-shadow), var(--liquid-inner-glow);
    cursor: pointer;
    transition: transform 0.28s ease, box-shadow 0.28s ease;
}

.werewolf-secret-card.peeking {
    transform: scale(1.015);
    border-color: var(--accent) !important;
    box-shadow: 0 20px 48px rgba(56, 152, 236, 0.32);
}

.secret-card-facedown,
.secret-card-faceup {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.secret-card-icon {
    width: 56px;
    height: 56px;
    border-radius: 50% !important;
    background: var(--liquid-pill-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--glass-border-strong);
}

.secret-card-icon svg { width: 26px; height: 26px; }
.secret-role-title { font-size: 1.65rem; font-weight: 800; }
.secret-role-camp { font-size: 0.84rem; font-weight: 700; padding: 4px 14px; border-radius: var(--radius-full) !important; }
.secret-role-desc { font-size: 0.86rem; color: var(--text-secondary); line-height: 1.5; max-width: 300px; }

.camp-wolf { background: rgba(239, 68, 68, 0.20) !important; color: #f87171 !important; border: 1px solid rgba(239, 68, 68, 0.45) !important; }
.camp-god { background: rgba(245, 158, 11, 0.20) !important; color: #fbbf24 !important; border: 1px solid rgba(245, 158, 11, 0.45) !important; }
.camp-villager { background: rgba(56, 152, 236, 0.20) !important; color: var(--accent) !important; border: 1px solid rgba(56, 152, 236, 0.45) !important; }
.camp-third { background: rgba(168, 85, 247, 0.20) !important; color: #c084fc !important; border: 1px solid rgba(168, 85, 247, 0.45) !important; }

/* --- God Console & Dialogs --- */
.god-directives-panel {
    padding: 24px;
    border-radius: 28px !important;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.god-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
    gap: 10px;
}

.god-btn {
    padding: 12px 16px;
    font-size: 0.9rem;
    font-weight: 700;
    border-radius: 16px !important;
    background: var(--liquid-pill-bg) !important;
    border: 1px solid var(--glass-border) !important;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.god-btn:hover {
    background: var(--liquid-bg-hover) !important;
    border-color: var(--glass-border-strong) !important;
    transform: translateY(-2px);
}

.god-btn-danger {
    background: rgba(239, 68, 68, 0.16) !important;
    color: #ef4444 !important;
    border-color: rgba(239, 68, 68, 0.35) !important;
}

dialog.werewolf-modal-backdrop {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
    z-index: 10000 !important;
    display: none;
    align-items: center;
    justify-content: center;
}

dialog.werewolf-modal-backdrop[open] { display: flex !important; }
dialog.werewolf-modal-backdrop::backdrop {
    background: rgba(10, 15, 26, 0.55);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.werewolf-modal-dialog {
    width: 90vw;
    max-width: 520px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 28px 32px;
    border-radius: 28px !important;
    background: var(--liquid-bg, rgba(255, 255, 255, 0.9)) !important;
    backdrop-filter: blur(28px) saturate(190%) !important;
    -webkit-backdrop-filter: blur(28px) !important;
    border: 1px solid var(--glass-border-strong) !important;
    box-shadow: 0 24px 64px -12px rgba(0, 0, 0, 0.35), var(--liquid-inner-glow) !important;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.werewolf-modal-title {
    font-size: 1.22rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.werewolf-vote-choices {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
}

.werewolf-vote-card-btn {
    padding: 13px;
    border-radius: 16px !important;
    background: var(--liquid-pill-bg) !important;
    border: 1px solid var(--glass-border) !important;
    color: var(--text-primary);
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
}

.werewolf-vote-card-btn.selected {
    background: var(--accent) !important;
    color: #ffffff !important;
    border-color: var(--accent) !important;
    box-shadow: 0 4px 14px var(--accent-dim);
}

.werewolf-history-card {
    padding: 24px;
    border-radius: 28px !important;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.history-item-row {
    padding: 12px 16px;
    border-radius: 16px !important;
    background: var(--liquid-pill-bg) !important;
    border: 1px solid var(--glass-border) !important;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.history-item-left { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.history-time-tag { font-size: 0.76rem; font-weight: 700; color: var(--accent); }
.history-item-text { font-size: 0.88rem; line-height: 1.5; }
.history-item-delete-btn { background: none; border: none; color: var(--text-tertiary); cursor: pointer; font-size: 1.1rem; }

/* ============================================================
   7 BOARD & CARD GAMES STYLING (UNO, GOMOKU, GO, XIANGQI, CHESS, TTT, LUZHANQI)
   ============================================================ */

.bg-arena-card {
    padding: 24px;
    border-radius: 30px !important;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    gap: 14px;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    overflow-x: hidden;
}

.board-scroll-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    padding: 6px;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
}

/* 1. Tic-Tac-Toe */
.ttt-board-grid {
    display: grid;
    grid-template-columns: repeat(3, 100px);
    grid-template-rows: repeat(3, 100px);
    gap: 12px;
}

.ttt-cell-btn {
    border-radius: 22px !important;
    background: var(--liquid-pill-bg) !important;
    border: 2px solid var(--glass-border-strong) !important;
    font-size: 2.6rem;
    font-weight: 900;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.ttt-cell-btn:hover:not(:disabled) {
    background: var(--liquid-bg-hover) !important;
    transform: scale(1.03);
}

.ttt-cell-btn.win-cell {
    border-color: #10b981 !important;
    background: rgba(16, 185, 129, 0.18) !important;
}

.ttt-mark-x { color: #ef4444; }
.ttt-mark-o { color: #3b82f6; }

/* 2 & 3. Gomoku & Weiqi (Go) Intersection Board */
.go-board-frame {
    display: inline-flex;
    flex-direction: column;
    background: linear-gradient(145deg, #e5be6e 0%, #d4a34a 52%, #c7933b 100%);
    border: 3px solid #7c5821;
    border-radius: 14px;
    padding: 10px 14px 14px 8px;
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 245, 215, 0.55);
}

.go-coords-top {
    display: grid;
    grid-template-columns: repeat(var(--board-size, 15), 32px);
    margin-left: 24px;
    margin-bottom: 4px;
    font-size: 0.68rem;
    font-weight: 800;
    color: rgba(66, 42, 10, 0.78);
    text-align: center;
    user-select: none;
}

.go-board-middle {
    display: flex;
    align-items: stretch;
}

.go-coords-left {
    display: grid;
    grid-template-rows: repeat(var(--board-size, 15), 32px);
    width: 24px;
    font-size: 0.68rem;
    font-weight: 800;
    color: rgba(66, 42, 10, 0.78);
    align-items: center;
    justify-items: center;
    user-select: none;
}

.go-intersection-board {
    display: grid;
    grid-template-columns: repeat(var(--board-size, 15), 32px);
    grid-template-rows: repeat(var(--board-size, 15), 32px);
    background: transparent;
    border: none;
    border-radius: 4px;
    padding: 0;
    box-shadow: none;
}

.go-cell {
    position: relative;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.go-cell::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 1px;
    background: rgba(58, 37, 8, 0.74);
    pointer-events: none;
}

.go-cell::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 1px;
    background: rgba(58, 37, 8, 0.74);
    pointer-events: none;
}

.go-cell.edge-left::before { left: 50%; }
.go-cell.edge-right::before { right: 50%; }
.go-cell.edge-top::after { top: 50%; }
.go-cell.edge-bottom::after { bottom: 50%; }

.go-intersection-board[data-turn-color="black"] .go-cell.is-playable:hover {
    background: radial-gradient(circle, rgba(20, 20, 20, 0.42) 0%, rgba(20, 20, 20, 0.34) 52%, transparent 56%);
}

.go-intersection-board[data-turn-color="white"] .go-cell.is-playable:hover {
    background: radial-gradient(circle, rgba(255, 255, 255, 0.75) 0%, rgba(235, 235, 235, 0.55) 52%, transparent 56%);
}

.go-star-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #3a2508;
    z-index: 1;
    pointer-events: none;
}

.go-stone {
    width: 27px;
    height: 27px;
    border-radius: 50%;
    z-index: 2;
    position: relative;
    transition: transform 0.15s ease;
}

.go-stone.is-atari {
    box-shadow: 0 0 0 2.5px #ef4444, 0 0 10px rgba(239, 68, 68, 0.75);
    animation: atariPulse 1.1s ease-in-out infinite;
}

@keyframes atariPulse {
    0%, 100% { box-shadow: 0 0 0 2px #ef4444, 0 0 6px rgba(239, 68, 68, 0.6); }
    50% { box-shadow: 0 0 0 3.5px #f97316, 0 0 14px rgba(239, 68, 68, 0.95); }
}

.stone-black {
    background: radial-gradient(circle at 32% 30%, #5c5c5c, #111 75%);
    box-shadow: 1px 2px 5px rgba(0, 0, 0, 0.58);
}

.stone-white {
    background: radial-gradient(circle at 32% 30%, #fff, #d6d6d6 78%);
    border: 1px solid rgba(0, 0, 0, 0.22);
    box-shadow: 1px 2px 5px rgba(0, 0, 0, 0.35);
}

.go-stone.is-last::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ef4444;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.go-stone.is-win {
    box-shadow: 0 0 0 3px #10b981, 0 0 12px #10b981;
}

/* 4. Xiangqi (Chinese Chess 10x9) */
.xiangqi-board-grid {
    display: grid;
    grid-template-columns: repeat(9, 52px);
    grid-template-rows: repeat(10, 52px);
    background: #e6c280;
    border: 3px solid #6e4715;
    border-radius: 14px;
    padding: 12px;
    position: relative;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
}

.xiangqi-river-banner {
    position: absolute;
    left: 12px;
    right: 12px;
    top: calc(12px + 52px * 4.5 - 14px);
    height: 28px;
    background: rgba(230, 194, 128, 0.92);
    display: flex;
    align-items: center;
    justify-content: space-around;
    font-weight: 900;
    font-size: 1.05rem;
    color: #5c3a10;
    letter-spacing: 0.4em;
    pointer-events: none;
    z-index: 1;
}

.xq-cell {
    width: 52px;
    height: 52px;
    border: 1px dashed rgba(92, 58, 16, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
    z-index: 2;
}

.xq-cell.selected {
    background: rgba(59, 130, 246, 0.28);
    border-radius: 50%;
}

.xq-cell.last-move {
    background: rgba(245, 158, 11, 0.25);
}

.xq-piece {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #fdf5e6, #e2c08d);
    border: 2px solid #5c3a10;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3), inset 0 0 0 2px rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 900;
    user-select: none;
}

.xq-red { color: #c81e1e; border-color: #991b1b; }
.xq-black { color: #1e293b; border-color: #0f172a; }

/* 5. International Chess (8x8) */
.chess-board-grid {
    display: grid;
    grid-template-columns: repeat(8, 56px);
    grid-template-rows: repeat(8, 56px);
    border: 3px solid #475569;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
}

.chess-square {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
}

.sq-light { background: #f1d9b5; }
.sq-dark { background: #b58863; }
.chess-square.selected { background: #60a5fa !important; }
.chess-square.last-move { box-shadow: inset 0 0 0 3px #f59e0b; }

.chess-piece {
    font-size: 2.25rem;
    line-height: 1;
}

.cp-white { color: #ffffff; text-shadow: 0 1px 3px rgba(0,0,0,0.85), 0 0 2px #000; }
.cp-black { color: #111827; text-shadow: 0 1px 2px rgba(255,255,255,0.45); }

/* 6. Luzhanqi (Military Chess 12x5) */
.lzq-board-grid {
    display: grid;
    grid-template-columns: repeat(5, 74px);
    grid-template-rows: repeat(12, 46px);
    gap: 6px;
    background: rgba(30, 41, 59, 0.45);
    padding: 14px;
    border-radius: 18px;
    border: 2px solid var(--glass-border-strong);
}

.lzq-cell {
    position: relative;
    border-radius: 10px;
    background: var(--liquid-pill-bg);
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.lzq-cell.lzq-rail { border: 1.5px dashed #94a3b8; }
.lzq-cell.lzq-camp { border-radius: 22px; border: 2px solid #f59e0b; background: rgba(245, 158, 11, 0.1); }
.lzq-cell.lzq-hq { border: 2px solid #a855f7; background: rgba(168, 85, 247, 0.12); }
.lzq-cell.selected { box-shadow: 0 0 0 3px var(--accent); }

.lzq-station-label {
    position: absolute;
    font-size: 0.65rem;
    color: var(--text-tertiary);
    pointer-events: none;
}

.lzq-piece {
    width: 90%;
    height: 84%;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 800;
    color: #fff;
    z-index: 2;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.lzq-unrevealed { background: linear-gradient(135deg, #475569, #334155); border: 1px solid #94a3b8; }
.lzq-red { background: linear-gradient(135deg, #dc2626, #991b1b); border: 1px solid #fca5a5; }
.lzq-blue { background: linear-gradient(135deg, #2563eb, #1e40af); border: 1px solid #93c5fd; }

/* 7. UNO Cards */
.uno-hand-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.uno-card {
    width: 74px;
    height: 110px;
    border-radius: 14px !important;
    border: 3px solid #ffffff !important;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff !important;
    font-weight: 900;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    user-select: none;
}

.uno-table-card {
    width: 90px;
    height: 132px;
    cursor: default;
}

.uno-card.playable:hover {
    transform: translateY(-8px) scale(1.05);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
}

.uno-card-corner {
    position: absolute;
    top: 6px;
    left: 8px;
    font-size: 0.78rem;
    color: inherit;
}

.uno-card-center {
    font-size: 1.45rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.38);
    color: inherit;
}

.uno-red { background: linear-gradient(135deg, #ef4444, #b91c1c) !important; color: #ffffff !important; }
.uno-yellow { background: linear-gradient(135deg, #fbbf24, #d97706) !important; color: #ffffff !important; }
.uno-green { background: linear-gradient(135deg, #10b981, #047857) !important; color: #ffffff !important; }
.uno-blue { background: linear-gradient(135deg, #3b82f6, #1d4ed8) !important; color: #ffffff !important; }
.uno-wild { background: linear-gradient(135deg, #1e293b, #0f172a) !important; border-color: #f59e0b !important; color: #ffffff !important; }

.uno-color-choice {
    padding: 16px;
    border-radius: 16px !important;
    border: 2px solid #fff !important;
    color: #fff;
    font-weight: 800;
    font-size: 1rem;
    cursor: pointer;
}

/* --- Desktop 2-Column Workspace Layout & Mobile Ergonomic Adaptations --- */
.bg-workspace-grid {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.bg-sidebar-col {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

@media (min-width: 980px) {
    .bg-workspace-grid {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 340px;
        align-items: start;
        gap: 22px;
    }
    .bg-sidebar-col {
        position: sticky;
        top: calc(var(--nav-height, 64px) + 20px);
    }
}

@media (max-width: 768px) {
    .game-container {
        padding: calc(var(--nav-height, 64px) + 32px) 12px 56px;
    }
    .game-hero {
        padding: 28px 16px;
        margin-bottom: 20px;
    }
    .game-controls-capsule {
        padding: 16px;
        gap: 12px;
    }
    .werewolf-header {
        padding: 14px 16px;
        border-radius: 22px !important;
        gap: 10px;
    }
    .werewolf-setup-box {
        padding: 18px 15px;
        border-radius: 24px !important;
        gap: 18px;
    }
    .bg-arena-card {
        padding: 16px 12px;
        border-radius: 24px !important;
        gap: 12px;
    }
    /* Compact 3-column seating grid on mobile so 10-16 seats fit on screen without long scrolling */
    .werewolf-seating-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
    }
    .werewolf-seat-card {
        padding: 10px 6px;
        border-radius: 16px !important;
    }
    .werewolf-seat-num {
        font-size: 0.92rem;
    }
    .werewolf-seat-name {
        font-size: 0.76rem;
    }
    .lrs-radio-pill,
    .lrs-check-pill,
    .lrs-action-pill {
        padding: 7px 13px;
        font-size: 0.84rem;
        min-height: 38px;
    }
    .games-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }
    .god-actions-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    /* Viewport-responsive boards on mobile (no awkward horizontal overflow) */
    .board-scroll-wrap {
        justify-content: safe center;
        -webkit-overflow-scrolling: touch;
    }
    .go-board-frame {
        --cell-px: clamp(18px, calc((100vw - 74px) / var(--board-size, 15)), 28px);
        padding: 6px 8px 8px 4px;
    }
    .go-coords-top {
        grid-template-columns: repeat(var(--board-size, 15), var(--cell-px));
        margin-left: 18px;
        font-size: 0.58rem;
    }
    .go-coords-left {
        grid-template-rows: repeat(var(--board-size, 15), var(--cell-px));
        width: 18px;
        font-size: 0.58rem;
    }
    .go-intersection-board {
        grid-template-columns: repeat(var(--board-size, 15), var(--cell-px));
        grid-template-rows: repeat(var(--board-size, 15), var(--cell-px));
        padding: 0;
        margin: 0 auto;
    }
    .go-cell {
        width: var(--cell-px);
        height: var(--cell-px);
    }
    .go-stone {
        width: calc(var(--cell-px) - 2px);
        height: calc(var(--cell-px) - 2px);
    }
    .xiangqi-board-grid {
        --xq-px: clamp(32px, calc((100vw - 56px) / 9), 44px);
        grid-template-columns: repeat(9, var(--xq-px));
        grid-template-rows: repeat(10, var(--xq-px));
        padding: 8px;
    }
    .xiangqi-river-banner {
        top: calc(8px + var(--xq-px) * 4.5 - 12px);
        height: 24px;
        font-size: 0.88rem;
    }
    .xq-cell {
        width: var(--xq-px);
        height: var(--xq-px);
    }
    .xq-piece {
        width: calc(var(--xq-px) - 5px);
        height: calc(var(--xq-px) - 5px);
        font-size: 0.92rem;
    }
    .chess-board-grid {
        --ch-px: clamp(36px, calc((100vw - 48px) / 8), 48px);
        grid-template-columns: repeat(8, var(--ch-px));
        grid-template-rows: repeat(8, var(--ch-px));
    }
    .chess-square {
        width: var(--ch-px);
        height: var(--ch-px);
    }
    .chess-piece {
        font-size: 1.65rem;
    }
    .lzq-board-grid {
        grid-template-columns: repeat(5, minmax(54px, 1fr));
        grid-template-rows: repeat(12, 38px);
        gap: 4px;
        padding: 8px;
    }
    .ttt-board-grid {
        grid-template-columns: repeat(3, 86px);
        grid-template-rows: repeat(3, 86px);
    }
    .uno-card {
        width: 62px;
        height: 94px;
    }
}

/* ============================================================
   LEGAL MOVE INDICATORS, WAITING OVERLAY & QUICK CHEATSHEETS
   ============================================================ */
.xq-cell.legal-move::after,
.chess-square.legal-move::after,
.lzq-cell.legal-move::after {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.88);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.75), 0 0 0 3px rgba(16, 185, 129, 0.22);
    pointer-events: none;
    z-index: 6;
}

.xq-cell.legal-capture::after,
.chess-square.legal-capture::after,
.lzq-cell.legal-capture::after {
    content: '';
    position: absolute;
    inset: 3px;
    border-radius: 50%;
    border: 3px solid rgba(239, 68, 68, 0.92);
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.55);
    pointer-events: none;
    z-index: 6;
}

.lzq-cell.legal-capture::after {
    border-radius: 8px;
}

.bg-arena-card {
    position: relative;
}

.bg-waiting-banner {
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    padding: 14px 18px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.14), rgba(16, 185, 129, 0.12));
    border: 1.5px solid var(--glass-border-strong);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    box-sizing: border-box;
    flex-shrink: 0;
}

.bg-cheatsheet-bar {
    width: 100%;
    max-width: 680px;
    padding: 9px 14px;
    border-radius: 12px;
    background: var(--liquid-pill-bg);
    border: 1px solid var(--glass-border);
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
    text-align: center;
    box-sizing: border-box;
    flex-shrink: 0;
}

/* --- Circular "i" Info Button on Room Info Box & Lobby --- */
.game-info-circle-btn {
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    border-radius: 50% !important;
    background: var(--liquid-pill-bg) !important;
    border: 1.5px solid var(--glass-border-strong) !important;
    color: var(--accent) !important;
    font-family: Georgia, 'Times New Roman', serif;
    font-style: italic;
    font-weight: 900;
    font-size: 0.98rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12), var(--liquid-inner-glow);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    flex-shrink: 0;
    padding: 0 !important;
}

.game-info-circle-btn:hover {
    background: var(--accent) !important;
    color: #ffffff !important;
    border-color: var(--accent) !important;
    transform: translateY(-1px) scale(1.06);
    box-shadow: 0 4px 12px var(--accent-dim);
}

/* --- Stealth Admin God-Eye Banner --- */
.admin-stealth-banner {
    width: 100%;
    padding: 10px 18px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.22), rgba(59, 130, 246, 0.18));
    border: 1.5px solid rgba(168, 85, 247, 0.55);
    color: var(--text-primary);
    font-size: 0.86rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    box-sizing: border-box;
}

/* --- Minesweeper (sweeper) Responsive Grid --- */
.sweeper-board-grid {
    --sw-px: clamp(20px, calc((100vw - 88px - (var(--sw-cols, 9) - 1) * 3px) / var(--sw-cols, 9)), 36px);
    display: grid;
    grid-template-columns: repeat(var(--sw-cols, 9), var(--sw-px));
    grid-template-rows: repeat(var(--sw-rows, 9), var(--sw-px));
    gap: 3px;
    padding: 10px;
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.38);
    border: 2px solid var(--glass-border-strong);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
    user-select: none;
    -webkit-user-select: none;
}

.sweeper-cell {
    width: var(--sw-px);
    height: var(--sw-px);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: calc(var(--sw-px) * 0.52);
    cursor: pointer;
    transition: transform 0.1s ease, background 0.15s ease;
    padding: 0;
}

.sweeper-cell.sw-hidden {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.24), rgba(148, 163, 184, 0.16));
    border: 1px solid var(--glass-border-strong);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.35), 0 2px 4px rgba(0, 0, 0, 0.15);
}

.sweeper-cell.sw-hidden:hover:not(:disabled) {
    background: var(--liquid-bg-hover);
    transform: scale(1.04);
}

.sweeper-cell.sw-flagged {
    background: rgba(245, 158, 11, 0.22);
    border: 1.5px solid #f59e0b;
}

.sweeper-cell.sw-open {
    background: rgba(15, 23, 42, 0.16);
    border: 1px solid rgba(148, 163, 184, 0.18);
    cursor: default;
}

.sweeper-cell.sw-mine {
    background: rgba(239, 68, 68, 0.28);
    border: 1.5px solid #ef4444;
}

.sweeper-cell.sw-exploded {
    background: #ef4444 !important;
    color: #fff !important;
    box-shadow: 0 0 14px rgba(239, 68, 68, 0.8);
}

.sw-num-1 { color: #3b82f6; }
.sw-num-2 { color: #10b981; }
.sw-num-3 { color: #ef4444; }
.sw-num-4 { color: #8b5cf6; }
.sw-num-5 { color: #d97706; }
.sw-num-6 { color: #06b6d4; }
.sw-num-7 { color: #ec4899; }
.sw-num-8 { color: #64748b; }

/* --- Hand Card Fanning / Overlap & Collapsible Seat / Cheatsheet Drawers --- */
.uno-hand-row.compact-fan {
    gap: 6px 0;
    padding: 8px 10px 4px 24px;
}

.uno-hand-row.compact-fan .uno-card,
.uno-hand-row.compact-fan .rk-tile-btn {
    margin-left: -18px;
    box-shadow: -3px 4px 12px rgba(0, 0, 0, 0.38);
    transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), margin 0.18s ease, z-index 0s;
}

.uno-hand-row.compact-fan .uno-card.playable {
    transform: translateY(-7px);
    box-shadow: -2px 8px 18px rgba(16, 185, 129, 0.42), 0 0 0 2px #10b981 !important;
    z-index: 3;
}

.uno-hand-row.compact-fan .uno-card:hover:not(:disabled),
.uno-hand-row.compact-fan .rk-tile-btn:hover:not(:disabled) {
    transform: translateY(-12px) scale(1.06);
    z-index: 10;
}

.bg-mini-seat-strip {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.bg-mini-seat-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 700;
    background: var(--liquid-pill-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
}

.bg-mini-seat-chip.is-turn {
    border-color: #f59e0b;
    background: rgba(245, 158, 11, 0.16);
    color: #fbbf24;
}

.bg-mini-seat-chip.is-me {
    border-color: var(--accent);
    color: var(--text-primary);
}

.bg-hand-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.bg-mini-toggle-btn {
    padding: 3px 9px;
    border-radius: 999px !important;
    font-size: 0.72rem;
    font-weight: 700;
    background: var(--liquid-pill-bg) !important;
    border: 1px solid var(--glass-border-strong) !important;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
}

.bg-mini-toggle-btn.active,
.bg-mini-toggle-btn:hover {
    color: var(--accent);
    border-color: var(--accent) !important;
}

.bg-compact-select {
    padding: 4px 10px;
    border-radius: 999px !important;
    font-size: 0.78rem;
    font-weight: 700;
    background: var(--liquid-pill-bg) !important;
    border: 1px solid var(--glass-border-strong) !important;
    color: var(--text-primary);
    cursor: pointer;
    outline: none;
    height: 30px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.bg-compact-select:focus {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 3px var(--accent-dim);
}

.bg-lobby-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 10px;
}

.bg-lobby-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.bg-lobby-field .bg-compact-select {
    width: 100%;
    height: 36px;
    border-radius: 14px !important;
    padding: 6px 12px;
    font-size: 0.86rem;
}

@media (max-width: 768px) {
    .werewolf-shell {
        gap: 10px;
    }
    .werewolf-header {
        padding: 10px 12px !important;
        border-radius: 18px !important;
        gap: 6px !important;
    }
    .werewolf-back-btn {
        padding: 5px 11px !important;
        font-size: 0.78rem !important;
    }
    .werewolf-room-badge {
        padding: 5px 11px !important;
        font-size: 0.82rem !important;
        gap: 6px !important;
    }
    .werewolf-timeline-capsule {
        padding: 4px 10px !important;
        font-size: 0.78rem !important;
    }
    .bg-lobby-options-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    .uno-table-card {
        width: 72px !important;
        height: 104px !important;
    }
    .uno-card {
        width: 60px !important;
        height: 88px !important;
        border-radius: 11px !important;
        border-width: 2.5px !important;
    }
    .uno-card-corner {
        top: 5px;
        left: 6px;
        font-size: 0.74rem;
    }
    .uno-card-center {
        font-size: 1.28rem;
    }
    .uno-hand-row.compact-fan .uno-card {
        margin-left: -16px;
    }
}

/* Turn Countdown Pill & Card Drag/Reorder Styles */
.bg-turn-timer-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 11px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    background: rgba(16, 185, 129, 0.16);
    border: 1px solid rgba(16, 185, 129, 0.45);
    color: #10b981;
    transition: all 0.2s ease;
}

.bg-turn-timer-pill.timer-mine {
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.28);
}

.bg-turn-timer-pill.timer-warn {
    background: rgba(245, 158, 11, 0.2);
    border-color: #f59e0b;
    color: #f59e0b;
}

.bg-turn-timer-pill.timer-danger {
    background: rgba(239, 68, 68, 0.24);
    border-color: #ef4444;
    color: #ef4444;
    animation: pulseTimerDanger 0.7s infinite alternate;
}

@keyframes pulseTimerDanger {
    from { transform: scale(1); }
    to { transform: scale(1.06); }
}

.uno-card[draggable="true"] {
    cursor: grab;
}

.uno-card.dragging,
[data-hand-drag-idx].dragging {
    opacity: 0.45;
    transform: scale(0.94);
}

.uno-card.drag-over,
[data-hand-drag-idx].drag-over {
    outline: 3px dashed var(--accent) !important;
    transform: translateY(-10px) scale(1.04) !important;
}

.uno-card.hand-swap-selected,
[data-hand-drag-idx].hand-swap-selected {
    outline: 3px solid #f59e0b !important;
    box-shadow: 0 0 16px rgba(245, 158, 11, 0.65) !important;
    transform: translateY(-10px) scale(1.05) !important;
    z-index: 25 !important;
}

/* ============================================================
   ADMIN STEALTH GOD-EYE INSPECTOR & PERSPECTIVE SWITCHER
   ============================================================ */
.admin-godeye-panel {
    width: 100%;
    padding: 12px 14px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.14), rgba(59, 130, 246, 0.1));
    border: 1.5px solid rgba(168, 85, 247, 0.42);
    box-shadow: 0 8px 24px rgba(124, 58, 237, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.admin-godeye-seat-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.admin-godeye-seat-pill {
    padding: 5px 11px;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 800;
    border: 1px solid rgba(168, 85, 247, 0.38);
    background: rgba(255, 255, 255, 0.12);
    color: var(--text-primary);
    cursor: pointer;
    transition: transform 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.admin-godeye-seat-pill:hover {
    transform: translateY(-1px);
    background: rgba(168, 85, 247, 0.22);
}

.admin-godeye-seat-pill.active {
    background: linear-gradient(135deg, #7c3aed, #2563eb);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.4);
}

.admin-godeye-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 8px;
}

.admin-godeye-player-box {
    padding: 8px 10px;
    border-radius: 12px;
    background: var(--liquid-pill-bg);
    border: 1px solid var(--glass-border);
    cursor: pointer;
    transition: border-color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.admin-godeye-player-box:hover {
    transform: translateY(-1px);
    border-color: rgba(168, 85, 247, 0.55);
}

.admin-godeye-player-box.is-inspected {
    border: 1.5px solid #a855f7;
    box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.22);
}

.admin-mini-card {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 24px;
    padding: 0 6px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 900;
    color: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.45);
}

.admin-mini-card.mc-R { background: linear-gradient(135deg, #ef4444, #b91c1c); }
.admin-mini-card.mc-Y { background: linear-gradient(135deg, #f59e0b, #d97706); }
.admin-mini-card.mc-G { background: linear-gradient(135deg, #10b981, #047857); }
.admin-mini-card.mc-B { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.admin-mini-card.mc-W,
.admin-mini-card.mc-P { background: linear-gradient(135deg, #334155, #0f172a); }

.werewolf-seat-card.is-inspecting {
    border-color: #a855f7 !important;
    box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.35), 0 6px 16px rgba(124, 58, 237, 0.22) !important;
}

.sw-god-mine {
    background: rgba(168, 85, 247, 0.22) !important;
    border-color: rgba(168, 85, 247, 0.55) !important;
    color: #e9d5ff !important;
}

/* ============================================================
   FAST, NATURAL BOARD & CARD ANIMATIONS (180ms - 260ms)
   ============================================================ */
@keyframes bgPieceSlide {
    0% {
        transform: translate(calc(var(--move-dx, 0) * 100%), calc(var(--move-dy, 0) * 100%)) scale(1.12);
        filter: drop-shadow(0 10px 16px rgba(0, 0, 0, 0.38));
    }
    70% {
        transform: translate(0, 0) scale(1.05);
    }
    100% {
        transform: translate(0, 0) scale(1);
    }
}

@keyframes bgCapturePulse {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.75), inset 0 0 14px rgba(245, 158, 11, 0.65);
    }
    100% {
        box-shadow: 0 0 0 14px rgba(239, 68, 68, 0), inset 0 0 0 rgba(245, 158, 11, 0);
    }
}

@keyframes bgStonePlace {
    0% {
        transform: scale(1.38);
        opacity: 0.45;
        filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.35));
    }
    75% {
        transform: scale(0.95);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes bgPieceFlip {
    0% {
        transform: perspective(360px) rotateY(90deg) scale(1.1);
        opacity: 0.55;
    }
    100% {
        transform: perspective(360px) rotateY(0deg) scale(1);
        opacity: 1;
    }
}

@keyframes bgDiscFlip {
    0% {
        transform: perspective(320px) rotateY(180deg) scale(1.12);
    }
    50% {
        transform: perspective(320px) rotateY(90deg) scale(1.18);
    }
    100% {
        transform: perspective(320px) rotateY(0deg) scale(1);
    }
}

@keyframes bgCardCover {
    0% {
        transform: translate(18px, 26px) scale(1.16) rotate(8deg);
        opacity: 0.6;
        box-shadow: 0 18px 34px rgba(0, 0, 0, 0.42);
    }
    75% {
        transform: translate(-2px, -2px) scale(0.98) rotate(-1.5deg);
        opacity: 1;
    }
    100% {
        transform: translate(0, 0) scale(1) rotate(0deg);
        opacity: 1;
    }
}

@keyframes bgCardDraw {
    0% {
        transform: translateY(-26px) scale(0.84) rotate(-5deg);
        opacity: 0.35;
        box-shadow: 0 0 18px rgba(16, 185, 129, 0.7);
    }
    100% {
        transform: translateY(0) scale(1) rotate(0deg);
        opacity: 1;
    }
}

@keyframes bgDiceRoll {
    0% {
        transform: rotate(-18deg) scale(0.82);
    }
    50% {
        transform: rotate(12deg) scale(1.1);
    }
    100% {
        transform: rotate(0deg) scale(1);
    }
}

.anim-piece-slide {
    animation: bgPieceSlide 0.22s cubic-bezier(0.22, 1, 0.36, 1) both;
    z-index: 12;
}

.anim-cell-capture {
    animation: bgCapturePulse 0.28s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.anim-stone-place {
    animation: bgStonePlace 0.2s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.anim-piece-flip {
    animation: bgPieceFlip 0.22s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.anim-disc-flip {
    animation: bgDiscFlip 0.24s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.anim-card-cover {
    animation: bgCardCover 0.22s cubic-bezier(0.22, 1, 0.36, 1) both;
    z-index: 6;
}

.anim-card-draw {
    animation: bgCardDraw 0.23s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.anim-dice-roll {
    animation: bgDiceRoll 0.24s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.uno-pile-stack {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.uno-pile-under {
    position: absolute;
    inset: 0;
    transform: rotate(-7deg) translate(-4px, 3px) scale(0.96);
    opacity: 0.72;
    pointer-events: none;
    z-index: 1;
}

/* ============================================================
   ONE CARD (POKER SHEDDING GAME) STYLES
   ============================================================ */
.poker-card {
    position: relative;
    width: 68px;
    height: 98px;
    border-radius: 14px;
    background: linear-gradient(155deg, #ffffff 0%, #f1f5f9 100%);
    border: 2.5px solid #cbd5e1;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.18s ease, border-color 0.18s ease;
    padding: 6px;
}

.poker-card.poker-table-card {
    width: 82px;
    height: 116px;
    cursor: default;
}

.poker-card.poker-red {
    color: #dc2626;
}

.poker-card.poker-black {
    color: #0f172a;
}

.poker-card-corner {
    position: absolute;
    top: 5px;
    left: 7px;
    font-size: 0.78rem;
    font-weight: 900;
    line-height: 1.05;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.poker-card-corner-br {
    position: absolute;
    bottom: 5px;
    right: 7px;
    font-size: 0.78rem;
    font-weight: 900;
    line-height: 1.05;
    transform: rotate(180deg);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.poker-card-center {
    font-size: 1.65rem;
    font-weight: 900;
    line-height: 1;
}

.poker-card-tag {
    position: absolute;
    bottom: 5px;
    left: 6px;
    font-size: 0.6rem;
    font-weight: 800;
    padding: 1px 4px;
    border-radius: 4px;
    background: rgba(15, 23, 42, 0.08);
}

.poker-card.playable {
    border-color: #10b981 !important;
    box-shadow: 0 0 0 2.5px rgba(16, 185, 129, 0.45), 0 8px 18px rgba(16, 185, 129, 0.25) !important;
    transform: translateY(-6px);
}

.poker-card.playable:hover {
    transform: translateY(-12px) scale(1.04);
}

.uno-hand-row .poker-card:not(.playable) {
    opacity: 0.76;
}

.uno-hand-row.compact-fan .poker-card + .poker-card {
    margin-left: -18px;
}

.onecard-attack-banner {
    padding: 8px 16px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.22), rgba(245, 158, 11, 0.22));
    border: 1.5px solid #ef4444;
    color: #ef4444;
    font-weight: 900;
    font-size: 0.86rem;
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.25);
    animation: bgCapturePulse 1.2s infinite alternate;
}

@media (max-width: 640px) {
    .poker-card {
        width: 56px;
        height: 82px;
        border-radius: 11px;
    }
    .poker-card-center {
        font-size: 1.35rem;
    }
    .poker-card-corner,
    .poker-card-corner-br {
        font-size: 0.68rem;
    }
}

/* ============================================================
   PUBLIC WAITING ROOMS STRIP, WEIQI HUD, SOCIAL PANEL & TOD
   ============================================================ */
.public-rooms-strip {
    margin-bottom: 18px;
    padding: 14px 18px;
    border-radius: 22px;
}

.public-rooms-list {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.public-room-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    background: var(--liquid-pill-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    font-size: 0.84rem;
    cursor: pointer;
    transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.public-room-chip:hover {
    transform: translateY(-1px);
    border-color: var(--accent);
    box-shadow: 0 6px 18px rgba(59, 130, 246, 0.18);
}

.public-room-game {
    font-weight: 800;
    color: var(--accent);
}

.public-room-meta {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.public-room-cta {
    font-weight: 800;
    font-size: 0.78rem;
    color: #10b981;
}

.weiqi-hud-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
}

.weiqi-hud-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 999px;
    background: var(--liquid-pill-bg);
    border: 1px solid var(--glass-border);
    font-size: 0.8rem;
    color: var(--text-primary);
}

.weiqi-hud-pill.hud-danger {
    border-color: rgba(239, 68, 68, 0.55);
    background: rgba(239, 68, 68, 0.14);
    color: #ef4444;
    font-weight: 800;
}

.weiqi-hud-pill.hud-warn {
    border-color: rgba(245, 158, 11, 0.55);
    background: rgba(245, 158, 11, 0.14);
    color: #f59e0b;
    font-weight: 800;
}

.weiqi-dot-black,
.weiqi-dot-white {
    display: inline-block;
    width: 11px;
    height: 11px;
    border-radius: 50%;
}

.weiqi-dot-black {
    background: radial-gradient(circle at 32% 30%, #666, #111 78%);
}

.weiqi-dot-white {
    background: radial-gradient(circle at 32% 30%, #fff, #ccc 80%);
    border: 1px solid rgba(0, 0, 0, 0.25);
}

.bg-social-panel {
    padding: 12px 14px;
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bg-emote-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.bg-emote-chip {
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid var(--glass-border);
    background: var(--liquid-pill-bg);
    color: var(--text-primary);
    font-size: 0.76rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.12s ease, border-color 0.12s ease;
}

.bg-emote-chip:hover {
    transform: scale(1.05);
    border-color: var(--accent);
}

.bg-emote-toast {
    position: fixed;
    top: 84px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1200;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.88);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.22);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(12px);
    font-size: 0.94rem;
    font-weight: 800;
    pointer-events: none;
}

.bg-emote-toast-sender {
    color: #60a5fa;
}

.bg-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.bg-chat-log {
    max-height: 180px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px 10px;
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.06);
    font-size: 0.8rem;
}

.bg-chat-msg {
    line-height: 1.4;
    word-break: break-word;
}

.bg-chat-sender {
    font-weight: 800;
    color: var(--accent);
    margin-right: 4px;
}

.bg-chat-form {
    display: flex;
    gap: 6px;
}

.bg-chat-input {
    flex: 1;
    min-width: 0;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid var(--glass-border);
    background: var(--liquid-pill-bg);
    color: var(--text-primary);
    font-size: 0.82rem;
}

.tod-fate-card {
    padding: 22px;
    text-align: center;
    width: 100%;
    max-width: 560px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.tod-filter-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.tod-filter-pills {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
}

.tod-counter-badge {
    font-size: 0.78rem;
    color: var(--text-secondary);
    padding: 3px 12px;
    border-radius: 999px;
    background: var(--liquid-pill-bg);
    border: 1px solid var(--glass-border);
}

.tod-lucky-title {
    font-size: 1.28rem;
    font-weight: 900;
    color: var(--accent);
}

.tod-prompt-box {
    width: 100%;
    padding: 16px 18px;
    border-radius: 16px;
    background: var(--liquid-pill-bg);
    border: 1px solid var(--glass-border);
    font-size: 1.02rem;
    line-height: 1.65;
    font-weight: 600;
    color: var(--text-primary);
}

.tod-custom-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    width: 100%;
    margin-top: 6px;
    padding-top: 12px;
    border-top: 1px solid var(--divider);
}




