/* ============================================
   BOT SHOWCASE - MODERN STREAMING UI
   Complete UI Revamp - Premium Design
   ============================================ */

:root {
    --primary-bg: #0a0e27;
    --secondary-bg: #141b2d;
    --accent-blue: #00d4ff;
    --accent-purple: #9d4edd;
    --accent-pink: #ff006e;
    --accent-orange: #ff6b35;
    --live-red: #ff0040;
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.5);
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 24px 64px rgba(0, 0, 0, 0.5);
}

* {
    box-sizing: border-box;
}

body.bot-showcase {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    height: 100vh;
    overflow: hidden;
    background: linear-gradient(135deg, #0a0e27 0%, #1a1f3a 50%, #0a0e27 100%);
    background-size: 200% 200%;
    animation: gradientShift 15s ease infinite;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text-primary);
    overflow-x: hidden;
    position: relative;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Animated background pattern */
body.bot-showcase::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(0, 212, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(157, 78, 221, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
    animation: patternFloat 20s ease-in-out infinite;
}

@keyframes patternFloat {
    0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.5; }
    50% { transform: translate(-30px, -30px) scale(1.1); opacity: 0.7; }
}

/* Disable pointer events on game elements */
body.bot-showcase #player1-hand,
body.bot-showcase #player2-hand,
body.bot-showcase .game-board-container canvas {
    pointer-events: none;
}

/* ============================================
   HEADER
   ============================================ */

.stream-header {
    position: relative;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 32px;
    background: rgba(10, 14, 39, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    box-shadow: var(--shadow-md);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.live-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: linear-gradient(135deg, var(--live-red), #ff3366);
    border-radius: 24px;
    box-shadow: 0 0 20px rgba(255, 0, 64, 0.5);
    animation: livePulse 2s ease-in-out infinite;
}

@keyframes livePulse {
    0%, 100% { box-shadow: 0 0 20px rgba(255, 0, 64, 0.5); }
    50% { box-shadow: 0 0 30px rgba(255, 0, 64, 0.8); }
}

.live-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
    animation: dotPulse 1.5s ease-in-out infinite;
}

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

.live-text {
    font-weight: 700;
    font-size: 0.875rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #ffffff;
}

.stream-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stream-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stream-subtitle {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.viewer-count {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

.viewer-icon {
    width: 18px;
    height: 18px;
    color: var(--accent-blue);
}

.viewer-number {
    font-weight: 700;
    font-size: 0.9375rem;
    color: var(--text-primary);
}

.menu-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    color: var(--text-primary);
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
}

.menu-button:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.menu-button svg {
    width: 18px;
    height: 18px;
}

/* ============================================
   MAIN CONTAINER
   ============================================ */

.stream-container {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 24px;
    padding: 20px;
    height: 100vh;
    max-width: 100%;
    margin: 0;
}

.game-stage {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.video-wrapper {
    position: relative;
    flex: 1;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-xl);
    backdrop-filter: blur(10px);
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* ============================================
   LIVE BANNER
   ============================================ */

.live-banner {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 18px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 30px;
    box-shadow: var(--shadow-lg);
}

.banner-live {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: linear-gradient(135deg, var(--live-red), #ff3366);
    border-radius: 16px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #ffffff;
}

.live-dot-small {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ffffff;
    animation: dotPulse 1.5s ease-in-out infinite;
}

.banner-match {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.05em;
}

.banner-viewers {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ============================================
   PLAYERS OVERLAY
   ============================================ */

.players-overlay {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 16px 24px;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: var(--shadow-xl);
    width: fit-content;
    min-width: 400px;
}

.player-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.player-left {
    flex-direction: row;
}

.player-right {
    flex-direction: row-reverse;
}

.player-avatar-wrapper {
    position: relative;
}

.player-avatar {
    width: 80px;
    height: 80px;
    border-radius: 16px;
    object-fit: cover;
    border: 3px solid var(--glass-border);
    box-shadow: var(--shadow-md);
}

.player-status {
    position: absolute;
    bottom: -4px;
    right: -4px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent-blue);
    border: 3px solid rgba(0, 0, 0, 0.8);
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.6);
    animation: statusPulse 2s ease-in-out infinite;
}

.player-info.active .player-status {
    background: var(--accent-purple);
    box-shadow: 0 0 15px rgba(157, 78, 221, 0.8);
    animation: statusPulse 1s ease-in-out infinite;
}

.player-info.active {
    transform: scale(1.05);
    transition: transform 0.3s ease;
}

.player-info.active .player-avatar {
    border-color: var(--accent-purple);
    box-shadow: 0 0 20px rgba(157, 78, 221, 0.5);
}

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

.player-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.player-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.player-score {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.vs-divider {
    padding: 8px 16px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    font-size: 0.875rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

/* ============================================
   MATCH OVERLAYS
   ============================================ */

.match-overlay {
    position: absolute;
    inset: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.match-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.overlay-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
}

.overlay-content {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 48px 64px;
    background: rgba(10, 14, 39, 0.95);
    border: 2px solid var(--glass-border);
    border-radius: 32px;
    box-shadow: var(--shadow-xl);
    backdrop-filter: blur(20px);
}

.overlay-badge {
    display: inline-block;
    padding: 8px 20px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--accent-blue);
    margin-bottom: 24px;
}

.overlay-title {
    font-size: 3rem;
    font-weight: 800;
    margin: 0 0 16px;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.overlay-player {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(12px);
}

.overlay-player img {
    width: 72px;
    height: 72px;
    border-radius: 18px;
    object-fit: cover;
    border: 2px solid var(--glass-border);
    box-shadow: var(--shadow-sm);
}

.overlay-player span {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 0.05em;
}

.overlay-player-left {
    flex-direction: row;
}

.overlay-player-right {
    flex-direction: row-reverse;
    text-align: right;
}

.overlay-vs {
    font-size: 1.5rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.overlay-score {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 16px 0;
}

.overlay-countdown {
    font-size: 4rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-top: 24px;
    animation: countdownPulse 1s ease-in-out infinite;
}

@keyframes countdownPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* ============================================
   GAME VIEW
   ============================================ */

body.bot-showcase #game-view {
    position: relative;
    flex: 1;
    display: flex !important;
    flex-direction: column;
    background: transparent !important;
    overflow: hidden !important;
    padding: 0 180px 0 240px; /* Left: scorecard (200px) + left (20px) + gap (20px) = 240px, Right: QR code (120px) + right (20px) + gap (40px) = 180px */
    padding-bottom: var(--stage-bottom-padding);
    min-height: 0;
    height: 100%;
    --game-left-gap: 240px;
    --game-right-gap: 180px;
    --hand-top-height: 110px;
    --hand-bottom-height: 190px;
    --hand-gap: 28px;
    --hand-bottom-clearance: 120px;
    --stage-bottom-padding: calc(var(--hand-bottom-clearance) + 12px);
}

body.bot-showcase #game-view::after {
    display: none !important;
}


.score-label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.score-number {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.score-label {
    font-size: 0.875rem;
}

.turn-indicator {
    padding: 8px 20px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent-blue);
}

.turn-indicator.thinking {
    animation: thinkingPulse 1.5s ease-in-out infinite;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.4);
}

@keyframes thinkingPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.turn-text {
    color: var(--accent-blue);
}

body.bot-showcase .video-wrapper #game-view .game-main-area {
    flex: 1;
    padding: calc(var(--hand-top-height) + var(--hand-gap)) 0 calc(var(--hand-bottom-height) + var(--hand-gap) + var(--hand-bottom-clearance));
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
    position: relative;
}

body.bot-showcase .video-wrapper #game-view .game-main-area .game-board-container {
    flex: 1;
    width: 100%;
    min-width: 0;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 20px;
}

body.bot-showcase .video-wrapper #game-view .game-board-container canvas {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
}

/* Card styles to match normal bot game */
body.bot-showcase .video-wrapper #game-view .game-main-area #player2-hand.player-hand-top .card {
    width: 60px;
    height: 82px;
    margin-left: -12px;
    flex-shrink: 0;
}

body.bot-showcase .video-wrapper #game-view .game-main-area #player2-hand.player-hand-top .card:first-child {
    margin-left: 0 !important;
}

body.bot-showcase .video-wrapper #game-view .game-main-area #player2-hand.player-hand-top .card.back {
    transform: rotate(180deg);
}

body.bot-showcase .video-wrapper #game-view .game-main-area #player2-hand.player-hand-top .card:hover {
    transform: rotate(180deg) translateY(-5px) scale(1.1);
    z-index: 95;
}

body.bot-showcase .video-wrapper #game-view .game-main-area .player-hand-section .player-hand {
    min-height: auto;
    height: auto;
    overflow: visible;
    align-items: flex-end;
    justify-content: center;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
}

body.bot-showcase .video-wrapper #game-view .game-main-area .player-hand-section .card.selected {
    position: relative;
    z-index: 1000;
}

body.bot-showcase .video-wrapper #game-view .game-main-area #player2-hand.player-hand-top {
    position: absolute !important;
    top: var(--hand-gap);
    left: var(--game-left-gap);
    right: var(--game-right-gap);
    flex-shrink: 0;
    width: auto;
    height: var(--hand-top-height);
    min-height: var(--hand-top-height);
    max-height: var(--hand-top-height);
    padding: 12px 20px !important;
    margin: 0 !important;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    border: none !important;
    border-radius: 0 0 15px 15px;
    z-index: 40;
    display: flex;
    justify-content: center !important;
    align-items: center !important;
    box-sizing: border-box;
}

/* Reset global VS Computer overrides so showcase layout keeps hands pinned inside the stage */
body.bot-showcase #player2-hand.player-hand-top,
body.bot-showcase .video-wrapper #game-view .player-hand-section {
    left: var(--game-left-gap) !important;
    right: var(--game-right-gap) !important;
    width: auto !important;
    max-width: none !important;
}

body.bot-showcase #player2-hand.player-hand-top {
    margin: 0 !important;
}

body.bot-showcase .video-wrapper #game-view .player-hand-section {
    position: absolute !important;
    bottom: calc(var(--hand-gap) + var(--hand-bottom-clearance));
    flex-shrink: 0;
    width: auto;
    height: var(--hand-bottom-height);
    min-height: var(--hand-bottom-height);
    max-height: none;
    padding: 12px 20px !important;
    margin: 0 !important;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    border-top: 2px solid rgba(255, 255, 255, 0.1);
    border-left: none !important;
    border-right: none !important;
    border-bottom: none !important;
    border-radius: 15px 15px 0 0;
    z-index: 40;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    box-sizing: border-box;
}

body.bot-showcase .video-wrapper #game-view .game-main-area .player-hand-section {
    position: absolute;
}

/* ============================================
   VERTICAL SCORECARD
   ============================================ */

.scorecard-vertical {
    position: absolute;
    top: 50%;
    left: 20px;
    transform: translateY(-50%);
    width: 200px;
    min-width: 180px;
    max-width: calc(100vw - 40px);
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 24px 20px;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: var(--shadow-xl);
    z-index: 15;
    box-sizing: border-box;
    overflow: visible;
    max-height: calc(100vh - 40px);
}

.scorecard-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 20px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    transition: all 0.3s ease;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
    overflow: visible;
}

.scorecard-item.active {
    background: rgba(0, 212, 255, 0.1);
    border-color: var(--accent-blue);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
    transform: scale(1.02);
}

.scorecard-avatar-wrapper {
    position: relative;
}

.scorecard-avatar {
    width: 100px;
    height: 100px;
    border-radius: 20px;
    object-fit: cover;
    border: 3px solid var(--glass-border);
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
}

.scorecard-item.active .scorecard-avatar {
    border-color: var(--accent-blue);
    box-shadow: 0 0 25px rgba(0, 212, 255, 0.5);
}

.scorecard-status {
    position: absolute;
    bottom: -6px;
    right: -6px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-blue);
    border: 4px solid rgba(0, 0, 0, 0.8);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.6);
    animation: statusPulse 2s ease-in-out infinite;
}

.scorecard-item.active .scorecard-status {
    background: var(--accent-purple);
    box-shadow: 0 0 20px rgba(157, 78, 221, 0.8);
    animation: statusPulse 1s ease-in-out infinite;
}

.scorecard-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-width: 0;
    overflow: visible;
}

.scorecard-name {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.05em;
    text-align: center;
    white-space: nowrap;
}

.scorecard-score {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    min-height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-blue); /* Fallback for browsers that don't support gradient text */
}

/* Fallback for browsers that don't support background-clip */
@supports not (-webkit-background-clip: text) {
    .scorecard-score {
        color: var(--accent-blue);
        background: none;
    }
}

.scorecard-divider {
    display: flex;
    justify-content: center;
    padding: 12px 0;
}

.scorecard-divider .turn-indicator {
    width: 100%;
    text-align: center;
    padding: 12px 16px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent-blue);
}

.scorecard-divider .turn-indicator.thinking {
    animation: thinkingPulse 1.5s ease-in-out infinite;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.4);
}

/* ============================================
   CHAT SIDEBAR
   ============================================ */

.chat-sidebar {
    width: 380px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: rgba(10, 14, 39, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    height: 100%;
}

.chat-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    background: rgba(0, 0, 0, 0.3);
}

.chat-title-section {
    flex: 1;
}

.chat-title {
    margin: 0 0 4px;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
}

.chat-subtitle {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.chat-badge {
    padding: 6px 12px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.chat-messages {
    flex: 1;
    padding: 16px 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.chat-message {
    display: flex;
    gap: 8px;
    font-size: 0.9375rem;
    line-height: 1.5;
    animation: messageSlideIn 0.3s ease-out;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.chat-message .username {
    font-weight: 700;
    color: var(--accent-blue);
    cursor: pointer;
    transition: color 0.2s ease;
}

.chat-message .username:hover {
    color: var(--accent-purple);
}

.chat-message .badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
    border: none;
    border-radius: 8px;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #ffffff;
    text-transform: uppercase;
    box-shadow: 0 2px 6px rgba(157, 78, 221, 0.3);
    margin-left: 6px;
}

.chat-message .badge[data-badge="MOD"] {
    background: linear-gradient(135deg, #ff6b35, #ff006e);
    box-shadow: 0 2px 6px rgba(255, 107, 53, 0.3);
}

.chat-message .badge[data-badge="SUB"] {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
}

.chat-message .text {
    flex: 1;
    color: var(--text-primary);
    word-wrap: break-word;
}

.chat-message .emote {
    color: var(--accent-pink);
    font-weight: 700;
}

/* Superchat Messages */
.superchat-message {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15) 0%, rgba(255, 140, 0, 0.15) 100%);
    border-left: 4px solid #ffd700;
    padding: 10px 14px;
    margin: 6px 0;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.2);
    animation: superchatSlideIn 0.4s ease-out;
    position: relative;
    overflow: hidden;
}

.superchat-message::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: superchatShine 3s infinite;
}

@keyframes superchatSlideIn {
    from {
        opacity: 0;
        transform: translateX(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes superchatShine {
    0% { left: -100%; }
    50% { left: 100%; }
    100% { left: 100%; }
}

.superchat-amount {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-left: 10px;
    padding: 5px 10px;
    background: linear-gradient(135deg, #ffd700, #ff8c00);
    border-radius: 14px;
    font-weight: 800;
    font-size: 0.8125rem;
    color: #000;
    box-shadow: 0 3px 10px rgba(255, 215, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.smashcoin-icon {
    width: 18px;
    height: 18px;
    object-fit: contain;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.superchat-message .username {
    color: #ffd700;
    font-weight: 800;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.6), 0 2px 4px rgba(0, 0, 0, 0.3);
    letter-spacing: 0.3px;
}

.superchat-message .text {
    color: var(--text-primary);
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* ============================================
   CARD SELECTION ANIMATION
   ============================================ */

.card.bot-selected {
    position: relative;
    z-index: 5;
    transform: translateY(-8px) scale(1.08);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card.bot-selected::after {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 16px;
    border: 3px solid var(--accent-blue);
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.6);
    pointer-events: none;
    animation: selectionGlow 1.5s ease-in-out infinite;
}

@keyframes selectionGlow {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.05); }
}

/* ============================================
   MODAL
   ============================================ */

.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
}

.modal-content {
    position: relative;
    z-index: 1;
    padding: 48px 64px;
    background: rgba(10, 14, 39, 0.95);
    border: 2px solid var(--glass-border);
    border-radius: 32px;
    box-shadow: var(--shadow-xl);
    backdrop-filter: blur(20px);
    text-align: center;
    max-width: 500px;
    width: 90%;
}

.modal-content h2 {
    margin: 0 0 16px;
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.modal-score {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 32px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.modal-btn {
    padding: 12px 32px;
    border: none;
    border-radius: 20px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-btn.primary {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    color: #ffffff;
    box-shadow: 0 4px 16px rgba(0, 212, 255, 0.4);
}

.modal-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0, 212, 255, 0.6);
}

.modal-btn.secondary {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
}

.modal-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

/* ============================================
   QR CODE OVERLAY
   ============================================ */

.qr-code-overlay {
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    z-index: 25;
    pointer-events: none;
}

.qr-code-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: var(--shadow-xl);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.qr-code-container:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

.qr-code-image {
    width: 120px;
    height: 120px;
    border-radius: 12px;
    background: #ffffff;
    padding: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.qr-code-label {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent-blue);
    text-align: center;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 1400px) {
    .stream-container {
        padding: 20px 24px;
        gap: 20px;
    }

    .chat-sidebar {
        width: 340px;
    }
}

@media (max-width: 1200px) {
    .stream-container {
        flex-direction: column;
        height: 100vh;
    }

    .video-wrapper {
        min-height: 600px;
    }

    body.bot-showcase #game-view {
        padding: 0 180px 0 200px; /* Left: scorecard width + gap, Right: QR code width + gap */
        --game-left-gap: 200px;
        --game-right-gap: 180px;
    }

    .scorecard-vertical {
        width: 180px;
        min-width: 160px;
        padding: 20px 16px;
        left: 12px;
        max-width: calc(100vw - 24px);
    }

    .scorecard-item {
        padding: 16px;
    }

    .scorecard-avatar {
        width: 90px;
        height: 90px;
    }

    .scorecard-name {
        font-size: 1rem;
    }

    .scorecard-score {
        font-size: 2.25rem;
        min-height: 2.25rem;
    }

    .chat-sidebar {
        width: 100%;
        max-height: 400px;
    }
}

@media (max-width: 768px) {
    .stream-container {
        padding: 12px;
        gap: 12px;
    }

    .live-banner {
        top: 12px;
        left: 12px;
        padding: 8px 14px;
        font-size: 0.7rem;
        gap: 8px;
        flex-wrap: wrap;
    }

    .qr-code-overlay {
        top: 50%;
        right: 12px;
        transform: translateY(-50%);
    }

    .qr-code-container {
        padding: 10px;
    }

    .qr-code-image {
        width: 100px;
        height: 100px;
    }

    .qr-code-label {
        font-size: 0.6875rem;
    }

    body.bot-showcase #game-view {
        padding: 0 150px 0 170px; /* Left: scorecard width + gap, Right: QR code width + gap */
        --game-left-gap: 170px;
        --game-right-gap: 150px;
    }

    .scorecard-vertical {
        width: 150px;
        min-width: 140px;
        padding: 16px 12px;
        left: 8px;
        max-width: calc(100vw - 16px);
        gap: 12px;
    }

    .scorecard-item {
        padding: 14px 12px;
        gap: 10px;
    }

    .scorecard-avatar {
        width: 70px;
        height: 70px;
    }

    .scorecard-name {
        font-size: 0.95rem;
        line-height: 1.2;
    }

    .scorecard-score {
        font-size: 2rem;
        min-height: 2rem;
    }

    .scorecard-divider {
        padding: 8px 0;
    }

    .scorecard-divider .turn-indicator {
        padding: 10px 12px;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    body.bot-showcase #game-view {
        padding: 0 130px 0 150px; /* Left: scorecard width + gap, Right: QR code width + gap */
        --game-left-gap: 150px;
        --game-right-gap: 130px;
    }

    .qr-code-overlay {
        top: 50%;
        right: 8px;
        transform: translateY(-50%);
    }

    .qr-code-container {
        padding: 8px;
    }

    .qr-code-image {
        width: 80px;
        height: 80px;
    }

    .qr-code-label {
        font-size: 0.625rem;
    }

    .scorecard-vertical {
        width: 130px;
        min-width: 120px;
        padding: 12px 10px;
        left: 6px;
        gap: 10px;
    }

    .scorecard-item {
        padding: 12px 10px;
        gap: 8px;
    }

    .scorecard-avatar {
        width: 60px;
        height: 60px;
    }

    .scorecard-name {
        font-size: 0.875rem;
    }

    .scorecard-score {
        font-size: 1.75rem;
        min-height: 1.75rem;
    }
}

/* Desktop optimization - ensure full screen usage */
@media (min-width: 1201px) {
    .stream-container {
        height: 100vh;
        padding: 16px;
        gap: 20px;
    }

    .video-wrapper {
        height: 100%;
    }

    body.bot-showcase #game-view {
        padding: 0 180px 0 220px; /* Left: scorecard width + gap, Right: QR code width + gap */
        --game-left-gap: 220px;
        --game-right-gap: 180px;
    }

    .scorecard-vertical {
        width: 220px;
        min-width: 200px;
        padding: 28px 24px;
        left: 16px;
        max-width: calc(100vw - 32px);
    }

    .scorecard-item {
        padding: 24px 20px;
    }

    .scorecard-avatar {
        width: 110px;
        height: 110px;
    }

    .scorecard-name {
        font-size: 1.25rem;
    }

    .scorecard-score {
        font-size: 3rem;
        min-height: 3rem;
    }
}

/* Large desktop screens */
@media (min-width: 1600px) {
    body.bot-showcase #game-view {
        padding: 0 180px 0 240px; /* Left: scorecard width + gap, Right: QR code width + gap */
        --game-left-gap: 240px;
        --game-right-gap: 180px;
    }

    .scorecard-vertical {
        width: 240px;
        padding: 32px 28px;
    }

    .scorecard-avatar {
        width: 120px;
        height: 120px;
    }

    .scorecard-score {
        font-size: 3.5rem;
        min-height: 3.5rem;
    }

    body.bot-showcase .video-wrapper #game-view .game-board-container {
        max-width: 100%;
        max-height: 100%;
    }
}
