@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;700;900&family=Inter:wght@300;400;600;800&display=swap');

:root {
    --bg-color: #0d0e12;
    --card-bg: rgba(20, 22, 30, 0.65);
    --border-color: rgba(255, 215, 0, 0.2);
    --accent-gold: #ffd700;
    --accent-red: #ff3b30;
    --accent-green: #34c759;
    --text-primary: #f5f5f7;
    --text-muted: #8e8e93;
    --neon-blue: #00f0ff;
    --glow-shadow: 0 0 20px rgba(255, 215, 0, 0.35);
    --table-color: #3b1717; /* Dark mahogany wood */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(255, 60, 60, 0.04) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(0, 240, 255, 0.04) 0%, transparent 40%),
        url('data:image/svg+xml;utf8,<svg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"><filter id="noiseFilter"><feTurbulence type="fractalNoise" baseFrequency="0.9" numOctaves="4" stitchTiles="stitch"/></filter><rect width="100%" height="100%" filter="url(%23noiseFilter)" opacity="0.02"/></svg>');
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    overflow: hidden;
}

/* Screen Management */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem 1rem;
    overflow-y: auto;
}

.screen.active {
    opacity: 1;
    pointer-events: auto;
}

/* Header Styles */
header {
    text-align: center;
    margin-bottom: 2rem;
    flex-shrink: 0;
}

/* ==========================================================================
   DESKTOP TABLETOP GAME STYLE MAIN LOBBY
   ========================================================================== */

/* ==========================================================================
   DESKTOP TABLETOP GAME STYLE MAIN LOBBY (FULL TAVERN ARTWORK BACKGROUND)
   ========================================================================== */

/* Fullscreen 2D Tavern Lobby Screen */
.full-tavern-lobby {
    background: 
        linear-gradient(90deg, rgba(12, 9, 8, 0.88) 0%, rgba(12, 9, 8, 0.65) 35%, rgba(12, 9, 8, 0.12) 68%, rgba(12, 9, 8, 0.45) 100%), 
        url('assets/tavern_scene_hd.jpg') no-repeat center center / cover;
    overflow: hidden;
    padding: 0.8rem 1.8rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
}

/* Top Curved Gold-Rimmed Navigation Bar */
.tabletop-top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1500px;
    padding: 0.7rem 1.8rem;
    border-radius: 14px;
    background: rgba(22, 16, 12, 0.8);
    border: 1.5px solid rgba(255, 215, 0, 0.35);
    border-bottom: 2px solid var(--accent-gold);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    flex-shrink: 0;
    margin-bottom: 1.5rem;
}

.nav-brand-group {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.brand-crest {
    font-size: 2rem;
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.5));
}

.brand-titles {
    display: flex;
    flex-direction: column;
}

.brand-main-title {
    font-family: 'Cinzel', serif;
    font-size: 1.8rem;
    font-weight: 900;
    letter-spacing: 0.2rem;
    background: linear-gradient(135deg, #ffffff 15%, var(--accent-gold) 70%, #ff8c00 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0;
    line-height: 1.1;
    text-align: left;
}

.brand-subtitle {
    color: var(--text-muted);
    font-size: 0.8rem;
    letter-spacing: 0.1rem;
    font-weight: 400;
}

.nav-menu-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-action-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 215, 0, 0.12);
    border: 1.5px solid rgba(255, 215, 0, 0.45);
    color: var(--accent-gold);
    padding: 0.5rem 1.3rem;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.nav-action-pill:hover {
    background: var(--accent-gold);
    color: #0d0e12;
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

/* Stage Layout Body */
.tabletop-lobby-body {
    display: flex;
    width: 100%;
    max-width: 1500px;
    flex-grow: 1;
    align-items: center;
    padding-left: 1rem;
}

/* ==========================================================================
   TAVERN WOODEN PLAQUE MODE CARDS (ORIGINAL TABLET/DESKTOP VERTICAL PLAQUES)
   ========================================================================== */

.mode-deck-container {
    display: flex !important;
    flex-direction: column !important;
    gap: 2.2rem;
    width: 490px;
    max-width: 92vw;
}

.tavern-mode-plaque {
    position: relative;
    width: 100%;
    min-height: 195px;
    padding: 1.6rem 2.4rem;
    border-radius: 24px;
    background: linear-gradient(180deg, #f5c26b 0%, #e09b36 32%, #b5711c 85%, #8c4e0d 100%);
    border: 4.5px solid #4a2810;
    box-shadow: 
        0 18px 45px rgba(0, 0, 0, 0.9),
        0 0 30px rgba(255, 190, 0, 0.25),
        inset 0 3px 8px rgba(255, 255, 255, 0.5),
        inset 0 -6px 14px rgba(0, 0, 0, 0.7);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    user-select: none;
    -webkit-user-select: none;
}

.pvp-plaque {
    background: linear-gradient(180deg, #ffcf73 0%, #e8a538 30%, #c47c1e 80%, #99550e 100%);
    box-shadow: 
        0 20px 50px rgba(0, 0, 0, 0.9),
        0 0 40px rgba(255, 215, 0, 0.4),
        inset 0 3px 8px rgba(255, 255, 255, 0.6),
        inset 0 -6px 14px rgba(0, 0, 0, 0.7);
}

.tavern-mode-plaque:hover {
    transform: translateX(14px) translateY(-5px) scale(1.03);
    box-shadow: 
        0 28px 65px rgba(0, 0, 0, 0.95),
        0 0 50px rgba(255, 215, 0, 0.65),
        inset 0 3px 12px rgba(255, 255, 255, 0.75),
        inset 0 -6px 18px rgba(0, 0, 0, 0.6);
    border-color: #ffd700;
}

.tavern-mode-plaque:active {
    transform: translateX(8px) translateY(2px) scale(0.98);
    box-shadow: 
        0 8px 20px rgba(0, 0, 0, 0.9),
        inset 0 5px 15px rgba(0, 0, 0, 0.8);
}

/* 4 Corner Metallic Screws / Rivets */
.plaque-rivet {
    position: absolute;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #ffffff 0%, #ecd078 30%, #a37c15 70%, #4a3607 100%);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.85), inset 0 1px 1px #fff;
    border: 1px solid rgba(0, 0, 0, 0.5);
    z-index: 5;
}

.rivet-tl { top: 14px; left: 14px; }
.rivet-tr { top: 14px; right: 14px; }
.rivet-bl { bottom: 14px; left: 14px; }
.rivet-br { bottom: 14px; right: 14px; }

/* Corner Mode Badge */
.plaque-corner-badge {
    position: absolute;
    top: 14px;
    right: 34px;
    font-size: 0.8rem;
    font-weight: 800;
    padding: 3px 12px;
    border-radius: 12px;
    letter-spacing: 0.5px;
    z-index: 6;
}

.badge-cyan {
    background: rgba(14, 18, 28, 0.85);
    border: 1px solid #00f0ff;
    color: #00f0ff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

.badge-gold {
    background: rgba(28, 18, 10, 0.85);
    border: 1px solid #ffd700;
    color: #ffd700;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6), 0 0 10px rgba(255, 215, 0, 0.4);
    animation: hotBadgePulse 2s infinite alternate;
}

/* Inner Layout: Large Icon + Big Bold Title */
.plaque-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2.2rem;
    width: 100%;
    z-index: 3;
}

.plaque-icon-wrap {
    width: 90px;
    height: 90px;
    border-radius: 22px;
    background: rgba(0, 0, 0, 0.28);
    border: 2.5px solid rgba(255, 255, 255, 0.35);
    box-shadow: 
        inset 0 3px 8px rgba(0, 0, 0, 0.6),
        0 6px 16px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.gold-icon-wrap {
    border-color: rgba(255, 235, 150, 0.6);
    background: radial-gradient(circle, rgba(255, 215, 0, 0.25) 0%, rgba(0, 0, 0, 0.35) 100%);
    box-shadow: 
        inset 0 3px 8px rgba(0, 0, 0, 0.6),
        0 0 20px rgba(255, 215, 0, 0.45);
}

.tavern-mode-plaque:hover .plaque-icon-wrap {
    transform: scale(1.12) rotate(5deg);
}

.plaque-icon {
    font-size: 3.8rem;
    filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.65));
}

.plaque-title {
    font-family: 'Cinzel', 'Noto Sans SC', 'PingFang SC', sans-serif;
    font-size: 2.8rem;
    font-weight: 900;
    color: #3b1c06;
    letter-spacing: 3px;
    text-shadow: 
        0 1px 0 rgba(255, 255, 255, 0.6),
        0 3px 6px rgba(0, 0, 0, 0.45);
    margin: 0;
    white-space: nowrap;
}

.gold-title {
    color: #381502;
    text-shadow: 
        0 1px 0 rgba(255, 240, 180, 0.8),
        0 3px 8px rgba(0, 0, 0, 0.5);
}

@keyframes charBob {
    0% { transform: translateY(0); }
    100% { transform: translateY(-5px); }
}

@keyframes activeGlowPulse {
    0% { box-shadow: 0 0 15px rgba(255, 215, 0, 0.4), 0 6px 20px rgba(0, 0, 0, 0.9); }
    100% { box-shadow: 0 0 30px rgba(255, 215, 0, 0.9), 0 6px 25px rgba(0, 0, 0, 0.9); }
}

@keyframes liveDotPulse {
    0% { transform: scale(0.8); opacity: 0.6; }
    50% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(0.8); opacity: 0.6; }
}

/* Back Navigation Button in Lobby */
.back-nav-btn {
    position: absolute;
    top: 1.5rem;
    left: 2rem;
    background: rgba(15, 17, 23, 0.85);
    border: 1px solid rgba(255, 215, 0, 0.35);
    color: var(--accent-gold);
    padding: 0.5rem 1.2rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(12px);
    z-index: 50;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.back-nav-btn:hover {
    background: var(--accent-gold);
    color: #000;
    transform: scale(1.05);
    box-shadow: 0 4px 18px rgba(255, 215, 0, 0.4);
}

h1 {
    font-family: 'Cinzel', serif;
    font-size: 3rem;
    font-weight: 900;
    letter-spacing: 0.3rem;
    background: linear-gradient(135deg, #fff 20%, var(--accent-gold) 70%, #ff8c00 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.15);
    margin-bottom: 0.3rem;
    text-transform: uppercase;
}

header p {
    color: var(--text-muted);
    font-size: 1rem;
    letter-spacing: 0.08rem;
    font-weight: 300;
}

/* Container */
.container {
    max-width: 1200px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    flex-grow: 1;
}

/* Lobby Selection Panel */
.selection-panel {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    backdrop-filter: blur(15px);
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 2rem;
    max-width: 400px;
}

.input-group label {
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    color: var(--accent-gold);
    letter-spacing: 0.05rem;
}

.input-group input {
    background: rgba(0,0,0,0.5);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: #fff;
    padding: 0.8rem 1.2rem;
    font-size: 1.1rem;
    outline: none;
    transition: all 0.3s ease;
}

.input-group input:focus {
    border-color: var(--accent-gold);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.2);
}

/* Section Title */
.section-title {
    font-family: 'Cinzel', serif;
    font-size: 1.4rem;
    color: var(--accent-gold);
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

/* Character Grid */
.character-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.2rem;
}

.character-card {
    background: rgba(10, 10, 15, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    position: relative;
    aspect-ratio: 3/4;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1rem;
}

.character-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, transparent 40%, rgba(0, 0, 0, 0.9) 95%);
    z-index: 2;
}

.character-poster {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: transform 0.5s ease;
    z-index: 1;
}

.character-card:hover .character-poster {
    transform: scale(1.05);
}

.character-info {
    position: relative;
    z-index: 3;
}

.character-name {
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
}

.character-role {
    font-size: 0.75rem;
    color: var(--accent-gold);
    text-transform: uppercase;
    letter-spacing: 0.05rem;
    margin-top: 0.1rem;
}

.character-card.selected {
    border-color: var(--accent-gold);
    box-shadow: var(--glow-shadow);
    transform: translateY(-5px);
}

.character-card.selected::after {
    content: 'SELECTED';
    position: absolute;
    top: 0.8rem;
    right: 0.8rem;
    background: var(--accent-gold);
    color: #000;
    font-size: 0.65rem;
    font-weight: 900;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    z-index: 3;
}

/* Lobby Room Actions */
.room-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem 2rem;
    backdrop-filter: blur(15px);
}

.join-box {
    display: flex;
    gap: 0.8rem;
}

.join-box input {
    background: rgba(0,0,0,0.5);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: #fff;
    padding: 0.7rem 1.2rem;
    font-size: 1.1rem;
    letter-spacing: 0.2rem;
    text-align: center;
    width: 180px;
    outline: none;
}

/* Buttons */
.menu-btn {
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    font-weight: 700;
    border: none;
    border-radius: 8px;
    padding: 0.75rem 2rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.primary-glow {
    background: linear-gradient(135deg, #ffe066, var(--accent-gold));
    color: #000;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.25);
}

.primary-glow:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.45);
}

.secondary-glow {
    background: transparent;
    border: 1px solid var(--accent-gold);
    color: var(--accent-gold);
}

.secondary-glow:hover {
    background: rgba(255, 215, 0, 0.1);
    transform: translateY(-2px);
}

/* Waiting Room */
.waiting-container {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2rem;
    backdrop-filter: blur(20px);
}

.waiting-layout {
    display: block;
    max-width: 550px;
    margin: 0 auto 2rem;
}

.players-panel h3 {
    font-family: 'Cinzel', serif;
    color: var(--accent-gold);
    font-size: 1.2rem;
    margin-bottom: 1.2rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding-bottom: 0.5rem;
    text-align: center;
}

.players-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.player-row {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem 1.2rem;
}

.player-row-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    border: 1.5px solid var(--accent-gold);
}

.player-row-info {
    display: flex;
    flex-direction: column;
}

.player-row-name {
    font-weight: 600;
    font-size: 1.05rem;
}

.player-row-role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.player-row-tag {
    margin-left: auto;
    background: rgba(255, 215, 0, 0.15);
    border: 1px solid var(--accent-gold);
    color: var(--accent-gold);
    font-size: 0.65rem;
    font-weight: 800;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
}

.invite-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.share-link-box p, .qr-box p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.link-copy {
    display: flex;
    gap: 0.5rem;
}

.link-copy input {
    background: rgba(0,0,0,0.5);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: #fff;
    padding: 0.6rem 1rem;
    font-size: 0.95rem;
    outline: none;
    flex-grow: 1;
}

.link-copy button {
    background: var(--accent-gold);
    color: #000;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    padding: 0 1.2rem;
    cursor: pointer;
}

.qr-container {
    background: #fff;
    border-radius: 10px;
    padding: 10px;
    width: 170px;
    height: 170px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.qr-container img {
    width: 150px;
    height: 150px;
}

/* Controls */
.lobby-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    border-top: 1px solid rgba(255,255,255,0.05);
    padding-top: 1.5rem;
}

.enter-btn {
    font-family: 'Cinzel', serif;
    font-size: 1.3rem;
    font-weight: 900;
    color: #000;
    background: linear-gradient(135deg, #ffe066, var(--accent-gold));
    border: none;
    border-radius: 30px;
    padding: 0.8rem 3.5rem;
    cursor: pointer;
    letter-spacing: 0.15rem;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.25);
    transition: all 0.3s ease;
}

.enter-btn:hover {
    transform: scale(1.03);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.55);
}

.notice-text {
    color: var(--text-muted);
    font-size: 0.95rem;
    font-style: italic;
}

.exit-btn {
    background: transparent;
    border: none;
    color: var(--accent-red);
    cursor: pointer;
    font-size: 0.9rem;
    text-decoration: underline;
}

/* GAME SCREEN TABLE */
.game-table-container {
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle at center, #2c2f3d 0%, #0d0f14 100%);
    position: relative;
}

/* GAME SCREEN TABLE */
.game-table-container {
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle at center, #2c2f3d 0%, #0d0f14 100%);
    position: relative;
    overflow: hidden;
}

.game-table {
    width: 82.8vw;
    height: 77.4vh;
    max-width: 1260px;
    max-height: 765px;
    background-color: #3b1717; /* Mahogany mahogany color */
    background-image: 
        radial-gradient(circle at center, #542222 0%, #1f0b0b 90%),
        url('data:image/svg+xml;utf8,<svg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"><filter id="noise"><feTurbulence type="fractalNoise" baseFrequency="0.6" numOctaves="3" stitchTiles="stitch"/></filter><rect width="100%" height="100%" filter="url(%23noise)" opacity="0.04"/></svg>');
    border: 18px solid #231111;
    border-radius: 50% / 50%;
    box-shadow: 
        inset 0 0 50px rgba(0, 0, 0, 0.9), 
        0 15px 40px rgba(0, 0, 0, 0.8),
        0 0 0 4px #0b0505;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Player seats absolute positioning */
.player-seat {
    position: absolute;
    width: 130px;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 10;
    transition: all 0.3s ease;
}

.player-seat.active-turn {
    transform: scale(1.08);
}

.avatar-frame {
    width: 90px;
    height: 120px;
    border-radius: 8px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    position: relative;
    background: #0f1015;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    transition: all 0.3s ease;
}

.player-seat.active-turn .avatar-frame {
    border-color: var(--accent-gold);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.seat-avatar {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
}

.auto-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 15, 0.75);
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0.35rem;
    color: var(--accent-gold);
    font-family: 'Cinzel', -apple-system, "Microsoft YaHei", sans-serif;
    font-weight: 900;
    font-size: 1.2rem;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.8), 0 2px 4px rgba(0, 0, 0, 0.9);
    z-index: 4;
    border-radius: 6px;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    border: 1px solid rgba(255, 215, 0, 0.4);
    animation: fadeIn 0.3s ease;
}

.auto-overlay span {
    display: block;
    line-height: 1.1;
}

.player-seat.is-auto .auto-overlay {
    display: flex;
}

.player-seat.is-auto .seat-avatar {
    filter: brightness(0.4) grayscale(0.7);
}

.player-seat.is-auto .seat-name {
    color: var(--accent-gold);
    opacity: 0.85;
}

.skull-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.75);
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: var(--accent-red);
    font-weight: 800;
    font-size: 0.65rem;
    text-align: center;
    z-index: 5;
    animation: pulse 1.5s infinite;
}

.player-seat.eliminated .skull-overlay {
    display: flex;
}

.player-seat.eliminated .seat-avatar {
    filter: grayscale(1);
}

.seat-info {
    text-align: center;
    margin-top: 0.5rem;
    width: 100%;
}

.seat-name {
    font-weight: 600;
    font-size: 0.9rem;
    display: block;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bullet-indicator {
    display: flex;
    justify-content: center;
    gap: 0.25rem;
    margin-top: 0.2rem;
}

.chamber {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent-green);
    box-shadow: 0 0 8px var(--accent-green);
    border: 1px solid rgba(0,0,0,0.6);
    transition: all 0.3s ease;
}

.chamber.fired {
    background: rgba(30, 45, 30, 0.85);
    box-shadow: none;
    border-color: rgba(255, 255, 255, 0.15);
}

/* Card backs pile displayed for other players */
.seat-cards {
    display: flex;
    justify-content: center;
    width: 120px;
    height: 35px;
    position: relative;
    margin-top: 0.3rem;
}

.mini-card-back {
    width: 24px;
    height: 34px;
    background-image: url('assets/card_back.png');
    background-size: cover;
    border-radius: 3px;
    border: 1px solid rgba(0,0,0,0.4);
    position: absolute;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* Seats layout coordinates */
.seat-left {
    left: -40px;
    top: calc(50% - 100px);
}

.seat-top {
    top: -55px;
    left: calc(50% - 65px);
}

.seat-right {
    right: -40px;
    top: calc(50% - 100px);
}

.seat-bottom {
    bottom: -40px;
    left: calc(50% - 240px);
    transform: scale(1.08);
}

.seat-bottom.active-turn {
    transform: scale(1.15);
}

/* CENTER BOARD ZONE */
.table-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 5;
    position: relative;
    width: 100%;
    height: 100px;
}

.center-card-pile {
    width: 70px;
    height: 95px;
    position: relative;
}

.pile-card {
    width: 70px;
    height: 95px;
    background-image: url('assets/card_back.png');
    background-size: cover;
    border-radius: 5px;
    border: 1px solid rgba(0,0,0,0.5);
    position: absolute;
    box-shadow: 0 4px 8px rgba(0,0,0,0.4);
}

.action-announcement {
    position: absolute;
    left: 25px;
    top: 25px;
    z-index: 200;
    max-width: 300px;
    font-size: 0.9rem;
    color: #fff;
    background: rgba(13, 14, 18, 0.9);
    padding: 0.7rem 1.3rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    border-left: 3.5px solid var(--accent-gold);
    white-space: normal;
    text-align: left;
    box-shadow: 0 5px 15px rgba(0,0,0,0.65);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
    line-height: 1.4;
}

/* HAND CARDS */
.hand-container {
    position: absolute;
    bottom: -40px;
    left: calc(50% + 110px);
    transform: translateX(-50%);
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 0.8rem;
    width: 440px;
    height: 160px;
    z-index: 100;
}

.game-card {
    width: 90px;
    height: 125px;
    border-radius: 6px;
    background-size: cover;
    background-position: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 6px 12px rgba(0,0,0,0.5);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    position: relative;
    user-select: none;
    /* Dealing animation default properties */
    transform-origin: center bottom;
}

.game-card:hover {
    transform: translateY(-14px) scale(1.05);
    box-shadow: 0 8px 16px rgba(0,0,0,0.6);
    border-color: rgba(255, 255, 255, 0.4);
}

.game-card.selected {
    transform: translateY(-22px) scale(1.06);
    border-color: var(--accent-gold);
    box-shadow: 0 0 12px rgba(255, 215, 0, 0.5);
}

.game-card.selected::after {
    content: '✓';
    position: absolute;
    top: -7px;
    right: -7px;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    background: var(--accent-gold);
    color: #000;
    font-size: 0.65rem;
    font-weight: bold;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1.5px solid #000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

/* Card readability label */
.card-value-label {
    position: absolute;
    top: 3px;
    left: 3px;
    background: rgba(13, 14, 18, 0.88);
    color: var(--accent-gold);
    border: 1px solid var(--accent-gold);
    border-radius: 3px;
    font-family: 'Cinzel', serif;
    font-size: 0.62rem;
    font-weight: 900;
    padding: 1px 3px;
    line-height: 1;
    box-shadow: 0 1px 3px rgba(0,0,0,0.6);
    text-shadow: 0 0 4px rgba(255, 215, 0, 0.5);
    z-index: 5;
    pointer-events: none;
    letter-spacing: 0.02rem;
}

.game-card:hover {
    transform: translateY(-25px) scale(1.05);
    box-shadow: 0 10px 20px rgba(0,0,0,0.6);
    border-color: rgba(255, 255, 255, 0.4);
}

.game-card.selected {
    transform: translateY(-40px) scale(1.05);
    border-color: var(--accent-gold);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
}

.game-card.selected::after {
    content: '✓';
    position: absolute;
    top: -10px;
    right: -10px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--accent-gold);
    color: #000;
    font-size: 0.8rem;
    font-weight: bold;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 2px solid #000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
}

/* Card readability label */
.card-value-label {
    position: absolute;
    top: 5px;
    left: 5px;
    background: rgba(13, 14, 18, 0.88);
    color: var(--accent-gold);
    border: 1px solid var(--accent-gold);
    border-radius: 4px;
    font-family: 'Cinzel', serif;
    font-size: 0.75rem;
    font-weight: 900;
    padding: 2px 5px;
    line-height: 1;
    box-shadow: 0 2px 5px rgba(0,0,0,0.6);
    text-shadow: 0 0 4px rgba(255, 215, 0, 0.5);
    z-index: 5;
    pointer-events: none;
    letter-spacing: 0.02rem;
}

/* Challenged Cards Reveal Horizontal Layout */
.revealed-cards-area {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin: 12px 0;
    z-index: 100;
    width: 100%;
    perspective: 1000px;
}

.revealed-card-container {
    width: 66px;
    height: 92px;
    perspective: 1000px;
    animation: revealPopAndFloat 2.0s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.revealed-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transform-style: preserve-3d;
    animation: revealFlip3D 2.0s cubic-bezier(0.34, 1.25, 0.64, 1) both;
}

/* Card Faces */
.revealed-card-back, .revealed-card-front {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 8px;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.75);
}

/* Back Face (Face Down) */
.revealed-card-back {
    background: linear-gradient(145deg, #301a12 0%, #170b06 100%);
    border: 2px solid #d4af37;
    background-image: repeating-linear-gradient(45deg, rgba(212, 175, 55, 0.18) 0, rgba(212, 175, 55, 0.18) 10px, transparent 10px, transparent 20px);
    display: flex;
    align-items: center;
    justify-content: center;
}
.revealed-card-back::after {
    content: '🃏';
    font-size: 1.8rem;
    opacity: 0.8;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.8));
}

/* Front Face (Face Up) */
.revealed-card-front {
    background-size: cover;
    background-position: center;
    transform: rotateY(180deg);
}

.revealed-card-front.revealed-honest {
    border: 2.5px solid #2ecc71;
    box-shadow: 0 0 20px rgba(46, 204, 113, 0.9);
}
.revealed-card-front.revealed-honest::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(46, 204, 113, 0.38); /* emerald green coating */
    border-radius: 6px;
    box-shadow: inset 0 0 14px rgba(46, 204, 113, 0.65);
}

.revealed-card-front.revealed-bluff {
    border: 2.5px solid #e74c3c;
    box-shadow: 0 0 20px rgba(231, 76, 60, 0.9);
}
.revealed-card-front.revealed-bluff::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(231, 76, 60, 0.42); /* crimson red coating */
    border-radius: 6px;
    box-shadow: inset 0 0 14px rgba(231, 76, 60, 0.65);
}

/* Verdict Sub-badge */
.reveal-verdict-tag {
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.68rem;
    font-weight: 900;
    padding: 2px 8px;
    border-radius: 12px;
    white-space: nowrap;
    z-index: 10;
    letter-spacing: 0.5px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.7);
}
.reveal-verdict-tag.tag-honest {
    background: linear-gradient(135deg, #27ae60 0%, #1e8449 100%);
    color: #ffffff;
    border: 1.5px solid #2ecc71;
}
.reveal-verdict-tag.tag-bluff {
    background: linear-gradient(135deg, #c0392b 0%, #922b21 100%);
    color: #ffffff;
    border: 1.5px solid #e74c3c;
}

/* 2-Second 3D Flip & Pop Keyframes */
@keyframes revealPopAndFloat {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.5);
    }
    20% {
        opacity: 1;
        transform: translateY(-10px) scale(1.18);
    }
    45% {
        transform: translateY(0px) scale(1.1);
    }
    75% {
        transform: translateY(0px) scale(1.03);
    }
    100% {
        opacity: 1;
        transform: translateY(0px) scale(1.0);
    }
}

@keyframes revealFlip3D {
    0% {
        transform: rotateY(0deg);
    }
    25% {
        transform: rotateY(0deg) scale(1.05);
    }
    60% {
        transform: rotateY(180deg) scale(1.22);
    }
    85% {
        transform: rotateY(180deg) scale(1.04);
    }
    100% {
        transform: rotateY(180deg) scale(1.0);
    }
}

/* Dealing Fly Animation styles */
.dealing {
    position: absolute !important;
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%) scale(0.3) rotate(0deg) !important;
    opacity: 0;
    z-index: 100;
    pointer-events: none;
}

/* Persistent theme banner in top-right area (shifted away from top-right buttons) */
.theme-banner {
    position: absolute;
    top: 25px;
    right: 200px;
    background: rgba(13, 14, 18, 0.85);
    border: 1px solid var(--border-color);
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #fff;
    z-index: 120;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
    pointer-events: none;
    border-left: 3px solid var(--accent-gold);
    letter-spacing: 0.05rem;
}
.theme-banner strong {
    color: var(--accent-gold);
    font-weight: 800;
    font-size: 1.15rem;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.5);
    margin: 0 0.2rem;
}

/* ACTION/REACTION CONTROL PANELS */
.action-panel {
    position: absolute;
    bottom: 135px;
    left: calc(50% + 110px);
    transform: translateX(-50%);
    z-index: 110;
    width: 320px;
    display: flex;
    justify-content: center;
}

.action-btn {
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    font-weight: 900;
    border: none;
    border-radius: 20px;
    padding: 0.6rem 2.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
}

.action-btn:disabled {
    background: #3a3b42;
    color: var(--text-muted);
    cursor: not-allowed;
    box-shadow: none;
}

.play-glow {
    background: linear-gradient(135deg, #ffe066, var(--accent-gold));
    color: #000;
    box-shadow: 0 4px 12px rgba(255,215,0,0.3);
}

.play-glow:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 6px 18px rgba(255,215,0,0.55);
}

.reaction-buttons {
    display: flex;
    gap: 1rem;
}

.pass-glow {
    background: linear-gradient(135deg, #a8ffb2, var(--accent-green));
    color: #000;
    box-shadow: 0 4px 12px rgba(52,199,89,0.3);
}

.pass-glow:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 18px rgba(52,199,89,0.55);
}

.challenge-glow {
    background: linear-gradient(135deg, #ff9b9b, var(--accent-red));
    color: #fff;
    box-shadow: 0 4px 12px rgba(255,59,48,0.3);
}

.challenge-glow:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(255,59,48,0.55);
}

/* RUSSIAN ROULETTE OVERLAY & CYLINER */
.roulette-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.95);
    z-index: 200;
    display: none;
    justify-content: center;
    align-items: center;
}

.roulette-box {
    background: rgba(20,20,25,0.9);
    border: 2px solid var(--accent-gold);
    border-radius: 20px;
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    width: 400px;
    box-shadow: var(--glow-shadow);
}

.roulette-box h2 {
    font-family: 'Cinzel', serif;
    color: var(--accent-red);
    text-shadow: 0 0 10px rgba(255,59,48,0.3);
    text-align: center;
    font-size: 1.4rem;
}

.cylinder-wrapper {
    position: relative;
    width: 200px;
    height: 200px;
}

.cylinder-3 {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #2b2d35;
    border: 6px solid #4a4d58;
    position: relative;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.8), 0 8px 16px rgba(0,0,0,0.5);
    transform: rotate(0deg);
}

.cylinder-3.spinning {
    animation: spin 5s cubic-bezier(0.15, 0.85, 0.35, 1);
}

.chamber-slot {
    position: absolute;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #111;
    border: 3px solid #1a1a1f;
    top: 50%;
    left: 50%;
    transform-origin: center;
}

/* Position 3 chambers at 120-degree intervals */
.chamber-slot.slot-0 {
    transform: translate(-50%, -50%) translateY(-60px);
}

.chamber-slot.slot-1 {
    transform: translate(-50%, -50%) rotate(120deg) translateY(-60px);
}

.chamber-slot.slot-2 {
    transform: translate(-50%, -50%) rotate(240deg) translateY(-60px);
}

.chamber-slot.fired-slot {
    background: radial-gradient(circle at center, #ffd700 10%, #ff3b30 40%, #000 90%);
    box-shadow: 0 0 15px var(--accent-red);
}

.cylinder-core {
    position: absolute;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #1c1d22;
    border: 4px solid #4a4d58;
    top: calc(50% - 18px);
    left: calc(50% - 18px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.roulette-status-text {
    font-weight: 600;
    font-size: 1.1rem;
    text-align: center;
}

/* GAMEOVER SCREEN */
.gameover-box {
    background: var(--card-bg);
    border: 2px solid var(--accent-gold);
    border-radius: 20px;
    padding: 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    max-width: 500px;
    width: 100%;
    text-align: center;
    backdrop-filter: blur(20px);
    box-shadow: var(--glow-shadow);
}

.gameover-box h1 {
    font-family: 'Cinzel', serif;
    color: var(--accent-gold);
    font-size: 2.2rem;
}

.winner-poster {
    width: 160px;
    height: 213px;
    border-radius: 8px;
    border: 3px solid var(--accent-gold);
    background-size: cover;
    background-position: center;
    box-shadow: var(--glow-shadow);
}

#winnerName {
    font-family: 'Cinzel', serif;
    font-size: 1.4rem;
    color: #fff;
}

/* Audio Toggle Widget (Hidden, audio managed via settings modal) */
.audio-toggle {
    display: none !important;
}

/* KEYFRAMES & SHAKE & ANIMATIONS */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(2880deg); } /* Multiple rotations for 5s spin */
}

@keyframes pulse {
    0% { opacity: 0.8; }
    50% { opacity: 1; }
    100% { opacity: 0.8; }
}

/* Gunfire shake animation */
.screen-shake {
    animation: shake 0.4s cubic-bezier(.36,.07,.19,.97) both;
    transform: translate3d(0, 0, 0);
}

@keyframes shake {
    10%, 90% { transform: translate3d(-4px, 0, 0); }
    20%, 80% { transform: translate3d(8px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-10px, 0, 0); }
    40%, 60% { transform: translate3d(10px, 0, 0); }
}/* Rotate phone prompt overlay */
#rotatePrompt {
    display: none !important; /* Disable fullscreen prompt to allow immediate play in portrait CSS rotation */
}

/* SHUFFLE ANIMATION STYLES */
.shuffle-animation-area {
    width: 180px;
    height: 95px;
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 200;
}

.shuffle-deck {
    width: 60px;
    height: 82px;
    background-image: url('assets/card_back.png');
    background-size: cover;
    border-radius: 5px;
    border: 1px solid rgba(0,0,0,0.5);
    box-shadow: 0 4px 8px rgba(0,0,0,0.4);
}

.deck-left {
    animation: shuffleLeft 0.4s ease-in-out infinite alternate;
}
.deck-right {
    animation: shuffleRight 0.4s ease-in-out infinite alternate;
}

@keyframes shuffleLeft {
    0% { transform: translateX(0) rotate(-6deg); }
    100% { transform: translateX(12px) rotate(0deg); }
}
@keyframes shuffleRight {
    0% { transform: translateX(0) rotate(6deg); }
    100% { transform: translateX(-12px) rotate(0deg); }
}

.shuffling-card-single {
    position: absolute;
    width: 60px;
    height: 82px;
    background-image: url('assets/card_back.png');
    background-size: cover;
    border-radius: 5px;
    border: 1px solid rgba(0,0,0,0.5);
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    z-index: 250;
    animation: riffleCard 0.25s linear infinite;
    pointer-events: none;
}

@keyframes riffleCard {
    0% { left: 15px; transform: scale(0.9) rotate(-15deg); opacity: 0.2; }
    30% { opacity: 1; }
    70% { opacity: 1; }
    100% { left: 105px; transform: scale(0.9) rotate(15deg); opacity: 0.2; }
}

/* THEME CARD REVEAL OVERLAY */
.theme-reveal-overlay {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.theme-reveal-card {
    width: 110px;
    height: 150px;
    background-size: 100% 100%;
    background-position: center;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.5), 0 0 0 3px var(--accent-gold);
    animation: themeRevealPop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

.theme-reveal-text {
    font-family: 'Cinzel', serif;
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--accent-gold);
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.6);
    letter-spacing: 0.15rem;
    animation: fadeIn 0.4s ease both;
}

@keyframes themeRevealPop {
    0% { transform: scale(0.1) rotate(-20deg); opacity: 0; }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

/* Game In-app Toast Notification */
.game-toast {
    position: fixed;
    top: 35px;
    left: 50%;
    transform: translateX(-50%) translateY(-25px);
    background: rgba(20, 22, 28, 0.95);
    border: 1px solid var(--accent-gold);
    border-radius: 10px;
    padding: 0.75rem 2rem;
    color: var(--accent-gold);
    font-family: 'Cinzel', -apple-system, sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 1px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.85), 0 0 15px rgba(255, 215, 0, 0.25);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    z-index: 3000;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

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

/* Per-Seat 30s Turn Countdown Timer Badge */
.seat-timer {
    position: absolute;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 17, 23, 0.95);
    border: 1.5px solid var(--accent-gold);
    border-radius: 50%;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.75), 0 0 12px rgba(255, 215, 0, 0.35);
    z-index: 150;
    animation: timerPopIn 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transition: all 0.3s ease;
}

@keyframes timerPopIn {
    0% { transform: scale(0.2) rotate(-30deg); opacity: 0; }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

/* Specific position beside each seat */
.seat-top .seat-timer {
    right: -28px;
    top: 35px;
}

.seat-left .seat-timer {
    right: -28px;
    top: 35px;
}

.seat-right .seat-timer {
    left: -28px;
    top: 35px;
}

.seat-bottom .seat-timer {
    left: -28px;
    top: 35px;
}

.seat-timer-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.seat-timer-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.12);
    stroke-width: 3;
}

.seat-timer-progress {
    fill: none;
    stroke: var(--accent-gold);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-dasharray: 91.1; /* 2 * PI * 14.5 */
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 0.9s linear, stroke 0.3s ease;
}

.seat-timer-sec {
    position: absolute;
    font-family: 'Cinzel', -apple-system, sans-serif;
    font-size: 0.92rem;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}

.seat-timer.urgent {
    border-color: #ff4757;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.8), 0 0 18px rgba(255, 71, 87, 0.6);
    animation: timerUrgentPulse 0.5s infinite alternate;
}

.seat-timer.urgent .seat-timer-progress {
    stroke: #ff4757;
}

.seat-timer.urgent .seat-timer-sec {
    color: #ff4757;
    font-weight: 900;
}

/* Game Rules Modal Styles */
.rules-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.rules-modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.rules-modal-content {
    background: rgba(20, 22, 28, 0.9);
    border: 1px solid var(--accent-gold);
    border-radius: 12px;
    width: 90%;
    max-width: 520px;
    max-height: 80vh;
    overflow-y: auto;
    padding: 25px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), inset 0 0 20px rgba(255, 215, 0, 0.05);
    color: #e0e0e0;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.15);
}

.rules-modal-overlay.active .rules-modal-content {
    transform: scale(1);
}

.rules-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 215, 0, 0.15);
    padding-bottom: 12px;
    margin-bottom: 16px;
}

.rules-modal-header h2 {
    font-family: 'Cinzel', serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--accent-gold);
    margin: 0;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
}

.rules-close-btn {
    background: none;
    border: none;
    color: #888;
    font-size: 1.8rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
    padding: 0;
}

.rules-close-btn:hover {
    color: var(--accent-gold);
}

.rules-modal-body {
    font-size: 0.92rem;
    line-height: 1.6;
}

.rules-section {
    margin-bottom: 20px;
}

.rules-section h3 {
    font-family: 'Cinzel', serif;
    font-size: 1.05rem;
    color: var(--accent-gold);
    margin-top: 0;
    margin-bottom: 8px;
    border-left: 3px solid var(--accent-gold);
    padding-left: 8px;
}

.rules-section p {
    margin: 0 0 8px 0;
}

.rules-section ul, .rules-section ol {
    margin: 0;
    padding-left: 20px;
}

.rules-section li {
    margin-bottom: 6px;
}

.rules-section strong {
    color: var(--accent-gold);
}

/* Rules Button */
.rules-btn {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: rgba(13, 14, 18, 0.6);
    border: 1px solid var(--border-color);
    color: var(--accent-gold);
    padding: 8px 16px;
    font-size: 0.85rem;
    border-radius: 6px;
    cursor: pointer;
    z-index: 120;
    transition: all 0.2s ease;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    font-family: inherit;
    font-weight: 600;
}

.rules-btn:hover {
    background: var(--accent-gold);
    color: #0d0e12;
    border-color: var(--accent-gold);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
}

/* ==========================================================================
   GAME SETTINGS MODAL & GLOBAL TOP-RIGHT ACTIONS
   ========================================================================== */

/* In-game Top Right Quick Action Buttons */
.game-top-right-actions {
    position: absolute;
    top: 10px;
    right: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 150;
}

.top-nav-btn {
    background: rgba(18, 14, 12, 0.78);
    border: 1.5px solid rgba(255, 215, 0, 0.4);
    color: var(--accent-gold);
    padding: 5px 12px;
    font-size: 0.78rem;
    font-weight: 700;
    border-radius: 16px;
    cursor: pointer;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.top-nav-btn:hover {
    background: var(--accent-gold);
    color: #120e08;
    transform: scale(1.05);
    box-shadow: 0 0 14px rgba(255, 215, 0, 0.6);
}

.return-lobby-top-btn {
    background: linear-gradient(135deg, rgba(230, 140, 30, 0.9) 0%, rgba(180, 80, 10, 0.95) 100%);
    border-color: #ffa502;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(255, 165, 2, 0.4);
}

.return-lobby-top-btn:hover {
    background: linear-gradient(135deg, #ffa502 0%, #d35400 100%);
    border-color: #ffd32a;
    color: #ffffff;
    box-shadow: 0 0 16px rgba(255, 165, 2, 0.7);
}

/* Settings Modal Overlay */
.settings-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.settings-modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.settings-modal-content {
    background: linear-gradient(135deg, rgba(28, 20, 16, 0.95) 0%, rgba(16, 12, 10, 0.98) 100%);
    border: 2px solid var(--accent-gold);
    border-radius: 18px;
    width: 90%;
    max-width: 480px;
    padding: 24px 28px;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.9), 0 0 35px rgba(255, 215, 0, 0.2);
    color: #f0f0f0;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    transform: scale(0.92);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.15);
}

.settings-modal-overlay.active .settings-modal-content {
    transform: scale(1);
}

.settings-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1.5px solid rgba(255, 215, 0, 0.25);
    padding-bottom: 12px;
    margin-bottom: 20px;
}

.settings-modal-header h2 {
    font-family: 'Cinzel', serif;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--accent-gold);
    margin: 0;
    text-shadow: 0 0 12px rgba(255, 215, 0, 0.4);
}

.settings-close-btn {
    background: none;
    border: none;
    color: #999;
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s, transform 0.2s;
    padding: 0;
}

.settings-close-btn:hover {
    color: var(--accent-gold);
    transform: scale(1.15);
}

.settings-modal-body {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.settings-group {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 215, 0, 0.15);
    border-radius: 12px;
    padding: 14px 18px;
}

.settings-group-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--accent-gold);
    margin: 0 0 12px 0;
    letter-spacing: 0.5px;
}

.setting-item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.setting-item-row.no-border {
    border-bottom: none;
    padding-bottom: 2px;
}

.setting-item-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.setting-item-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
}

.setting-item-desc {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* iOS Style Switch Slider */
.setting-switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
    flex-shrink: 0;
}

.setting-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.15);
    border: 1.5px solid rgba(255, 255, 255, 0.25);
    border-radius: 28px;
    transition: 0.3s;
}

.switch-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 2.5px;
    background-color: #fff;
    border-radius: 50%;
    transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

.setting-switch input:checked + .switch-slider {
    background-color: #2ed573;
    border-color: #2ed573;
    box-shadow: 0 0 12px rgba(46, 213, 115, 0.5);
}

.setting-switch input:checked + .switch-slider:before {
    transform: translateX(24px);
    background-color: #fff;
}

/* Clean Full-Width Setting Exit Game Button */
.settings-exit-wrapper {
    margin-top: 6px;
    width: 100%;
}

.setting-exit-btn-full {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, rgba(235, 60, 70, 0.9) 0%, rgba(175, 20, 30, 0.95) 100%);
    border: 1.5px solid #ff4757;
    color: #ffffff;
    padding: 12px 20px;
    border-radius: 14px;
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 6px 18px rgba(255, 71, 87, 0.35);
    user-select: none;
    -webkit-user-select: none;
}

.setting-exit-btn-full:hover {
    background: linear-gradient(135deg, #ff4757 0%, #c21323 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 71, 87, 0.6);
    border-color: #ffa502;
}

.setting-exit-btn-full:active {
    transform: translateY(1px) scale(0.98);
    box-shadow: 0 2px 8px rgba(255, 71, 87, 0.4);
}

.setting-return-lobby-btn {
    background: linear-gradient(135deg, rgba(230, 140, 30, 0.95) 0%, rgba(180, 80, 10, 0.95) 100%) !important;
    border: 1.5px solid #ffa502 !important;
    box-shadow: 0 6px 18px rgba(255, 165, 2, 0.35) !important;
    margin-bottom: 8px;
}

.setting-return-lobby-btn:hover {
    background: linear-gradient(135deg, #ffa502 0%, #d35400 100%) !important;
    box-shadow: 0 8px 25px rgba(255, 165, 2, 0.6) !important;
    border-color: #ffd32a !important;
}

.setting-return-lobby-btn:active {
    transform: translateY(1px) scale(0.98);
    box-shadow: 0 2px 8px rgba(255, 165, 2, 0.4) !important;
}

/* ==========================================================================
   RESPONSIVE MEDIA QUERIES (MOBILE PHONES ONLY)
   ========================================================================== */

@media screen and (max-height: 520px), screen and (max-width: 800px) {
    body {
        overflow: hidden !important;
        font-size: 13px;
    }

    /* Main Menu Screen */
    .full-tavern-lobby {
        padding: 0.35rem 0.8rem !important;
    }

    .tabletop-top-nav {
        padding: 0.3rem 0.8rem !important;
        margin-bottom: 0.45rem !important;
        border-radius: 10px !important;
    }

    .brand-crest {
        font-size: 1.2rem !important;
    }

    .brand-main-title {
        font-size: 1.05rem !important;
        letter-spacing: 0.08rem !important;
    }

    .brand-subtitle {
        font-size: 0.65rem !important;
    }

    .nav-action-pill {
        padding: 0.25rem 0.65rem !important;
        font-size: 0.75rem !important;
        border-radius: 12px !important;
    }

    /* Vertical Mode Cards for Mobile */
    .mode-deck-container {
        display: flex !important;
        flex-direction: column !important;
        gap: 0.6rem !important;
        width: 270px !important;
        max-width: 85vw !important;
    }

    .tavern-mode-plaque {
        width: 100% !important;
        min-height: 68px !important;
        padding: 0.45rem 1rem !important;
        border-radius: 14px !important;
        border-width: 2.5px !important;
    }

    .plaque-inner {
        gap: 0.8rem !important;
        justify-content: flex-start !important;
        padding-left: 0.5rem !important;
    }

    .plaque-icon-wrap {
        width: 44px !important;
        height: 44px !important;
        border-radius: 10px !important;
        border-width: 1.5px !important;
    }

    .plaque-icon {
        font-size: 1.6rem !important;
    }

    .plaque-title {
        font-size: 1.25rem !important;
        letter-spacing: 1.5px !important;
    }

    .plaque-corner-badge {
        font-size: 0.58rem !important;
        padding: 1px 6px !important;
        top: 4px !important;
        right: 10px !important;
        border-radius: 8px !important;
    }

    .plaque-rivet {
        width: 6px !important;
        height: 6px !important;
    }

    .rivet-tl { top: 5px !important; left: 5px !important; }
    .rivet-tr { top: 5px !important; right: 5px !important; }
    .rivet-bl { bottom: 5px !important; left: 5px !important; }
    .rivet-br { bottom: 5px !important; right: 5px !important; }

    /* Lobby Selection Screen */
    #lobbyScreen header {
        margin-bottom: 0.4rem !important;
    }
    #lobbyScreen h1 {
        font-size: 1.6rem !important;
    }
    #lobbyScreen p {
        font-size: 0.75rem !important;
    }
    #lobbyScreen .container {
        display: grid !important;
        grid-template-columns: 1.6fr 1fr !important;
        gap: 0.8rem !important;
        max-width: 96% !important;
        height: 76% !important;
        align-items: center !important;
        margin: 0 auto !important;
    }
    .selection-panel {
        padding: 0.5rem 0.8rem !important;
        border-radius: 10px !important;
    }
    .input-group {
        margin-bottom: 0.2rem !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 0.5rem !important;
    }
    .input-group label {
        font-size: 0.75rem !important;
        white-space: nowrap !important;
    }
    .input-group input {
        padding: 0.2rem 0.5rem !important;
        font-size: 0.8rem !important;
        height: 28px !important;
    }
    .section-title {
        font-size: 0.75rem !important;
        margin-bottom: 0.2rem !important;
        padding-bottom: 0.15rem !important;
    }
    .character-grid {
        grid-template-columns: repeat(5, 1fr) !important;
        gap: 0.25rem !important;
    }
    .character-card {
        padding: 0.15rem !important;
        border-radius: 5px !important;
    }
    .character-name {
        font-size: 0.6rem !important;
    }
    .character-role {
        display: none !important;
    }
    .room-actions {
        padding: 0.6rem !important;
        border-radius: 10px !important;
        gap: 0.5rem !important;
    }
    .join-box input {
        padding: 0.25rem !important;
        font-size: 0.8rem !important;
        height: 28px !important;
    }
    .menu-btn {
        padding: 0.35rem !important;
        font-size: 0.8rem !important;
        border-radius: 6px !important;
    }

    /* Waiting Room (Compact Mobile Full Display) */
    #waitingScreen header {
        margin-bottom: 0.25rem !important;
    }
    #waitingScreen h1 {
        font-size: 1.3rem !important;
        margin: 0 !important;
    }
    #waitingScreen p {
        font-size: 0.72rem !important;
        margin: 0.15rem 0 !important;
    }
    #displayRoomCode {
        font-size: 1.15rem !important;
        letter-spacing: 2px !important;
    }
    .waiting-container {
        padding: 0.4rem 0.8rem !important;
        max-width: 95% !important;
        max-height: 82vh !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
    }
    .waiting-layout {
        max-width: 480px !important;
        margin-bottom: 0.4rem !important;
    }
    .players-panel h3 {
        font-size: 0.78rem !important;
        margin-bottom: 0.25rem !important;
    }
    .players-list {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 0.35rem !important;
    }
    .player-row {
        padding: 0.25rem 0.5rem !important;
        gap: 0.4rem !important;
        border-radius: 6px !important;
    }
    .player-row-avatar {
        width: 26px !important;
        height: 26px !important;
    }
    .player-row-name {
        font-size: 0.75rem !important;
    }
    .player-row-role {
        font-size: 0.62rem !important;
    }
    .player-row-tag {
        font-size: 0.55rem !important;
        padding: 1px 3px !important;
    }
    .lobby-controls {
        padding-top: 0.4rem !important;
        gap: 0.5rem !important;
        margin-top: 0.2rem !important;
        flex-direction: row !important;
        justify-content: center !important;
    }
    .enter-btn {
        font-size: 0.82rem !important;
        padding: 0.35rem 1.4rem !important;
        border-radius: 16px !important;
    }
    .exit-btn {
        font-size: 0.82rem !important;
        padding: 0.35rem 1.2rem !important;
        border-radius: 16px !important;
    }
    .notice-text {
        font-size: 0.72rem !important;
    }

    /* Game Duel Screen Table (Phone Compact) */
    .game-table {
        width: 94vw !important;
        height: 88vh !important;
        max-width: 900px !important;
        max-height: 420px !important;
        border-width: 6px !important;
    }

    .player-seat {
        width: 70px !important;
    }

    .avatar-frame {
        width: 44px !important;
        height: 58px !important;
        border-radius: 5px !important;
        border-width: 1.5px !important;
    }

    .seat-name {
        font-size: 0.65rem !important;
    }

    .chamber {
        width: 5.5px !important;
        height: 5.5px !important;
    }

    .seat-cards {
        width: 55px !important;
        height: 20px !important;
    }

    .mini-card-back {
        width: 12px !important;
        height: 18px !important;
    }

    .seat-timer {
        width: 26px !important;
        height: 26px !important;
    }

    .seat-timer-sec {
        font-size: 0.6rem !important;
    }

    /* Top Player: Shift down into table view so avatar is 100% visible */
    .seat-top {
        top: 6px !important;
        left: calc(50% - 35px) !important;
    }

    .seat-left {
        left: 8px !important;
        top: calc(50% - 42px) !important;
    }

    .seat-right {
        right: 8px !important;
        top: calc(50% - 42px) !important;
    }

    .seat-bottom {
        bottom: 6px !important;
        left: 85px !important;
        transform: scale(1.0) !important;
    }

    .seat-bottom.active-turn {
        transform: scale(1.05) !important;
    }

    .hand-container {
        bottom: 6px !important;
        left: calc(50% + 55px) !important;
        max-width: 380px !important;
        height: 78px !important;
        gap: 0.35rem !important;
    }

    .game-card {
        width: 48px !important;
        height: 68px !important;
    }

    .game-card:hover {
        transform: translateY(-10px) scale(1.05) !important;
    }

    .game-card.selected {
        transform: translateY(-18px) scale(1.06) !important;
    }

    .card-value-label {
        font-size: 0.58rem !important;
        padding: 1px 3px !important;
        top: 2px !important;
        left: 2px !important;
    }

    .action-panel {
        bottom: 86px !important;
        left: calc(50% + 55px) !important;
    }

    .action-btn {
        font-size: 0.76rem !important;
        padding: 0.32rem 1rem !important;
        border-radius: 14px !important;
    }

    .reaction-buttons {
        gap: 0.45rem !important;
    }

    .center-card-pile {
        width: 42px !important;
        height: 60px !important;
    }

    .pile-card {
        width: 42px !important;
        height: 60px !important;
    }

    .revealed-card-container {
        width: 42px !important;
        height: 60px !important;
    }

    .revealed-cards-area {
        gap: 6px !important;
    }

    /* Original Right-Side Theme Banner: Compact text & word wrapping to avoid crowding */
    .theme-banner {
        top: 8px !important;
        right: 155px !important;
        left: auto !important;
        font-size: 0.52rem !important;
        padding: 0.2rem 0.45rem !important;
        max-width: 135px !important;
        line-height: 1.2 !important;
        white-space: normal !important;
        border-radius: 4px !important;
    }

    .theme-banner strong {
        font-size: 0.68rem !important;
        margin: 0 1px !important;
    }

    /* Action Announcement at original Top-Left */
    .action-announcement {
        left: 10px !important;
        top: 8px !important;
        font-size: 0.62rem !important;
        max-width: 160px !important;
        padding: 0.25rem 0.55rem !important;
    }

    .game-top-right-actions {
        top: 8px !important;
        right: 10px !important;
        gap: 5px !important;
    }

    .top-nav-btn {
        padding: 4px 9px !important;
        font-size: 0.72rem !important;
        border-radius: 12px !important;
    }

    .roulette-box {
        width: 270px !important;
        padding: 1.2rem !important;
        gap: 1rem !important;
    }

    .roulette-box h2 {
        font-size: 1.05rem !important;
    }

    .cylinder-wrapper {
        width: 110px !important;
        height: 110px !important;
    }

    .chamber-slot {
        width: 26px !important;
        height: 26px !important;
    }

    .cylinder-core {
        width: 20px !important;
        height: 20px !important;
    }

    .theme-reveal-card {
        width: 75px !important;
        height: 105px !important;
    }

    .theme-reveal-text {
        font-size: 1.05rem !important;
    }
}
