/* ========================================
   Stardust Holdem — Space Neon Theme
   ======================================== */

/* CSS Variables */
:root {
    --bg-deep: #050510;
    --bg-space: #0a0a1a;

    /* Neon colors */
    --neon-cyan: #22d3ee;
    --neon-purple: #a855f7;
    --neon-blue: #6366f1;
    --neon-pink: #ec4899;

    /* Poker action colors — 宇宙観カラー（高彩度） */
    --color-raise: #dca830;
    --color-call: #45d0dc;
    --color-fold: #a898d0;
    --color-gold: #fbbf24;

    /* Text */
    --text-primary: #f0f0ff;
    --text-secondary: #7a7aaa;
    --text-dim: #4a4a6a;

    /* Panel */
    --panel-bg: rgba(10, 15, 40, 0.85);
    --panel-border: rgba(120, 130, 255, 0.15);

    /* Table */
    --felt-color: #0c2818;
    --felt-border: #0a4020;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-deep);
    color: var(--text-primary);
    min-height: 100vh;
    overflow: hidden;
    position: relative;
}

/* Starfield canvas (behind everything) */
#starfield-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.app-container {
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

/* ========================================
   Poker Table
   ======================================== */
.poker-table {
    width: 900px;
    height: 560px;
    background:
        radial-gradient(ellipse at 30% 20%, rgba(200, 210, 230, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 80%, rgba(160, 175, 200, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(220, 225, 240, 0.08) 0%, transparent 70%),
        linear-gradient(135deg,
            rgba(40, 44, 55, 0.65) 0%,
            rgba(60, 65, 80, 0.55) 30%,
            rgba(75, 80, 100, 0.45) 50%,
            rgba(55, 60, 75, 0.55) 70%,
            rgba(35, 40, 50, 0.65) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 50%;
    position: absolute;
    top: 140px;
    box-shadow:
        /* Outer silver neon glow */
        0 0 60px rgba(180, 190, 210, 0.2),
        0 0 120px rgba(150, 165, 190, 0.1),
        0 0 200px rgba(180, 190, 210, 0.05),
        /* Inner depth */
        inset 0 0 80px rgba(0, 0, 0, 0.3),
        inset 0 0 2px 1px rgba(200, 210, 230, 0.1);
    border: 2px solid rgba(180, 190, 220, 0.3);
}

/* Neon inner ring */
.poker-table::before {
    content: '';
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    bottom: 12px;
    border-radius: 50%;
    border: 1px solid rgba(180, 190, 220, 0.12);
    box-shadow: inset 0 0 30px rgba(200, 210, 230, 0.03);
    pointer-events: none;
}


/* ========================================
   POT Display
   ======================================== */
.pot-display {
    position: absolute;
    top: 42%;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    z-index: 10;
}

.pot-amount {
    font-size: 22px;
    font-weight: 700;
    color: rgba(220, 225, 240, 0.95);
    font-family: 'Courier New', monospace;
    text-shadow: 0 0 20px rgba(200, 210, 230, 0.4);
}

/* Side Pots */
.side-pots-display {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 8px;
    min-height: 0;
}

.side-pot-chip {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 16px;
    font-size: 11px;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    white-space: nowrap;
    animation: chipAppear 0.3s ease;
    backdrop-filter: blur(8px);
}

.side-pot-chip .chip-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    flex-shrink: 0;
}

.side-pot-chip.main-pot {
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.4);
    color: var(--color-gold);
}

.side-pot-chip.main-pot .chip-dot {
    background: linear-gradient(135deg, #fef3c7, #fbbf24, #d97706);
    border: 1.5px solid #b45309;
}

.side-pot-chip.side-pot {
    background: rgba(200, 210, 230, 0.08);
    border: 1px solid rgba(200, 210, 230, 0.35);
    color: rgba(200, 210, 230, 0.9);
}

.side-pot-chip.side-pot .chip-dot {
    background: linear-gradient(135deg, #e2e8f0, #94a3b8, #64748b);
    border: 1.5px solid #475569;
}

/* ========================================
   Community Cards
   ======================================== */
.community-cards {
    position: absolute;
    top: 52%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    gap: 8px;
    z-index: 5;
}

/* ========================================
   Cards — Space Theme
   ======================================== */
.card {
    width: 60px;
    height: 84px;
    background: linear-gradient(145deg, #0f0f1e 0%, #161625 40%, #1a1a2a 100%);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.5), 0 0 1px rgba(200, 210, 230, 0.15);
    border: 1px solid rgba(200, 210, 230, 0.12);
    position: relative;
    overflow: hidden;
}

/* Subtle star-dust texture on card face */
.card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image:
        radial-gradient(1px 1px at 10px 15px, rgba(255,255,255,0.15), transparent),
        radial-gradient(1px 1px at 35px 45px, rgba(255,255,255,0.1), transparent),
        radial-gradient(1px 1px at 50px 20px, rgba(255,255,255,0.12), transparent),
        radial-gradient(1px 1px at 20px 60px, rgba(255,255,255,0.08), transparent);
    pointer-events: none;
    z-index: 0;
}

.card-slot {
    background: transparent;
    border: 2px dashed rgba(200, 210, 230, 0.1);
    box-shadow: none;
}

.card-slot::before { display: none; }

.card-back {
    background: linear-gradient(135deg, #1a1a2e 0%, #2a2a40 50%, #1a1a2e 100%);
    color: transparent;
    border: 1px solid rgba(200, 210, 230, 0.2);
    box-shadow: 0 2px 8px rgba(200, 210, 230, 0.1);
}

/* Diamond pattern on card back */
.card-back::after {
    content: '◆';
    position: absolute;
    font-size: 18px;
    color: rgba(200, 210, 230, 0.2);
    z-index: 1;
}

.card-rank {
    font-size: 20px;
    position: relative;
    z-index: 1;
}

.card-suit {
    font-size: 28px;
    margin-top: -4px;
    position: relative;
    z-index: 1;
}

/* ---- 4-color suit system ---- */
/* Hearts: Red */
.card.suit-hearts { border-color: rgba(239, 68, 68, 0.25); }
.card.suit-hearts .card-rank { color: #ef4444; }
.card.suit-hearts .card-suit { color: #ef4444; text-shadow: 0 0 8px rgba(239, 68, 68, 0.4); }

/* Diamonds: Blue */
.card.suit-diamonds { border-color: rgba(59, 130, 246, 0.25); }
.card.suit-diamonds .card-rank { color: #60a5fa; }
.card.suit-diamonds .card-suit { color: #3b82f6; text-shadow: 0 0 8px rgba(59, 130, 246, 0.4); }

/* Clubs: Green */
.card.suit-clubs { border-color: rgba(34, 197, 94, 0.25); }
.card.suit-clubs .card-rank { color: #4ade80; }
.card.suit-clubs .card-suit { color: #22c55e; text-shadow: 0 0 8px rgba(34, 197, 94, 0.4); }

/* Spades: White/Silver */
.card.suit-spades { border-color: rgba(200, 200, 230, 0.2); }
.card.suit-spades .card-rank { color: #e2e8f0; }
.card.suit-spades .card-suit { color: #cbd5e1; text-shadow: 0 0 8px rgba(200, 200, 230, 0.3); }

/* ========================================
   Player Seats
   ======================================== */
.player-seat {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    transition: opacity 0.3s;
}

.player-cards {
    display: flex;
    gap: 4px;
}

.player-cards .card {
    width: 50px;
    height: 70px;
    font-size: 18px;
}

.player-cards .card-rank { font-size: 16px; }
.player-cards .card-suit { font-size: 22px; }

/* Player info panel */
.player-info {
    background: var(--panel-bg);
    backdrop-filter: blur(12px);
    padding: 8px 14px;
    border-radius: 12px;
    text-align: center;
    min-width: 120px;
    border: 1px solid transparent;
    transition: border-color 0.3s, box-shadow 0.3s;
    position: relative;
}

/* Human player glow */
.player-human .player-info {
    border-color: transparent;
    box-shadow: 0 0 16px rgba(200, 210, 230, 0.1);
}

/* Acting player glow */
.player-seat.acting .player-info {
    border-color: rgba(220, 225, 240, 0.7);
    box-shadow: 0 0 20px rgba(200, 210, 230, 0.35), 0 0 40px rgba(200, 210, 230, 0.12);
    animation: actingPulse 1.5s ease-in-out infinite;
}

.player-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.player-position-stack-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.player-position-badge {
    display: inline-block;
    font-size: 10px;
    padding: 2px 8px;
    background: rgba(60, 70, 120, 0.6);
    border-radius: 4px;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
}

.player-position-badge.dealer {
    background: linear-gradient(135deg, #fbbf24, #d97706);
    color: #111;
    box-shadow: 0 0 8px rgba(251, 191, 36, 0.3);
}

.player-stack {
    font-size: 15px;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    color: rgba(220, 225, 240, 0.95);
    text-shadow: 0 0 8px rgba(200, 210, 230, 0.25);
}

.player-action {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    min-height: 16px;
    margin-top: 3px;
    letter-spacing: 0.05em;
}

/* Action color classes */
.player-action.action-fold { color: var(--color-fold); }
.player-action.action-raise { color: var(--color-raise); text-shadow: 0 0 6px rgba(220, 168, 48, 0.3); }
.player-action.action-call { color: var(--color-call); }
.player-action.action-check { color: var(--color-call); }
.player-action .inline-bet { color: inherit; }

/* Fold state */
.player-seat.folded .player-info { opacity: 0.4; }
.player-seat.folded .player-cards .card { visibility: hidden; }
.player-seat.folded .player-action { color: var(--text-dim); }

/* Winner state */
.player-seat.winner .player-info {
    border-color: var(--color-gold);
    animation: winnerGlow 1.5s ease-in-out infinite;
}

.player-seat.winner .player-name {
    color: var(--color-gold);
    text-shadow: 0 0 10px rgba(251, 191, 36, 0.5);
}

/* ---- Profit/Loss badge (showdown時の損益表示) ---- */
.profit-loss-badge {
    position: absolute;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.5px;
    white-space: nowrap;
    z-index: 20;
    pointer-events: none;
    animation: profitBadgeAppear 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.profit-loss-badge.profit-plus {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.5);
    text-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
    box-shadow: 0 0 12px rgba(34, 197, 94, 0.2);
}

.profit-loss-badge.profit-minus {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.5);
    text-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.2);
}

@keyframes profitBadgeAppear {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

/* Profit/Loss badge per-seat positions (bet display と同じ位置) */
.seat-0 .profit-loss-badge { top: -30px; left: 50%; transform: translateX(-50%); }
.seat-1 .profit-loss-badge { top: 20px; left: 120px; }
.seat-2 .profit-loss-badge { bottom: 20px; left: 120px; top: auto; }
.seat-3 .profit-loss-badge { bottom: -20px; left: 50%; transform: translateX(-50%); top: auto; }
.seat-4 .profit-loss-badge { bottom: 20px; right: 120px; left: auto; top: auto; }
.seat-5 .profit-loss-badge { top: 20px; right: 120px; left: auto; }

/* Player bet display (chip + amount, no border/frame) */
.player-bet-display {
    position: absolute;
    display: none;
    align-items: center;
    gap: 4px;
    background: none;
    padding: 0;
    border: none;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    font-weight: 700;
    color: var(--color-gold);
    white-space: nowrap;
    text-shadow: 0 0 8px rgba(251, 191, 36, 0.4);
    z-index: 20;
    pointer-events: none;
}

/* Chip icon — hidden */
.chip-icon {
    display: none;
}

.bet-amount { color: var(--color-gold); }

/* Bet display positions per seat — placed toward table center, away from cards/info */
/* seat-0 (bottom): above cards, toward table */
.seat-0 .player-bet-display { top: -30px; left: 50%; transform: translateX(-50%); }
/* seat-1 (left-bottom): to the right, toward center */
.seat-1 .player-bet-display { top: 20px; left: 120px; }
/* seat-2 (left-top): to the right, toward center */
.seat-2 .player-bet-display { bottom: 20px; left: 120px; top: auto; }
/* seat-3 (top): below info, toward table */
.seat-3 .player-bet-display { bottom: -20px; left: 50%; transform: translateX(-50%); top: auto; }
/* seat-4 (right-top): to the left, toward center */
.seat-4 .player-bet-display { bottom: 20px; right: 120px; left: auto; top: auto; }
/* seat-5 (right-bottom): to the left, toward center */
.seat-5 .player-bet-display { top: 20px; right: 120px; left: auto; }

/* ========================================
   Dealer Button — Moon
   ======================================== */
.dealer-button {
    position: absolute;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    /* Moon body: pale yellow with subtle texture */
    background:
        radial-gradient(circle at 35% 30%, rgba(255,255,255,0.4) 0%, transparent 40%),
        radial-gradient(circle at 65% 65%, rgba(180,160,120,0.3) 0%, transparent 30%),
        radial-gradient(circle at 45% 55%, rgba(160,140,100,0.2) 0%, transparent 25%),
        radial-gradient(circle at 25% 70%, rgba(140,120,80,0.25) 0%, transparent 20%),
        radial-gradient(ellipse at 50% 50%,
            #fef9e7 0%,
            #f5e6b8 30%,
            #e8d5a0 60%,
            #d4bc7a 100%);
    border: none;
    box-shadow:
        0 0 12px rgba(254, 249, 231, 0.6),
        0 0 24px rgba(251, 191, 36, 0.25),
        inset -3px -2px 6px rgba(0, 0, 0, 0.15);
    z-index: 30;
    transition: all 0.5s ease;
    pointer-events: none;
    font-size: 0; /* hide text */
    color: transparent;
    overflow: hidden;
}

/* Moon craters */
.dealer-button::before {
    content: '';
    position: absolute;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(180, 160, 120, 0.35);
    top: 8px;
    left: 6px;
    box-shadow:
        10px 8px 0 2px rgba(170, 150, 110, 0.25),
        4px 14px 0 0px rgba(160, 140, 100, 0.3),
        12px 2px 0 -1px rgba(170, 150, 110, 0.2);
}

/* Subtle glow halo */
.dealer-button::after {
    content: '';
    position: absolute;
    top: -4px; left: -4px; right: -4px; bottom: -4px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(254, 249, 231, 0.15) 40%, transparent 70%);
    pointer-events: none;
}

/* Dealer button: positioned right next to each player's info panel */
/* seat-0 (bottom center): to the right of info */
.dealer-button.pos-0 { bottom: -10px; left: calc(50% + 75px); }
/* seat-1 (left-bottom): right side of info */
.dealer-button.pos-1 { bottom: 62px; left: 95px; }
/* seat-2 (left-top): right side of info */
.dealer-button.pos-2 { top: 140px; left: 95px; }
/* seat-3 (top center): to the right of info */
.dealer-button.pos-3 { top: 4px; left: calc(50% + 75px); }
/* seat-4 (right-top): left side of info */
.dealer-button.pos-4 { top: 140px; right: 95px; left: auto; }
/* seat-5 (right-bottom): left side of info */
.dealer-button.pos-5 { bottom: 62px; right: 95px; left: auto; }

/* ========================================
   Seat Positions (elliptical layout)
   ======================================== */
.seat-0 { bottom: -40px; left: 50%; transform: translateX(-50%); }
.seat-1 { bottom: 60px; left: -40px; }
.seat-2 { top: 60px; left: -40px; }
.seat-3 { top: -80px; left: 50%; transform: translateX(-50%); }
.seat-4 { top: 60px; right: -40px; }
.seat-5 { bottom: 60px; right: -40px; }

/* ========================================
   Time Bar
   ======================================== */
.time-bar {
    display: none;
    position: relative;
    width: 100%;
    height: 3px;
    background: rgba(200, 210, 230, 0.1);
    border-radius: 2px;
    overflow: visible;
    margin-top: 6px;
}

.acting .time-bar {
    display: block;
}

.time-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, rgba(200, 210, 230, 0.7), rgba(160, 170, 200, 0.5));
    width: 100%;
    box-shadow: 0 0 8px rgba(200, 210, 230, 0.3);
    border-radius: 2px;
}

.time-bar-fill.animating {
    animation: timeProgress 60s linear forwards;
}

@keyframes timeProgress {
    from { width: 100%; }
    to { width: 0%; }
}

.time-bar-countdown {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 11px;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    color: #ff6b6b;
    text-shadow: 0 0 6px rgba(255, 80, 80, 0.5);
    pointer-events: none;
    z-index: 1;
    white-space: nowrap;
}

.time-bar-countdown.visible {
    display: block;
}

/* ========================================
   Action History Panel (left)
   ======================================== */
.action-history-panel {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 280px;
    max-height: 300px;
    background: var(--panel-bg);
    backdrop-filter: blur(16px);
    border-radius: 16px;
    padding: 14px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.4);
    border: 1px solid var(--panel-border);
    display: flex;
    flex-direction: column;
}

/* Mobile history inside action panel, hidden on desktop */
.action-history-mobile { display: none; }
/* Desktop top-row wrapper hidden on desktop */
.action-panel-top-row { display: contents; }

.action-history-content {
    flex: 1;
    overflow-y: auto;
    font-size: 12px;
    min-height: 0;
}

.action-history-content::-webkit-scrollbar { width: 4px; }
.action-history-content::-webkit-scrollbar-track { background: transparent; }
.action-history-content::-webkit-scrollbar-thumb {
    background: rgba(120, 130, 255, 0.2);
    border-radius: 2px;
}

.action-item {
    padding: 3px 0;
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
}

.action-history-content .game-phase {
    display: block;
    padding: 8px 0 3px;
    font-size: 11px;
    font-weight: 700;
    color: rgba(200, 210, 230, 0.8);
    letter-spacing: 0.1em;
    text-shadow: 0 0 8px rgba(200, 210, 230, 0.2);
}

/* ========================================
   Action Panel (right)
   ======================================== */
.action-panel {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 480px;
    background: var(--panel-bg);
    backdrop-filter: blur(16px);
    border-radius: 16px;
    padding: 14px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.4);
    border: 1px solid var(--panel-border);
    transition: opacity 0.25s;
}

/* CPUターン中: 半透明＋操作不可 */
.action-panel.disabled {
    opacity: 0.35;
    pointer-events: none;
}

/* Preset buttons */
.preset-buttons {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 5px;
    margin-bottom: 10px;
}

.preset-btn {
    padding: 12px 4px;
    background: rgba(30, 35, 55, 0.6);
    color: var(--text-secondary);
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
}

.preset-btn:hover {
    background: rgba(50, 55, 75, 0.7);
    color: var(--text-primary);
    border-color: rgba(200, 210, 230, 0.4);
    box-shadow: 0 0 8px rgba(200, 210, 230, 0.15);
}

.preset-btn:active { transform: scale(0.95); }

/* ± Amount buttons */
.custom-amount {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-bottom: 10px;
}

.amount-adj-group {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.amount-adj-btn {
    width: 44px;
    height: 44px;
    border: 1px solid var(--panel-border);
    border-radius: 10px;
    background: rgba(30, 35, 80, 0.5);
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
    flex-shrink: 0;
    user-select: none;
    font-family: 'Courier New', monospace;
}

.amount-adj-btn:hover {
    background: rgba(50, 55, 120, 0.6);
    color: var(--text-primary);
    border-color: rgba(120, 130, 255, 0.3);
}

.amount-adj-btn:active { transform: scale(0.95); }

/* Amount display */
.amount-display {
    display: flex;
    align-items: center;
    gap: 4px;
}

.amount-display input {
    width: 70px;
    padding: 10px 4px;
    background: rgba(20, 25, 40, 0.8);
    border: 1px solid rgba(200, 210, 230, 0.25);
    border-radius: 8px;
    color: rgba(220, 225, 240, 0.95);
    font-size: 18px;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    text-align: center;
    text-shadow: 0 0 10px rgba(200, 210, 230, 0.2);
    -moz-appearance: textfield;
}

.amount-display input::-webkit-inner-spin-button,
.amount-display input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.amount-display input:focus {
    outline: none;
    border-color: rgba(200, 210, 230, 0.5);
    box-shadow: 0 0 12px rgba(200, 210, 230, 0.15);
}

.amount-unit {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-dim);
    font-family: 'Courier New', monospace;
}

/* Main action buttons */
.main-actions {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
}

.action-btn {
    padding: 14px 16px;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: white;
    position: relative;
    overflow: hidden;
}

.action-btn:hover {
    transform: translateY(-2px);
}

.action-btn:active {
    transform: translateY(0) scale(0.97);
}

.fold-btn {
    background: linear-gradient(135deg, rgba(130, 105, 185, 0.8), rgba(108, 85, 165, 0.9));
    box-shadow: 0 0 12px rgba(130, 105, 185, 0.2);
}

.fold-btn:hover {
    box-shadow: 0 0 18px rgba(130, 105, 185, 0.35);
}

.call-btn, .check-btn {
    background: linear-gradient(135deg, rgba(40, 180, 195, 0.8), rgba(30, 155, 170, 0.9));
    box-shadow: 0 0 12px rgba(40, 180, 195, 0.2);
}

.call-btn:hover, .check-btn:hover {
    box-shadow: 0 0 18px rgba(40, 180, 195, 0.35);
}

.raise-btn {
    background: linear-gradient(135deg, rgba(225, 165, 40, 0.8), rgba(200, 142, 25, 0.9));
    box-shadow: 0 0 12px rgba(225, 165, 40, 0.2);
}

.raise-btn:hover {
    box-shadow: 0 0 18px rgba(225, 165, 40, 0.35);
}

/* ========================================
   Next Hand Button
   ======================================== */
#next-hand-btn {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    padding: 14px 44px;
    font-size: 16px;
    font-weight: 700;
    background: linear-gradient(135deg, rgba(200, 210, 230, 0.2), rgba(160, 170, 200, 0.15));
    color: rgba(220, 225, 240, 0.95);
    border: 1px solid rgba(200, 210, 230, 0.4);
    border-radius: 14px;
    cursor: pointer;
    letter-spacing: 0.05em;
    box-shadow: 0 0 24px rgba(200, 210, 230, 0.15);
    z-index: 100;
    transition: all 0.2s;
}

#next-hand-btn:hover {
    transform: translateX(-50%) scale(1.05);
    box-shadow: 0 0 36px rgba(200, 210, 230, 0.25);
}

#next-hand-btn:active {
    transform: translateX(-50%) scale(0.97);
}

/* ========================================
   Debug Panel
   ======================================== */
.debug-panel {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 320px;
    background: var(--panel-bg);
    backdrop-filter: blur(16px);
    border-radius: 14px;
    padding: 14px;
    box-shadow: 0 0 20px rgba(236, 72, 153, 0.15);
    border: 1px solid rgba(236, 72, 153, 0.4);
    z-index: 200;
}

.debug-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.debug-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--neon-pink);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-shadow: 0 0 8px rgba(236, 72, 153, 0.4);
}

.debug-info {
    font-size: 11px;
    color: var(--text-secondary);
    font-family: 'Courier New', monospace;
}

.debug-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
    margin-bottom: 8px;
}

.debug-btn {
    padding: 10px 4px;
    border: none;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
    text-transform: uppercase;
    color: white;
    letter-spacing: 0.03em;
}

.debug-btn:hover { transform: translateY(-1px); filter: brightness(1.2); }
.debug-btn:active { transform: scale(0.95); }

.debug-fold { background: linear-gradient(135deg, rgba(59, 130, 246, 0.8), rgba(37, 99, 235, 0.9)); }
.debug-check { background: linear-gradient(135deg, rgba(34, 197, 94, 0.8), rgba(22, 163, 74, 0.9)); }
.debug-call { background: linear-gradient(135deg, rgba(13, 148, 136, 0.8), rgba(15, 118, 110, 0.9)); }
.debug-raise { background: linear-gradient(135deg, rgba(239, 68, 68, 0.8), rgba(220, 38, 38, 0.9)); }

.debug-btn:disabled {
    opacity: 0.25;
    cursor: not-allowed;
    transform: none !important;
    filter: none !important;
}

.debug-raise-input {
    display: flex;
    align-items: center;
    gap: 6px;
}

.debug-raise-input input {
    flex: 1;
    padding: 8px;
    background: rgba(20, 25, 60, 0.8);
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 13px;
    font-family: 'Courier New', monospace;
}

.debug-raise-input input:focus {
    outline: none;
    border-color: var(--neon-pink);
    box-shadow: 0 0 8px rgba(236, 72, 153, 0.2);
}

/* ========================================
   Debug Toggle
   ======================================== */
.debug-toggle {
    position: fixed;
    top: 16px;
    left: 16px;
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--panel-bg);
    backdrop-filter: blur(12px);
    padding: 6px 14px;
    border-radius: 10px;
    border: 1px solid var(--panel-border);
    cursor: pointer;
    z-index: 200;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-dim);
    letter-spacing: 0.1em;
    user-select: none;
    transition: all 0.2s;
}

.debug-toggle:has(input:checked) {
    border-color: var(--neon-pink);
    color: var(--neon-pink);
    box-shadow: 0 0 12px rgba(236, 72, 153, 0.2);
    text-shadow: 0 0 8px rgba(236, 72, 153, 0.3);
}

.debug-toggle input {
    accent-color: var(--neon-pink);
    width: 14px;
    height: 14px;
}

/* ========================================
   Chip Mode Toggle
   ======================================== */
.chip-mode-toggle {
    position: fixed;
    top: 16px;
    right: 16px;
    display: flex;
    gap: 3px;
    background: var(--panel-bg);
    backdrop-filter: blur(12px);
    padding: 4px;
    border-radius: 12px;
    border: 1px solid var(--panel-border);
    z-index: 200;
    font-size: 11px;
}

.chip-mode-label {
    cursor: pointer;
    display: flex;
    align-items: center;
}

.chip-mode-label input { display: none; }

.chip-mode-option {
    padding: 5px 12px;
    border-radius: 8px;
    color: var(--text-dim);
    transition: all 0.2s;
    white-space: nowrap;
    font-weight: 600;
}

.chip-mode-label input:checked + .chip-mode-option {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.7), rgba(22, 163, 74, 0.8));
    color: #fff;
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.25);
}

/* ========================================
   Stats HUD Popup
   ======================================== */
.stats-hud-popup {
    position: fixed;
    width: 200px;
    background: var(--panel-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(200, 210, 230, 0.2);
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 0 24px rgba(0, 0, 0, 0.5), 0 0 12px rgba(200, 210, 230, 0.08);
    z-index: 150;
    animation: statsPopupAppear 0.2s ease-out;
    pointer-events: auto;
}

@keyframes statsPopupAppear {
    0% { opacity: 0; transform: scale(0.9); }
    100% { opacity: 1; transform: scale(1); }
}

.stats-hud-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--panel-border);
}

.stats-hud-name {
    font-size: 12px;
    font-weight: 700;
    color: rgba(220, 225, 240, 0.95);
    font-family: 'Courier New', monospace;
    text-shadow: 0 0 8px rgba(200, 210, 230, 0.25);
}

.stats-hud-meta {
    font-size: 9px;
    color: var(--text-secondary);
    font-family: 'Courier New', monospace;
}

.stats-hud-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
}

.stats-hud-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 6px;
    background: rgba(20, 25, 60, 0.5);
    border-radius: 6px;
    border: 1px solid rgba(120, 130, 255, 0.08);
}

/* 奇数個の最後の項目は全幅 */
.stats-hud-item:last-child:nth-child(odd) {
    grid-column: 1 / -1;
}

.stats-hud-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-secondary);
    font-family: 'Courier New', monospace;
    letter-spacing: 0.05em;
}

.stats-hud-value {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
}

/* ========================================
   Secret Hand Authentication
   ======================================== */

.auth-intro-desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 16px;
    padding: 10px 12px;
    background: rgba(200, 210, 230, 0.04);
    border: 1px solid rgba(200, 210, 230, 0.12);
    border-radius: 8px;
}

.auth-name-notice {
    font-size: 11px;
    color: rgba(200, 160, 130, 0.8);
    margin: 4px 0 0 0;
}

.secret-hand-desc {
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    line-height: 1.5;
}

.secret-hand-selector {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-bottom: 16px;
}

.secret-card-slot {
    width: 70px;
    height: 98px;
    border: 2px dashed rgba(200, 210, 230, 0.3);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(0, 0, 0, 0.2);
}

.secret-card-slot:hover {
    border-color: rgba(200, 210, 230, 0.6);
    background: rgba(200, 210, 230, 0.05);
    box-shadow: 0 0 12px rgba(200, 210, 230, 0.15);
}

.secret-card-placeholder {
    font-size: 11px;
    color: var(--text-dim);
    font-family: 'Courier New', monospace;
}

.secret-card-visual {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: rgba(15, 20, 50, 0.9);
    border-radius: 8px;
    border: 1px solid rgba(120, 130, 255, 0.2);
}

.secret-card-rank {
    font-size: 20px;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    line-height: 1;
}

.secret-card-suit {
    font-size: 24px;
    line-height: 1;
    margin-top: 2px;
}

/* Card Picker Grid */
.card-picker {
    background: rgba(10, 15, 40, 0.9);
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 12px;
    animation: statsPopupAppear 0.2s ease-out;
}

.card-picker-header {
    font-size: 11px;
    color: rgba(200, 210, 230, 0.8);
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
    text-align: center;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.card-picker-ranks {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.card-picker-rank-btn {
    padding: 10px 4px;
    background: rgba(30, 35, 80, 0.6);
    color: var(--text-primary);
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    cursor: pointer;
    transition: all 0.15s;
}

.card-picker-rank-btn:hover {
    background: rgba(50, 55, 120, 0.7);
    border-color: rgba(200, 210, 230, 0.5);
    box-shadow: 0 0 8px rgba(200, 210, 230, 0.2);
}

.card-picker-rank-btn:active {
    transform: scale(0.95);
}

.card-picker-suits {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-top: 8px;
}

.card-picker-suit-btn {
    padding: 14px 8px;
    background: rgba(30, 35, 80, 0.6);
    border: 1px solid var(--panel-border);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
}

.card-picker-suit-btn:hover:not(:disabled) {
    background: rgba(50, 55, 120, 0.7);
    border-color: rgba(120, 130, 255, 0.4);
    box-shadow: 0 0 12px rgba(120, 130, 255, 0.15);
}

.card-picker-suit-btn:active:not(:disabled) {
    transform: scale(0.95);
}

.card-picker-disabled {
    opacity: 0.2;
    cursor: not-allowed !important;
}

.picker-suit-symbol {
    font-size: 28px;
}

/* Remember me checkbox */
.remember-me-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
    font-family: 'Courier New', monospace;
    margin-bottom: 8px;
    cursor: pointer;
}

.remember-me-label input[type="checkbox"] {
    accent-color: rgba(200, 210, 230, 0.8);
    width: 16px;
    height: 16px;
}

/* Auth message */
.auth-message {
    text-align: center;
    font-size: 12px;
    font-family: 'Courier New', monospace;
    min-height: 20px;
    margin-bottom: 8px;
    transition: color 0.3s;
}

.auth-error {
    color: #ef4444;
    text-shadow: 0 0 8px rgba(239, 68, 68, 0.3);
}

.auth-ok {
    color: #22c55e;
    text-shadow: 0 0 8px rgba(34, 197, 94, 0.3);
}

/* Auth Divider */
/* 認証セクション — Google（推奨） */
.auth-section-google {
    margin-bottom: 4px;
}
.auth-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}
.auth-section-title {
    font-size: 13px;
    font-weight: 700;
    color: rgba(220, 225, 240, 0.9);
    font-family: 'Courier New', monospace;
}
.auth-recommend-badge {
    font-size: 10px;
    font-weight: 700;
    color: #0a0e1a;
    background: linear-gradient(135deg, #45d0dc, #38b2bd);
    padding: 1px 8px;
    border-radius: 10px;
    letter-spacing: 0.5px;
}
.auth-section-note {
    font-size: 11px;
    color: var(--text-secondary);
    margin: 0 0 12px;
    line-height: 1.5;
}

/* 認証セクション — ゲスト（シークレットハンド） */
.auth-guest-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    padding: 10px 0;
    transition: opacity 0.2s;
}
.auth-guest-toggle:hover {
    opacity: 0.8;
}
.auth-toggle-arrow {
    font-size: 10px;
    color: var(--text-secondary);
    transition: transform 0.3s;
}
.auth-toggle-arrow.open {
    transform: rotate(180deg);
}
.auth-guest-form {
    padding-top: 4px;
}
.auth-guest-warning {
    font-size: 11px;
    color: rgba(200, 160, 130, 0.85);
    line-height: 1.6;
    margin: 0 0 14px;
    padding: 8px 12px;
    background: rgba(200, 160, 130, 0.06);
    border: 1px solid rgba(200, 160, 130, 0.15);
    border-radius: 8px;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0;
}

.auth-divider-line {
    flex: 1;
    height: 1px;
    background: rgba(200, 210, 230, 0.15);
}

.auth-divider-text {
    font-size: 11px;
    color: var(--text-dim);
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
}

/* Google Sign-In Wrapper */
.google-signin-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 8px;
}

/* Google再ログインメッセージ */
.google-relogin-msg {
    font-size: 11px;
    color: rgba(69, 208, 220, 0.9);
    text-align: center;
    margin: 4px 0 0;
    line-height: 1.5;
}

/* Google Back Button */
.auth-back-btn {
    width: 100%;
    padding: 10px;
    margin-top: 8px;
    background: transparent;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 13px;
    font-family: 'Courier New', monospace;
    cursor: pointer;
    transition: all 0.2s;
}

.auth-back-btn:hover {
    border-color: rgba(200, 210, 230, 0.5);
    color: var(--text-primary);
}

/* Authenticated user display */
.auth-user-display {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: rgba(200, 210, 230, 0.05);
    border: 1px solid rgba(200, 210, 230, 0.2);
    border-radius: 10px;
}

.auth-user-name {
    flex: 1;
    font-size: 15px;
    font-weight: 700;
    color: rgba(220, 225, 240, 0.95);
    font-family: 'Courier New', monospace;
    text-shadow: 0 0 8px rgba(200, 210, 230, 0.3);
}

.auth-logout-btn {
    padding: 4px 12px;
    background: transparent;
    border: 1px solid var(--panel-border);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 11px;
    font-family: 'Courier New', monospace;
    cursor: pointer;
    transition: all 0.2s;
}

.auth-logout-btn:hover {
    border-color: rgba(200, 210, 230, 0.5);
    color: var(--text-primary);
}

/* 名前変更ボタン */
.auth-rename-btn {
    padding: 2px 6px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 14px;
    opacity: 0.6;
    transition: opacity 0.2s;
}
.auth-rename-btn:hover {
    opacity: 1;
}

/* 名前変更モーダル */
.rename-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.rename-modal-content {
    background: var(--bg-deep, #0a0e1a);
    border: 1px solid rgba(200, 210, 230, 0.3);
    border-radius: 14px;
    padding: 24px;
    width: 90%;
    max-width: 320px;
    text-align: center;
}
.rename-modal-title {
    color: rgba(220, 225, 240, 0.95);
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 16px;
    font-family: 'Courier New', monospace;
}
.rename-modal-content .settings-input {
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 8px;
}
.rename-modal-note {
    color: var(--text-secondary);
    font-size: 11px;
    margin: 0 0 16px;
}
.rename-modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}
.rename-modal-cancel {
    flex: 1;
    padding: 8px 16px;
    background: transparent;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 13px;
    font-family: 'Courier New', monospace;
    cursor: pointer;
    transition: all 0.2s;
}
.rename-modal-cancel:hover {
    border-color: rgba(200, 210, 230, 0.5);
    color: var(--text-primary);
}
.rename-modal-confirm {
    flex: 1;
    padding: 8px 16px;
    background: linear-gradient(135deg, rgba(40, 180, 195, 0.8), rgba(30, 155, 170, 0.9));
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    cursor: pointer;
    transition: all 0.2s;
}
.rename-modal-confirm:hover {
    filter: brightness(1.15);
}
.rename-modal-error {
    color: #f87171;
    font-size: 11px;
    margin: 8px 0 0;
    min-height: 16px;
}

/* CPU Debug Button */
.cpu-debug-btn {
    padding: 6px 16px;
    background: transparent;
    border: 1px dashed var(--panel-border);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 0.75rem;
    cursor: pointer;
    opacity: 0.6;
    transition: all 0.2s;
}
.cpu-debug-btn:hover {
    border-color: rgba(200, 210, 230, 0.5);
    color: var(--text-primary);
    opacity: 1;
}

/* ========================================
   Saved Rooms Section
   ======================================== */

.saved-rooms-section {
    margin-bottom: 20px;
}

.saved-rooms-section h4 {
    color: rgba(220, 225, 240, 0.9);
    font-size: 13px;
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
    text-shadow: 0 0 8px rgba(200, 210, 230, 0.3);
}

.saved-rooms-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
    padding-right: 4px;
}

.saved-rooms-list::-webkit-scrollbar {
    width: 4px;
}

.saved-rooms-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
}

.saved-rooms-list::-webkit-scrollbar-thumb {
    background: rgba(200, 210, 230, 0.5);
    border-radius: 2px;
}

.saved-room-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(10, 15, 40, 0.6);
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    padding: 10px 14px;
    transition: all 0.2s;
}

.saved-room-item:hover {
    border-color: rgba(200, 210, 230, 0.35);
    background: rgba(10, 15, 40, 0.8);
}

.saved-room-info {
    flex: 1;
}

.saved-room-name {
    display: block;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 2px;
}

.saved-room-code {
    display: block;
    color: rgba(200, 210, 230, 0.8);
    font-family: 'Courier New', monospace;
    font-size: 12px;
    letter-spacing: 2px;
    text-shadow: 0 0 8px rgba(200, 210, 230, 0.2);
}

.saved-room-meta {
    display: block;
    color: var(--text-secondary);
    font-size: 11px;
    margin-top: 3px;
}

.saved-room-actions {
    display: flex;
    gap: 6px;
}

.saved-room-actions button {
    padding: 6px 12px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
}

.saved-room-detail-btn {
    background: transparent;
    border: 1px solid var(--panel-border);
    color: var(--text-secondary);
}

.saved-room-detail-btn:hover {
    border-color: rgba(200, 210, 230, 0.5);
    color: rgba(200, 210, 230, 0.8);
}

.saved-room-join-btn {
    background: rgba(200, 210, 230, 0.1);
    border: 1px solid rgba(200, 210, 230, 0.5);
    color: rgba(220, 225, 240, 0.9);
}

.saved-room-join-btn:hover {
    background: rgba(200, 210, 230, 0.2);
    box-shadow: 0 0 12px rgba(200, 210, 230, 0.2);
}

.saved-room-delete-btn {
    background: transparent;
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: rgba(239, 68, 68, 0.7);
    padding: 6px 8px !important;
    font-size: 13px !important;
}

.saved-room-delete-btn:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: #ef4444;
    color: #ef4444;
}

.room-detail-bottom-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    justify-content: center;
}

.room-detail-delete-btn {
    background: transparent;
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: rgba(239, 68, 68, 0.7);
    padding: 10px 20px;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.room-detail-delete-btn:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: #ef4444;
    color: #ef4444;
}

.saved-rooms-empty {
    color: var(--text-secondary);
    font-size: 12px;
    text-align: center;
    padding: 12px;
    font-style: italic;
}

.save-room-option {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 12px 0;
    padding: 10px 14px;
    background: rgba(10, 15, 40, 0.4);
    border: 1px solid var(--panel-border);
    border-radius: 8px;
}

.save-room-option input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid var(--panel-border);
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
}

.save-room-option input[type="checkbox"]:checked {
    background: rgba(200, 210, 230, 0.9);
    border-color: rgba(200, 210, 230, 0.9);
    box-shadow: 0 0 8px rgba(200, 210, 230, 0.4);
}

.save-room-option input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #0a0f28;
    font-size: 12px;
    font-weight: bold;
}

.save-room-option label {
    color: var(--text-secondary);
    font-size: 12px;
    font-family: 'Courier New', monospace;
    cursor: pointer;
}

/* ========================================
   Room Detail Overlay
   ======================================== */

.room-detail-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.room-detail-panel {
    background: linear-gradient(135deg, rgba(10, 15, 40, 0.97) 0%, rgba(20, 25, 60, 0.97) 100%);
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    padding: 24px;
    width: 90%;
    max-width: 480px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow:
        0 0 30px rgba(200, 210, 230, 0.08),
        0 0 60px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease;
}

.room-detail-panel::-webkit-scrollbar {
    width: 4px;
}

.room-detail-panel::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
}

.room-detail-panel::-webkit-scrollbar-thumb {
    background: rgba(200, 210, 230, 0.5);
    border-radius: 2px;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.room-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.room-detail-header h3 {
    color: rgba(220, 225, 240, 0.95);
    font-family: 'Courier New', monospace;
    font-size: 18px;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(200, 210, 230, 0.3);
    margin: 0;
}

.room-detail-close {
    background: transparent;
    border: 1px solid var(--panel-border);
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.room-detail-close:hover {
    border-color: #ef4444;
    color: #ef4444;
}

.room-detail-settings {
    color: var(--text-secondary);
    font-size: 12px;
    font-family: 'Courier New', monospace;
    margin-bottom: 20px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Stats Comparison Table */

.stats-compare-section {
    margin-bottom: 20px;
}

.stats-compare-section h4 {
    color: rgba(200, 210, 230, 0.8);
    font-size: 12px;
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
    text-shadow: 0 0 8px rgba(200, 210, 230, 0.2);
}

.stats-compare-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Courier New', monospace;
    font-size: 11px;
}

.stats-compare-table thead th {
    color: var(--text-secondary);
    font-weight: normal;
    text-align: center;
    padding: 6px 4px;
    border-bottom: 1px solid var(--panel-border);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stats-compare-table thead th:first-child {
    text-align: left;
}

.stats-compare-table tbody td {
    text-align: center;
    padding: 8px 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
}

.stats-compare-table tbody td:first-child {
    text-align: left;
    color: rgba(220, 225, 240, 0.9);
    font-weight: bold;
}

.stats-compare-table tbody tr:hover {
    background: rgba(200, 210, 230, 0.05);
}

.pl-positive {
    color: #22c55e !important;
    text-shadow: 0 0 6px rgba(34, 197, 94, 0.3);
}

.pl-negative {
    color: #ef4444 !important;
    text-shadow: 0 0 6px rgba(239, 68, 68, 0.3);
}

/* Graph Containers */

.room-graph-container {
    margin-bottom: 16px;
    background: rgba(10, 15, 40, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 12px;
    overflow: hidden;
}

.room-graph-title {
    color: rgba(200, 210, 230, 0.8);
    font-size: 11px;
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 8px;
    text-shadow: 0 0 8px rgba(200, 210, 230, 0.2);
}

.room-graph-empty {
    color: var(--text-secondary);
    font-size: 12px;
    text-align: center;
    padding: 30px 0;
    font-style: italic;
}

.room-detail-join-btn {
    display: block;
    width: 100%;
    padding: 12px;
    margin-top: 16px;
    background: linear-gradient(135deg, rgba(200, 210, 230, 0.1) 0%, rgba(160, 170, 200, 0.1) 100%);
    border: 1px solid rgba(200, 210, 230, 0.5);
    border-radius: 10px;
    color: rgba(220, 225, 240, 0.9);
    font-family: 'Courier New', monospace;
    font-size: 14px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.3s;
    text-shadow: 0 0 8px rgba(200, 210, 230, 0.2);
}

.room-detail-join-btn:hover {
    background: linear-gradient(135deg, rgba(200, 210, 230, 0.2) 0%, rgba(160, 170, 200, 0.2) 100%);
    box-shadow: 0 0 20px rgba(200, 210, 230, 0.2);
    transform: translateY(-1px);
}

/* In-Game Room Stats Button */

/* Legacy room-stats-btn now uses room-icon-graph */
.room-stats-btn {
    background: rgba(200, 210, 230, 0.1);
    border: 1px solid rgba(200, 210, 230, 0.3);
    color: rgba(200, 210, 230, 0.8);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    margin-left: 8px;
}

.room-stats-btn:hover {
    background: rgba(200, 210, 230, 0.2);
    box-shadow: 0 0 12px rgba(200, 210, 230, 0.2);
    border-color: rgba(200, 210, 230, 0.5);
}

.room-stats-btn svg {
    width: 18px;
    height: 18px;
}

/* ========================================
   Responsive
   ======================================== */

/* Tablet */
@media (max-width: 1280px) {
    .poker-table {
        width: 800px;
        height: 500px;
    }
    .action-panel { width: 420px; }
}

/* Small tablet / Large phone landscape */
@media (max-width: 960px) {
    .poker-table {
        width: 620px;
        height: 400px;
        top: 120px;
    }

    .pot-display { top: 38%; }

    .community-cards { gap: 5px; }
    .community-cards .card,
    .card-slot {
        width: 48px;
        height: 68px;
    }
    .community-cards .card-rank { font-size: 16px; }
    .community-cards .card-suit { font-size: 22px; }

    .player-cards .card { width: 40px; height: 56px; }
    .player-cards .card-rank { font-size: 13px; }
    .player-cards .card-suit { font-size: 18px; }

    .player-info { min-width: 96px; padding: 6px 10px; }
    .player-name { font-size: 11px; }
    .player-stack { font-size: 13px; }
    .player-position-badge { font-size: 9px; padding: 1px 6px; }
    .player-action { font-size: 10px; }
    .profit-loss-badge { font-size: 11px; padding: 2px 6px; }

    .dealer-button { width: 26px; height: 26px; font-size: 12px; }

    .action-panel { width: 360px; padding: 10px; }
    .action-history-panel { width: 220px; padding: 10px; }

    .preset-btn { padding: 10px 2px; font-size: 13px; }
    .amount-adj-btn { width: 36px; height: 36px; font-size: 13px; }
    .amount-display input { width: 56px; font-size: 15px; padding: 8px 2px; }
    .action-btn { padding: 10px 10px; font-size: 12px; }

    /* Seat re-positions for smaller table */
    .seat-0 { bottom: -35px; }
    .seat-1 { bottom: 40px; left: -30px; }
    .seat-2 { top: 40px; left: -30px; }
    .seat-3 { top: -70px; }
    .seat-4 { top: 40px; right: -30px; }
    .seat-5 { bottom: 40px; right: -30px; }

    .dealer-button { width: 24px; height: 24px; font-size: 10px; }
    .dealer-button.pos-0 { bottom: -10px; left: calc(50% + 65px); }
    .dealer-button.pos-1 { bottom: 42px; left: 75px; }
    .dealer-button.pos-2 { top: 115px; left: 75px; }
    .dealer-button.pos-3 { top: -5px; left: calc(50% + 65px); }
    .dealer-button.pos-4 { top: 115px; right: 75px; left: auto; }
    .dealer-button.pos-5 { bottom: 42px; right: 75px; left: auto; }
}

/* Phone portrait */
@media (max-width: 640px) {
    body { overflow: hidden; }

    .app-container {
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        height: 100vh;
        height: 100dvh;
        padding-bottom: 0;
        /* 席・テーブル配置の基準値（全子要素に継承） */
        --top-anchor: 48px;
        --bot-anchor: 156px;
        --seat-h: 110px;
        --side-gap: -30px;
    }

    /* Hide desktop history, show mobile history */
    .action-history-desktop { display: none !important; }
    .action-history-mobile { display: flex !important; }

    .poker-table {
        /* テーブルは上プレイヤーの中心〜下プレイヤーの中心を結ぶ楕円 */
        /* 画面サイズに応じて自動的に可変する */
        /* ※ transform / backdrop-filter / filter 禁止:
           これらは CSS containing block を生成し、
           子要素の position:fixed がビューポート基準でなくなるため */
        position: fixed;
        top: calc(var(--top-anchor) + var(--seat-h) / 2);
        bottom: calc(var(--bot-anchor) + var(--seat-h) / 2);
        left: 7vw;
        width: 86vw;
        height: auto;
        margin: 0;
        border-radius: 50%;
        z-index: 5;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    .pot-display {
        top: 28%;
        font-size: 14px;
    }
    .pot-amount { font-size: 17px; }

    .community-cards { gap: 4px; top: 46%; }

    .player-position-stack-row { gap: 4px; }
    .community-cards .card,
    .card-slot {
        width: 46px;
        height: 64px;
    }
    .community-cards .card-rank { font-size: 18px; }
    .community-cards .card-suit { font-size: 23px; }

    /* 全プレイヤーのカード（統一サイズ） */
    .player-cards .card { width: 46px; height: 64px; }
    .player-cards .card-rank { font-size: 18px; }
    .player-cards .card-suit { font-size: 23px; }
    .player-cards { gap: 2px; }

    /* プレイヤー情報パネル — モバイルでは枠・影を完全に除去 */
    .player-info {
        min-width: 58px;
        padding: 2px 5px;
        border-radius: 7px;
        border: none !important;
        box-shadow: none !important;
    }
    .player-seat.seat-occupied,
    .player-seat.seat-selectable {
        border: none !important;
        box-shadow: none !important;
    }
    .player-name { font-size: 12px; margin-bottom: 0; line-height: 1.2; }
    .player-stack { font-size: 13px; line-height: 1.2; }
    .player-position-badge { font-size: 9px; padding: 1px 4px; }
    .player-action { font-size: 10px; min-height: 12px; margin-top: 1px; line-height: 1.2; }
    .profit-loss-badge { font-size: 10px; padding: 1px 5px; }
    /* Profit/Loss badge per-seat (mobile) — bet display と同じ位置 */
    .seat-0 .profit-loss-badge { top: -18px; left: 50%; transform: translateX(-50%); right: auto; }
    .seat-1 .profit-loss-badge { bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%); top: auto; right: auto; }
    .seat-2 .profit-loss-badge { bottom: -16px; left: 50%; transform: translateX(-50%); top: auto; right: auto; }
    .seat-3 .profit-loss-badge { bottom: -16px; left: 50%; transform: translateX(-50%); top: auto; right: auto; }
    .seat-4 .profit-loss-badge { bottom: -16px; left: 50%; transform: translateX(-50%); top: auto; right: auto; }
    .seat-5 .profit-loss-badge { bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%); top: auto; right: auto; }

    /* 自分の情報パネルは少し大きく */
    .seat-0 .player-info { min-width: 68px; padding: 3px 6px; }
    .seat-0 .player-name { font-size: 13px; }
    .seat-0 .player-stack { font-size: 14px; }
    .seat-0 .player-position-badge { font-size: 10px; padding: 1px 5px; }

    .player-seat { gap: 2px; }

    /* ---- 席はビューポート固定 — 配置基準値 ---- */
    /* --top-anchor: seat-3 上端（アイコン直下） */
    /* --bot-anchor: seat-0 下端（アクションパネル直上） */
    /* --seat-h: 席の概算高さ（カード64 + gap2 + info~44） */
    /* --side-gap: サイドプレイヤーと上下プレイヤー間のクリアランス（bet表示含む） */
    .player-seat {
        position: fixed;
        z-index: 15;
    }
    /* seat-0 (自分 / bottom center) - アクションパネルすぐ上 */
    .seat-0 { bottom: var(--bot-anchor); left: 50%; transform: translateX(-50%); top: auto; right: auto; }
    /* seat-3 (top center) - アイコンすぐ下 */
    .seat-3 { top: var(--top-anchor); left: 50%; transform: translateX(-50%); bottom: auto; right: auto; }
    /* seat-2 (left-top) - 上プレイヤーから--side-gap離して左端 */
    .seat-2 { top: calc(var(--top-anchor) + var(--seat-h) + var(--side-gap)); left: 2vw; bottom: auto; right: auto; }
    /* seat-4 (right-top) - 上プレイヤーから--side-gap離して右端 */
    .seat-4 { top: calc(var(--top-anchor) + var(--seat-h) + var(--side-gap)); right: 2vw; left: auto; bottom: auto; }
    /* seat-1 (left-bottom) - 下プレイヤーから--side-gap離して左端 */
    .seat-1 { bottom: calc(var(--bot-anchor) + var(--seat-h) + var(--side-gap)); left: 2vw; top: auto; right: auto; }
    /* seat-5 (right-bottom) - 下プレイヤーから--side-gap離して右端 */
    .seat-5 { bottom: calc(var(--bot-anchor) + var(--seat-h) + var(--side-gap)); right: 2vw; left: auto; top: auto; }

    /* ディーラーボタン: モバイルでは非表示 */
    .dealer-button { display: none; }

    /* Bet display - モバイルではアクション表示に統合するため非表示 */
    .player-bet-display {
        display: none !important;
    }

    /* Time bar — display切替ではなくvisibilityで制御しレイアウトシフトを防止 */
    .time-bar { display: block !important; visibility: hidden; margin-top: 1px; height: 2px; }
    .acting .time-bar { visibility: visible; }

    /* Action panel - full width bottom, CSS Grid layout */
    .action-panel {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        border-radius: 14px 14px 0 0;
        padding: 8px 10px;
        padding-bottom: max(8px, env(safe-area-inset-bottom));
        z-index: 60;
        display: grid;
        grid-template-columns: 1fr 2fr;
        grid-template-rows: minmax(30px, auto) minmax(38px, auto) auto;
        gap: 6px;
    }

    /* disabled: パネル全体ではなく操作部分のみ暗くする */
    .action-panel.disabled {
        opacity: 1;
        pointer-events: auto;
    }
    .action-panel.disabled .main-actions,
    .action-panel.disabled .custom-amount {
        opacity: 0.35;
        pointer-events: none;
    }

    /* top-rowを透過してGridの子に参加させる */
    .action-panel-top-row {
        display: contents;
    }

    /* Action history - 左カラム、プリセット〜金額入力の2行分を縦に使う */
    .action-history-panel {
        position: static;
        width: auto;
        max-height: 80px;
        border-radius: 6px;
        padding: 4px 6px;
        background: rgba(15, 18, 40, 0.5);
        border: 1px solid rgba(100, 110, 160, 0.2);
        box-shadow: none;
        backdrop-filter: none;
        min-width: 0;
        z-index: auto;
        grid-column: 1;
        grid-row: 1 / 3;
        overflow-y: auto;
    }
    .action-history-content { font-size: 10px; }
    .action-history-content .game-phase { font-size: 9px; padding: 2px 0 1px; }

    /* Preset buttons - 右カラム上段、横一列 */
    .preset-buttons {
        display: flex;
        flex-wrap: nowrap;
        gap: 2px;
        margin-bottom: 0;
        width: auto;
        grid-column: 2;
        grid-row: 1;
        align-items: center;
    }
    .preset-btn {
        padding: 8px 1px;
        font-size: 11px;
        border-radius: 5px;
        flex: 1;
        min-width: 0;
    }

    /* Custom amount - 右カラム下段 */
    .custom-amount {
        gap: 4px;
        margin-bottom: 0;
        grid-column: 2;
        grid-row: 2;
    }
    .amount-adj-btn { width: 38px; height: 38px; font-size: 15px; border-radius: 10px; }
    .amount-display input { width: 56px; font-size: 16px; padding: 6px 2px; }
    .amount-unit { font-size: 13px; }

    /* Main actions - 両カラムにまたがる */
    .main-actions {
        gap: 6px;
        grid-column: 1 / 3;
        grid-row: 3;
    }
    .action-btn { padding: 12px 8px; font-size: 15px; border-radius: 12px; }

    /* Next hand button */
    #next-hand-btn {
        bottom: 20px;
        padding: 14px 36px;
        font-size: 17px;
        border-radius: 12px;
    }

    /* Debug toggle */
    .debug-toggle { top: 8px; left: 8px; padding: 3px 8px; font-size: 8px; }

    /* Chip mode toggle - hide on mobile */
    .chip-mode-toggle { display: none; }

    /* Debug panel - overlay */
    .debug-panel {
        top: 40px;
        left: 6px;
        right: 6px;
        width: auto;
    }

    /* Side pots */
    .side-pots-display { gap: 4px; }
    .side-pot-chip { font-size: 10px; padding: 2px 6px; }
    .side-pot-chip .chip-dot { width: 9px; height: 9px; }

    /* Stats HUD popup - mobile */
    .stats-hud-popup {
        width: 180px;
        padding: 10px;
        border-radius: 10px;
    }
    .stats-hud-name { font-size: 13px; }
    .stats-hud-meta { font-size: 9px; }
    .stats-hud-label { font-size: 10px; }
    .stats-hud-value { font-size: 13px; }
    .stats-hud-item { padding: 3px 5px; }

    /* Lobby responsive */
    .lobby-screen { padding: 20px 15px; }
    .site-logo-img { width: 210px; }
    .lobby-subtitle { font-size: 10px; letter-spacing: 5px; }
    .mode-select { flex-direction: column; gap: 10px; }
    .mode-btn { min-width: auto; width: 100%; padding: 14px; }
    .lobby-settings { padding: 18px; max-width: 100%; }
    .seat-select-table { width: 240px; height: 160px; }
    .seat-option { width: 50px; height: 50px; font-size: 9px; }
    .lobby-start-btn { font-size: 16px; padding: 14px; }
    .lobby-notice { margin-top: 16px; padding: 10px 14px; }
    .lobby-notice p { font-size: 10px; }

    .back-to-lobby-btn { top: 6px; left: 6px; font-size: 11px; padding: 5px 10px; }

    /* Room icons bar - mobile */
    .room-icons-bar { top: 5px; right: 5px; gap: 4px; }
    .room-icon-btn { width: 30px; height: 30px; border-radius: 7px; }
    .room-icon-R { font-size: 14px; }
    .room-icon-graph svg { width: 14px; height: 14px; }
    .room-icon-settings svg { width: 14px; height: 14px; }
    .room-info-popup { top: 42px; right: 5px; padding: 8px 12px; }
    .room-info-popup-name { font-size: 11px; }
    .room-info-popup-code { font-size: 13px; }

    /* Player controls - compact, right side above action panel */
    .player-controls {
        bottom: 186px;
        right: 8px;
        z-index: 60;
    }
    .player-control-label {
        font-size: 11px;
        padding: 5px 10px;
    }
    .player-control-label input[type="checkbox"] {
        width: 14px;
        height: 14px;
    }
    .leave-seat-btn {
        font-size: 11px;
        padding: 5px 10px;
    }
    .leave-seat-btn:active { transform: scale(0.95); }

    /* Waiting overlay for mobile (inside table) */
    .multi-waiting-msg { font-size: 12px; padding: 6px 16px; }
    .multi-waiting-hint {
        font-size: 10px;
        padding: 5px 12px;
        max-width: 70vw;
    }

    /* Auth card picker mobile */
    .card-picker-ranks { grid-template-columns: repeat(7, 1fr); gap: 3px; }
    .card-picker-rank-btn { padding: 8px 2px; font-size: 12px; }
    .card-picker-suits { gap: 6px; }
    .card-picker-suit-btn { padding: 10px 4px; }
    .picker-suit-symbol { font-size: 22px; }
    .secret-card-slot { width: 60px; height: 84px; }
    .secret-card-rank { font-size: 16px; }
    .secret-card-suit { font-size: 20px; }
    .auth-user-name { font-size: 13px; }

    /* Saved rooms mobile */
    .saved-rooms-list { max-height: 150px; }
    .saved-room-item { padding: 8px 10px; }
    .saved-room-code { font-size: 14px; }
    .saved-room-meta { font-size: 10px; }
    .saved-room-actions button { padding: 5px 10px; font-size: 10px; }

    /* Room detail overlay mobile */
    .room-detail-panel { padding: 18px; max-width: 95%; max-height: 90vh; }
    .room-detail-header h3 { font-size: 15px; }
    .stats-compare-table { font-size: 10px; }
    .stats-compare-table thead th { font-size: 9px; padding: 4px 2px; }
    .stats-compare-table tbody td { padding: 6px 2px; }
    .room-graph-container { padding: 8px; }

    /* In-game stats button (now part of room-icons-bar, handled above) */

    /* Room settings panel mobile */
    .room-settings-inner { padding: 20px 18px; max-width: 95%; }
    .room-settings-title { font-size: 15px; letter-spacing: 2px; }
    .game-mode-option { padding: 10px 12px; }
    .game-mode-label { font-size: 12px; }
}

/* ========================================
   Lobby Screen
   ======================================== */

.lobby-screen {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    overflow-y: auto;
}

.lobby-logo {
    margin-bottom: 6px;
    text-align: center;
}

.site-logo-img {
    width: 210px;
    height: auto;
    object-fit: contain;
    position: relative;
    left: -9px;
}

.lobby-subtitle {
    font-size: 13px;
    color: rgba(200, 205, 220, 0.6);
    letter-spacing: 8px;
    text-align: center;
    margin-bottom: 20px;
    font-family: 'Helvetica Neue', 'Arial', sans-serif;
    font-weight: 300;
}

/* このサイトについて */
.about-section {
    max-width: 340px;
    margin: 0 auto 20px;
}
.about-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    padding: 6px 0;
    transition: opacity 0.2s;
}
.about-toggle:hover {
    opacity: 0.8;
}
.about-toggle-label {
    font-size: 12px;
    color: var(--text-secondary);
    letter-spacing: 1px;
}
.about-toggle-arrow {
    font-size: 9px;
    color: var(--text-secondary);
    transition: transform 0.3s;
}
.about-toggle-arrow.open {
    transform: rotate(180deg);
}
.about-content {
    margin-top: 10px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    text-align: left;
}
.about-text {
    font-size: 12.5px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin: 0 0 10px;
}
.about-list {
    margin: 0;
    padding: 0 0 0 18px;
    list-style: none;
}
.about-list li {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.8;
    position: relative;
    padding-left: 4px;
}
.about-list li::before {
    content: '✦';
    position: absolute;
    left: -16px;
    color: rgba(180, 160, 120, 0.6);
    font-size: 8px;
    top: 2px;
}
.about-list strong {
    color: var(--text-primary);
    font-weight: 500;
}

.lobby-notice {
    margin-top: 24px;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    max-width: 400px;
    width: 100%;
}

.lobby-notice p {
    font-size: 11px;
    color: rgba(200, 205, 220, 0.5);
    line-height: 1.6;
    margin: 0;
    text-align: center;
}

.lobby-notice p + p {
    margin-top: 4px;
}

.lobby-notice a {
    color: rgba(200, 205, 220, 0.7);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.lobby-notice a:hover {
    color: rgba(200, 205, 220, 0.9);
}

.lobby-notice-links {
    margin-top: 8px !important;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.lobby-notice-sep {
    margin: 0 6px;
    color: rgba(200, 205, 220, 0.3);
}

/* ===== ポリシー・規約ページ ===== */
.policy-page {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 40px 20px;
    overflow-y: auto;
}

.policy-panel {
    width: 100%;
    max-width: 640px;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    padding: 32px 28px;
    backdrop-filter: blur(16px);
}

.policy-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 4px;
    font-family: 'Courier New', monospace;
}

.policy-updated {
    font-size: 11px;
    color: var(--text-dim);
    margin: 0 0 24px;
}

.policy-body h2 {
    font-size: 14px;
    font-weight: 700;
    color: rgba(200, 210, 230, 0.9);
    margin: 24px 0 8px;
    font-family: 'Courier New', monospace;
}

.policy-body h3 {
    font-size: 12px;
    font-weight: 700;
    color: rgba(200, 210, 230, 0.7);
    margin: 12px 0 6px;
}

.policy-body p {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.8;
    margin: 0 0 8px;
}

.policy-body ul {
    margin: 0 0 8px;
    padding-left: 20px;
}

.policy-body li {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.8;
}

.policy-body a {
    color: rgba(69, 208, 220, 0.8);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.policy-body a:hover {
    color: rgba(69, 208, 220, 1);
}

.policy-footer-links {
    display: flex;
    gap: 20px;
    margin-top: 24px;
}

.policy-back-link {
    font-size: 12px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
    cursor: pointer;
}

.policy-back-link:hover {
    color: var(--text-primary);
}

/* Mode Select */
.mode-select {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}

.mode-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 180px;
    padding: 20px 24px;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-secondary);
}

.mode-btn:hover {
    border-color: rgba(200, 205, 220, 0.3);
    background: rgba(10, 15, 40, 0.95);
}

.mode-btn-active {
    border-color: rgba(200, 210, 230, 0.6);
    color: var(--text-primary);
    box-shadow: 0 0 15px rgba(200, 210, 230, 0.1), inset 0 0 15px rgba(200, 210, 230, 0.03);
}

.mode-icon {
    font-size: 28px;
}

.mode-label {
    font-size: 16px;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
}

.mode-desc {
    font-size: 11px;
    opacity: 0.6;
}

/* Lobby Settings Panel */
.lobby-settings {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 14px;
    padding: 24px 28px;
    max-width: 440px;
    width: 100%;
    backdrop-filter: blur(12px);
}

.settings-row {
    margin-bottom: 16px;
}

.settings-row:last-of-type {
    margin-bottom: 8px;
}

.settings-label {
    display: block;
    font-size: 12px;
    color: rgba(200, 210, 230, 0.8);
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.settings-input {
    width: 100%;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 15px;
    font-family: 'Courier New', monospace;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.settings-input:focus {
    border-color: rgba(200, 210, 230, 0.5);
}

.settings-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.settings-option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 13px;
}

.settings-option input[type="radio"],
.settings-option input[type="checkbox"] {
    accent-color: rgba(200, 210, 230, 0.8);
    width: 16px;
    height: 16px;
}

.settings-option-disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.settings-option-disabled input {
    cursor: not-allowed;
}

.coming-soon-inline {
    font-size: 10px;
    color: rgba(200, 210, 230, 0.5);
    font-style: italic;
    letter-spacing: 0.5px;
}

/* Seat Select */
.seat-select {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.seat-select-table {
    position: relative;
    width: 320px;
    height: 200px;
    border: 2px solid rgba(180, 190, 220, 0.2);
    border-radius: 50%;
    background: rgba(30, 35, 50, 0.3);
}

.seat-option {
    position: absolute;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(20, 25, 40, 0.7);
    border: 2px solid var(--panel-border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    transform: translate(-50%, -50%);
}

.seat-option:hover {
    border-color: rgba(200, 210, 230, 0.5);
    background: rgba(200, 210, 230, 0.06);
}

.seat-selected {
    border-color: rgba(220, 225, 240, 0.7) !important;
    background: rgba(200, 210, 230, 0.1) !important;
    box-shadow: 0 0 12px rgba(200, 210, 230, 0.15);
}

.seat-opt-name {
    font-size: 10px;
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
    text-align: center;
    word-break: break-all;
    padding: 2px;
}

/* Seat positions on elliptical table */
.seat-opt-0 { bottom: -30px; left: 50%; transform: translate(-50%, 0); }
.seat-opt-1 { bottom: 10%;  left: 5%;  transform: translate(-50%, 50%); }
.seat-opt-2 { top: 10%;     left: 5%;  transform: translate(-50%, -50%); }
.seat-opt-3 { top: -30px;   left: 50%; transform: translate(-50%, 0); }
.seat-opt-4 { top: 10%;     right: 5%; transform: translate(50%, -50%); left: auto; }
.seat-opt-5 { bottom: 10%;  right: 5%; transform: translate(50%, 50%); left: auto; }

/* Start Button */
.lobby-start-btn {
    width: 100%;
    padding: 16px;
    margin-top: 12px;
    background: linear-gradient(135deg, rgba(200, 210, 230, 0.1), rgba(160, 170, 200, 0.1));
    border: 1px solid rgba(200, 210, 230, 0.5);
    border-radius: 10px;
    color: rgba(220, 225, 240, 0.9);
    font-size: 18px;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    letter-spacing: 3px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.lobby-start-btn:hover {
    background: linear-gradient(135deg, rgba(200, 210, 230, 0.2), rgba(160, 170, 200, 0.2));
    box-shadow: 0 0 25px rgba(200, 210, 230, 0.15);
}

/* Coming Soon */
.coming-soon {
    text-align: center;
    padding: 30px 10px;
    color: var(--text-secondary);
}

.coming-soon-icon {
    font-size: 40px;
    display: block;
    margin-bottom: 12px;
}

.coming-soon p {
    font-size: 14px;
    line-height: 1.8;
}

/* Back to Lobby Button */
.back-to-lobby-btn {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 50;
    padding: 8px 16px;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 12px;
    font-family: 'Courier New', monospace;
    cursor: pointer;
    transition: all 0.2s ease;
}

.back-to-lobby-btn:hover {
    border-color: rgba(200, 210, 230, 0.5);
    color: var(--text-primary);
}

/* ========================================
   Multiplayer Lobby Styles
   ======================================== */

.multi-room-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 10px;
}

.multi-create-btn {
    width: 100%;
}

.multi-join-row {
    display: flex;
    gap: 8px;
}

.multi-code-input {
    flex: 1;
    text-align: center;
    font-size: 18px !important;
    font-family: 'Courier New', monospace !important;
    letter-spacing: 6px;
    text-transform: uppercase;
}

.multi-join-btn {
    flex-shrink: 0;
    width: 80px;
    font-size: 14px !important;
    padding: 10px !important;
}

/* ========================================
   Lobby Action Cards (部屋を作る / 部屋に入る)
   ======================================== */
.lobby-action-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
}

.lobby-action-card {
    background: rgba(10, 15, 40, 0.5);
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    padding: 16px;
    transition: all 0.3s ease;
}

.lobby-action-card:hover {
    border-color: rgba(200, 210, 230, 0.3);
    background: rgba(10, 15, 40, 0.7);
}

.lobby-action-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.lobby-action-icon {
    font-size: 22px;
}

.lobby-action-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
}

.lobby-action-card .lobby-start-btn {
    margin-top: 0;
}

.lobby-action-card .multi-join-row {
    margin-top: 0;
}

/* ========================================
   Room Settings Panel (ゲーム画面内)
   ======================================== */
.room-settings-panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    animation: statsPopupAppear 0.3s ease-out;
}

.room-settings-inner {
    position: relative;
    background: var(--panel-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    padding: 28px 32px;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.5), 0 0 30px rgba(200, 210, 230, 0.08);
    max-height: 90vh;
    overflow-y: auto;
}

.room-settings-title {
    font-size: 18px;
    font-weight: 700;
    color: rgba(220, 225, 240, 0.95);
    font-family: 'Courier New', monospace;
    text-align: center;
    letter-spacing: 3px;
    margin-bottom: 20px;
    text-shadow: 0 0 12px rgba(200, 210, 230, 0.3);
    text-transform: uppercase;
}

/* Game Mode Select */
.game-mode-select {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.game-mode-option {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 12px 14px;
    background: rgba(20, 25, 50, 0.5);
    border: 1px solid var(--panel-border);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.game-mode-option:hover:not(.game-mode-disabled) {
    border-color: rgba(200, 210, 230, 0.4);
    background: rgba(200, 210, 230, 0.05);
}

.game-mode-option input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid var(--panel-border);
    border-radius: 4px;
    background: rgba(20, 25, 50, 0.6);
    cursor: pointer;
    transition: all 0.2s ease;
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
}

.game-mode-option input[type="checkbox"]:checked {
    background: rgba(200, 210, 230, 0.9);
    border-color: rgba(200, 210, 230, 0.9);
    box-shadow: 0 0 8px rgba(200, 210, 230, 0.4);
}

.game-mode-option input[type="checkbox"]:checked::after {
    content: '✓';
    display: block;
    text-align: center;
    font-size: 12px;
    font-weight: 900;
    color: #0a0e27;
    line-height: 14px;
}

.game-mode-option {
    position: relative;
}

.game-mode-selected {
    border-color: rgba(200, 210, 230, 0.6) !important;
    background: rgba(200, 210, 230, 0.08) !important;
    box-shadow: 0 0 12px rgba(200, 210, 230, 0.12);
}

.game-mode-label {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
}

.game-mode-desc {
    font-size: 11px;
    color: var(--text-secondary);
    font-family: 'Courier New', monospace;
}

.game-mode-disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.game-mode-disabled .game-mode-desc {
    color: rgba(180, 185, 210, 0.6);
    font-style: italic;
}

.save-room-option {
    margin-bottom: 4px;
}

/* Room Code Display */
.room-code-display {
    text-align: center;
    margin-bottom: 16px;
    padding: 16px;
    background: rgba(200, 210, 230, 0.05);
    border: 1px solid rgba(200, 210, 230, 0.2);
    border-radius: 12px;
}

.room-code-label {
    display: block;
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.room-code-value {
    display: block;
    font-size: 36px;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    color: rgba(220, 225, 240, 0.95);
    letter-spacing: 10px;
    text-shadow: 0 0 20px rgba(200, 210, 230, 0.4);
}

.room-code-copy {
    margin-top: 8px;
    background: none;
    border: 1px solid var(--panel-border);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 16px;
    padding: 4px 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.room-code-copy:hover {
    border-color: rgba(200, 210, 230, 0.5);
    color: var(--text-primary);
}

/* Waiting Players */
.waiting-players {
    margin-bottom: 16px;
}

.waiting-player-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    margin-bottom: 4px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    border: 1px solid var(--panel-border);
}

.waiting-player-name {
    font-size: 14px;
    color: var(--text-primary);
}

.waiting-player-host {
    font-size: 10px;
    color: rgba(220, 225, 240, 0.9);
    padding: 2px 8px;
    border: 1px solid rgba(200, 210, 230, 0.3);
    border-radius: 10px;
}

.waiting-player-seat {
    font-size: 11px;
    color: var(--text-secondary);
    font-family: 'Courier New', monospace;
}

/* Multi Seat Selection */
.multi-seat-opt {
    cursor: pointer;
    transition: all 0.2s;
}

.multi-seat-opt.seat-taken {
    background: rgba(180, 185, 210, 0.12) !important;
    border-color: rgba(180, 185, 210, 0.35) !important;
    cursor: default;
}

.multi-seat-opt.seat-mine {
    background: rgba(200, 210, 230, 0.12) !important;
    border-color: rgba(220, 225, 240, 0.7) !important;
    box-shadow: 0 0 10px rgba(200, 210, 230, 0.2);
}

/* Leave Room Button */
.lobby-back-btn {
    display: block;
    width: 100%;
    margin-top: 8px;
    padding: 10px;
    background: transparent;
    border: 1px solid rgba(255, 100, 100, 0.3);
    border-radius: 8px;
    color: #ff6b6b;
    font-size: 13px;
    font-family: 'Courier New', monospace;
    cursor: pointer;
    transition: all 0.2s;
}

.lobby-back-btn:hover {
    border-color: #ff6b6b;
    background: rgba(255, 100, 100, 0.1);
}

/* Connection Status */
.connection-status {
    text-align: center;
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 8px;
}

.connection-status.connected {
    color: var(--color-call);
}

.connection-status.error {
    color: var(--color-raise);
}

/* ========================================
   Multiplayer In-Game UI
   ======================================== */

/* Room icons bar (top right) */
.room-icons-bar {
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 50;
    display: flex;
    gap: 6px;
    align-items: center;
}

.room-icon-btn {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    border: 1px solid;
}

.room-icon-R {
    background: rgba(200, 210, 230, 0.1);
    border-color: rgba(200, 210, 230, 0.3);
    color: rgba(200, 210, 230, 0.8);
    font-family: 'Courier New', monospace;
    font-size: 16px;
    font-weight: bold;
    text-shadow: 0 0 8px rgba(200, 210, 230, 0.2);
}

.room-icon-R:hover {
    background: rgba(200, 210, 230, 0.2);
    box-shadow: 0 0 12px rgba(200, 210, 230, 0.2);
}

.room-icon-graph {
    background: rgba(200, 210, 230, 0.1);
    border-color: rgba(200, 210, 230, 0.3);
    color: rgba(200, 210, 230, 0.8);
}

.room-icon-graph:hover {
    background: rgba(200, 210, 230, 0.2);
    box-shadow: 0 0 12px rgba(200, 210, 230, 0.2);
}

.room-icon-graph svg {
    width: 16px;
    height: 16px;
}

.room-icon-settings {
    background: rgba(200, 210, 230, 0.1);
    border-color: rgba(200, 210, 230, 0.3);
    color: rgba(200, 210, 230, 0.8);
}

.room-icon-settings:hover {
    background: rgba(200, 210, 230, 0.2);
    box-shadow: 0 0 12px rgba(200, 210, 230, 0.2);
}

.room-icon-settings svg {
    width: 16px;
    height: 16px;
}

/* Room settings close button */
.room-settings-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    line-height: 1;
}

.room-settings-close:hover {
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.05);
}

/* Room info popup (shown on R click) */
.room-info-popup {
    position: fixed;
    top: 50px;
    right: 10px;
    z-index: 55;
    padding: 10px 16px;
    background: var(--panel-bg);
    border: 1px solid rgba(200, 210, 230, 0.2);
    border-radius: 10px;
    backdrop-filter: blur(16px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.room-info-popup-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.room-info-popup-name:empty { display: none; }

.room-info-popup-code {
    font-size: 15px;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    color: rgba(220, 225, 240, 0.95);
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(200, 210, 230, 0.25);
}

/* Player controls container */
.player-controls {
    position: fixed;
    bottom: 20px;
    right: 20px;
    left: auto;
    z-index: 50;
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-end;
}

.player-control-label {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 0;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    white-space: nowrap;
    user-select: none;
}

.player-control-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: rgba(200, 210, 230, 0.8);
    cursor: pointer;
}

.ready-checkbox-label {
    background: none;
    border: none;
    color: rgba(200, 210, 230, 0.9);
}

.ready-checkbox-label:hover {
    text-shadow: 0 0 8px rgba(200, 210, 230, 0.4);
}

/* カウントダウン表示 */
.ready-countdown {
    font-size: 11px;
    color: rgba(200, 210, 230, 0.8);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* 一時離席コントロール（アクションパネルのすぐ上） */
.away-controls {
    position: fixed;
    bottom: 220px;
    right: 20px;
    z-index: 50;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.away-checkbox-label {
    background: none;
    border: none;
    color: rgba(200, 210, 230, 0.6);
    font-size: 11px;
}

.away-checkbox-label:hover {
    color: rgba(200, 210, 230, 0.85);
    text-shadow: 0 0 8px rgba(200, 210, 230, 0.3);
}

/* Leave seat button */
.leave-seat-btn {
    padding: 6px 14px;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    border-radius: 8px;
    color: #f87171;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    white-space: nowrap;
}

.leave-seat-btn:hover {
    background: rgba(239, 68, 68, 0.3);
    border-color: rgba(239, 68, 68, 0.6);
    text-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
}

.leave-seat-btn:active {
    transform: scale(0.95);
}

/* Seat state indicators */
.seat-ready .player-name::after {
    content: ' ✓';
    color: #22d3ee;
    font-size: 10px;
}

.seat-away .player-info {
    opacity: 0.5;
}

.seat-away .player-name::after {
    content: ' (離席中)';
    color: #fbbf24;
    font-size: 9px;
}

/* Waiting overlay (inside table, centered) */
.multi-waiting-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.multi-waiting-msg {
    font-size: 14px;
    color: rgba(220, 225, 240, 0.9);
    font-family: 'Courier New', monospace;
    padding: 10px 24px;
    background: var(--panel-bg);
    border: 1px solid rgba(200, 210, 230, 0.2);
    border-radius: 10px;
    animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

.multi-waiting-hint {
    font-size: 12px;
    color: var(--text-secondary);
    font-family: 'Courier New', monospace;
    padding: 8px 20px;
    background: rgba(15, 18, 50, 0.7);
    border: 1px solid rgba(200, 210, 230, 0.15);
    border-radius: 8px;
}

.hint-r-icon {
    display: inline-block;
    background: rgba(200, 210, 230, 0.12);
    color: rgba(220, 225, 240, 0.9);
    border: 1px solid rgba(200, 210, 230, 0.3);
    font-weight: 900;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    width: 20px;
    height: 20px;
    line-height: 20px;
    text-align: center;
    border-radius: 5px;
    vertical-align: middle;
    text-shadow: 0 0 8px rgba(200, 210, 230, 0.3);
}

#multi-start-game-ingame {
    font-size: 16px;
    padding: 12px 40px;
}

/* Clickable seats during waiting */
.player-seat.seat-selectable {
    cursor: pointer;
    transition: all 0.2s;
}

.player-seat.seat-selectable:hover {
    box-shadow: 0 0 20px rgba(200, 210, 230, 0.25);
    border-color: rgba(200, 210, 230, 0.5);
}

.player-seat.seat-selectable .player-name {
    color: var(--text-dim);
}

.player-seat.seat-occupied .player-name {
    color: rgba(200, 210, 230, 0.8);
}

.player-seat.seat-occupied {
    border-color: rgba(200, 210, 230, 0.35);
    box-shadow: 0 0 10px rgba(200, 210, 230, 0.12);
}

/* ==============================
   72ゲーム ボーナス表示
   ============================== */

/* 勝者席のネオンエフェクト */
.player-seat.seven-two-winner {
    border-color: #fbbf24 !important;
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.6), 0 0 40px rgba(251, 191, 36, 0.3) !important;
    animation: sevenTwoGlow 0.5s ease-in-out 3;
}

@keyframes sevenTwoGlow {
    0%, 100% { box-shadow: 0 0 20px rgba(251, 191, 36, 0.6); }
    50% { box-shadow: 0 0 40px rgba(251, 191, 36, 0.9), 0 0 60px rgba(251, 191, 36, 0.4); }
}

/* オーバーレイ */
.seven-two-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    pointer-events: none;
    animation: sevenTwoFadeInOut 4s ease-in-out forwards;
}

@keyframes sevenTwoFadeInOut {
    0% { opacity: 0; transform: scale(0.5); }
    15% { opacity: 1; transform: scale(1.1); }
    25% { transform: scale(1); }
    75% { opacity: 1; }
    100% { opacity: 0; }
}

.seven-two-text {
    font-size: 3rem;
    font-weight: 900;
    color: #fbbf24;
    text-shadow: 0 0 20px rgba(251, 191, 36, 0.8), 0 0 40px rgba(251, 191, 36, 0.4);
    letter-spacing: 0.1em;
}

.seven-two-amount {
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.6);
    margin-top: 0.5rem;
}

/* 72ボーナス設定行 */
.seven-two-settings {
    border-top: 1px solid var(--panel-border);
    padding-top: 8px;
    margin-top: 4px;
}

.seven-two-input-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
}

.seven-two-bonus-input {
    width: 80px !important;
    text-align: center;
    font-size: 1rem;
    padding: 6px 8px;
}

.seven-two-unit {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

/* モバイル対応 */
@media (max-width: 768px) {
    .seven-two-text {
        font-size: 2rem;
    }
    .seven-two-amount {
        font-size: 1.5rem;
    }
}

/* ========================================
   Hand History Panel
   ======================================== */

/* スタンドアロンボタン（CPU用、左上に配置） */
.hand-history-standalone-btn {
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 100;
    background: rgba(10, 15, 40, 0.8);
    border: 1px solid rgba(120, 130, 255, 0.25);
    color: var(--text-primary);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.hand-history-standalone-btn:hover {
    background: rgba(20, 30, 70, 0.9);
    border-color: rgba(120, 130, 255, 0.5);
}

/* オーバーレイ */
.hand-history-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

/* パネル */
.hand-history-panel {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 40px rgba(100, 110, 255, 0.15);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* ヘッダー */
.hand-history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 12px;
    border-bottom: 1px solid var(--panel-border);
}

.hand-history-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.hand-history-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
    transition: color 0.2s;
}

.hand-history-close:hover {
    color: var(--text-primary);
}

/* タブ */
.hand-history-tabs {
    display: flex;
    gap: 4px;
    padding: 10px 16px 0;
    overflow-x: auto;
}

.hh-tab {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(120, 130, 255, 0.15);
    border-bottom: none;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
}

.hh-tab:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.hh-tab-active {
    background: rgba(200, 210, 230, 0.1);
    border-color: rgba(200, 210, 230, 0.3);
    color: rgba(220, 225, 240, 0.95);
}

/* ボディ */
.hand-history-body {
    padding: 16px;
    overflow-y: auto;
    flex: 1;
}

.hand-history-empty {
    text-align: center;
    color: var(--text-dim);
    padding: 40px 0;
    font-size: 0.9rem;
}

/* プレイヤーテーブル */
.hh-players-table {
    margin-bottom: 12px;
}

.hh-players-header {
    display: flex;
    align-items: center;
    padding: 6px 8px;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(120, 130, 255, 0.1);
}

.hh-player-row {
    display: flex;
    align-items: center;
    padding: 6px 8px;
    font-size: 0.8rem;
    border-bottom: 1px solid rgba(120, 130, 255, 0.05);
    transition: background 0.15s;
}

.hh-player-row:hover {
    background: rgba(255, 255, 255, 0.03);
}

.hh-winner-row {
    background: rgba(251, 191, 36, 0.06);
    border-left: 2px solid var(--color-gold);
}

.hh-winner-row:hover {
    background: rgba(251, 191, 36, 0.1);
}

.hh-col-pos {
    width: 40px;
    flex-shrink: 0;
    color: var(--text-secondary);
    font-size: 0.7rem;
    font-weight: 600;
}

.hh-col-name {
    flex: 1;
    min-width: 60px;
    color: var(--text-primary);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hh-col-cards {
    width: 90px;
    flex-shrink: 0;
    display: flex;
    gap: 4px;
}

.hh-col-stack {
    width: 50px;
    flex-shrink: 0;
    text-align: right;
    color: var(--text-secondary);
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
}

.hh-col-profit {
    width: 55px;
    flex-shrink: 0;
    text-align: right;
    font-family: 'Courier New', monospace;
    font-weight: 700;
    font-size: 0.8rem;
}

.hh-profit-plus {
    color: #22c55e;
}

.hh-profit-minus {
    color: #ef4444;
}

/* カード表示 */
.hh-card {
    font-family: 'Courier New', monospace;
    font-weight: 700;
    font-size: 0.8rem;
    background: rgba(255, 255, 255, 0.06);
    padding: 1px 4px;
    border-radius: 3px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    white-space: nowrap;
}

/* コミュニティカード */
.hh-community {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 8px;
    margin-bottom: 12px;
    border-top: 1px solid rgba(120, 130, 255, 0.1);
    border-bottom: 1px solid rgba(120, 130, 255, 0.1);
}

.hh-community-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.hh-community-cards {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.hh-community-cards .hh-card {
    font-size: 0.85rem;
    padding: 2px 6px;
}

/* アクションログ */
.hh-action-log {
    max-height: 200px;
    overflow-y: auto;
    padding: 4px 0;
}

.hh-phase {
    font-size: 0.7rem;
    font-weight: 700;
    color: rgba(200, 210, 230, 0.8);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 8px 8px 4px;
    margin-top: 4px;
}

.hh-phase:first-child {
    margin-top: 0;
    padding-top: 4px;
}

.hh-action {
    font-size: 0.75rem;
    color: var(--text-secondary);
    padding: 2px 8px 2px 16px;
    line-height: 1.4;
}

/* ルームアイコンバーの履歴ボタン */
.room-icon-history {
    background: rgba(200, 210, 230, 0.1);
    border-color: rgba(200, 210, 230, 0.3);
    color: rgba(200, 210, 230, 0.8);
}

.room-icon-history:hover {
    background: rgba(200, 210, 230, 0.2);
    box-shadow: 0 0 12px rgba(200, 210, 230, 0.2);
}

.room-icon-reload {
    background: rgba(200, 210, 230, 0.1);
    border-color: rgba(200, 210, 230, 0.3);
    color: rgba(200, 210, 230, 0.8);
}

.room-icon-reload:hover {
    background: rgba(200, 210, 230, 0.2);
    box-shadow: 0 0 12px rgba(200, 210, 230, 0.2);
}

/* モバイル対応 */
@media (max-width: 768px) {
    .hand-history-panel {
        width: 95%;
        max-height: 85vh;
    }

    .hh-col-stack {
        display: none;
    }

    .hh-col-cards {
        width: 80px;
    }

    .hh-col-profit {
        width: 50px;
    }

    .hand-history-standalone-btn {
        top: 10px;
        right: 10px;
    }
}

/* ========================================
   Next Hand Countdown
   ======================================== */
.next-hand-countdown {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 4rem;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.25);
    z-index: 50;
    pointer-events: none;
    font-family: 'Inter', sans-serif;
    text-shadow: 0 0 30px rgba(100, 110, 255, 0.15);
    animation: countdownPulse 1s ease-in-out infinite;
}

@keyframes countdownPulse {
    0%, 100% { opacity: 0.4; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 0.7; transform: translate(-50%, -50%) scale(1.05); }
}

@keyframes copiedFadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ========================================
   CPU Player Buttons
   ======================================== */

.add-cpu-btn {
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(100, 120, 200, 0.25);
    border: 1px solid rgba(150, 170, 220, 0.4);
    color: rgba(200, 210, 230, 0.9);
    font-size: 10px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 10px;
    cursor: pointer;
    z-index: 20;
    transition: all 0.2s ease;
    font-family: 'Courier New', monospace;
    white-space: nowrap;
}

.add-cpu-btn:hover {
    background: rgba(120, 140, 220, 0.4);
    border-color: rgba(180, 190, 240, 0.6);
    color: #fff;
}

.remove-cpu-btn {
    position: absolute;
    top: -6px;
    right: -6px;
    background: rgba(200, 80, 80, 0.3);
    border: 1px solid rgba(220, 100, 100, 0.4);
    color: rgba(255, 150, 150, 0.9);
    font-size: 10px;
    font-weight: 700;
    width: 18px;
    height: 18px;
    line-height: 16px;
    text-align: center;
    padding: 0;
    border-radius: 50%;
    cursor: pointer;
    z-index: 20;
    transition: all 0.2s ease;
}

.remove-cpu-btn:hover {
    background: rgba(220, 80, 80, 0.5);
    border-color: rgba(255, 120, 120, 0.6);
    color: #fff;
}

.seat-cpu .player-name {
    color: rgba(180, 190, 230, 0.9);
}

/* CPU Settings (Coming Soon) */
.cpu-count-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cpu-count-select {
    width: auto;
    min-width: 80px;
    opacity: 0.4;
    cursor: not-allowed;
}

.coming-soon-badge {
    display: inline-block;
    background: rgba(100, 120, 200, 0.15);
    border: 1px solid rgba(150, 170, 220, 0.3);
    color: rgba(180, 190, 230, 0.6);
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    white-space: nowrap;
    letter-spacing: 0.5px;
}
