/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&family=Bangers&family=Inter:wght@400;500;600;700&display=swap');

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #ff6b6b;
    --primary-hover: #ff5252;
    --secondary-color: #ff8787;
    --success-color: #51cf66;
    --error-color: #fa5252;
    --warning-color: #ffa94d;
    --accent-pink: #ff6ba4;
    --accent-orange: #ff8c42;
    --bg-light: #fff5f5;
    --bg-white: #ffffff;
    --bg-pink: #e0ffe4;
    --text-dark: #2d3436;
    --text-muted: #727263;
    --border-color: #ffd6dd;
    --shadow: 0 4px 6px rgba(255, 107, 107, 0.1);
    --shadow-lg: 0 8px 24px rgba(255, 107, 107, 0.15);

    /* Layout dimensions - these must match actual element heights */
    --header-height: 130px;
    --player-panel-height: 55px;
    --footer-height: 40px;
    --header-player-total: calc(var(--header-height) + var(--player-panel-height));
    /* Gap between header/banner and content row */
    --content-row-gap: 0px;
    /* Content row top - where player panel, social toggle, and game title align */
    --content-row-top: var(--header-height);
}

body {
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(to right,
        #fff7fb 0%,
        rgba(255, 220, 230, 0.4) 30%,
        rgba(255, 200, 210, 0.5) 60%,
        rgba(255, 180, 190, 0.6) 100%);
    background-attachment: fixed;
    color: var(--text-dark);
    min-height: 100vh;
    padding: 0;
    margin: 0;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    padding-top: var(--header-player-total);
    padding-bottom: var(--footer-height);
}

/* Container */
.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 1;
    flex: 1;
}

/* Header - Full Width with Background - Fixed at top */
header {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8787 50%, #ffa94d 100%);
    width: 100%;
    margin: 0;
    padding: 0;
    height: var(--header-height);
    display: flex;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
}


.main-header,
.game-header {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    position: relative;
    z-index: 10;
}

.header-banner {
    position: absolute;
    top: 0;
    left: 180px; /* Start after logo area */
    right: 0; /* Extend to screen edge */
    height: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
    z-index: 5;
    user-select: none;
    -webkit-user-select: none;
}

.header-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 15px;
    position: relative;
    z-index: 10; /* Above banner */
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
   
} 

.brand-glass-capsule {
    padding: 12px 24px;
   
    background: rgba(255, 208, 0, 0.049);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1),
                inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.brand-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.brand-title {
    font-family: 'Bangers', 'Segoe UI Black', sans-serif;
    font-size: 2.8rem;
    font-weight: 400;
    margin: 0;
    background: linear-gradient(135deg, #ffffff 0%, #faeff2 100%);
    background-clip: text;
    letter-spacing: 2px;
}

.brand-subtitle {
    font-family: 'Nunito', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: rgb(255, 255, 255);
    letter-spacing: 4px;
    text-transform: uppercase;
    margin: 0;
    margin-top: -4px;
}

/* Brand title row - holds mascots and title */
.brand-title-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Robot mascots - hidden by default (desktop) */
.brand-mascot {
    display: none;
    width: 28px;
    height: 28px;
    color: #fff;
    flex-shrink: 0;
}

.brand-mascot .robot-icon {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.brand-mascot .robot-antenna {
    filter: drop-shadow(0 0 4px rgba(255, 215, 0, 0.8));
}

/* Dots row - hidden by default (desktop) */
.brand-dots-row {
    display: none;
}

.brand-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.6);
}

.brand-dot-accent {
    background: #ffd700;
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.8);
}

.subtitle {
    color: rgba(255, 255, 255, 0.95);
    font-size: 1.1rem;
}

/* Player Panel - Below Header - Fixed */
.player-panel {
    width: 100%;
    height: var(--player-panel-height);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0;
    background: transparent;
    margin: 0;
    position: fixed;
    top: calc(var(--content-row-top) - 1px); /* Overlap by 1px to prevent gap */
    left: 0;
    right: 0;
    z-index: 999;
    pointer-events: none; /* Don't block clicks on elements below */
}

.player-panel-content {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 20px 0 12px;
    height: 100%;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 50px 0 0 50px;
    border: none;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: visible;
    pointer-events: auto; /* Re-enable clicks on the actual content */
    margin-right: 0;
}

.player-panel-content::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8787 50%, #ffa94d 100%);
    border-radius: 50px 0 0 50px;
    z-index: -1;
}

.player-panel .user-info-container {
    padding: 4px 12px;
    margin: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    backdrop-filter: none;
}

.player-panel .user-info-container::before {
    display: none;
}

.player-panel .user-menu-button {
    margin: 0;
}

.player-panel .user-menu-dropdown {
    top: calc(100% + 8px);
    right: 0;
}

/* Player Panel Login State */
.player-panel-login {
    justify-content: flex-end;
}

.player-panel-login-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    background: white;
    color: var(--primary-color);
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.player-panel-login-button:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

.player-panel-login-button svg {
    flex-shrink: 0;
}

/* Scrolling Banner - Now in Header */
.scrolling-banner {
    overflow: hidden;
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    padding: 2px 0;
}

.banner-content {
    display: flex;
    gap: 16px;
    animation: scroll 25s linear infinite;
    white-space: nowrap;
    align-items: center;
    --scroll-distance: -1064px; /* Default value, will be set dynamically */
    will-change: transform;
    backface-visibility: hidden;
    -webkit-font-smoothing: subpixel-antialiased;
}

.banner-card {
    width: 300px;
    height: 100px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease;
    flex-shrink: 0;
    cursor: pointer;
}

.banner-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

.banner-card-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

@keyframes scroll {
    0% {
        transform: translateX(0);
    }

    100% {
        /* Scroll distance calculated dynamically based on card count */
        transform: translateX(var(--scroll-distance));
    }
}

/* Main Content */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 0;
    position: relative;
    z-index: 1;
}

.games-section {
    margin-bottom: 40px;
}

.section-title {
    font-family: 'Nunito', sans-serif;
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 30px;
    text-align: center;
    color: var(--primary-color);
    background: none;
    -webkit-background-clip: initial;
    -webkit-text-fill-color: initial;
    background-clip: initial;
}

/* Video Wrapper */
.video-wrapper {
    position: relative;
    background: white;
    border-radius: 16px 0 0 16px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    aspect-ratio: 4 / 3;
    width: auto;
    height: 100%;
    border: 2px solid var(--border-color);
    border-right: none;
    box-sizing: border-box;
}

/* Camera Video Elements - Full-size by default for proper WebRTC initialization */
.camera-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    background: #fafafa;
    pointer-events: none;
    z-index: 1;
    /* Inactive videos render at tiny size in corner after initialization */
}

.camera-video:not(.active) {
    /* Only minimize after page loads - keeps WebRTC alive without being visible */
    bottom: 0;
    right: 0;
    top: auto;
    left: auto;
    width: 1px;
    height: 1px;
    opacity: 0.01;
    z-index: 1;
}

.camera-video.active {
    /* Active: full-size covering the entire wrapper */
    opacity: 1;
    pointer-events: auto;
    z-index: 2;
}

/* Legacy video support for backwards compatibility */
video:not(.camera-video) {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    background: #fafafa;
}

/* Loading Spinner */
.loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: none;
    z-index: 10;
}

.loading-spinner.active {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.loading-text {
    color: #666;
    font-size: 14px;
    font-weight: 500;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 107, 107, 0.2);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Status Indicator */
.status {
    position: absolute;
    top: 0;
    left: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 0 0 8px 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    font-size: 12px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.15);
    border: 2px solid var(--border-color);
    border-top: none;
    border-left: none;
    z-index: 10;
}

.status-stats {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
    flex-shrink: 0;
}

.status.connecting .status-dot {
    background: var(--warning-color);
}

.status.connected .status-dot {
    background: var(--success-color);
}

.status.error .status-dot {
    background: var(--error-color);
}

.status.stopped .status-dot {
    background: var(--text-muted);
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(1.1);
    }
}

@keyframes glow {
    0%,
    100% {
        box-shadow: 0 2px 12px rgba(249, 115, 22, 0.6);
    }

    50% {
        box-shadow: 0 2px 20px rgba(249, 115, 22, 0.9);
    }
}

/* ========================================
   Mobile Title Banner - WOW FACTOR Edition
   ======================================== */

@keyframes titleShimmer {
    0% {
        background-position: -200% center;
    }
    100% {
        background-position: 200% center;
    }
}

@keyframes titleGlow {
    0%, 100% {
        text-shadow:
            0 0 10px rgba(255, 255, 255, 0.8),
            0 0 20px rgba(255, 107, 107, 0.6),
            0 0 30px rgba(255, 169, 77, 0.4);
        filter: brightness(1);
    }
    50% {
        text-shadow:
            0 0 15px rgba(255, 255, 255, 1),
            0 0 30px rgba(255, 107, 107, 0.8),
            0 0 45px rgba(255, 169, 77, 0.6),
            0 0 60px rgba(255, 107, 107, 0.4);
        filter: brightness(1.1);
    }
}

@keyframes robotBounce {
    0%, 100% {
        transform: translateY(0) rotate(-5deg);
    }
    25% {
        transform: translateY(-3px) rotate(0deg);
    }
    50% {
        transform: translateY(0) rotate(5deg);
    }
    75% {
        transform: translateY(-2px) rotate(0deg);
    }
}

@keyframes robotEyes {
    0%, 90%, 100% {
        opacity: 1;
    }
    95% {
        opacity: 0.3;
    }
}

@keyframes sparkle {
    0%, 100% {
        opacity: 0;
        transform: scale(0) rotate(0deg);
    }
    50% {
        opacity: 1;
        transform: scale(1) rotate(180deg);
    }
}

@keyframes sparkleFloat {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 0;
    }
    20% {
        opacity: 1;
    }
    80% {
        opacity: 1;
    }
    100% {
        transform: translateY(-20px) rotate(360deg);
        opacity: 0;
    }
}

@keyframes subtitleSlide {
    0% {
        opacity: 0;
        transform: translateY(5px);
        letter-spacing: 8px;
    }
    100% {
        opacity: 1;
        transform: translateY(0);
        letter-spacing: 2px;
    }
}

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

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

/* Controls */
.controls {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    font-family: 'Nunito', sans-serif;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.2);
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-pink) 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-hover) 0%, #ff5a94 100%);
    box-shadow: 0 6px 16px rgba(255, 107, 107, 0.3);
}

.btn-secondary {
    background: white;
    color: var(--primary-color);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-pink);
    border-color: var(--primary-color);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Info Panel */
.info-panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    padding: 20px;
    background: white;
    border-radius: 16px;
    border: 2px solid var(--border-color);
    box-shadow: var(--shadow);
}

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

.info-label {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.info-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
}

/* Games Grid */
.games-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    padding: 0;
}

@media (max-width: 1200px) {
    .games-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }
}

@media (max-width: 900px) {
    .games-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
}

@media (max-width: 480px) {
    .games-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
}

.game-card {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow);
}

.game-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
    box-shadow: 0 12px 32px rgba(255, 107, 107, 0.25);
}

.game-card-disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

/* Game Card Header */
.game-card-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: var(--bg-light);
    border-bottom: 2px solid var(--border-color);
    min-height: 50px;
}

.playing-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
    box-shadow: 0 2px 12px rgba(249, 115, 22, 0.6);
    animation: glow 2s ease-in-out infinite;
    white-space: nowrap;
    z-index: 10;
}

.live-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ff5252 100%);
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.4);
    white-space: nowrap;
    z-index: 10;
}

.offline-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: rgba(128, 128, 128, 0.9);
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
    white-space: nowrap;
    z-index: 10;
}

/* Note: .coming-soon-badge is defined later in the file for game cards */

/* Coming Soon Card Styles */
.game-card.coming-soon {
    cursor: default;
    opacity: 0.85;
}

.game-card.coming-soon:hover {
    transform: none;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

.game-card.coming-soon .game-thumbnail::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.15);
    z-index: 5;
}

.game-thumbnail {
    position: relative;
    aspect-ratio: 16 / 9;
    background: var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: grab;
}

.game-thumbnail:active {
    cursor: grabbing;
}

/* Slides container for horizontal drag/swipe */
.slides-container {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.3s ease-out;
    will-change: transform;
}

.slides-container.dragging {
    transition: none;
}

.slide {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    position: relative;
}

.game-placeholder {
    color: var(--text-muted);
    display: none;
}

.game-placeholder.active {
    display: flex;
}

.game-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

/* Video element for live streams in game cards */
.game-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    z-index: 1;
    background: #fafafa;
}

/* Loading spinner for game card stream previews */
.card-stream-loader {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #fafafa;
    z-index: 5;
}

.card-stream-loader.active {
    display: flex;
}

.card-stream-loader .spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(255, 107, 107, 0.2);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.card-stream-loader .loading-text {
    color: #666;
    font-size: 12px;
    font-weight: 500;
}

.slideshow-dots {
    display: flex;
    gap: 8px;
    align-items: center;
}

.slideshow-dots .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.8);
    border: 2px solid #ec4899;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.slideshow-dots .dot:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.2);
}

.slideshow-dots .dot.active {
    background: #ec4899;
    border: 2px solid #ec4899;
    box-shadow: 0 2px 8px rgba(236, 72, 153, 0.5);
}

.playing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: white;
    animation: pulse 1.5s ease-in-out infinite;
}

.live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: white;
    animation: pulse 2s ease-in-out infinite;
}

/* Card Viewers - Floating avatars on game card thumbnails */
.card-viewers-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 5;
    pointer-events: none;
    overflow: hidden;
}

.card-viewer-avatar {
    position: absolute;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-color);
    pointer-events: auto;
    transition: transform 0.15s ease;
}

.card-viewer-avatar:hover {
    transform: scale(1.2);
    z-index: 20 !important;
}

.card-viewer-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.card-viewer-avatar svg {
    width: 100%;
    height: 100%;
}

.card-viewer-initial {
    font-size: 10px;
    font-weight: 600;
    color: white;
    text-transform: uppercase;
}

/* Game Player Bar */
.game-player-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: var(--bg-light);
    border-bottom: 2px solid var(--border-color);
}

.player-stat {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-color);
}

.player-stat svg {
    flex-shrink: 0;
    color: var(--primary-color);
}

/* Coming soon badge - centered on thumbnail image */
.coming-soon-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
    letter-spacing: 1px;
    z-index: 15;
    white-space: nowrap;
}

.game-info {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.game-title {
    font-size: 1rem;
    font-weight: 700;
    color: #ffd000;
    margin: 0;
    padding: 8px 12px;
    text-align: center;
    width: 100%;
    -webkit-text-stroke: 0.5px #000;
    text-shadow: 0 0 1px rgba(0, 0, 0, 0.3);
    box-sizing: border-box;
    line-height: 1.2;
}

.game-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.game-details-left {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.game-detail-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
}

.detail-label {
    font-weight: 600;
    color: var(--text-muted);
}

.detail-value {
    font-weight: 700;
    color: var(--text-dark);
}

.game-details-right {
    display: flex;
    align-items: center;
}

.game-type-badge {
    padding: 6px 12px;
    background: linear-gradient(135deg, var(--primary-color), #ff8787);
    color: white;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.game-detail {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.85rem;
    color: var(--text-color);
}

.detail-icon {
    font-size: 1rem;
}

.detail-text {
    font-weight: 500;
}

/* Header Right */
.header-left {
    display: flex;
    align-items: center;
}

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

.login-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: white;
    color: var(--primary-color);
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.3);
}

.login-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 255, 255, 0.4);
}

.login-button svg {
    width: 20px;
    height: 20px;
}

/* User Menu */
.user-menu {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-info-container {
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.5),
        inset 0 -1px 0 rgba(255, 255, 255, 0.1),
        inset 0 0 20px 10px rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.user-info-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.8),
        transparent
    );
}


.user-stats {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-left: 12px;
}

/* Player Panel Avatar - matches stat-item styling */
.player-panel-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    transition: all 0.2s ease;
    cursor: pointer;
    flex-shrink: 0;
    text-decoration: none;
}

.player-panel-avatar:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.player-panel-avatar-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    overflow: hidden;
}

.player-panel-avatar svg,
.player-panel-avatar-img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: white;
    font-family: 'Inter', -apple-system, sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.stat-item:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    font-size: 1.1rem;
}

.stat-value {
    font-size: 0.95rem;
}

.shop-icon-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-right: 12px;
    text-decoration: none;
}

.shop-icon-button:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.shop-icon-button:active {
    transform: translateY(0);
}

.cart-icon-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-right: 12px;
    text-decoration: none;
    position: relative;
}

.cart-icon-button:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.cart-icon-button:active {
    transform: translateY(0);
}

.cart-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: white;
    color: var(--primary-color);
    border-radius: 12px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    line-height: 1;
}

.user-menu-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(255,255,255,0.3);
    position: relative;
    z-index: 1000;
    pointer-events: auto !important;
}

.user-menu-button:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.user-menu-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 220px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(255, 107, 107, 0.2);
    border: 2px solid var(--border-color);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    overflow: hidden;
}

.user-menu-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-menu-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8787 100%);
    color: white;
}

.user-menu-username {
    font-weight: 600;
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-menu-divider {
    height: 1px;
    background: var(--border-color);
}

.user-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-dark);
    text-decoration: none;
    transition: all 0.2s ease;
}

.user-menu-item:hover {
    background: var(--bg-pink);
    color: var(--primary-color);
}

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

/* Footer - Simple Copyright Only - Fixed at bottom */
footer,
.main-footer {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8787 50%, #ffa94d 100%);
    width: 100%;
    margin: 0;
    padding: 8px 20px;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    box-shadow: 0 -4px 12px rgba(255, 107, 107, 0.2);
    box-sizing: border-box;
}

.footer-content {
    display: none;
}

.footer-section {
    display: none;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0;
}

.footer-bottom p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.85rem;
    margin: 0;
    font-weight: 500;
}

.footer-socials {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin: 0;
}

.footer-socials a {
    color: white;
    opacity: 0.9;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.footer-socials a:hover {
    opacity: 1;
    transform: scale(1.15);
}

.footer-socials svg {
    width: 20px;
    height: 20px;
}

/* Game Page - No scroll layout */
.game-page {
    overflow: hidden;
    /* Title bar: top=content-row-top, height=player-panel-height */
    /* Content starts below title bar */
    padding-top: calc(var(--header-height) + var(--content-row-gap) + var(--player-panel-height));
}

.game-page .container {
    height: calc(100vh - var(--header-height) - var(--player-panel-height) - var(--footer-height));
    padding: 0 10px 10px 10px;
    padding-right: 220px; /* Leave space for player panel */
    margin: 0;
    margin-top: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    box-sizing: border-box;
}

.game-page main.stream-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 0;
    width: 100%;
    margin: 0;
    padding: 0;
    gap: 0;
}

.stream-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    flex: 1;
    min-height: 0;
}

/* Game Title Bar - Fixed position between social toggle and player panel */
.game-page .game-title-bar {
    position: fixed;
    top: calc(var(--content-row-top) + 2px);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8787 50%, #ffa94d 100%);
    border-radius: 50px;
    padding: 8px 50px; /* Extra padding for back arrow */
    z-index: 99;
    height: var(--player-panel-height);
    box-sizing: border-box;
    box-shadow: none;
}

/* Back arrow in game title bar */
.game-title-bar .back-arrow {
    position: absolute;
    left: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    text-decoration: none;
    padding: 6px;
    border-radius: 8px;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.game-title-bar .back-arrow:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateX(-2px);
}

.game-title-bar .back-arrow svg {
    display: block;
}

.game-page .game-title,
.game-title-bar .game-title {
    font-family: 'Bangers', cursive;
    font-size: 1.4rem;
    font-weight: 400;
    letter-spacing: 1.5px;
    margin: 0;
    padding: 0;
    text-align: center;
    color: #ffffff;
    -webkit-text-fill-color: #ffffff;
    -webkit-text-stroke: 0;
    white-space: nowrap;
}

/* Game Card Title Override - Dynamic font sizing via JS */
.game-card .game-title {
    font-family: 'Bangers', cursive;
    font-size: 1.8rem; /* Default max, will be adjusted by JS */
    font-weight: 400;
    color: #1a1a2e;
    -webkit-text-fill-color: #1a1a2e;
    background: none;
    -webkit-background-clip: unset;
    background-clip: unset;
    -webkit-text-stroke: 1px rgba(255, 255, 255, 0.8);
    text-shadow:
        2px 2px 0px rgba(255, 107, 107, 0.6),
        -1px -1px 0px rgba(255, 255, 255, 0.8);
    padding: 8px 10px;
    line-height: 1.1;
    letter-spacing: 2px;
    white-space: nowrap;
    overflow: visible;
    box-sizing: border-box;
    max-width: 100%;
    width: 100%;
    text-align: center;
}

/* Video and Controls Container - Single column layout using grid */
.video-and-controls-container {
    display: grid;
    grid-template-rows: 1fr auto;
    grid-template-columns: 1fr;
    justify-items: center;
    flex: 1;
    min-height: 0;
    max-height: calc(100% - 10px);
    width: fit-content;
    box-sizing: border-box;
    margin: 0 auto;
    padding: 0;
    padding-bottom: 10px;
}

/* Video wrapper - sets the width for the container */
.video-and-controls-container .video-wrapper {
    grid-row: 1;
    width: auto;
    height: 100%;
    aspect-ratio: 4 / 3;
    border-radius: 16px 16px 0 0;
    border: 2px solid var(--border-color);
    border-bottom: none;
    min-height: 0;
}

/* Controls Row - stretches to match video width */
.controls-row {
    grid-row: 2;
    width: 100%;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 2px solid var(--border-color);
    border-top: 1px solid var(--border-color);
    border-radius: 0 0 16px 16px;
    box-sizing: border-box;
}

/* Stats and status container - holds stats panel and queue/start cards side by side */
.stats-and-status {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 8px;
    flex-shrink: 0;
    position: relative;
}

/* Stats panel - Queue & Viewers stacked vertically */
.stats-panel {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 6px 10px;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

/* Compact queue/start/session cards - positioned absolutely to not shift layout */
.stats-and-status .queue-card,
.stats-and-status .start-card,
.stats-and-status .session-card {
    position: absolute;
    left: calc(100% + 8px);
    bottom: 0;
    top: auto;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--primary-color);
    border-radius: 6px;
    min-width: auto;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.2);
    z-index: 10;
}

.stats-and-status .queue-card h3,
.stats-and-status .start-card h3,
.stats-and-status .session-card h3 {
    font-size: 0.75rem;
    font-weight: 600;
    margin: 0;
    white-space: nowrap;
}

.stats-and-status .queue-header,
.stats-and-status .start-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    border: none;
    background: none;
}

.stats-and-status .session-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 0;
    border: none;
    background: none;
}

.stats-and-status .queue-header .close-btn,
.stats-and-status .start-header .close-btn {
    width: 18px;
    height: 18px;
    padding: 2px;
}

.stats-and-status .queue-content {
    display: flex;
    align-items: center;
    padding: 0;
}

.stats-and-status .queue-position {
    display: flex;
    align-items: center;
    gap: 2px;
}

.stats-and-status .position-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary-color);
}

.stats-and-status .position-value {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-dark);
}

.stats-and-status .timer-display {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary-color);
    padding: 0;
    background: none;
}

.stats-and-status .start-button {
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.stats-and-status .start-button:hover {
    background: var(--primary-hover);
}

/* Your Turn Modal - Overlay only on controls panel */
.modal-overlay.your-turn-modal {
    background: transparent;
    backdrop-filter: none;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
    pointer-events: none;
    cursor: default;
}

.modal-overlay.your-turn-modal .modal-container {
    position: fixed;
    max-width: 100%;
    box-shadow: 0 0 20px rgba(255, 107, 107, 0.3);
    pointer-events: auto;
    cursor: default;
    margin: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
}

.modal-overlay.your-turn-modal .modal-header {
    display: none;
}

.modal-overlay.your-turn-modal .modal-close {
    display: none;
}

.modal-overlay.your-turn-modal .modal-body {
    padding: 12px 24px;
    background: linear-gradient(135deg, #fefefe 0%, #fff5f5 50%, #ffe8e8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    box-sizing: border-box;
}

.modal-overlay.your-turn-modal .modal-footer {
    padding: 0 16px 8px;
    border-top: none;
    background: transparent;
    justify-content: center;
}

.modal-overlay.your-turn-modal .modal-footer:empty {
    display: none;
}

.modal-overlay.your-turn-modal .modal-footer .btn-sm {
    padding: 6px 20px;
    font-size: 0.8rem;
}

/* Time Expired message styling */
.time-expired-text {
    margin: 0;
    font-size: 0.9rem;
    font-family: 'Nunito', sans-serif;
    font-weight: 600;
    color: #333;
}

/* Your Turn Modal Content - Fill controls panel */
.your-turn-modal-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
    padding: 0;
    width: 100%;
    height: 100%;
}

.your-turn-lottie {
    display: none;
}

/* Your Turn Countdown Timer - Prominent display */
.your-turn-countdown {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    gap: 8px;
    margin: 0;
}

.your-turn-countdown .countdown-value {
    font-family: 'Bangers', sans-serif;
    font-size: 2rem;
    font-weight: 400;
    color: var(--primary-color);
    line-height: 1;
    letter-spacing: 2px;
    text-shadow: 2px 2px 0 rgba(255, 107, 107, 0.15);
    transition: color 0.3s ease, transform 0.3s ease;
}

.your-turn-countdown .countdown-label {
    font-family: 'Nunito', sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.your-turn-countdown.warning .countdown-value {
    color: var(--error-color);
    animation: pulse-warning 0.8s ease-in-out infinite;
    text-shadow: 2px 2px 0 rgba(250, 82, 82, 0.15);
}

@keyframes pulse-warning {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

.your-turn-message {
    display: none;
}

.your-turn-dismiss-hint {
    display: none;
}

/* Slide to Action Control - Beautiful full-width slider */
.slide-to-action {
    width: 100%;
    max-width: 320px;
    margin: 0;
}

.slide-track {
    position: relative;
    height: 44px;
    background: linear-gradient(90deg,
        #22c55e 0%,
        #22c55e 20%,
        #86efac 35%,
        #fef3c7 50%,
        #fca5a5 65%,
        #ef4444 80%,
        #ef4444 100%);
    border-radius: 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    overflow: hidden;
    box-shadow:
        inset 0 2px 4px rgba(0, 0, 0, 0.1),
        0 2px 8px rgba(0, 0, 0, 0.1);
    border: none;
}

.slide-label {
    font-family: 'Nunito', sans-serif;
    font-size: 13px;
    font-weight: 800;
    color: white;
    text-transform: uppercase;
    letter-spacing: 1px;
    pointer-events: none;
    z-index: 1;
}

.slide-label-left {
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.slide-label-right {
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.slide-thumb {
    position: absolute;
    left: calc(50% - 18px);
    top: 4px;
    width: 36px;
    height: 36px;
    background: linear-gradient(145deg, #ffffff 0%, #f0f0f0 100%);
    border-radius: 50%;
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.15),
        0 2px 4px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s ease, background 0.2s ease, transform 0.15s ease;
    z-index: 2;
    user-select: none;
    -webkit-user-select: none;
    border: 3px solid white;
}

.slide-thumb:hover {
    transform: scale(1.05);
}

.slide-thumb:active,
.slide-thumb.dragging {
    cursor: grabbing;
    transform: scale(1.1);
    box-shadow:
        0 6px 20px rgba(0, 0, 0, 0.2),
        0 3px 8px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.slide-thumb-icon {
    font-size: 14px;
    color: #666;
    transition: color 0.2s ease, transform 0.2s ease;
    font-weight: bold;
}

.slide-thumb.start-ready {
    background: linear-gradient(145deg, #22c55e 0%, #16a34a 100%);
    border-color: #22c55e;
    box-shadow:
        0 4px 16px rgba(34, 197, 94, 0.4),
        0 2px 4px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.slide-thumb.start-ready .slide-thumb-icon {
    color: white;
    transform: rotate(-90deg) scale(1.1);
}

.slide-thumb.quit-ready {
    background: linear-gradient(145deg, #ef4444 0%, #dc2626 100%);
    border-color: #ef4444;
    box-shadow:
        0 4px 16px rgba(239, 68, 68, 0.4),
        0 2px 4px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.slide-thumb.quit-ready .slide-thumb-icon {
    color: white;
    transform: rotate(90deg) scale(1.1);
}

/* Slider responsive adjustments */
@media (max-width: 480px) {
    .slide-to-action {
        max-width: 280px;
    }

    .slide-track {
        height: 40px;
        border-radius: 20px;
    }

    .slide-thumb {
        width: 32px;
        height: 32px;
        left: calc(50% - 16px);
    }

    .slide-label {
        font-size: 11px;
    }

    .your-turn-countdown .countdown-value {
        font-size: 1.75rem;
    }

    .your-turn-countdown .countdown-label {
        font-size: 0.7rem;
    }
}

/* Floating Viewers */
.floating-viewers-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
    overflow: hidden;
}

.floating-viewer {
    position: absolute;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    border: 2px solid white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease-out;
    opacity: 0.7;
    pointer-events: auto;
    cursor: pointer;
}

.floating-viewer:hover {
    opacity: 1;
    transform: scale(1.1);
}

.floating-viewer svg {
    width: 100%;
    height: 100%;
}

.floating-viewer-initial {
    font-size: 1rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Queue Stack - Players in queue shown on left of video */
.queue-stack-container {
    position: fixed;
    display: flex;
    flex-direction: column-reverse;
    align-items: flex-end;
    gap: 8px;
    z-index: 10;
    pointer-events: none;
}

.queue-stack-item {
    display: flex;
    align-items: center;
    gap: 6px;
    pointer-events: auto;
    position: relative;
}

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

.queue-position-number {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 2px 6px;
    min-width: 20px;
    text-align: center;
}

.queue-stack-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    border: 2px solid var(--primary-color);
    background: var(--bg-dark);
    flex-shrink: 0;
}

.queue-stack-avatar svg,
.queue-stack-avatar img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.queue-stack-avatar .floating-viewer-initial {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
}

/* Timer badge for queue position 1 - shows countdown when it's their turn */
.queue-timer-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 22px;
    height: 22px;
    padding: 0 5px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a5a 100%);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 11px;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(255, 107, 107, 0.5);
    border: 2px solid white;
    font-variant-numeric: tabular-nums;
    z-index: 15;
    animation: timerBadgePulse 1s ease-in-out infinite;
}

.queue-timer-badge.visible {
    display: flex;
}

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

/* Leave Queue button - absolutely positioned to not shift layout */
.controls-leave-queue-btn {
    position: absolute;
    left: calc(100% + 8px);
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 4px 8px;
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    white-space: nowrap;
    z-index: 10;
}

.controls-leave-queue-btn:hover {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 3px 10px rgba(239, 68, 68, 0.3);
}

.controls-leave-queue-btn:active {
    transform: scale(0.98);
}

.controls-leave-queue-btn svg {
    width: 14px;
    height: 14px;
}

.stats-panel .stat-box {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 2px 0;
    background: none;
    border: none;
    border-radius: 0;
    box-shadow: none;
}

.stats-panel .stat-icon {
    color: var(--primary-color);
}

.stats-panel .stat-icon svg {
    width: 18px;
    height: 18px;
}

.stats-panel .stat-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.stats-panel .stat-value {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1;
}

.stats-panel .stat-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* Controls panel in controls row */
.controls-row .controls-panel {
    border-radius: 12px;
    margin: 0;
    border: none;
    box-shadow: none;
    background: transparent;
    flex: 1 1 auto;
    min-width: 0;
}

/* Game info box in controls row */
.controls-row .game-info-box {
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.controls-row .game-info-box .info-row {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 2px 0;
    font-size: 0.75rem;
}

.controls-row .game-info-box .info-label {
    color: var(--text-muted);
    font-weight: 500;
}

.controls-row .game-info-box .info-value {
    color: var(--text-dark);
    font-weight: 700;
}

/* Rules button in game info box */
.rules-button {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary-color);
    cursor: pointer;
    transition: all 0.2s ease;
}

.rules-button:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.rules-button .stat-icon {
    font-size: 0.8rem;
}

/* Game play section - stacks info and play button vertically */
.game-play-section {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    flex-shrink: 0;
}

.game-play-section .play-button {
    width: 100%;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    justify-content: center;
}

.game-play-section .play-button svg {
    display: none;
}

/* Legacy sidebar panel - keeping for compatibility */
.sidebar-panel {
    flex: 0 0 auto;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 0 16px 16px 0;
    padding: 24px 12px;
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.2);
    border: 2px solid var(--border-color);
    border-left: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-self: stretch;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Desktop: sidebar has fixed width and matches video height */
@media (min-width: 769px) {
    .sidebar-panel {
        min-width: 280px;
        max-width: 320px;
        width: auto;
        align-self: stretch;
    }
}

/* Removed - game title moved to title bar above video */
/* .game-title-sidebar {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
    padding: 0;
    text-align: center;
} */

.sidebar-stats {
    display: flex;
    flex-direction: row;
    gap: 12px;
}

.stat-box {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 12px;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    flex: 1;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
}

.stat-box:hover {
    border-color: var(--primary-color);
    box-shadow: 0 6px 16px rgba(255, 107, 107, 0.2);
}

.stat-icon {
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.game-info-box {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 12px;
    box-shadow: var(--shadow);
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.info-row:not(:last-child) {
    border-bottom: 1px solid var(--border-color);
}

.info-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 600;
}

.info-value {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-dark);
}

.play-button {
    width: 100%;
    padding: 18px 24px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-pink) 100%);
    color: white;
    border: none;
    border-radius: 16px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 6px 16px rgba(255, 107, 107, 0.3);
}

.play-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 107, 107, 0.4);
}

.play-button:active {
    transform: translateY(0);
}

.play-button svg {
    flex-shrink: 0;
}

/* Video Stats Overlay */
.video-stats {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 10;
}

.stat-item {
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary-color);
    text-align: right;
    white-space: nowrap;
    border: 2px solid var(--border-color);
}

.stream-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px 20px;
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow);
    border: 2px solid var(--border-color);
    width: 100%;
}

.stream-controls:has(> :not([style*="display: none"])) {
    display: flex;
}

/* Camera Toggle Button */
.camera-toggle-btn {
    position: absolute;
    top: 0;
    right: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    padding: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    color: var(--text-dark);
    border: 2px solid var(--border-color);
    border-radius: 0 0 0 50%;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.15);
    border-top: none;
    border-right: none;
    z-index: 10;
}

.camera-toggle-btn:hover {
    border-color: var(--primary-color);
    background: var(--bg-pink);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.2);
}

.camera-toggle-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(255, 107, 107, 0.15);
}

.camera-toggle-btn:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.1);
}

/* Game Start Announcement - Animated transition to timer */
.game-start-announcement {
    position: absolute;
    bottom: 8%;
    left: 50%;
    transform: translateX(-50%);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 10px 24px;
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.95) 0%, rgba(255, 135, 135, 0.95) 100%);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(255, 107, 107, 0.5),
                0 0 0 2px rgba(255, 255, 255, 0.3);
    z-index: 20;
    opacity: 0;
    pointer-events: none;
}

.game-start-announcement.show {
    display: flex;
    animation: announcementEntrance 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.game-start-announcement.transition-to-timer {
    animation: announcementToTimer 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.announcement-text {
    font-family: 'Bangers', sans-serif;
    font-size: 1.8rem;
    color: white;
    letter-spacing: 2px;
    text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.2),
                 0 0 20px rgba(255, 255, 255, 0.3);
    white-space: nowrap;
}

.announcement-timer {
    font-family: 'Bangers', sans-serif;
    font-size: 1.2rem;
    color: white;
    letter-spacing: 2px;
    opacity: 0.9;
}

.game-start-announcement.transition-to-timer .announcement-text {
    animation: textFadeOut 0.4s ease-out forwards;
}

.game-start-announcement.transition-to-timer .announcement-timer {
    animation: timerStay 0.6s ease-out forwards;
}

@keyframes announcementEntrance {
    0% {
        opacity: 0;
        transform: translateX(-50%) scale(0.5);
    }
    50% {
        opacity: 1;
        transform: translateX(-50%) scale(1.1);
    }
    100% {
        opacity: 1;
        transform: translateX(-50%) scale(1);
    }
}

@keyframes announcementToTimer {
    0% {
        bottom: 8%;
        left: 50%;
        transform: translateX(-50%) scale(1);
        padding: 10px 24px;
        border-radius: 16px;
        opacity: 1;
    }
    100% {
        top: 8px;
        left: 50%;
        transform: translate(-50%, 0) scale(0.6);
        padding: 6px 16px;
        border-radius: 20px;
        opacity: 0;
    }
}

@keyframes textFadeOut {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(0.8);
        font-size: 0;
        height: 0;
        margin: 0;
    }
}

@keyframes timerStay {
    0% {
        opacity: 0.9;
        font-size: 2rem;
    }
    100% {
        opacity: 1;
        font-size: 1.3rem;
    }
}

/* Game Timer Overlay - Top center of video */
.game-timer-overlay {
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 16px;
    background: rgba(255, 107, 107, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 4px 16px rgba(255, 107, 107, 0.4);
    z-index: 10;
    animation: timerPulse 2s ease-in-out infinite;
}

.game-timer-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.5px;
}


@keyframes timerPulse {
    0%, 100% {
        box-shadow: 0 4px 16px rgba(255, 107, 107, 0.4);
    }
    50% {
        box-shadow: 0 4px 20px rgba(255, 107, 107, 0.6);
    }
}

/* Timer warning state (last 10 seconds) */
.game-timer-overlay.warning {
    background: rgba(250, 82, 82, 0.95);
    animation: timerWarning 0.5s ease-in-out infinite;
}

@keyframes timerWarning {
    0%, 100% {
        transform: translateX(-50%) scale(1);
    }
    50% {
        transform: translateX(-50%) scale(1.05);
    }
}


/* Action in progress - timer paused */
.game-timer-overlay.action-in-progress {
    background: rgba(147, 51, 234, 0.95);
    box-shadow: 0 4px 16px rgba(147, 51, 234, 0.4);
    animation: actionPulse 1.5s ease-in-out infinite;
}


@keyframes actionPulse {
    0%, 100% {
        transform: translateX(-50%) scale(1);
        opacity: 1;
    }
    50% {
        transform: translateX(-50%) scale(1.02);
        opacity: 0.85;
    }
}

/* Timer fading out */
.game-timer-overlay.fading-out {
    animation: timerFadeOut 0.3s ease-out forwards;
}

@keyframes timerFadeOut {
    0% {
        opacity: 1;
        transform: translateX(-50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) scale(0.8);
    }
}

/* Connection Warning Overlay - shown when connection lost during active gameplay */
.connection-warning {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.connection-warning.show {
    opacity: 1;
    visibility: visible;
}

.connection-warning-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 32px 48px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    text-align: center;
    animation: warningPulse 2s ease-in-out infinite;
}

.connection-warning-icon {
    width: 64px;
    height: 64px;
    color: #f59e0b;
    animation: iconPulse 1s ease-in-out infinite;
}

.connection-warning-icon svg {
    width: 100%;
    height: 100%;
}

.connection-warning-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.connection-warning-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
}

.connection-warning-subtitle {
    font-size: 1rem;
    color: #6b7280;
}

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

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

/* Auth Pages */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
    padding: 40px 20px;
}

.auth-card {
    background: white;
    backdrop-filter: blur(10px);
    border: 2px solid var(--border-color);
    border-radius: 20px;
    padding: 40px;
    max-width: 480px;
    width: 100%;
    box-shadow: var(--shadow-lg);
}

.auth-title {
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8787 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 30px;
    font-size: 1rem;
}

/* Auth Message */
.auth-message {
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 14px;
    text-align: center;
}

.auth-message-info {
    background: rgba(66, 153, 225, 0.1);
    border: 2px solid rgba(66, 153, 225, 0.3);
    color: #4299e1;
}

.auth-message-success {
    background: rgba(81, 207, 102, 0.1);
    border: 2px solid rgba(81, 207, 102, 0.3);
    color: #51cf66;
}

.auth-message-error {
    background: rgba(250, 82, 82, 0.1);
    border: 2px solid rgba(250, 82, 82, 0.3);
    color: #fa5252;
}

/* Social Auth Buttons */
.social-auth-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.social-auth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 14px 24px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background: white;
    color: var(--text-dark);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.social-auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 107, 107, 0.15);
    border-color: var(--primary-color);
}

.social-auth-btn svg {
    width: 20px;
    height: 20px;
}

.google-btn:hover {
    background: rgba(66, 133, 244, 0.05);
    border-color: #4285f4;
}

.apple-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    border-color: #000;
}

.twitter-btn:hover {
    background: rgba(29, 155, 240, 0.05);
    border-color: #1DA1F2;
}

.wallet-btn {
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.1) 0%, rgba(255, 135, 135, 0.1) 100%);
}

.wallet-btn:hover {
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.15) 0%, rgba(255, 135, 135, 0.15) 100%);
    border-color: var(--primary-color);
}

/* Auth Divider */
.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 24px 0;
    color: var(--text-muted);
    font-size: 14px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-color);
}

.auth-divider span {
    padding: 0 16px;
}

/* Auth Form */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
}

.form-group input {
    padding: 14px 16px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    background: white;
    color: var(--text-dark);
    font-size: 15px;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--bg-pink);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

/* Primary Button */
.btn-primary {
    padding: 14px 24px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8787 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 107, 107, 0.3);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Button Spinner */
.btn-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Auth Footer */
.auth-footer {
    margin-top: 24px;
    text-align: center;
}

.auth-footer p {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.auth-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.auth-link:hover {
    text-decoration: underline;
}

.auth-note {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 6px;
r);
}

/* ========================================
   Profile Pages
   ======================================== */

.profile-container {
    width: 800px;
    max-width: 100%;
    margin: 0 auto;
}

.profile-title {
    font-size: 2rem;
    margin-bottom: 30px;
    color: var(--primary-color);
    text-align: center;
}

/* Profile Tabs */
.profile-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    position: sticky;
    top: 0;
    background: var(--bg-light);
    z-index: 10;
    padding: 10px 0;
    margin: -10px 0 20px 0;
}

.profile-tab {
    padding: 12px 24px;
    background: transparent;
    color: var(--text-muted);
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.profile-tab:hover {
    color: var(--primary-color);
}

.profile-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.profile-card {
    background: white;
    backdrop-filter: blur(10px);
    border: 2px solid var(--border-color);
    border-radius: 20px;
    padding: 40px;
    box-shadow: var(--shadow-lg);
    min-height: 400px;
}

/* Tab Content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

.info-item {
    margin-bottom: 20px;
}

.info-item label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-value {
    font-size: 1.125rem;
    color: var(--text-dark);
    font-weight: 500;
}

.username-form h3 {
    font-size: 1.5rem;
    margin-bottom: 12px;
    color: var(--primary-color);
}

.form-hint {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.error-message {
    padding: 12px 16px;
    background: rgba(250, 82, 82, 0.1);
    border: 2px solid rgba(250, 82, 82, 0.3);
    border-radius: 10px;
    color: #fa5252;
    margin-bottom: 10px;
    font-size: 0.875rem;
}

.success-message {
    padding: 12px 16px;
    background: rgba(81, 207, 102, 0.1);
    border: 2px solid rgba(81, 207, 102, 0.3);
    border-radius: 10px;
    color: #51cf66;
    margin-bottom: 10px;
    font-size: 0.875rem;
}

.submit-button {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8787 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.submit-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 107, 107, 0.3);
}

.submit-button:active {
    transform: translateY(0);
}

.submit-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Loading and Empty States */
.loading-message,
.empty-message {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.empty-message a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.empty-message a:hover {
    text-decoration: underline;
}

/* Shipment Items */
.shipment-item {
    display: flex;
    gap: 20px;
    padding: 20px;
    background: var(--bg-light);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.shipment-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.shipment-image {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.shipment-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.shipment-image .no-image {
    font-size: 2rem;
}

.shipment-details {
    flex: 1;
}

.shipment-details h4 {
    margin: 0 0 8px 0;
    color: var(--text-dark);
    font-size: 1.125rem;
}

.shipment-details p {
    margin: 4px 0;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.shipment-quantity {
    font-weight: 600;
}

.shipment-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8125rem;
    font-weight: 600;
}

.status-pending {
    background: rgba(255, 193, 7, 0.1);
    color: #ffc107;
}

.status-processing {
    background: rgba(3, 169, 244, 0.1);
    color: #03a9f4;
}

.status-shipped {
    background: rgba(76, 175, 80, 0.1);
    color: #4caf50;
}

.shipment-date {
    color: var(--text-muted) !important;
    font-size: 0.8125rem !important;
}

/* Controls Panel - Hangs below video */
.controls-panel {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 0 0 12px 12px;
    border-top: none;
    padding: 8px 16px;
    box-shadow: var(--shadow);
    width: fit-content;
    min-width: 200px;
    margin-top: -2px; /* Connect to video border */
    margin-bottom: 10px; /* Space above footer */
}

.controls-header {
    margin-bottom: 12px;
}

.controls-header h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
    text-align: center;
}

/* Queue and Game Controls */
.game-controls {
    display: flex;
    gap: 12px;
    align-items: center;
    width: 100%;
}

.game-controls .control-button {
    flex: 1;
    justify-content: center;
}

.control-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8787 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 6px 16px rgba(255, 107, 107, 0.3), 0 4px 0 rgba(0, 0, 0, 0.15);
}

.control-button:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(255, 107, 107, 0.4), 0 5px 0 rgba(0, 0, 0, 0.15);
}

.control-button:active:not(:disabled),
.control-button.active {
    transform: translateY(3px);
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3), 0 0px 0 rgba(0, 0, 0, 0.15);
    background: linear-gradient(135deg, #ff5252 0%, #ff7676 100%);
}

.control-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Control Layout Variants */
.control-layout-hold_buttons {
    display: flex;
    gap: 12px;
}

.control-layout-single_button {
    display: flex;
    justify-content: center;
}

.control-layout-single_button .control-button {
    min-width: 120px;
}

.control-layout-dpad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 8px;
    max-width: 200px;
    margin: 0 auto;
}

.control-layout-dpad #upButton {
    grid-column: 2;
    grid-row: 1;
}

.control-layout-dpad #leftButton {
    grid-column: 1;
    grid-row: 2;
}

.control-layout-dpad #rightButton {
    grid-column: 3;
    grid-row: 2;
}

.control-layout-dpad #downButton {
    grid-column: 2;
    grid-row: 3;
}

.control-layout-joystick {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    max-width: 320px;
    margin: 0 auto;
}

/* Hide the original direction buttons when using virtual joystick */
.control-layout-joystick #upButton,
.control-layout-joystick #leftButton,
.control-layout-joystick #rightButton,
.control-layout-joystick #downButton {
    display: none;
}

/* Joystick action button - 3D arcade button */
.joystick-action-button {
    width: 70px !important;
    height: 70px !important;
    min-width: 70px;
    min-height: 70px;
    max-width: 70px;
    max-height: 70px;
    border-radius: 50% !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;

    /* 3D convex top - matching joystick ball style */
    background:
        radial-gradient(ellipse 70% 50% at 50% 25%, rgba(255, 255, 255, 0.4) 0%, transparent 50%),
        linear-gradient(180deg, #ff8a8a 0%, #ff6b6b 50%, #e05555 100%) !important;
    border: none !important;

    /* 3D depth - thick shadow base */
    box-shadow:
        0 6px 0 #a33535,
        0 8px 8px rgba(0, 0, 0, 0.35),
        inset 0 2px 3px rgba(255, 255, 255, 0.3),
        inset 0 -2px 4px rgba(0, 0, 0, 0.15) !important;

    /* Smooth transition for press */
    transition: transform 0.08s ease-out, box-shadow 0.08s ease-out, background 0.08s ease-out !important;
    transform-origin: center center;
}

/* Inner circle detail - recessed ring */
.joystick-action-button::after {
    content: '';
    position: absolute;
    width: 44%;
    height: 44%;
    border-radius: 50%;
    background: radial-gradient(ellipse 60% 40% at 50% 35%, rgba(255, 255, 255, 0.25) 0%, transparent 60%),
                linear-gradient(180deg, #ff6b6b 0%, #e85555 100%);
    box-shadow:
        inset 0 2px 4px rgba(0, 0, 0, 0.2),
        inset 0 -1px 2px rgba(255, 255, 255, 0.15),
        0 1px 2px rgba(255, 255, 255, 0.2);
}

.joystick-action-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow:
        0 8px 0 #a33535,
        0 10px 12px rgba(0, 0, 0, 0.4),
        inset 0 2px 3px rgba(255, 255, 255, 0.3),
        inset 0 -2px 4px rgba(0, 0, 0, 0.15) !important;
}

/* Press effect - pushes down with squish */
.joystick-action-button:active:not(:disabled),
.joystick-action-button.active {
    transform: translateY(5px) scale(0.97) !important;
    background:
        radial-gradient(ellipse 70% 50% at 50% 30%, rgba(255, 255, 255, 0.25) 0%, transparent 50%),
        linear-gradient(180deg, #ff7a7a 0%, #e85555 50%, #d04545 100%) !important;
    box-shadow:
        0 1px 0 #a33535,
        0 2px 4px rgba(0, 0, 0, 0.25),
        inset 0 3px 6px rgba(0, 0, 0, 0.2),
        inset 0 -1px 2px rgba(255, 255, 255, 0.1) !important;
}

.joystick-action-button:active::after,
.joystick-action-button.active::after {
    box-shadow:
        inset 0 3px 6px rgba(0, 0, 0, 0.25),
        inset 0 -1px 1px rgba(255, 255, 255, 0.1);
}

.joystick-action-button:disabled {
    opacity: 0.5;
    background:
        radial-gradient(ellipse 70% 50% at 50% 25%, rgba(255, 255, 255, 0.2) 0%, transparent 50%),
        linear-gradient(180deg, #bbb 0%, #999 50%, #888 100%) !important;
    box-shadow:
        0 4px 0 #666,
        0 5px 6px rgba(0, 0, 0, 0.2),
        inset 0 1px 2px rgba(255, 255, 255, 0.2),
        inset 0 -1px 2px rgba(0, 0, 0, 0.1) !important;
}

.joystick-action-button:disabled::after {
    background: radial-gradient(ellipse 60% 40% at 50% 35%, rgba(255, 255, 255, 0.15) 0%, transparent 60%),
                linear-gradient(180deg, #999 0%, #777 100%);
    box-shadow:
        inset 0 2px 3px rgba(0, 0, 0, 0.15),
        0 1px 1px rgba(255, 255, 255, 0.1);
}

/* Virtual Joystick Styles */
.virtual-joystick {
    position: relative;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

.virtual-joystick.disabled {
    pointer-events: none;
    cursor: not-allowed;
}

.joystick-base {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(145deg, #f5f5f5, #e0e0e0);
    border: 3px solid var(--border-color);
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.1),
                0 4px 12px rgba(255, 107, 107, 0.15);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.joystick-directions {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.direction-indicator {
    position: absolute;
    font-size: 14px;
    color: #ccc;
    transition: color 0.15s ease, transform 0.15s ease;
}

.direction-indicator.active {
    color: var(--primary-color);
    transform: scale(1.3);
}

.dir-up {
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
}

.dir-up.active {
    transform: translateX(-50%) scale(1.3);
}

.dir-down {
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
}

.dir-down.active {
    transform: translateX(-50%) scale(1.3);
}

.dir-left {
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
}

.dir-left.active {
    transform: translateY(-50%) scale(1.3);
}

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

.dir-right.active {
    transform: translateY(-50%) scale(1.3);
}

.joystick-knob {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    cursor: not-allowed;
    transition: transform 0.1s ease-out, box-shadow 0.1s ease-out, background 0.2s ease-out;

    /* Default: greyed out (disabled look) */
    opacity: 0.5;
    background: radial-gradient(ellipse 60% 40% at 50% 30%, rgba(255, 255, 255, 0.3) 0%, transparent 60%),
                linear-gradient(180deg, #ccc 0%, #aaa 40%, #999 100%);
    box-shadow:
        0 3px 0 #888,
        0 4px 6px rgba(0, 0, 0, 0.2);
}

/* Enabled state: colored 3D ball */
.virtual-joystick:not(.disabled) .joystick-knob {
    opacity: 1;
    cursor: grab;
    background: radial-gradient(ellipse 60% 40% at 50% 30%, rgba(255, 255, 255, 0.5) 0%, transparent 60%),
                radial-gradient(ellipse 80% 50% at 50% 100%, rgba(0, 0, 0, 0.15) 0%, transparent 50%),
                linear-gradient(180deg, #ff8a8a 0%, #ff6b6b 40%, #e85555 100%);
    box-shadow:
        0 4px 0 #c44545,
        0 6px 10px rgba(0, 0, 0, 0.3),
        inset 0 2px 4px rgba(255, 255, 255, 0.4),
        inset 0 -2px 4px rgba(0, 0, 0, 0.1);
}

.virtual-joystick.active .joystick-knob {
    cursor: grabbing;
    box-shadow:
        0 2px 0 #c44545,
        0 3px 6px rgba(0, 0, 0, 0.25),
        inset 0 1px 2px rgba(255, 255, 255, 0.3),
        inset 0 -1px 3px rgba(0, 0, 0, 0.15);
}

.virtual-joystick.disabled .joystick-base {
    opacity: 0.5;
}

.control-layout-servo_test {
    display: flex;
    gap: 16px;
    justify-content: center;
    max-width: 300px;
    margin: 0 auto;
}

.control-layout-servo_test .control-button {
    flex: 1;
    min-width: 100px;
    padding: 16px 24px;
}

/* Control Type Section (Top) - Selected control UI */
.control-type-section {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 12px;
}

/* Joystick container - ensures single joystick display */
.joystick-container {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Ensure only one virtual joystick is visible in the container */
.joystick-container .virtual-joystick {
    flex-shrink: 0;
}

/* Ensure control-type-section with joystick only shows joystick and action button */
.control-type-section > .joystick-container {
    flex: 0 0 auto;
}

/* Motor Test Section (Bottom) - Individual motor buttons */
.motor-test-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.motor-test-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
}

.motor-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.motor-test-button {
    flex: 0 0 auto;
    min-width: 80px;
    padding: 8px 12px;
    font-size: 0.85rem;
    background: linear-gradient(135deg, #6b7280 0%, #9ca3af 100%);
    box-shadow: 0 4px 12px rgba(107, 114, 128, 0.3), 0 3px 0 rgba(0, 0, 0, 0.1);
}

.motor-test-button:hover:not(:disabled) {
    background: linear-gradient(135deg, #4b5563 0%, #6b7280 100%);
}

.motor-test-button:active:not(:disabled),
.motor-test-button.active {
    background: linear-gradient(135deg, #374151 0%, #4b5563 100%);
}

.motor-test-button .gpio-pin {
    font-size: 0.7rem;
    opacity: 0.7;
    margin-left: 4px;
}

/* Queue Card */
.queue-card,
.session-card {
    background: white;
    backdrop-filter: blur(10px);
    border: 2px solid var(--border-color);
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-lg);
}

.start-card {
    background: white;
    backdrop-filter: blur(10px);
    border: 2px solid var(--border-color);
    border-radius: 20px;
    padding: 10px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-lg);
}

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

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

.queue-header h3,
.session-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-color);
    margin: 0;
}

.start-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
    margin: 0;
}

.start-card .timer-display {
    margin: 6px 0;
    text-align: center;
}

.close-btn {
    background: rgba(250, 82, 82, 0.1);
    border: 2px solid rgba(250, 82, 82, 0.3);
    color: #fa5252;
    border-radius: 10px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    background: rgba(250, 82, 82, 0.2);
    transform: scale(1.05);
}

.queue-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.queue-position {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: var(--bg-pink);
    border-radius: 12px;
}

.position-label {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.position-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.queue-message {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Timer Display */
.timer-display {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    padding: 6px 12px;
    background: var(--bg-pink);
    border-radius: 10px;
    min-width: 60px;
    text-align: center;
    color: var(--primary-color);
}

/* Start Button */
.start-button {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #51cf66 0%, #40c057 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 16px rgba(81, 207, 102, 0.4);
    margin: 8px 0 0 0;
}

.start-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(81, 207, 102, 0.5);
}

.start-button:active {
    transform: translateY(0);
}

.start-hint {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin: 0;
}

/* Session Card */
.session-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.session-message {
    text-align: center;
    color: #51cf66;
    font-weight: 600;
    font-size: 1rem;
    margin: 0;
}

.session-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 16px;
    background: var(--bg-pink);
    border-radius: 16px;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.step-indicator {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-muted);
    transition: all 0.3s ease;
}

.step-indicator.completed {
    background: linear-gradient(135deg, #51cf66 0%, #40c057 100%);
    border-color: #51cf66;
    color: white;
}

.progress-arrow {
    font-size: 1.5rem;
    color: var(--text-muted);
}

.progress-step span {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Brand Link Styling */
.brand-link {
    text-decoration: none;
    color: inherit;
}

.brand-link .brand-title {
    margin: 0;
}

/* ========================================
   LANDSCAPE BLOCKER (Mobile Only)
   Forces portrait-only experience on mobile devices
   ======================================== */
@media screen and (max-width: 1024px) and (orientation: landscape) {
    /* Full-screen overlay */
    body::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: linear-gradient(135deg, var(--primary-color), var(--accent-pink));
        z-index: 99999;
    }

    /* Rotate message */
    body::after {
        content: '📱 Please rotate your device to portrait mode';
        position: fixed;
        bottom: 0;
        left: 50%;
        transform: translate(-50%, -50%);
        color: white;
        font-size: 1.5rem;
        font-weight: 600;
        text-align: center;
        padding: 2rem;
        z-index: 100000;
        max-width: 80%;
        line-height: 1.4;
    }

    /* Hide everything else */
    body > *:not(script):not(style) {
        visibility: hidden !important;
    }
}

/* Responsive Design */

/* Tablet and below (1024px) */
@media (max-width: 1024px) {
    .container {
        padding: 0 15px;
    }

    /* Full width layout on tablet and mobile */
    .stream-layout {
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Stack video and sidebar vertically on tablet */
    .video-and-sidebar-container {
        flex-direction: column;
        width: 100% !important;
        max-width: 100% !important;
    }

    .video-and-sidebar-container .video-wrapper {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        height: auto;
    }

    .video-wrapper {
        min-width: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        height: auto;
    }

    .sidebar-panel {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        max-height: none;
        height: auto;
    }

    .sidebar-stats {
        flex-direction: row;
        justify-content: space-between;
    }

    .stat-box {
        flex: 1;
    }

    .game-title-bar {
        padding: 10px 20px;
    }

    .game-title-bar .game-title {
        font-size: 1.3rem;
    }
}

/* Mobile Portrait (768px and below) */
@media (max-width: 768px) {

    /* Override CSS variables for mobile */
    :root {
        --header-height: 44px;
        --player-panel-height: 52px;
        --footer-height: 56px;
        --content-row-gap: 0px;
        --content-row-top: var(--header-height);
        --header-player-total: calc(var(--header-height) + var(--player-panel-height));
    }

    /* Adjust body padding for new header/footer heights */
    body {
        padding-top: var(--header-player-total);
        padding-bottom: calc(var(--footer-height) + 40px) !important; /* Footer is fixed + extra padding */
    }

    /* Ensure main content has bottom padding for footer */
    main,
    .container,
    .profile-section,
    .shop-section,
    .profile-card,
    .shop-content,
    .shop-content.active,
    .prizes-grid,
    .packages-grid,
    #tokensGrid,
    #prizesGrid {
        padding-bottom: 40px !important;
    }

    /* Extra spacer at bottom of shop page */
    .landing-page .container:last-of-type {
        margin-bottom: 60px !important;
    }

    /* Header height adjustment */
    header {
        height: var(--header-height);
    }

    /* Player panel height adjustment */
    .player-panel {
        height: var(--player-panel-height);
        padding: 4px 8px;
    }

    .player-panel .stat-item {
        font-size: 0.75rem;
        gap: 4px;
    }

    .player-panel .stat-icon {
        font-size: 0.9rem;
    }

    .player-panel .stat-value {
        font-size: 0.8rem;
    }

    /* Footer height adjustment */
    footer {
        height: var(--footer-height);
        padding: 8px 12px;
    }

    .footer-nav {
        gap: 4px;
    }

    .footer-nav a {
        font-size: 0.7rem;
        padding: 4px 8px;
    }

    /* Show scrolling banner on mobile - positioned between header and player panel */
    .header-banner {
        position: fixed !important;
        top: calc(var(--header-height) - 1px) !important; /* -1px to prevent gap with header */
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        height: 108px !important; /* 100px cards + 4px padding top/bottom */
        z-index: 99 !important;
        background: linear-gradient(135deg, #ff6b6b 0%, #ff8787 50%, #ffa94d 100%);
        margin: 0 !important;
        overflow: hidden !important;
        padding: 4px 0 !important;
        box-sizing: border-box !important;
    }

    .scrolling-banner {
        display: flex !important;
        height: 100% !important;
        align-items: center !important;
    }

    /* Banner cards - same size as desktop */
    .banner-card {
        width: 300px !important;
        height: 100px !important;
        flex-shrink: 0 !important;
    }

    /* Adjust player panel to be below the banner */
    .player-panel {
        top: calc(var(--header-height) + 107px) !important; /* header + banner height, overlap to prevent gap */
        justify-content: flex-end !important; /* Content flush right */
        padding-right: 0 !important;
        background: transparent !important;
    }

    /* Player panel content flush to right edge */
    .player-panel-content {
        justify-content: flex-end !important;
        padding: 0 8px !important;
        margin-right: 0 !important;
        height: 100% !important;
        overflow: visible !important; /* Allow dropdown to show */
    }

    /* Adjust body padding to account for banner + player panel */
    body {
        padding-top: calc(var(--header-height) + 108px + var(--player-panel-height)) !important;
    }

    /* Typography */
    h1 {
        font-size: 1.1rem;
    }

    .brand-title {
        font-size: 1.1rem;
        font-weight: 900;
        white-space: nowrap;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .game-title {
        font-size: 1.5rem;
    }

    /* Header - Keep horizontal on mobile but compact */
    .main-header,
    .game-header {
        padding: 0 8px;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 6px;
    }

    header {
        padding: 6px 0;
    }

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

    .header-left {
        flex: 1 1 auto;
        min-width: 0;
        overflow: hidden;
    }

    .header-right {
        flex: 0 0 auto;
        flex-shrink: 0;
    }

    /* Game Layout - Center everything */
    .container {
        padding: 0 12px;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .stream-layout {
        gap: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        display: flex;
        flex-direction: column;
        align-items: stretch;
    }

    .game-title-bar {
        padding: 6px 12px;
        border-radius: 0;
        margin: 0 !important;
    }

    .game-title-bar .game-title {
        font-size: 1rem;
    }

    /* Reset game page container for mobile scroll */
    .game-page .container {
        height: auto !important;
        padding: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
        overflow-x: hidden !important;
        box-sizing: border-box !important;
    }

    /* ========================================
       MOBILE GAME PAGE - Elegant Responsive Layout
       ======================================== */

    .game-page {
        overflow-x: hidden !important;
        overflow-y: auto !important;
        /* No header/banner on mobile game page - just player panel */
        padding-top: var(--player-panel-height) !important;
        padding-bottom: 0 !important;
        min-height: 100vh !important;
        min-height: 100dvh !important; /* Dynamic viewport height for mobile browsers */
    }

    /* Hide header and banner on mobile game page to save space */
    .game-page header {
        display: none !important;
    }

    .game-page .header-banner {
        display: none !important;
    }

    /* Hide footer on mobile game page */
    .game-page footer,
    .game-page .main-footer {
        display: none !important;
    }

    /* Adjust player panel position when header is hidden */
    .game-page .player-panel {
        top: 0 !important;
    }

    /* Mobile game title bar - compact, elegant */
    .game-page .game-title-bar {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        transform: none !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 6px 12px !important;
        box-sizing: border-box !important;
        background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 50%, var(--accent-orange) 100%) !important;
        border-bottom: none !important;
        border-radius: 0 !important;
        z-index: 1 !important; /* Must be below social column (z-index: 9999) */
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
    }

    .game-page .game-title-bar .game-title {
        font-size: 1rem !important;
        font-weight: 600 !important;
        text-align: center !important;
        color: #ffd000 !important; /* Keep original gold color */
        flex: 1 !important;
        margin: 0 !important;
    }

    /* Mobile back arrow styling */
    .game-page .game-title-bar .back-arrow {
        position: relative !important;
        left: auto !important;
        padding: 4px !important;
        color: #ffd000 !important;
        flex-shrink: 0 !important;
    }

    .game-page .game-title-bar .back-arrow svg {
        width: 28px !important;
        height: 28px !important;
        stroke-width: 3.5 !important;
    }

    .video-and-sidebar-container {
        flex-direction: column !important;
        gap: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .video-and-sidebar-container .video-wrapper {
        min-width: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        border-radius: 0 !important;
        border: none !important;
        box-shadow: none !important;
        height: auto !important;
        box-sizing: border-box !important;
        background: #fafafa !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    /* Video player portrait optimization - full width, edge-to-edge */
    .video-wrapper {
        aspect-ratio: 4 / 3 !important; /* MUST keep 4:3 per project rules - cameras are 640x480 */
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        height: auto !important;
        max-height: 50vh !important;
        box-sizing: border-box !important;
        border-radius: 0 !important;
        border: none !important;
        box-shadow: none !important;
        background: #fafafa !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    /* Video element on mobile - light background, fill container */
    .camera-video {
        background: #fafafa !important;
    }

    /* Sidebar below video in portrait */
    .sidebar-panel {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        max-height: none !important;
        height: auto !important;
        overflow-y: visible !important;
        box-sizing: border-box !important;
    }

    .stream-layout {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        gap: 0 !important;
        margin: 0 !important;
    }

    /* Status and Camera Toggle - Smaller on mobile */
    .status {
        padding: 6px 10px;
        font-size: 11px;
    }

    .status-dot {
        width: 8px;
        height: 8px;
    }

    /* Camera toggle meets 48px minimum touch target */
    .camera-toggle-btn {
        width: 48px;
        height: 48px;
        font-size: 1.3rem;
    }

    /* Game timer - compact for mobile */
    .game-timer-overlay {
        top: 6px;
        padding: 5px 12px;
    }

    .game-timer-value {
        font-size: 1.1rem;
    }

    /* Sidebar - Full width */
    .sidebar-panel {
        padding: 16px;
        gap: 16px;
        width: 100%;
    }

    .sidebar-stats {
        gap: 10px;
        width: 100%;
    }

    .stat-box {
        padding: 12px;
        flex: 1;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .stat-label {
        font-size: 0.85rem;
    }

    .game-info-box {
        padding: 12px;
        width: 100%;
    }

    /* Controls - Full width */
    .stream-controls {
        padding: 10px 15px;
        gap: 10px;
        width: 100%;
    }

    .game-controls {
        width: 100%;
        justify-content: center;
        gap: 12px;
    }

    .controls-panel {
        width: 100%;
        min-width: unset;
        margin: 8px 0 0;
    }

    .control-button {
        flex: 1;
        justify-content: center;
        padding: 14px 12px;
        font-size: 0.95rem;
        min-height: 48px;
    }

    /* Queue and Session Cards - Full width */
    .queue-card,
    .session-card,
    .start-card {
        padding: 16px;
        margin-bottom: 10px;
        width: 100%;
    }

    .play-button {
        width: 100%;
    }

    .timer-display {
        font-size: 1.3rem;
        min-width: 50px;
        padding: 5px 10px;
    }

    .start-button,
    .play-button {
        padding: 14px 20px;
        font-size: 1rem;
    }

    .session-progress {
        flex-direction: column;
        gap: 12px;
    }

    .progress-arrow {
        transform: rotate(90deg);
    }

    /* ========================================
       MOBILE GAME PAGE - Elegant Responsive Layout (Continued)
       ======================================== */

    /* Game container - full width, NO SCROLL - everything fits */
    /* Account for player panel (45px) + game title bar (~28px) */
    .game-page .container {
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        display: flex !important;
        flex-direction: column !important;
        height: calc(100vh - var(--player-panel-height) - 28px) !important;
        height: calc(100dvh - var(--player-panel-height) - 28px) !important;
        max-height: calc(100vh - var(--player-panel-height) - 28px) !important;
        max-height: calc(100dvh - var(--player-panel-height) - 28px) !important;
        overflow: hidden !important;
    }

    /* Stream layout - flex to fill available space, no overflow */
    .game-page .stream-layout {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
        gap: 0 !important;
        flex: 1 !important;
        min-height: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important;
    }

    /* Video and Controls Container - fills available space, no overflow */
    .game-page .video-and-controls-container {
        width: 100% !important;
        max-width: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
        flex: 1 !important;
        min-height: 0 !important;
        overflow: hidden !important;
    }

    /* Video and Sidebar Container - no gaps on mobile game page */
    .game-page .video-and-sidebar-container {
        gap: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Video wrapper - shrinks to fit, controls get priority */
    .game-page .video-wrapper {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        min-height: 0 !important;
        /* Video shrinks to accommodate controls */
        flex: 1 1 auto !important;
        max-height: min(38vh, 38dvh) !important;
        aspect-ratio: 4 / 3 !important;
        border-radius: 0 !important;
        border: none !important;
        margin: 0 !important;
        padding: 0 !important;
        background: #fafafa !important;
        overflow: hidden !important;
    }

    /* Video element - fill wrapper completely, light background */
    .game-page .camera-video {
        background: #fafafa !important;
        object-fit: cover !important;
    }

    /* Controls row - compact design */
    .game-page .controls-row {
        width: 100% !important;
        max-width: 100% !important;
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        grid-template-rows: auto auto auto auto auto !important;
        gap: 4px 10px !important;
        background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 245, 245, 0.98) 100%) !important;
        border-top: 2px solid var(--border-color) !important;
        padding: 10px 12px !important;
        padding-bottom: 20px !important; /* Extra bottom padding for play button */
        box-sizing: border-box !important;
        flex: 0 0 auto !important;
        align-content: start !important;
        margin: 0 !important;
    }

    /* Stats and game play sections use grid contents */
    .game-page .controls-row > .stats-and-status,
    .game-page .controls-row > .game-play-section {
        display: contents !important;
    }

    /* Stats panel uses grid contents */
    .game-page .stats-panel {
        display: contents !important;
    }

    /* Stat boxes - clean, compact design */
    .game-page .stats-panel .stat-box {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 6px !important;
        padding: 4px 8px !important;
        background: rgba(255, 107, 107, 0.08) !important;
        border-radius: 6px !important;
        border: 1px solid rgba(255, 107, 107, 0.15) !important;
    }

    .game-page .stats-panel .stat-box:first-child {
        grid-column: 1 !important;
        grid-row: 1 !important;
    }

    .game-page .stats-panel .stat-box:last-child {
        grid-column: 2 !important;
        grid-row: 1 !important;
    }

    .game-page .stats-panel .stat-icon {
        display: flex !important;
        width: 20px !important;
        height: 20px !important;
        color: var(--primary-color) !important;
    }

    .game-page .stats-panel .stat-icon svg {
        width: 100% !important;
        height: 100% !important;
    }

    .game-page .stats-panel .stat-content {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 4px !important;
    }

    .game-page .stats-panel .stat-label {
        font-size: 0.8rem !important;
        color: var(--text-muted) !important;
        order: 1 !important;
    }

    .game-page .stats-panel .stat-value {
        font-size: 0.9rem !important;
        font-weight: 700 !important;
        color: var(--text-dark) !important;
        order: 2 !important;
    }

    /* Leave queue button - centered on mobile */
    .game-page .controls-leave-queue-btn {
        position: relative !important;
        left: auto !important;
        bottom: auto !important;
        grid-column: 1 / -1 !important;
        grid-row: 3 !important;
        justify-self: center !important;
        margin-top: 4px !important;
        padding: 6px 12px !important;
        font-size: 0.75rem !important;
    }

    /* Game info box - right aligned in row 2 */
    .game-page .game-play-section .game-info-box {
        display: contents !important;
    }

    .game-page .game-play-section .game-info-box .info-row {
        display: flex !important;
        align-items: center !important;
        gap: 4px !important;
        padding: 4px 8px !important;
        background: rgba(255, 107, 107, 0.08) !important;
        border-radius: 6px !important;
        border: 1px solid rgba(255, 107, 107, 0.15) !important;
    }

    .game-page .game-play-section .game-info-box .info-row:first-child {
        grid-column: 1 !important;
        grid-row: 2 !important;
    }

    .game-page .game-play-section .game-info-box .info-row:last-child {
        grid-column: 2 !important;
        grid-row: 2 !important;
    }

    .game-page .game-play-section .game-info-box .info-label {
        font-size: 0.8rem !important;
        color: var(--text-muted) !important;
    }

    .game-page .game-play-section .game-info-box .info-value {
        font-size: 0.9rem !important;
        font-weight: 700 !important;
        color: var(--text-dark) !important;
        display: flex !important;
        align-items: center !important;
        gap: 2px !important;
    }

    .game-page .game-play-section .game-info-box .stat-icon {
        font-size: 0.85rem !important;
    }

    /* Queue/Start/Session cards - full width, row 4 (after leave queue button) */
    .game-page .stats-and-status .queue-card,
    .game-page .stats-and-status .start-card,
    .game-page .stats-and-status .session-card {
        position: relative !important;
        left: auto !important;
        top: auto !important;
        transform: none !important;
        grid-column: 1 / -1 !important;
        grid-row: 4 !important;
        margin: 4px 0 0 0 !important;
        padding: 10px 12px !important;
        border-radius: 10px !important;
    }

    .game-page .queue-card .queue-header,
    .game-page .start-card .start-header,
    .game-page .session-card .session-header {
        padding: 0 !important;
        margin-bottom: 6px !important;
    }

    .game-page .queue-card .queue-header h3,
    .game-page .start-card .start-header h3,
    .game-page .session-card .session-header h3 {
        font-size: 0.9rem !important;
    }

    .game-page .queue-position .position-value,
    .game-page .timer-display {
        font-size: 1.2rem !important;
    }

    .game-page .start-button {
        padding: 10px 20px !important;
        font-size: 0.95rem !important;
    }

    /* Controls panel - full width, row 4 */
    .game-page .controls-panel {
        grid-column: 1 / -1 !important;
        grid-row: 4 !important;
        width: 100% !important;
        max-width: 100% !important;
        display: flex !important;
        justify-content: center !important;
        padding: 8px 0 4px 0 !important;
        margin: 0 !important;
    }

    .game-page .game-controls {
        width: 100% !important;
        max-width: 100% !important;
        display: flex !important;
        justify-content: center !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
    }

    /* Control buttons - touch-friendly */
    .game-page .control-button {
        min-height: 48px !important;
        min-width: 48px !important;
        padding: 10px 16px !important;
        font-size: 0.9rem !important;
        border-radius: 10px !important;
    }

    /* Action button - keep circular on mobile */
    .game-page .joystick-action-button {
        width: 64px !important;
        height: 64px !important;
        min-width: 64px !important;
        min-height: 64px !important;
        max-width: 64px !important;
        max-height: 64px !important;
        border-radius: 50% !important;
        padding: 0 !important;
    }

    /* Play button - prominent, full width, row 5 */
    .game-page .game-play-section .play-button {
        grid-column: 1 / -1 !important;
        grid-row: 5 !important;
        width: 100% !important;
        padding: 10px 20px !important;
        margin: 6px 0 0 0 !important;
        font-size: 0.95rem !important;
        font-weight: 600 !important;
        border-radius: 10px !important;
        min-height: 44px !important;
    }

    .game-page .game-play-section .play-button svg {
        width: 20px !important;
        height: 20px !important;
    }
}

/* ========================================
   EXTRA SMALL SCREENS (< 400px) - Game Page
   ======================================== */
@media (max-width: 400px) {
    .game-page .controls-row {
        padding: 8px 10px !important;
        gap: 4px 8px !important;
    }

    .game-page .stats-panel .stat-box,
    .game-page .game-play-section .game-info-box .info-row {
        padding: 4px 6px !important;
    }

    .game-page .stats-panel .stat-label,
    .game-page .game-play-section .game-info-box .info-label {
        font-size: 0.7rem !important;
    }

    .game-page .stats-panel .stat-value,
    .game-page .game-play-section .game-info-box .info-value {
        font-size: 0.8rem !important;
    }

    .game-page .stats-panel .stat-icon {
        width: 16px !important;
        height: 16px !important;
    }

    .game-page .control-button {
        padding: 8px 10px !important;
        font-size: 0.8rem !important;
    }

    /* Action button - keep circular on extra small screens */
    .game-page .joystick-action-button {
        width: 56px !important;
        height: 56px !important;
        min-width: 56px !important;
        min-height: 56px !important;
        max-width: 56px !important;
        max-height: 56px !important;
        border-radius: 50% !important;
        padding: 0 !important;
    }

    .game-page .game-play-section .play-button {
        padding: 12px 18px !important;
        font-size: 0.9rem !important;
        min-height: 48px !important;
    }

    .game-page .game-title-bar .game-title {
        font-size: 0.9rem !important;
    }
}

@media (max-width: 768px) {
    /* Footer */
    .footer-content {
        grid-template-columns: 1fr;
        gap: 25px;
        text-align: center;
    }

    .footer-section a {
        display: inline-block;
        margin: 0 10px 10px;
    }

    /* Games Grid - 2 columns, full screen width */
    .games-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 2px !important;
        padding: 2px !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        box-sizing: border-box !important;
    }

    /* Full width layout on mobile - reset all offsets */
    html {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    body {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
        margin: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        padding-bottom: 0 !important;
    }

    /* Landing page body - keep flex for footer positioning */
    body.landing-page {
        display: flex !important;
        flex-direction: column !important;
        min-height: 100vh !important;
    }

    /* Remove container padding on mobile for full-width cards */
    .container {
        padding: 0 !important;
        margin: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
        flex: 1 0 auto !important;
    }

    /* Footer pushed to bottom via flexbox */
    body.landing-page footer,
    body.landing-page .main-footer {
        margin-top: auto !important;
    }

    .games-section {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
    }

    /* Social column on mobile - full-width overlay that slides in from left */
    .social-column {
        display: flex !important;
        position: fixed !important;
        top: calc(var(--header-height) + 107px + var(--player-panel-height)) !important; /* Below header + banner + player panel */
        left: 0 !important;
        right: 0 !important;
        bottom: var(--footer-height) !important; /* Above the fixed footer */
        width: 100% !important;
        max-width: 100% !important;
        min-width: 100% !important;
        height: auto !important;
        z-index: 100 !important; /* Above game title bar (z-index: 99) */
        border-right: none !important;
        border-radius: 0 !important;
        transform: translateX(0) !important;
        transition: transform 0.3s ease !important;
        background: var(--bg-white) !important;
    }

    /* Game page: social column below player panel since header/banner are hidden */
    .game-page .social-column {
        top: var(--player-panel-height) !important;
        bottom: var(--footer-height) !important; /* Above the fixed footer */
        height: calc(100vh - var(--player-panel-height) - var(--footer-height)) !important;
        max-height: calc(100vh - var(--player-panel-height) - var(--footer-height)) !important;
        overflow: hidden !important;
        z-index: 9999 !important; /* Above everything including game title bar */
    }

    .game-page .social-column .social-column-content {
        height: 100% !important;
        max-height: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important;
    }

    .game-page .social-column .social-column-body {
        flex: 1 !important;
        min-height: 0 !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
    }

    .game-page .social-column .social-tab-content {
        height: 100% !important;
        max-height: 100% !important;
        overflow-y: auto !important;
    }

    .game-page .social-column .chat-messages {
        flex: 1 !important;
        min-height: 0 !important;
        overflow-y: auto !important;
    }

    /* Game page: social toggle aligned with player panel since header/banner are hidden */
    .game-page .social-column-toggle,
    .game-page #socialColumnToggle {
        top: 4px !important;
        left: 0 !important;
        height: calc(var(--player-panel-height) - 8px) !important;
        border-radius: 0 8px 8px 0 !important;
    }

    /* When collapsed, slide off screen to the left */
    .social-column.collapsed {
        transform: translateX(-100%) !important;
    }

    /* Hide content when collapsed - keep it ready but off-screen */
    .social-column.collapsed .social-column-content {
        opacity: 1 !important;
        pointer-events: auto !important;
        display: flex !important;
    }

    /* Social column content area */
    .social-column .social-column-content {
        width: 100% !important;
        height: 100% !important;
        display: flex !important;
        flex-direction: column !important;
    }

    /* Mobile-optimized tabs - full width, horizontal layout */
    .social-column .social-column-tabs {
        display: flex !important;
        flex-direction: row !important;
        padding: 8px !important;
        gap: 4px !important;
        background: rgba(255, 107, 107, 0.1) !important;
        border-bottom: 1px solid var(--border-color) !important;
        flex-shrink: 0 !important;
    }

    .social-column .social-tab {
        flex: 1 !important;
        padding: 12px 8px !important;
        font-size: 0.85rem !important;
        min-height: 44px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 6px !important;
        border-radius: 8px !important;
        background: transparent !important;
        border: none !important;
        color: var(--text-muted) !important;
        transition: all 0.2s ease !important;
    }

    .social-column .social-tab.active {
        background: var(--primary-color) !important;
        color: white !important;
    }

    .social-column .social-tab svg {
        width: 18px !important;
        height: 18px !important;
    }

    /* Mobile-optimized tab body */
    .social-column .social-column-body {
        flex: 1 !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        padding: 0 !important;
    }

    /* Mobile-optimized content */
    .social-column .social-tab-content {
        padding: 12px !important;
        height: 100% !important;
        display: none !important;
    }

    .social-column .social-tab-content.active {
        display: flex !important;
        flex-direction: column !important;
    }

    /* Chat area optimization for mobile */
    .social-column .chat-messages {
        flex: 1 !important;
        overflow-y: auto !important;
        padding: 8px !important;
        min-height: 0 !important;
    }

    .social-column .chat-input-container {
        padding: 8px !important;
        border-top: 1px solid var(--border-color) !important;
        flex-shrink: 0 !important;
    }

    .social-column .chat-input {
        min-height: 44px !important;
        font-size: 16px !important; /* Prevents iOS zoom */
    }

    /* Activity list optimization */
    .social-column .activity-list {
        padding: 8px !important;
    }

    /* Leaderboard optimization */
    .social-column .leaderboard-list {
        padding: 8px !important;
    }

    /* Reset page-content-wrapper on mobile - no flex layout needed */
    .page-content-wrapper {
        display: block !important;
        padding: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
    }

    /* Reset container margin on mobile - social column is overlay */
    .page-content-wrapper .container {
        margin-left: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Also reset collapsed state margins */
    .social-column.collapsed ~ .container {
        margin-left: 0 !important;
    }

    /* Toggle button on mobile - flush left, aligned with player panel */
    .social-column-toggle,
    #socialColumnToggle {
        display: flex !important;
        top: calc(var(--header-height) + 107px) !important; /* Below header + banner, aligned with player panel */
        left: 0 !important;
        right: auto !important;
        width: 40px !important;
        height: var(--player-panel-height) !important;
        z-index: 100 !important;
        border-radius: 0 8px 8px 0 !important;
    }

    /* When panel is open, move toggle to right edge */
    .social-column-toggle:not(.collapsed) {
        left: auto !important;
        right: 0 !important;
        border-radius: 8px 0 0 8px !important;
    }

    /* Footer - fixed at bottom on mobile */
    footer,
    .main-footer {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        margin: 0 !important;
        padding: 6px 12px env(safe-area-inset-bottom, 0px) 12px !important;
        text-align: center !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        z-index: 100 !important;
    }

    .footer-bottom {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 4px !important;
        width: 100% !important;
        padding: 0 12px !important;
        margin: 0 auto !important;
        box-sizing: border-box !important;
    }

    .footer-bottom p {
        font-size: 0.7rem !important;
        margin: 0 !important;
        opacity: 0.9 !important;
        text-align: center !important;
        width: 100% !important;
    }

    .footer-socials {
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 20px !important;
        margin: 0 !important;
        width: 100% !important;
    }

    .footer-socials svg {
        width: 20px !important;
        height: 20px !important;
    }

    /* Compact game cards for mobile */
    .game-card {
        border-radius: 8px;
    }

    /* Keep header but make it compact - match desktop styling */
    .game-card .game-card-header {
        padding: 4px 6px;
        min-height: auto;
        background: var(--bg-light);
    }

    .game-card .game-title {
        font-family: 'Bangers', cursive;
        font-weight: 400;
        line-height: 1.1;
        letter-spacing: 1.5px;
        color: #1a1a2e;
        -webkit-text-fill-color: #1a1a2e;
        -webkit-text-stroke: 1px rgba(255, 255, 255, 0.8);
        text-shadow:
            2px 2px 0px rgba(255, 107, 107, 0.6),
            -1px -1px 0px rgba(255, 255, 255, 0.8);
        white-space: nowrap;
        overflow: visible;
        width: 100%;
        text-align: center;
        padding: 4px 6px;
        box-sizing: border-box;
    }

    .game-card .game-thumbnail {
        aspect-ratio: 1 / 1;
    }

    /* Show only slideshow dots on mobile, hide stats */
    .game-card .game-player-bar {
        justify-content: center;
        padding: 4px 8px;
        min-height: auto;
    }

    .game-card .game-player-bar .player-stat {
        display: none;
    }

    .game-card .game-player-bar .slideshow-dots {
        display: flex;
    }

    .game-card .game-player-bar .slideshow-dots .dot {
        width: 8px;
        height: 8px;
    }

    /* Compact info section */
    .game-card .game-info {
        padding: 4px 6px;
    }

    .game-card .game-details-left {
        flex-direction: row;
        justify-content: space-between;
        width: 100%;
    }

    .game-card .game-details-right {
        display: none;
    }

    .game-card .game-detail-row {
        gap: 2px;
    }

    .game-card .detail-label {
        font-size: 0.5rem;
    }

    .game-card .detail-value {
        font-size: 0.5rem;
    }

    /* Smaller badges */
    .game-card .live-badge,
    .game-card .offline-badge,
    .game-card .playing-badge,
    .game-card .coming-soon-badge {
        padding: 3px 6px;
        font-size: 0.55rem;
    }

    /* Profile & Auth */
    .profile-card {
        padding: 20px;
    }
}

/* Mobile Portrait Only - Full width brand styling */
@media (max-width: 768px) and (orientation: portrait) {
    /* ============================================
       MOBILE TITLE BANNER - WOW FACTOR EDITION
       ============================================ */

    /* Make header content full width */
    .main-header,
    .game-header {
        justify-content: center !important;
        padding: 0 !important;
    }

    .header-left {
        flex: 1 !important;
        width: 100% !important;
        justify-content: center !important;
    }

    .header-right {
        display: none !important;
    }

    /* Full width brand capsule with animated gradient background */
    .brand-glass-capsule {
        width: 100% !important;
        border-radius: 0 !important;
        padding: 12px 16px !important;
        margin: 0 !important;
        position: relative !important;
        overflow: hidden !important;
        background: linear-gradient(
            135deg,
            rgba(255, 107, 107, 0.3) 0%,
            rgba(255, 169, 77, 0.3) 25%,
            rgba(255, 215, 0, 0.3) 50%,
            rgba(255, 169, 77, 0.3) 75%,
            rgba(255, 107, 107, 0.3) 100%
        ) !important;
        background-size: 300% 300% !important;
        animation: bannerGradient 8s ease infinite !important;
        border: none !important;
        box-shadow:
            0 4px 20px rgba(255, 107, 107, 0.3),
            inset 0 1px 0 rgba(255, 255, 255, 0.4),
            inset 0 -1px 0 rgba(0, 0, 0, 0.1) !important;
    }

    /* Sparkle decorations */
    .brand-glass-capsule::before,
    .brand-glass-capsule::after {
        content: '✦' !important;
        position: absolute !important;
        font-size: 14px !important;
        color: rgba(255, 255, 255, 0.9) !important;
        animation: sparkleFloat 3s ease-in-out infinite !important;
        pointer-events: none !important;
    }

    .brand-glass-capsule::before {
        left: 12px !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        animation-delay: 0s !important;
    }

    .brand-glass-capsule::after {
        right: 12px !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        animation-delay: 1.5s !important;
    }

    .brand-link {
        width: 100% !important;
        display: block !important;
    }

    .brand-container {
        width: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 2px !important;
    }

    /* Animated shimmer title with glow */
    .brand-title {
        font-family: 'Bangers', 'Segoe UI Black', sans-serif !important;
        font-size: 1.5rem !important;
        font-weight: 400 !important;
        text-align: center !important;
        width: 100% !important;
        letter-spacing: 3px !important;

        /* Animated shimmer gradient */
        background: linear-gradient(
            90deg,
            #ffffff 0%,
            #fff5f5 20%,
            #ffd700 40%,
            #ffffff 50%,
            #ffd700 60%,
            #fff5f5 80%,
            #ffffff 100%
        ) !important;
        background-size: 200% auto !important;
        background-clip: text !important;
        -webkit-background-clip: text !important;
        -webkit-text-fill-color: transparent !important;
        animation:
            titleShimmer 3s linear infinite,
            titleGlow 2s ease-in-out infinite !important;

        /* Glow effect (works alongside transparent text via filter) */
        filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.6))
                drop-shadow(0 0 15px rgba(255, 107, 107, 0.4)) !important;
    }

    /* Hide Japanese subtitle on mobile - no room */
    .brand-subtitle {
        display: none !important;
    }

    /* Animated dots row below title */
    .brand-dots-row {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 8px !important;
        margin-top: 4px !important;
    }

    .brand-dot {
        width: 5px !important;
        height: 5px !important;
        border-radius: 50% !important;
        background: rgba(255, 255, 255, 0.85) !important;
        box-shadow: 0 0 6px rgba(255, 255, 255, 0.5) !important;
        animation: dotPulse 2s ease-in-out infinite !important;
    }

    .brand-dot-accent {
        width: 7px !important;
        height: 7px !important;
        background: #ffd700 !important;
        box-shadow: 0 0 10px rgba(255, 215, 0, 0.8) !important;
    }

    .brand-dot:nth-child(1) { animation-delay: 0s !important; }
    .brand-dot:nth-child(2) { animation-delay: 0.15s !important; }
    .brand-dot:nth-child(3) { animation-delay: 0.3s !important; }
    .brand-dot:nth-child(4) { animation-delay: 0.45s !important; }
    .brand-dot:nth-child(5) { animation-delay: 0.6s !important; }
    .brand-dot:nth-child(6) { animation-delay: 0.75s !important; }
    .brand-dot:nth-child(7) { animation-delay: 0.9s !important; }

    /* Show bouncing robot mascots on mobile */
    .brand-mascot {
        display: inline-flex !important;
        width: 24px !important;
        height: 24px !important;
        animation: robotBounce 2s ease-in-out infinite !important;
    }

    .brand-mascot-right {
        animation-delay: 0.5s !important;
    }

    .brand-mascot .robot-icon {
        width: 100% !important;
        height: 100% !important;
    }

    .brand-mascot .robot-eye-left,
    .brand-mascot .robot-eye-right {
        animation: robotEyes 4s ease-in-out infinite !important;
    }

    .brand-mascot .robot-eye-right {
        animation-delay: 0.1s !important;
    }

    .brand-mascot .robot-antenna {
        animation: sparkle 2s ease-in-out infinite !important;
    }

    .brand-mascot-right .robot-antenna {
        animation-delay: 1s !important;
    }

    /* Brand title row layout */
    .brand-title-row {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 6px !important;
    }
}

/* Continue with remaining mobile styles */
@media (max-width: 768px) {
    .profile-title {
        font-size: 1.5rem;
    }

    .auth-card {
        padding: 24px 16px;
    }

    .auth-title {
        font-size: 1.75rem;
    }

    .social-auth-btn {
        padding: 12px 20px;
        font-size: 14px;
        min-height: 48px;
    }

    .login-button {
        padding: 8px 12px;
        font-size: 13px;
        min-height: 44px;
        white-space: nowrap;
    }

    .login-button svg {
        width: 16px;
        height: 16px;
    }

    .user-menu-button {
        width: 48px;
        height: 48px;
    }

    .user-menu-dropdown {
        min-width: 200px;
        position: absolute !important;
        top: calc(100% + 4px) !important;
        right: 0 !important;
        z-index: 10001 !important;
    }

    /* Compact user menu for mobile */
    .user-menu {
        gap: 6px;
    }

    .user-info-container {
        gap: 4px;
        padding: 4px 8px !important;
        font-size: 0.8rem;
    }

    .user-stats {
        gap: 6px;
    }

    .user-stats .stat-item {
        padding: 4px 8px;
        font-size: 0.75rem;
        min-height: 28px;
        border-radius: 50px;
    }

    .user-stats .stat-icon {
        font-size: 0.85rem;
    }

    .user-stats .stat-value {
        font-size: 0.8rem;
    }

    .player-panel-avatar {
        padding: 3px;
    }

    .player-panel-avatar-inner {
        width: 32px;
        height: 32px;
    }

    .player-panel-avatar svg,
    .player-panel-avatar-img {
        width: 28px;
        height: 28px;
    }

    .shop-icon-button {
        width: 32px;
        height: 32px;
        padding: 0;
        margin-right: 8px;
    }

    .shop-icon-button .stat-icon {
        font-size: 0.9rem;
    }

    .user-menu-button {
        width: 32px;
        height: 32px;
    }

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

    /* Close buttons and other small interactive elements */
    .close-btn {
        min-width: 44px;
        min-height: 44px;
        padding: 10px;
    }

    /* Play button should be easily tappable */
    .play-button {
        min-height: 52px;
    }

    .start-button {
        min-height: 52px;
    }
}

/* Mobile Landscape (max-height focuses on landscape orientation) */
@media (max-width: 768px) and (orientation: landscape) {

    /* Compact header for limited vertical space */
    header {
        padding: 6px 0;
    }

    .main-header,
    .game-header {
        flex-direction: row;
        padding: 0 15px;
        gap: 10px;
    }

    .brand-title {
        font-size: 1.5rem;
    }

    /* Compact game layout */
    .stream-layout {
        gap: 0 !important;
    }

    .game-title-bar {
        padding: 8px 16px;
        margin: 0 !important;
    }

    .game-title-bar .game-title {
        font-size: 1.1rem;
    }

    /* Try to fit video and sidebar side-by-side if possible */
    .video-and-sidebar-container {
        flex-direction: row;
        gap: 12px;
    }

    .video-and-sidebar-container .video-wrapper {
        flex: 1;
        min-width: 0;
    }

    .sidebar-panel {
        flex: 0 0 auto;
        width: 240px;
        max-width: 240px;
        padding: 12px;
        gap: 12px;
    }

    .sidebar-stats {
        flex-direction: column;
        gap: 8px;
    }

    .stat-box {
        padding: 10px;
    }

    .stat-value {
        font-size: 1.3rem;
    }

    .stat-label {
        font-size: 0.8rem;
    }

    /* Compact controls */
    .stream-controls {
        padding: 8px 12px;
    }

    .control-button {
        padding: 10px;
        font-size: 0.9rem;
        min-height: 44px;
    }

    /* Compact cards */
    .queue-card,
    .session-card,
    .start-card {
        padding: 12px;
        margin-bottom: 12px;
    }

    .queue-header,
    .session-header,
    .start-header {
        margin-bottom: 10px;
    }

    .timer-display {
        font-size: 1.1rem;
        padding: 4px 8px;
    }

    .start-button,
    .play-button {
        padding: 10px 16px;
        font-size: 0.95rem;
    }

    /* Status and camera - compact but still touchable */
    .status {
        padding: 4px 8px;
        font-size: 10px;
    }

    .status-dot {
        width: 6px;
        height: 6px;
    }

    /* Camera toggle - 44px minimum for landscape touch target */
    .camera-toggle-btn {
        width: 44px;
        height: 44px;
        font-size: 1.2rem;
    }

    /* Game timer - even smaller for landscape */
    .game-timer-overlay {
        top: 4px;
        padding: 4px 10px;
    }

    .game-timer-value {
        font-size: 1rem;
    }

    /* Footer - more compact */
    .main-footer {
        padding: 20px 0 10px;
    }

    .footer-content {
        gap: 15px;
    }

    .footer-section h4 {
        font-size: 1rem;
        margin-bottom: 6px;
    }

    .footer-section p,
    .footer-section a {
        font-size: 0.85rem;
    }

    /* ========================================
       MOBILE GAME PAGE - Landscape Layout
       ======================================== */

    /* Game page in landscape - side by side layout */
    .game-page {
        padding-top: var(--player-panel-height) !important;
        padding-bottom: 0 !important;
    }

    .game-page header,
    .game-page .header-banner,
    .game-page footer,
    .game-page .main-footer {
        display: none !important;
    }

    .game-page .player-panel {
        top: 0 !important;
        height: 36px !important;
        padding: 2px 8px !important;
    }

    .game-page .game-title-bar {
        display: none !important;
    }

    .game-page .container {
        padding: 0 !important;
        height: calc(100vh - 36px) !important;
        height: calc(100dvh - 36px) !important;
        overflow: hidden !important;
    }

    .game-page .stream-layout,
    .game-page .video-and-controls-container {
        height: 100% !important;
        flex-direction: row !important;
    }

    /* Video takes left side */
    .game-page .video-wrapper {
        flex: 1 !important;
        height: 100% !important;
        max-height: 100% !important;
        aspect-ratio: auto !important;
        border-radius: 0 !important;
    }

    /* Controls panel on the right side */
    .game-page .controls-row {
        width: 200px !important;
        min-width: 200px !important;
        max-width: 200px !important;
        height: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 6px !important;
        padding: 8px !important;
        overflow-y: auto !important;
        border-top: none !important;
        border-left: 2px solid var(--border-color) !important;
    }

    .game-page .controls-row > .stats-and-status,
    .game-page .controls-row > .game-play-section {
        display: flex !important;
        flex-direction: column !important;
        gap: 4px !important;
    }

    .game-page .stats-panel {
        display: flex !important;
        flex-direction: column !important;
        gap: 4px !important;
    }

    .game-page .stats-panel .stat-box {
        grid-column: auto !important;
        grid-row: auto !important;
        padding: 4px 8px !important;
    }

    .game-page .game-play-section .game-info-box {
        display: flex !important;
        flex-direction: column !important;
        gap: 4px !important;
    }

    .game-page .game-play-section .game-info-box .info-row {
        grid-column: auto !important;
        grid-row: auto !important;
        padding: 4px 8px !important;
    }

    .game-page .stats-and-status .queue-card,
    .game-page .stats-and-status .start-card,
    .game-page .stats-and-status .session-card {
        grid-column: auto !important;
        grid-row: auto !important;
        padding: 8px !important;
    }

    /* Leave queue button - centered in landscape */
    .game-page .controls-leave-queue-btn {
        position: relative !important;
        left: auto !important;
        bottom: auto !important;
        grid-column: auto !important;
        grid-row: auto !important;
        justify-self: center !important;
        padding: 6px 12px !important;
    }

    .game-page .controls-panel {
        grid-column: auto !important;
        grid-row: auto !important;
        padding: 4px 0 !important;
    }

    .game-page .game-controls {
        gap: 4px !important;
    }

    .game-page .control-button {
        min-height: 40px !important;
        padding: 8px 12px !important;
        font-size: 0.8rem !important;
    }

    /* Action button - keep circular in landscape */
    .game-page .joystick-action-button {
        width: 56px !important;
        height: 56px !important;
        min-width: 56px !important;
        min-height: 56px !important;
        max-width: 56px !important;
        max-height: 56px !important;
        border-radius: 50% !important;
        padding: 0 !important;
    }

    .game-page .game-play-section .play-button {
        grid-column: auto !important;
        grid-row: auto !important;
        padding: 10px 16px !important;
        margin: 4px 0 0 0 !important;
        min-height: 44px !important;
    }

    /* Social column in landscape */
    .game-page .social-column {
        top: 36px !important;
        height: calc(100vh - 36px) !important;
        height: calc(100dvh - 36px) !important;
    }

    .game-page .social-column-toggle {
        top: 2px !important;
        height: 32px !important;
    }
}

/* Animation for elements */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.container>* {
    animation: fadeIn 0.5s ease-out;
}

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

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    animation: fadeInModal 0.3s ease-out;
}

.modal-overlay.active {
    display: flex;
}

.modal-container {
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    animation: slideUpModal 0.3s ease-out;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 2px solid var(--border-color);
    background: linear-gradient(135deg, var(--bg-light) 0%, var(--bg-pink) 100%);
}

.modal-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 32px;
    color: var(--text-muted);
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s;
}

.modal-close:hover {
    background: rgba(255, 107, 107, 0.1);
    color: var(--primary-color);
}

.modal-body {
    padding: 24px;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-body p {
    margin: 0 0 16px 0;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-dark);
}

.modal-body p:last-child {
    margin-bottom: 0;
}

/* Rules Modal Content */
.rules-content {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-dark);
    text-align: left;
}

.modal-footer {
    display: flex;
    gap: 12px;
    padding: 20px 24px;
    border-top: 2px solid var(--border-color);
    justify-content: flex-end;
    background: var(--bg-light);
}

.modal-footer .btn {
    min-width: 100px;
}

@keyframes fadeInModal {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUpModal {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ========================================
   SHOP PAGE STYLES
   ======================================== */

/* Shop subtitle */
.shop-subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 1rem;
    margin: -8px 0 20px 0;
    transition: opacity 0.2s ease;
}

.shop-subtitle.fade-out {
    opacity: 0;
}

/* Tabs */
.shop-tabs {
    display: flex;
    gap: 8px;
    border-bottom: 2px solid var(--border-color);
    justify-content: center;
    margin-bottom: 24px;
}

.shop-tab {
    background: none;
    border: none;
    padding: 10px 20px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
    position: relative;
    bottom: -2px;
    white-space: nowrap;
}

.shop-tab:hover {
    color: var(--primary-color);
}

.shop-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

/* Shop Content */
.shop-content {
    display: none;
}

.shop-content.active {
    display: block;
    flex: 1;
    min-height: 50vh;
}

/* Package Cards */
.packages-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

/* Happy Mode Message in Shop */
.happy-mode-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 40px;
    background: linear-gradient(135deg, #fff7fb 0%, #ffffff 50%, #ffe6f1 100%);
    border-radius: 20px;
    border: 2px solid var(--border-color);
    box-shadow: var(--shadow);
}

.happy-mode-icon {
    font-size: 4rem;
    margin-bottom: 10px;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.happy-mode-message h2 {
    font-size: 2rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0 0 12px 0;
}

.happy-mode-message > p {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin: 0 0 24px 0;
}

.happy-mode-features {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin: 32px 0;
    flex-wrap: wrap;
}

.happy-feature {
    display: flex;
    align-items: center;
    gap: 10px;
    background: white;
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    font-size: 1rem;
    color: var(--text-dark);
}

.happy-feature .feature-icon {
    font-size: 1.5rem;
}

.happy-mode-note {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 24px;
}

.package-card {
    background: white;
    border-radius: 12px;
    padding: 20px 16px;
    text-align: center;
    box-shadow: 0 0 20px rgba(243, 96, 166, 0.3), var(--shadow);
    transition: all 0.3s;
    position: relative;
    border: 2px solid rgba(243, 96, 166, 0.4);
}

.package-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 25px rgba(243, 96, 166, 0.5), var(--shadow-lg);
    border-color: rgba(243, 96, 166, 0.6);
}

.package-card.popular {
    border-color: rgba(243, 96, 166, 0.6);
    box-shadow: 0 0 25px rgba(243, 96, 166, 0.4), var(--shadow);
}

.package-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(135deg, var(--accent-pink), var(--accent-orange));
    color: white;
    padding: 4px 10px;
    border-radius: 16px;
    font-size: 11px;
    font-weight: 700;
}

.popular-badge {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.package-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.package-amount {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 6px;
}

.package-price {
    font-size: 28px;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.package-bonus {
    font-size: 13px;
    color: var(--success-color);
    font-weight: 600;
    margin-bottom: 10px;
    min-height: 18px;
}

.package-btn {
    width: 100%;
    padding: 10px;
    font-size: 14px;
}

/* Prizes Grid */
.prizes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

/* Prize Card - optimized for image-based prizes */
.prize-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(243, 96, 166, 0.3), var(--shadow);
    transition: all 0.3s;
    border: 2px solid rgba(243, 96, 166, 0.4);
    display: flex;
    flex-direction: column;
}

.prize-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 25px rgba(243, 96, 166, 0.5), var(--shadow-lg);
    border-color: rgba(243, 96, 166, 0.6);
}

.prize-card.popular {
    border-color: rgba(243, 96, 166, 0.6);
    box-shadow: 0 0 25px rgba(243, 96, 166, 0.4), var(--shadow);
}

.prize-card .prize-header {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid #f0f0f0;
    position: relative;
}

.prize-card .prize-badge {
    background: linear-gradient(135deg, var(--accent-pink), var(--accent-orange));
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    white-space: nowrap;
    flex-shrink: 0;
}

.prize-card .prize-badge.popular-badge {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.prize-card .prize-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
    flex: 1;
}

.prize-card .shipping-icon {
    font-size: 20px;
    flex-shrink: 0;
    opacity: 0.8;
}

.prize-card .prize-image-container {
    width: 100%;
    height: 240px;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.prize-card .prize-image-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.prize-card .prize-image-container .prize-emoji {
    font-size: 80px;
}

.prize-card .prize-info {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.prize-card .prize-description {
    font-size: 14px;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.4;
}

.prize-card .prize-cost {
    font-size: 20px;
    font-weight: 800;
    color: var(--primary-color);
    margin: 0;
}

.prize-card .package-btn {
    width: 100%;
    padding: 12px;
    font-size: 14px;
    margin: 0;
}

/* Cart Page Styles */
.cart-subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-top: -10px;
    margin-bottom: 40px;
}

.cart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 24px;
    margin-bottom: 30px;
}

.cart-item {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s;
    display: flex;
    flex-direction: row;
    border: 2px solid transparent;
}

.cart-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.cart-item-image-container {
    width: 140px;
    min-width: 140px;
    height: 140px;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.cart-item-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.cart-item-emoji {
    font-size: 60px;
}

.cart-item-details {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cart-item-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
}

.cart-item-quantity {
    font-size: 14px;
    color: var(--text-muted);
}

.cart-item-status {
    margin-top: auto;
}

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.status-badge.pending {
    background: linear-gradient(135deg, var(--accent-orange), var(--accent-pink));
    color: white;
}

.status-badge.processing {
    background: linear-gradient(135deg, #4CAF50, #8BC34A);
    color: white;
}

.cart-item-date {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.cart-total {
    background: white;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    box-shadow: var(--shadow);
    font-size: 18px;
    color: var(--primary-color);
}

.empty-cart {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.empty-cart-icon {
    font-size: 80px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-cart h2 {
    color: var(--text-dark);
    margin-bottom: 10px;
}

.empty-cart p {
    color: var(--text-muted);
    margin-bottom: 30px;
    font-size: 16px;
}

.empty-cart .btn {
    display: inline-block;
}

.coming-soon-card {
    background: white;
    border-radius: 12px;
    padding: 32px 24px;
    text-align: center;
    box-shadow: var(--shadow);
}

.coming-soon-card h3 {
    font-size: 24px;
    color: var(--primary-color);
    margin-bottom: 12px;
}

.coming-soon-card p {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 8px;
}

/* Modal Note */
.modal-note {
    background: var(--bg-light);
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-muted);
    border-left: 4px solid var(--warning-color);
}

/* Active Nav Link */
nav a.active {
    color: white;
    font-weight: 700;
}

/* Mobile Responsiveness */
@media (max-width: 1024px) {
    .packages-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    /* ===================================
       Mobile Shop Styles
       =================================== */

    /* Shop page container needs padding on mobile */
    .landing-page .container {
        padding: 0 12px !important;
    }

    /* Shop subtitle on mobile */
    .shop-subtitle {
        font-size: 0.9rem;
        margin: 0 0 16px 0;
        padding: 0 8px;
    }

    /* Shop tabs - horizontal scrollable on mobile */
    .shop-tabs {
        gap: 4px;
        margin-bottom: 10px;
        padding: 0;
    }

    .shop-tab {
        flex: 1;
        padding: 12px 8px;
        font-size: 14px;
        min-height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .shop-tab.active {
        border-bottom-color: var(--primary-color);
    }

    /* Packages grid - 2 columns on mobile for compact view */
    .packages-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
        padding: 0 !important;
    }

    /* Package card - compact beautiful mobile design */
    .package-card {
        padding: 10px 6px !important;
        border-radius: 12px !important;
        border-width: 1px !important;
        box-shadow: 0 2px 8px rgba(243, 96, 166, 0.15) !important;
    }

    .package-card.popular {
        transform: none;
        box-shadow: 0 2px 12px rgba(243, 96, 166, 0.25) !important;
    }

    .package-card.popular:hover {
        transform: translateY(-2px);
    }

    .package-badge {
        position: static !important;
        display: inline-block !important;
        padding: 2px 8px !important;
        font-size: 8px !important;
        margin-bottom: 4px !important;
        border-radius: 10px !important;
    }

    .package-icon {
        font-size: 28px !important;
        margin-bottom: 2px !important;
    }

    .package-amount {
        font-size: 12px !important;
        margin-bottom: 2px !important;
        font-weight: 600 !important;
    }

    .package-price {
        font-size: 18px !important;
        margin-bottom: 2px !important;
        font-weight: 800 !important;
    }

    .package-bonus {
        font-size: 9px !important;
        margin-bottom: 6px !important;
        min-height: auto !important;
        line-height: 1.2 !important;
        color: var(--success-color) !important;
    }

    .package-btn {
        padding: 8px 6px !important;
        font-size: 11px !important;
        min-height: 34px !important;
        border-radius: 8px !important;
    }

    /* Prize cards - 2 columns, compact and beautiful */
    .prize-card {
        border-radius: 12px !important;
        border-width: 1px !important;
        box-shadow: 0 2px 8px rgba(243, 96, 166, 0.15) !important;
    }

    .prize-card .prize-header {
        padding: 6px 8px !important;
        gap: 4px !important;
    }

    .prize-card .prize-badge {
        padding: 2px 6px !important;
        font-size: 7px !important;
        border-radius: 4px !important;
    }

    .prize-card .prize-title {
        font-size: 11px !important;
        line-height: 1.2 !important;
    }

    .prize-card .shipping-icon {
        font-size: 14px !important;
    }

    .prize-card .prize-image-container {
        height: 100px !important;
    }

    .prize-card .prize-image-container .prize-emoji {
        font-size: 40px !important;
    }

    .prize-card .prize-info {
        padding: 8px !important;
        gap: 4px !important;
    }

    .prize-card .prize-description {
        font-size: 10px !important;
        line-height: 1.2 !important;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .prize-card .prize-cost {
        font-size: 14px;
    }

    .prize-card .package-btn {
        padding: 10px 8px;
        font-size: 11px;
        min-height: 38px;
    }

    /* Happy mode message - mobile optimized */
    .happy-mode-message {
        padding: 30px 16px;
        border-radius: 12px;
    }

    .happy-mode-icon {
        font-size: 2.5rem;
        margin-bottom: 12px;
    }

    .happy-mode-message h2 {
        font-size: 1.4rem;
        margin-bottom: 8px;
    }

    .happy-mode-message > p {
        font-size: 0.95rem;
        margin-bottom: 10px;
    }

    .happy-mode-features {
        flex-direction: column;
        gap: 10px;
        margin: 20px 0;
    }

    .happy-feature {
        padding: 12px 16px;
        font-size: 0.9rem;
        justify-content: center;
    }

    .happy-feature .feature-icon {
        font-size: 1.2rem;
    }

    .happy-mode-note {
        font-size: 0.85rem;
        margin-top: 10px;
    }
}

/* Extra small screens - single column for shop */
@media (max-width: 400px) {
    .packages-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .package-card {
        padding: 16px 12px;
    }

    .package-icon {
        font-size: 40px;
    }

    .package-amount {
        font-size: 18px;
    }

    .package-price {
        font-size: 24px;
    }

    .package-bonus {
        font-size: 12px;
    }

    .package-btn {
        padding: 12px;
        font-size: 14px;
    }

    .prize-card .prize-image-container {
        height: 180px;
    }

    .prize-card .prize-title {
        font-size: 16px;
    }

    .prize-card .prize-description {
        font-size: 13px;
        -webkit-line-clamp: 3;
    }

    .prize-card .prize-cost {
        font-size: 18px;
    }

    .prize-card .package-btn {
        padding: 12px;
        font-size: 14px;
        min-height: 44px;
    }
}

/* ===================================
   Admin Dashboard Styles
   =================================== */

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.stat-card {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    color: white;
    box-shadow: var(--shadow);
    transition: all 0.3s;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-label {
    font-size: 14px;
    font-weight: 600;
    opacity: 0.9;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card .stat-value {
    font-size: 32px;
    font-weight: 700;
    line-height: 1.2;
    color: white;
}

.stat-card .stat-label {
    color: rgba(255, 255, 255, 0.9);
}

/* Beautiful Game Admin Cards - Compact */
.game-admin-card {
    background: white;
    border-radius: 10px;
    padding: 0;
    margin-bottom: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #e8e8e8;
    transition: all 0.3s ease;
    overflow: hidden;
}

.game-admin-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 16px rgba(255, 107, 107, 0.15);
    transform: translateY(-2px);
}

/* Card Header - Title on left, Actions on right */
.game-card-header {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;
    padding: 8px 16px !important;
    background: linear-gradient(135deg, #fafafa 0%, #f5f5f5 100%) !important;
    border-bottom: 1px solid #e8e8e8 !important;
}

.game-card-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.game-online-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.05);
}

.game-online-status .online-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.game-online-status .online-text {
    color: #6c757d;
}

/* Expand/collapse toggle for mobile */
.game-expand-toggle {
    display: none;
    font-size: 10px;
    color: #999;
    transition: transform 0.2s;
    flex-shrink: 0;
}

.game-admin-card.collapsed .game-expand-toggle {
    transform: rotate(0deg);
}

.game-admin-card:not(.collapsed) .game-expand-toggle {
    transform: rotate(90deg);
}

/* Compact info grid for mobile */
.info-grid-compact {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
}

.info-compact {
    font-size: 12px;
    color: var(--text-dark);
}

.info-compact b {
    color: var(--text-muted);
    font-weight: 600;
}

.game-id-badge {
    font-family: 'Courier New', monospace;
    font-size: 10px;
    font-weight: 700;
    color: var(--primary-color);
    background: white;
    padding: 3px 8px;
    border-radius: 5px;
    border: 1px solid var(--border-color);
    display: inline-block;
    flex-shrink: 0;
}

.game-name-link {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s;
    display: inline-block;
}

.game-name-link h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--text-dark);
    display: inline;
    white-space: nowrap;
}

.game-name-link:hover h4 {
    color: var(--primary-color);
}

.game-status-badge {
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
    flex-shrink: 0;
}

.game-status-badge.active {
    background: linear-gradient(135deg, #51cf66, #40c057);
    color: white;
    box-shadow: 0 2px 8px rgba(81, 207, 102, 0.3);
}

.game-status-badge.inactive {
    background: #e9ecef;
    color: #868e96;
}

/* Card Info Grid - Compact */
.game-card-info {
    padding: 6px 16px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px 8px;
}

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

.info-label {
    font-size: 9px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-value {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-dark);
}

/* Card Actions - Inline in header */
.game-card-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-shrink: 0;
}

.btn-sm {
    padding: 6px 12px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    border-radius: 6px !important;
}

.btn-warning {
    background: linear-gradient(135deg, #FF9800, #FF5722);
    color: white;
    border: none;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #F57C00, #E64A19);
}

/* Tab Header Row */
.tab-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.tab-header-row h3 {
    margin: 0;
}

/* ========================================
   Controls Tab Styles
   ======================================== */

.control-section {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.control-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}

.control-info {
    flex: 1;
}

.control-info h4 {
    margin: 0 0 8px 0;
    color: var(--text-dark);
    font-size: 1.1rem;
}

.control-description {
    margin: 0 0 12px 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.control-features {
    margin: 0;
    padding-left: 20px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.control-features li {
    margin-bottom: 4px;
}

.control-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.toggle-status {
    font-weight: 600;
    font-size: 0.9rem;
    min-width: 50px;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 56px;
    height: 30px;
}

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

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 30px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + .toggle-slider {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(26px);
}

.control-action {
    flex-shrink: 0;
}

.control-result {
    margin-top: 12px;
    padding: 10px 16px;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 0.9rem;
}

/* Game Form Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    animation: fadeIn 0.2s ease;
}

.game-form-modal {
    background: white;
    border-radius: 12px;
    width: 95%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.game-form-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #e8e8e8;
    position: sticky;
    top: 0;
    background: white;
    z-index: 1;
}

.game-form-modal .modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.game-form-modal .modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    line-height: 1;
}

.game-form-modal .modal-close:hover {
    color: #333;
}

.game-form-modal .form-grid {
    padding: 16px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.game-form-modal .form-section {
    padding: 12px;
    background: #fafafa;
    border-radius: 8px;
    border: 1px solid #eee;
}

.game-form-modal .form-section:last-child {
    margin-bottom: 0;
}

.game-form-modal .form-section h4 {
    margin: 0 0 10px 0;
    font-size: 12px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.game-form-modal .form-group {
    margin-bottom: 10px;
}

.game-form-modal .form-group:last-child {
    margin-bottom: 0;
}

.game-form-modal .form-group label {
    display: block;
    margin-bottom: 3px;
    font-size: 12px;
    font-weight: 500;
    color: #555;
}

.game-form-modal .form-group small {
    display: block;
    margin-top: 2px;
    font-size: 10px;
    color: #999;
}

.game-form-modal .form-group input,
.game-form-modal .form-group select,
.game-form-modal .form-group textarea {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.game-form-modal .form-group textarea {
    resize: vertical;
    min-height: 50px;
}

.game-form-modal .form-group input:focus,
.game-form-modal .form-group select:focus,
.game-form-modal .form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.game-form-modal .form-group input:disabled {
    background: #f0f0f0;
    cursor: not-allowed;
}

.game-form-modal .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.game-form-modal .checkbox-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 13px;
}

.game-form-modal .checkbox-group input[type="checkbox"] {
    width: auto;
}

.game-form-modal .modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 12px 16px;
    border-top: 1px solid #e8e8e8;
    background: #fafafa;
    position: sticky;
    bottom: 0;
}

/* GPIO Bindings Grid - Compact */
.game-form-modal .gpio-bindings {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
    margin-top: 6px;
}

.game-form-modal .gpio-input {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 0;
}

.game-form-modal .gpio-input label {
    font-size: 12px;
    margin: 0;
    white-space: nowrap;
}

.game-form-modal .gpio-input input {
    width: 50px;
    padding: 4px 6px;
    text-align: center;
    font-size: 12px;
}

.game-form-modal .binding-group h4 {
    margin: 12px 0 6px !important;
}

/* Pi Setup Progress Display */
.setup-progress {
    margin-top: 12px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

.progress-status {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 10px;
    padding: 6px 10px;
    background: white;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.progress-steps {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.step-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    background: white;
    border-radius: 4px;
    border: 1px solid #eee;
    font-size: 12px;
}

.step-icon {
    flex-shrink: 0;
    width: 18px;
    text-align: center;
}

.step-text {
    color: #555;
}

/* Pi Setup Button Group */
.btn-group-vertical {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 8px;
}

.btn-group-vertical .btn {
    width: 100%;
}

.setup-steps h5 {
    margin: 0 0 10px 0;
    font-size: 12px;
    font-weight: 600;
    color: #666;
}

.setup-steps small {
    display: block;
    font-size: 11px;
    color: #888;
    line-height: 1.5;
}

/* Loading and Empty States */
.loading-message {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    font-size: 16px;
}

.empty-message {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

.empty-message p {
    margin: 0;
    font-size: 16px;
}

/* Responsive Admin Styles */
@media (max-width: 1200px) {
    .info-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .game-card-header {
        flex-wrap: wrap;
        gap: 6px;
        cursor: pointer;
    }

    .game-card-title {
        flex: 1;
        min-width: 100%;
    }

    /* Show expand toggle on mobile */
    .game-expand-toggle {
        display: inline-block;
    }

    /* Compact info grid - 3 columns on mobile */
    .info-grid-compact {
        grid-template-columns: repeat(3, 1fr);
        gap: 4px 12px;
    }

    .info-compact {
        font-size: 11px;
    }

    /* Hide info when collapsed on mobile */
    .game-admin-card.collapsed .game-card-info {
        display: none;
    }

    .game-card-actions {
        flex-wrap: wrap;
        width: 100%;
        justify-content: flex-start;
    }

    .game-card-actions .btn {
        flex: 1;
        min-width: 70px;
    }

    /* ==========================================
       PROFILE PAGE - Sleek Mobile Design
       ========================================== */

    /* Profile Container - Clean edges */
    .profile-container {
        width: 100%;
        padding: 0;
    }

    /* Profile Card - Minimal flat design */
    .profile-card {
        padding: 10px 12px 30px 12px;
        border-radius: 0;
        border: none;
        box-shadow: none;
        background: white;
        min-height: auto;
    }

    /* Profile Tabs - Match shop tabs style */
    .profile-tabs {
        display: flex;
        gap: 4px;
        padding: 0;
        margin: 0 0 16px 0;
        background: transparent;
        border-bottom: 2px solid var(--border-color);
        border-radius: 0;
        justify-content: center;
    }

    .profile-tab {
        flex: 1;
        padding: 12px 8px;
        font-size: 14px;
        font-weight: 600;
        border-radius: 0;
        border-bottom: 3px solid transparent;
        background: none;
        box-shadow: none;
        text-align: center;
        color: var(--text-muted);
        transition: all 0.3s ease;
        min-height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
        bottom: -2px;
    }

    .profile-tab:hover {
        transform: none;
        box-shadow: none;
        color: var(--primary-color);
    }

    .profile-tab.active {
        background: none;
        color: var(--primary-color);
        border-bottom-color: var(--primary-color);
        box-shadow: none;
    }

    /* Player Info Section - Compact */
    .player-info-section {
        flex-direction: column !important;
        gap: 8px !important;
        padding-bottom: 8px !important;
        margin-bottom: 8px !important;
        border-bottom: 1px solid #f0f0f0 !important;
    }

    .player-info-section > div:first-child {
        order: 2;
    }

    .player-info-section > div:last-child {
        order: 1;
        align-self: center !important;
    }

    /* Form inputs - Tight */
    .profile-card .form-input,
    .profile-card input[type="text"],
    .profile-card input[type="email"] {
        max-width: 100% !important;
        width: 100% !important;
        font-size: 15px !important;
        padding: 6px 10px;
        border-radius: 4px;
        border: 1px solid #ddd;
        background: #fafafa;
        transition: all 0.2s ease;
    }

    .profile-card .form-input:focus,
    .profile-card input:focus {
        border-color: var(--primary-color);
        background: white;
        box-shadow: none;
    }

    /* Form group - Tight spacing */
    .profile-card .form-group {
        margin-bottom: 6px;
    }

    .profile-card .form-group label {
        font-size: 0.65rem;
        font-weight: 600;
        color: #999;
        text-transform: uppercase;
        letter-spacing: 0.3px;
        margin-bottom: 2px;
        display: block;
    }

    /* Save button - Small inline */
    .profile-card .form-group > div[style*="display: flex"] {
        flex-direction: row !important;
        gap: 6px !important;
    }

    .profile-card #saveUsernameBtn,
    .profile-card #saveEmailBtn {
        width: auto !important;
        padding: 6px 12px !important;
        border-radius: 4px;
        font-size: 0.7rem;
        flex-shrink: 0;
    }

    /* Linked Accounts - Tight list */
    .linked-accounts-section {
        margin-top: 0 !important;
        padding-top: 8px !important;
        border-top: none !important;
    }

    .linked-accounts-section h3 {
        font-size: 0.65rem;
        font-weight: 600;
        color: #999;
        text-transform: uppercase;
        letter-spacing: 0.3px;
        margin-bottom: 6px;
    }

    .linked-accounts-section .form-hint {
        display: none;
    }

    .linked-accounts-list {
        gap: 4px;
        margin-top: 0;
    }

    .linked-account-item {
        padding: 6px 8px;
        border-radius: 6px;
        border: 1px solid #eee;
        background: #fafafa;
        gap: 6px;
    }

    .linked-account-item:hover {
        transform: none;
        box-shadow: none;
    }

    .account-icon {
        width: 24px;
        height: 24px;
        border-radius: 4px;
        background: white;
        box-shadow: none;
    }

    .account-icon svg {
        width: 14px;
        height: 14px;
    }

    .account-info {
        gap: 0;
    }

    .account-name {
        font-size: 0.75rem;
        font-weight: 600;
    }

    .account-status {
        font-size: 0.6rem;
        color: #999;
    }

    .link-button {
        padding: 4px 8px;
        border-radius: 4px;
        font-size: 0.65rem;
        font-weight: 600;
    }

    /* Avatar - Compact */
    .avatar-selector-container {
        transform: scale(0.75);
    }

    /* Address Form - Tight */
    #shippingForm h3 {
        font-size: 0.65rem;
        font-weight: 600;
        color: #999;
        text-transform: uppercase;
        letter-spacing: 0.3px;
        margin-bottom: 2px;
    }

    #shippingForm .form-hint {
        font-size: 0.7rem;
        color: #999;
        margin-bottom: 8px;
    }

    #shippingForm .form-group {
        margin-bottom: 4px;
    }

    #shippingForm .form-group label {
        font-size: 0.65rem;
        font-weight: 600;
        color: #999;
        text-transform: uppercase;
        letter-spacing: 0.3px;
        margin-bottom: 2px;
    }

    #shippingForm input {
        padding: 6px 10px;
        border-radius: 4px;
        font-size: 15px;
        border: 1px solid #ddd;
        background: #fafafa;
    }

    #shippingForm input:focus {
        border-color: var(--primary-color);
        background: white;
        box-shadow: none;
    }

    #shippingForm .submit-button {
        width: 100%;
        padding: 8px;
        font-size: 0.8rem;
        border-radius: 4px;
        margin-top: 4px;
    }

    /* Tab content headings - Small */
    .tab-content h3 {
        font-size: 0.65rem;
        font-weight: 600;
        color: #999;
        text-transform: uppercase;
        letter-spacing: 0.3px;
        margin-bottom: 2px;
        text-align: left;
    }

    .tab-content .form-hint {
        text-align: left;
        margin-bottom: 8px;
        color: #999;
        font-size: 0.7rem;
    }

    /* Plays and Shipments */
    #playsList,
    #shipmentsList {
        display: flex;
        flex-direction: column;
        gap: 6px;
    }

    /* Empty/Loading states */
    .loading-message,
    .empty-message {
        text-align: center;
        padding: 24px 16px;
        color: #999;
        font-size: 0.85rem;
    }

    .empty-message a {
        color: var(--primary-color);
        font-weight: 600;
    }

    /* Tab Header Row - Stack on mobile */
    .tab-header-row {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .tab-header-row h3 {
        text-align: left;
        font-size: 0.7rem;
        color: #888;
        text-transform: uppercase;
    }

    .tab-header-row .btn {
        width: 100%;
        padding: 10px;
        font-size: 0.85rem;
    }

    /* Control Section - Mobile optimized */
    .control-section {
        padding: 16px;
    }

    .control-header {
        flex-direction: column;
        gap: 16px;
    }

    .control-toggle {
        align-self: flex-start;
    }

    .control-action {
        width: 100%;
    }

    .control-action .btn {
        width: 100%;
    }

    /* Game Admin Card - Mobile optimized */
    .game-admin-card {
        margin-bottom: 8px;
    }

    .game-admin-card.collapsed {
        margin-bottom: 6px;
    }

    .game-card-header {
        padding: 8px 10px !important;
    }

    .game-card-info {
        padding: 6px 10px;
    }

    .game-card-actions {
        gap: 6px;
    }

    .game-card-actions .btn {
        padding: 4px 8px !important;
        font-size: 11px !important;
    }

    /* Game Form Modal - Full screen on mobile */
    .game-form-modal {
        width: 100%;
        max-width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
    }

    .game-form-modal .form-grid {
        grid-template-columns: 1fr;
        padding: 12px;
        gap: 12px;
    }

    /* Camera Config Cards - Stack on mobile */
    #modal-tab-cameras [style*="display: flex"][style*="gap: 12px"] {
        flex-direction: column !important;
    }

    #cam1ConfigCard,
    #cam2ConfigCard {
        flex: 1 1 auto !important;
    }

    /* Camera detection header - Stack */
    #modal-tab-cameras [style*="justify-content: space-between"] {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 10px !important;
    }

    /* Camera preview containers */
    #cam1PreviewContainer,
    #cam2PreviewContainer {
        min-height: 150px;
    }

    /* Controls Tab - Stack columns on mobile */
    #modal-tab-controls .form-grid {
        display: flex !important;
        flex-direction: column !important;
    }

    #rightColumnContainer {
        width: 100% !important;
    }

    /* Button Script Section - Mobile adjustments */
    #buttonScriptSection {
        padding: 12px !important;
    }

    #buttonScriptSection [style*="display: flex"][style*="gap: 15px"] {
        flex-direction: column !important;
        gap: 10px !important;
    }

    /* Test & Clear buttons */
    #buttonScriptSection [style*="display: flex"][style*="gap: 10px"] {
        flex-direction: column !important;
    }

    #buttonScriptSection .btn {
        width: 100% !important;
    }

    /* Saved configs dropdown */
    #savedConfigsGroup [style*="display: flex"] {
        flex-wrap: wrap !important;
        gap: 8px !important;
    }

    #savedConfigsGroup select {
        flex: 1 1 100% !important;
        min-width: 100% !important;
    }

    /* Zones Section - Mobile adjustments */
    #zonesSection [style*="display: flex"][style*="gap: 16px"] {
        flex-direction: column !important;
        align-items: center !important;
    }

    #zonesGrid {
        grid-template-columns: repeat(3, 50px) !important;
        grid-template-rows: repeat(3, 50px) !important;
    }

    /* Test Controls Section */
    #testControlsSection {
        width: 100% !important;
    }

    #streamPreviewContainer {
        max-width: 100% !important;
        width: 100% !important;
    }

    #streamPreviewContainer + div {
        max-width: 100% !important;
    }

    /* Test Control Buttons */
    #testControlButtons {
        justify-content: center !important;
    }

    #testControlButtons .btn {
        min-width: 60px !important;
    }

    /* Modal Actions - Stack on mobile */
    .game-form-modal .modal-actions {
        flex-direction: column !important;
        gap: 12px !important;
    }

    .game-form-modal .modal-actions > div {
        width: 100% !important;
        margin-left: 0 !important;
    }

    .game-form-modal .modal-actions > div .btn {
        flex: 1 !important;
    }

    #setupPiContainer {
        display: flex !important;
        width: 100% !important;
    }

    /* Modal Header Row - Stack on mobile */
    .modal-header-row {
        position: relative !important;
        flex-wrap: wrap !important;
        gap: 10px !important;
        padding: 12px !important;
        padding-right: 48px !important; /* Space for close btn */
    }

    .modal-header-row .game-name-input {
        flex: 1 1 100% !important;
        max-width: 100% !important;
        order: 3;
    }

    .modal-header-row .game-id-badge {
        min-width: 70px !important;
        order: 0;
    }

    .modal-header-row #goToGameBtn {
        order: 1;
    }

    .modal-header-row .status-select {
        flex: 1;
        min-width: 90px !important;
        order: 2;
    }

    .modal-header-row .pi-config {
        flex: 1 1 100% !important;
        margin-left: 0 !important;
        padding-left: 0 !important;
        border-left: none !important;
        padding-top: 10px;
        border-top: 1px solid #dee2e6;
        order: 4;
    }

    .modal-header-row .pi-ip-input {
        flex: 1;
        width: auto !important;
    }

    .modal-header-row .close-btn {
        position: absolute !important;
        top: 8px !important;
        right: 8px !important;
        margin: 0 !important;
        padding: 8px !important;
        z-index: 10 !important;
    }

    /* Modal Tabs - Scrollable */
    .modal-tabs {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap !important;
    }

    .modal-tab {
        flex-shrink: 0;
        padding: 10px 14px !important;
        font-size: 13px !important;
    }

    /* Form Sections in Modal */
    .game-form-modal .form-section {
        padding: 10px;
    }

    .game-form-modal .form-section h4 {
        font-size: 11px;
    }

    /* Modal Actions - Stack buttons */
    .game-form-modal .modal-actions {
        flex-direction: column;
        gap: 8px;
        padding: 12px;
    }

    .game-form-modal .modal-actions .btn {
        width: 100%;
    }

    /* Setup Pi Buttons */
    #setupPiContainer {
        flex-direction: column !important;
    }

    #setupPiContainer .btn {
        width: 100%;
    }

    /* Stat Cards - Smaller text on mobile */
    .stat-card {
        padding: 16px;
    }

    .stat-card .stat-value {
        font-size: 24px;
    }

    .stat-card .stat-label {
        font-size: 11px;
    }

    /* Toggle Switch - Larger for touch */
    .toggle-switch {
        width: 56px;
        height: 30px;
    }

    .toggle-slider:before {
        width: 24px;
        height: 24px;
    }

    input:checked + .toggle-slider:before {
        transform: translateX(26px);
    }

    /* Form Rows - Stack on mobile */
    .game-form-modal .form-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    /* GPIO Bindings - Smaller on mobile */
    .game-form-modal .gpio-bindings {
        gap: 4px 8px;
    }

    .game-form-modal .gpio-input input {
        width: 45px !important;
    }

    /* Camera Section Inputs */
    .game-form-modal input[type="text"],
    .game-form-modal input[type="number"],
    .game-form-modal select {
        font-size: 14px;
        padding: 10px;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    /* Profile - Ultra compact */
    .profile-container {
        padding: 0;
    }

    .profile-card {
        padding: 10px 12px;
        border-radius: 0;
    }

    .profile-tabs {
        margin: 0 0 12px 0;
        gap: 2px;
    }

    .profile-tab {
        padding: 10px 4px;
        font-size: 12px;
        min-height: 44px;
    }

    /* Form inputs - Even slimmer */
    .profile-card .form-input,
    .profile-card input[type="text"],
    .profile-card input[type="email"] {
        padding: 7px 10px;
        font-size: 15px !important;
    }

    .profile-card .form-group {
        margin-bottom: 8px;
    }

    .profile-card .form-group label {
        font-size: 0.65rem;
    }

    /* Linked accounts - Ultra tight */
    .linked-account-item {
        padding: 6px 8px;
        gap: 6px;
    }

    .account-icon {
        width: 24px;
        height: 24px;
    }

    .account-icon svg {
        width: 14px;
        height: 14px;
    }

    .account-name {
        font-size: 0.75rem;
    }

    .account-status {
        font-size: 0.6rem;
    }

    .link-button {
        padding: 4px 8px;
        font-size: 0.65rem;
    }

    /* Avatar even smaller */
    .avatar-selector-container {
        transform: scale(0.75);
    }

    /* Address form - Ultra compact */
    #shippingForm input {
        padding: 7px 10px;
    }

    #shippingForm .submit-button {
        padding: 9px;
        font-size: 0.8rem;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .info-grid-compact {
        grid-template-columns: repeat(2, 1fr);
    }

    .stat-card .stat-value {
        font-size: 20px;
    }

    .control-features {
        padding-left: 16px;
    }

    .control-features li {
        font-size: 0.85rem;
    }

    /* Modal Header Row - Extra compact */
    .modal-header-row {
        padding: 10px !important;
        gap: 8px !important;
    }

    .modal-header-row .game-id-badge {
        font-size: 11px !important;
        padding: 4px 8px !important;
    }

    .modal-header-row .game-name-input {
        font-size: 14px !important;
        padding: 8px 10px !important;
    }

    .modal-header-row .status-select {
        font-size: 12px !important;
        padding: 6px 8px !important;
    }

    /* Smaller modal tabs */
    .modal-tab {
        padding: 8px 10px !important;
        font-size: 12px !important;
    }

    /* Form sections tighter */
    .game-form-modal .form-section {
        padding: 8px;
    }

    .game-form-modal .form-group label {
        font-size: 11px;
    }

    /* Smaller action buttons */
    .game-form-modal .modal-actions .btn {
        padding: 10px 16px;
        font-size: 14px;
    }
}

/* Linked Accounts Section */
.linked-accounts-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #e5e7eb;
}

.linked-accounts-section h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.linked-accounts-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 20px;
}

.linked-account-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    background: white;
    transition: all 0.2s ease;
}

.linked-account-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.account-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #f3f4f6;
}

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

.account-name {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-dark);
}

.account-status {
    font-size: 0.875rem;
    color: #666;
    font-weight: 500;
}

.link-button {
    flex-shrink: 0;
    padding: 8px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.link-button:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.link-button:disabled {
    background: #e5e7eb;
    color: #9ca3af;
    cursor: not-allowed;
}

.link-button.unlink {
    background: #ef4444;
}

.link-button.unlink:hover {
    background: #dc2626;
}


/* Avatar Component Styles */
.profile-avatar-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    position: relative;
}

.profile-avatar-container svg {
    display: block;
    border-radius: 50%;
    background: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.avatar-container svg {
    display: block;
}

/* Avatar Selector for Profile Page */
.avatar-selector-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.avatar-selector {
    display: flex;
    flex-direction: row;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.avatar-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    padding: 10px;
    border-radius: 12px;
    border: 2px solid transparent;
    background: var(--bg-light);
    transition: all 0.2s ease;
}

.avatar-option:hover {
    background: var(--bg-white);
    border-color: var(--border-color);
}

.avatar-option.selected {
    border-color: var(--primary-color);
    background: rgba(255, 107, 107, 0.1);
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.2);
}

.avatar-option input[type="radio"] {
    display: none;
}

.avatar-option-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.avatar-option-preview-wrapper {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-option-preview {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-option-preview svg {
    border-radius: 50%;
}

.avatar-option-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
}

.avatar-option.selected .avatar-option-label {
    color: var(--primary-color);
    font-weight: 600;
}

/* Responsive adjustments for avatar */
@media (max-width: 768px) {
    .player-info-section {
        flex-direction: column !important;
        align-items: center !important;
    }

    .profile-avatar-container {
        margin-top: 20px;
        order: -1; /* Show avatar first on mobile */
    }
}

/* ========================================
   Social Column Component
   ======================================== */

/* Wrapper that contains social column + main content */
.page-content-wrapper {
    display: flex;
    gap: 0; /* No gap, using percentages instead */
    width: 100%;
    flex: 1; /* Take up available space between header and footer */
    padding: 0; /* No vertical spacing - seamless with header */
    position: relative; /* For absolute positioning of social column */
    overflow: visible; /* Allow social column to extend above */
    z-index: 1; /* Below all fixed elements */
}

/* Social column - fixed positioned to stay in place while page scrolls */
.social-column {
    width: 20%; /* 20% of screen width */
    min-width: 200px; /* Lower minimum to allow scaling on smaller screens */
    max-width: 360px; /* Maximum width to prevent too wide */
    position: fixed; /* Fixed position to stay visible while scrolling */
    left: 0;
    top: var(--content-row-top); /* Flush with top of content row */
    bottom: var(--footer-height); /* Stop above footer */
    background: var(--bg-white);
    border-right: 2px solid var(--border-color);
    border-radius: 0; /* No border radius - flush with screen edge */
    box-shadow: 4px 0 12px rgba(255, 107, 107, 0.08);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* Align content to top */
    align-items: stretch;
    z-index: 100; /* Same level as header/footer - appears above player panel (99) */
    overflow-y: auto; /* Allow social column content to scroll if needed */
    overflow-x: hidden; /* Prevent horizontal overflow */
    box-sizing: border-box; /* Include padding in height calculation */
    padding: 0; /* No internal padding */
}

/* Collapsed state */
.social-column.collapsed {
    width: 32px; /* Just wide enough for the toggle button */
    min-width: 32px;
    max-width: 32px;
    border: none;
    box-shadow: none;
    overflow: visible; /* Keep toggle button visible */
    margin-left: 0; /* Flush against left edge of screen */
    margin-right: 0; /* Remove right margin when collapsed */
    background: transparent; /* Remove background when collapsed */
    padding: 0; /* Remove any padding */
}

/* Hide content when collapsed but keep toggle button */
.social-column.collapsed .social-column-content {
    opacity: 0;
    pointer-events: none;
    display: none; /* Completely hide when collapsed */
}

/* Don't adjust container margin when collapsed - keep content in same position */
/* This prevents layout shift when toggling the social column */

/* Container takes remaining space */
.page-content-wrapper .container {
    flex: 1; /* Takes remaining space */
    max-width: 100%;
    transition: all 0.3s ease;
    padding: 0 20px; /* Horizontal padding */
    position: relative;
    z-index: 2; /* Above page wrapper but below fixed elements */
    display: flex;
    flex-direction: column;
    margin-left: calc(20% + 20px); /* Push right of social column (20% width + 20px gap) */
}

/* When social column is collapsed, reduce container margin */
.social-column.collapsed ~ .container {
    margin-left: 52px; /* Just enough for collapsed column (32px) + gap */
}

/* Toggle Button - needs to be visible above all content */
.social-column-toggle {
    position: fixed;
    top: var(--content-row-top); /* Aligned with player panel and game title */
    width: 40px;
    height: var(--player-panel-height); /* Same height as player panel and game title */
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 2px 2px 8px rgba(255, 107, 107, 0.3);
    transition: left 0.3s ease, border-radius 0.3s ease;
    z-index: 101;
    pointer-events: all;
}

/* PANEL OPEN - Close button at right edge of social panel */
.social-column-toggle:not(.collapsed) {
    left: min(calc(20% - 2px), calc(360px - 2px)) !important;
    border-radius: 0 8px 8px 0;
}

/* PANEL CLOSED - Open button at left edge of screen */
.social-column-toggle.collapsed {
    left: 0 !important;
    border-radius: 0 8px 8px 0;
}

.social-column-toggle:hover {
    background: linear-gradient(135deg, var(--primary-hover) 0%, var(--primary-color) 100%);
    box-shadow: 2px 2px 12px rgba(255, 107, 107, 0.4);
}

.social-column-toggle:active {
    box-shadow: 0 0 20px rgba(255, 107, 107, 0.8), 0 0 40px rgba(255, 107, 107, 0.4);
}

/* Column Content */
.social-column-content {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    height: 100%;
    overflow: hidden;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    width: 100%;
}

/* Tab Navigation */
.social-column-tabs {
    display: flex;
    background: linear-gradient(135deg, #fff5f5 0%, #ffffff 100%);
    border-bottom: 2px solid var(--border-color);
    padding: 8px;
    margin: 0;
    gap: 4px;
    flex-shrink: 0;
    box-sizing: border-box;
    width: 100%;
}

.social-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 8px;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-muted);
    font-family: 'Nunito', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.social-tab:hover {
    background: rgba(255, 107, 107, 0.08);
    color: var(--primary-color);
}

.social-tab.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
}

.social-tab svg {
    flex-shrink: 0;
}

.social-tab span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Hide tab text on narrower social columns, show only icons */
@media (max-width: 1200px) {
    .social-column:not(.collapsed) .social-tab span {
        display: none;
    }

    .social-column:not(.collapsed) .social-tab {
        padding: 12px;
    }

    .social-tab-content {
        padding: 12px;
    }

    .tab-placeholder,
    .tab-login-prompt {
        padding: 20px 12px;
    }

    /* Responsive chat input */
    .chat-input-area {
        padding: 8px;
        gap: 6px;
    }

    .chat-input {
        padding: 8px 10px;
        font-size: 0.85rem;
    }

    .chat-emoji-btn {
        width: 32px;
        height: 32px;
    }

    .chat-send-btn {
        width: 36px;
        height: 36px;
    }

    /* Responsive activity feed */
    .activity-feed {
        padding: 12px;
        gap: 8px;
    }

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

/* Tab Content Area */
.social-column-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
}

.social-tab-content {
    display: none;
    height: 100%;
    padding: 20px;
    box-sizing: border-box;
    overflow-x: hidden;
    word-wrap: break-word;
}

.social-tab-content.active {
    display: block;
}

/* Activity tab needs flex layout for scrollable feed */
.social-tab-content#activityTab.active {
    display: flex;
    flex-direction: column;
    padding: 0; /* Activity feed has its own padding */
}

/* Placeholder Content */
.tab-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: var(--text-muted);
    padding: 40px 20px;
}

.tab-placeholder svg {
    opacity: 0.3;
    margin-bottom: 20px;
}

/* Login Prompt for Tabs */
.tab-login-prompt {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    padding: 40px 20px;
    gap: 16px;
}

.tab-login-prompt svg {
    color: var(--primary-color);
    opacity: 0.5;
    margin-bottom: 8px;
}

.tab-login-prompt h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.tab-login-prompt p {
    color: var(--text-muted);
    margin: 0;
    max-width: 280px;
    line-height: 1.5;
}

.tab-login-prompt .btn {
    margin-top: 8px;
}

.tab-placeholder h3 {
    font-size: 1.25rem;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.tab-placeholder p {
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Chat Styles */
.social-tab-content#chatTab {
    padding: 0;
}

.social-tab-content#chatTab.active {
    display: flex;
    flex-direction: column;
}

/* Chat Sub-tabs */
/* Chat Messages Container */
.chat-messages-container {
    flex: 1;
    position: relative;
    overflow: hidden;
}

/* Chat Messages Area */
.chat-messages {
    display: none;
    flex-direction: column;
    gap: 12px;
    height: 100%;
    overflow-y: auto;
    padding: 16px;
}

.chat-messages.active {
    display: flex;
}

/* Glass Bubble Scrollbar for Chat, Activity, and Leaderboard */
.chat-messages::-webkit-scrollbar,
.activity-feed::-webkit-scrollbar,
.leaderboard-container::-webkit-scrollbar {
    width: 12px;
}

.chat-messages::-webkit-scrollbar-track,
.activity-feed::-webkit-scrollbar-track,
.leaderboard-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    margin: 4px;
}

.chat-messages::-webkit-scrollbar-thumb,
.activity-feed::-webkit-scrollbar-thumb,
.leaderboard-container::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg,
        rgba(255, 107, 107, 0.6) 0%,
        rgba(255, 135, 135, 0.8) 50%,
        rgba(255, 107, 107, 0.6) 100%);
    border-radius: 10px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    box-shadow:
        inset 0 1px 3px rgba(255, 255, 255, 0.8),
        0 2px 8px rgba(255, 107, 107, 0.4);
    backdrop-filter: blur(10px);
}

.chat-messages::-webkit-scrollbar-thumb:hover,
.activity-feed::-webkit-scrollbar-thumb:hover,
.leaderboard-container::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg,
        rgba(255, 107, 107, 0.8) 0%,
        rgba(255, 135, 135, 1) 50%,
        rgba(255, 107, 107, 0.8) 100%);
    box-shadow:
        inset 0 1px 3px rgba(255, 255, 255, 0.9),
        0 3px 12px rgba(255, 107, 107, 0.6);
}

.chat-message {
    display: flex;
    flex-direction: row;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    align-items: flex-start;
    margin-bottom: 8px;
}

/* Other users' messages - left aligned with light pink background */
.chat-message-other-user {
    background: rgba(255, 182, 193, 0.15); /* Light pink */
    border-left: 3px solid #ff6b6b; /* Pink/red border */
    margin-right: 20%; /* Leave space on right to show stagger */
}

/* Current user's messages - right aligned with light orange background */
.chat-message-current-user {
    background: rgba(255, 165, 0, 0.12); /* Light orange */
    border-right: 3px solid #ffa94d; /* Orange border */
    border-left: none;
    flex-direction: row-reverse; /* Avatar on right side */
    margin-left: 20%; /* Leave space on left to show stagger */
    margin-right: 0;
}

/* Right-align text content for current user messages */
.chat-message-current-user .chat-message-content {
    text-align: right;
}

.chat-message-current-user .chat-message-header {
    flex-direction: row-reverse; /* Swap username and timestamp */
}

.chat-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--primary-color);
    background: var(--bg-white);
}

.chat-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chat-avatar svg {
    width: 100%;
    height: 100%;
}

.chat-avatar-placeholder {
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.3), rgba(255, 135, 135, 0.5));
}

.chat-message-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

.chat-message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.chat-username {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--primary-color);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}

.chat-timestamp {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

.chat-message-text {
    font-size: 0.9rem;
    color: var(--text-dark);
    word-wrap: break-word;
    line-height: 1.4;
}

/* Chat Input Wrapper */
.chat-input-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0;
    border-top: 2px solid var(--border-color);
    position: relative;
    box-sizing: border-box;
    width: 100%;
    flex-shrink: 0;
}

/* Chat Input Area */
.chat-input-area {
    display: flex;
    gap: 8px;
    padding: 12px;
    background: linear-gradient(135deg, #ffffff 0%, #fff5f5 100%);
    align-items: center;
    box-sizing: border-box;
    width: 100%;
    min-width: 0; /* Allow flex children to shrink below content size */
}

.chat-emoji-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.chat-emoji-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(255, 107, 107, 0.05);
}

.chat-input {
    flex: 1;
    min-width: 0; /* Allow input to shrink below content size */
    padding: 10px 14px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-family: 'Nunito', sans-serif;
    font-size: 0.9rem;
    color: var(--text-dark);
    background: white;
    transition: all 0.2s ease;
    box-sizing: border-box;
    width: 100%;
}

.chat-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.1);
}

.chat-input::placeholder {
    color: var(--text-muted);
}

.chat-send-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    color: white;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.chat-send-btn:hover {
    background: linear-gradient(135deg, var(--primary-hover) 0%, var(--primary-color) 100%);
    transform: scale(1.05);
}

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

/* Channel Switches */
.chat-channel-switches {
    display: flex;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(255, 107, 107, 0.03);
    border-top: 1px solid var(--border-color);
}

.chat-channel-switch {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
}

.chat-channel-switch:hover {
    border-color: var(--primary-color);
    background: rgba(255, 107, 107, 0.05);
}

.chat-channel-switch.active {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.1) 0%, rgba(255, 135, 135, 0.08) 100%);
    color: var(--primary-color);
}

.switch-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    background: white;
    transition: all 0.2s ease;
}

.chat-channel-switch.active .switch-indicator {
    border-color: var(--primary-color);
    background: var(--primary-color);
    box-shadow: 0 0 8px rgba(255, 107, 107, 0.5);
}

.switch-label {
    flex: 1;
    text-align: left;
}

/* Emoji Picker */
.emoji-picker {
    position: fixed !important;
    bottom: auto;
    left: auto;
    width: 280px;
    max-height: 240px;
    background: white;
    border: 2px solid var(--primary-color);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 107, 107, 0.1);
    overflow: visible;
    z-index: 9999 !important;
    pointer-events: auto;
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 4px;
    padding: 8px;
    max-height: 240px;
    overflow-y: auto;
}

.emoji-item {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.2s ease;
}

.emoji-item:hover {
    background: rgba(255, 107, 107, 0.1);
    transform: scale(1.2);
}

/* Emoji Grid Scrollbar */
.emoji-grid::-webkit-scrollbar {
    width: 8px;
}

.emoji-grid::-webkit-scrollbar-track {
    background: rgba(255, 107, 107, 0.05);
    border-radius: 4px;
}

.emoji-grid::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

.emoji-grid::-webkit-scrollbar-thumb:hover {
    background: var(--primary-hover);
}

/* Activity Feed Styles */
.activity-feed {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    height: 100%;
    box-sizing: border-box;
}

.activity-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    transition: all 0.2s ease;
    align-items: center;
}

/* Other users' activities - left aligned with light pink background */
.activity-item-other-user {
    background: rgba(255, 182, 193, 0.15);
    border-left: 3px solid #ff6b6b;
    margin-right: 15%;
}

.activity-item-other-user:hover {
    background: rgba(255, 182, 193, 0.25);
    transform: translateX(2px);
}

/* Current user's activities - right aligned with light orange background */
.activity-item-current-user {
    flex-direction: row-reverse;
    background: rgba(255, 165, 0, 0.12);
    border-right: 3px solid #ffa94d;
    border-left: none;
    margin-left: 15%;
}

.activity-item-current-user:hover {
    background: rgba(255, 165, 0, 0.2);
    transform: translateX(-2px);
}

.activity-item-current-user .activity-content {
    text-align: right;
}

.activity-item-current-user .activity-text {
    color: #e67700;
    font-weight: 500;
}

.activity-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--primary-color);
    background: var(--bg-white);
}

.activity-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.activity-avatar svg {
    width: 100%;
    height: 100%;
}

.activity-avatar-placeholder {
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.3), rgba(255, 135, 135, 0.5));
}

.activity-icon {
    width: 32px;
    height: 32px;
    min-width: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 8px;
    color: white;
}

.activity-icon svg {
    width: 18px;
    height: 18px;
}

.activity-icon.clickable {
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.activity-icon.clickable:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.activity-icon.clickable:active {
    transform: scale(0.95);
}

.activity-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.activity-text {
    font-size: 0.9rem;
    color: var(--text-dark);
    line-height: 1.4;
}

.activity-timestamp {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Leaderboard Styles */
.leaderboard-container {
    padding: 0px 16px 16px 16px;
    overflow-y: auto;
}

.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Entry row: Rank + Card */
.leaderboard-entry {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Rank outside the card */
.leaderboard-rank {
    width: 28px;
    min-width: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rank-number {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-muted);
}

/* Player card */
.leaderboard-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 12px;
    background: rgba(255, 107, 107, 0.04);
    border-radius: 8px;
    border-left: 3px solid var(--primary-color);
    transition: all 0.2s ease;
    min-width: 0;
}

.leaderboard-card:hover {
    background: rgba(255, 107, 107, 0.08);
    transform: translateX(2px);
}

.leaderboard-card.rank-1 {
    border-left-color: #FFD700;
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.1) 0%, rgba(255, 107, 107, 0.04) 100%);
}

.leaderboard-card.rank-2 {
    border-left-color: #C0C0C0;
    background: linear-gradient(90deg, rgba(192, 192, 192, 0.1) 0%, rgba(255, 107, 107, 0.04) 100%);
}

.leaderboard-card.rank-3 {
    border-left-color: #CD7F32;
    background: linear-gradient(90deg, rgba(205, 127, 50, 0.1) 0%, rgba(255, 107, 107, 0.04) 100%);
}

/* Row 1: Avatar, Name */
.leaderboard-row-top {
    display: flex;
    align-items: center;
    gap: 10px;
}

.leaderboard-row-top .player-name {
    flex: 1;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Row 2: Stats */
.leaderboard-row-bottom {
    display: flex;
    align-items: center;
    gap: 6px;
    padding-left: 42px; /* Align with name (32px avatar + 10px gap) */
    font-size: 0.85rem;
}

.leaderboard-row-bottom .stat-value {
    font-weight: 700;
    color: var(--primary-color);
}

.leaderboard-row-bottom .stat-label {
    color: var(--text-muted);
}

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

.player-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-dark);
}

.player-stats {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.stat-label {
    font-weight: 500;
}

.stat-value {
    color: var(--primary-color);
    font-weight: 600;
}

.stat-separator {
    color: var(--border-color);
}

.leaderboard-score {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
    min-width: 60px;
    text-align: right;
}

/* Leaderboard Sub-tabs */
.leaderboard-subtabs {
    display: flex;
    gap: 4px;
    padding: 0 0 12px 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 12px;
}

.leaderboard-subtab {
    flex: 1;
    padding: 8px 12px;
    border: none;
    background: rgba(255, 107, 107, 0.08);
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.leaderboard-subtab:hover {
    background: rgba(255, 107, 107, 0.15);
    color: var(--text-dark);
}

.leaderboard-subtab.active {
    background: var(--primary-color);
    color: white;
}

/* Leaderboard Category Toggle */
.leaderboard-category-toggle {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.category-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    background: transparent;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.category-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.category-btn.active {
    background: rgba(255, 107, 107, 0.1);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.category-btn svg {
    opacity: 0.7;
}

.category-btn.active svg {
    opacity: 1;
}

/* Leaderboard Mode Indicator */
.leaderboard-mode-indicator {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    margin-bottom: 12px;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15) 0%, rgba(255, 183, 77, 0.15) 100%);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #DAA520;
}

.leaderboard-mode-indicator.happy-mode {
    display: flex;
}

.leaderboard-mode-indicator svg {
    stroke: #DAA520;
}

/* Updated Leaderboard Item with Avatar */
.leaderboard-player {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
}

.player-avatar {
    flex-shrink: 0;
}

.player-avatar .avatar-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    color: white;
}

.player-avatar .avatar-img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 107, 107, 0.3);
}

.player-avatar .avatar-generated {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
}

.player-avatar .avatar-generated svg {
    width: 100%;
    height: 100%;
}

.player-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.player-info .player-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-info .player-stats {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
}

.player-info .stat-value {
    color: var(--primary-color);
    font-weight: 700;
}

.player-info .stat-label {
    color: var(--text-muted);
    font-weight: 400;
}

/* Leaderboard Loading State */
.leaderboard-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    gap: 12px;
    color: var(--text-muted);
}

.leaderboard-loading .loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(255, 107, 107, 0.2);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Leaderboard Empty State */
.leaderboard-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    color: var(--text-muted);
}

.leaderboard-empty svg {
    opacity: 0.4;
    margin-bottom: 12px;
}

.leaderboard-empty p {
    margin: 0;
    font-size: 0.9rem;
}

.leaderboard-empty-hint {
    font-size: 0.8rem;
    margin-top: 4px;
    opacity: 0.7;
}

/* Leaderboard Error State */
.leaderboard-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    color: var(--text-muted);
}

.leaderboard-error svg {
    opacity: 0.5;
    margin-bottom: 12px;
    stroke: var(--text-muted);
}

.leaderboard-error p {
    margin: 0 0 16px 0;
    font-size: 0.9rem;
}

.leaderboard-error .btn-small {
    padding: 6px 16px;
    font-size: 0.8rem;
}

/* Scrollbar Styling */
.social-column-body::-webkit-scrollbar {
    width: 12px;
}

.social-column-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    margin: 4px;
}

.social-column-body::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg,
        rgba(255, 107, 107, 0.6) 0%,
        rgba(255, 135, 135, 0.8) 50%,
        rgba(255, 107, 107, 0.6) 100%);
    border-radius: 10px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    box-shadow:
        inset 0 1px 3px rgba(255, 255, 255, 0.8),
        0 2px 8px rgba(255, 107, 107, 0.4);
    backdrop-filter: blur(10px);
}

.social-column-body::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg,
        rgba(255, 107, 107, 0.8) 0%,
        rgba(255, 135, 135, 1) 50%,
        rgba(255, 107, 107, 0.8) 100%);
    box-shadow:
        inset 0 1px 3px rgba(255, 255, 255, 0.9),
        0 3px 12px rgba(255, 107, 107, 0.6);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .page-content-wrapper {
        padding: 10px 0; /* Reduce vertical padding on mobile */
    }

    .social-column {
        width: 30%; /* Increase to 30% on tablets */
        min-width: 240px;
        max-width: 300px;
        margin-left: 10px; /* Reduce left margin on mobile */
        margin-right: 10px;
    }

    .page-content-wrapper .container {
        padding: 0 10px; /* Reduce padding on mobile */
    }

    .social-tab span {
        display: none; /* Hide text, show only icons on mobile */
    }

    .social-tab {
        padding: 12px;
    }
}

@media (max-width: 480px) {
    .page-content-wrapper {
        flex-direction: column; /* Stack vertically on small screens */
        padding: 5px 0;
    }

    .social-column {
        width: 100%;
        min-width: 100%;
        max-width: 100%;
        margin-left: 0;
        margin-right: 0;
        border-right: none;
        border-radius: 8px;
    }

    .page-content-wrapper .container {
        padding: 0 10px;
    }

    .social-column-toggle {
        right: -36px;
        width: 36px;
        height: 36px;
    }
}

/* ==========================================
   Video Recording Styles
   ========================================== */

.play-video-section {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.watch-video-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(255, 107, 107, 0.3);
}

.watch-video-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.4);
}

.watch-video-btn:active {
    transform: translateY(0);
}

.watch-video-btn svg {
    flex-shrink: 0;
}

.video-expires {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.video-processing {
    color: #f0ad4e;
    font-size: 0.8rem;
    font-style: italic;
}

.video-expired {
    color: var(--text-muted);
    font-size: 0.8rem;
    font-style: italic;
}

.video-failed {
    color: #dc3545;
    font-size: 0.8rem;
    font-style: italic;
}

/* Video Modal */
.video-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.video-modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    animation: scaleIn 0.2s ease;
}

@keyframes scaleIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.video-modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: white;
    font-size: 32px;
    cursor: pointer;
    padding: 5px 10px;
    transition: color 0.2s ease;
}

.video-modal-close:hover {
    color: var(--primary-color);
}

.video-modal video {
    max-width: 100%;
    max-height: 80vh;
    aspect-ratio: 4 / 3;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    background: #000;
}

/* Mobile adjustments for video modal */
@media (max-width: 768px) {
    .video-modal-content {
        max-width: 95%;
    }

    .video-modal-close {
        top: -35px;
        font-size: 28px;
    }

    .video-modal video {
        max-height: 70vh;
        aspect-ratio: 4 / 3;
    }

    .play-video-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

/* News Page Styles */
.news-section {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
}

.news-article {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    scroll-margin-top: 100px;
}

.news-header {
    height: 250px;
    display: flex;
    justify-content: flex-end;
    align-items: flex-start;
    padding: 16px;
    position: relative;
    color: white;
}

.news-title {
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.news-date {
    font-size: 0.85rem;
    font-weight: 600;
    background: rgba(0, 0, 0, 0.5);
    padding: 6px 12px;
    border-radius: 6px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.news-body-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-top: 0;
    margin-bottom: 12px;
}

.news-body {
    padding: 24px;
    color: var(--text-dark);
    line-height: 1.6;
}

.news-body h3 {
    font-size: 1.4rem;
    color: var(--primary-color);
    margin-top: 0;
    margin-bottom: 12px;
}

.news-body h4 {
    font-size: 1.1rem;
    color: var(--text-dark);
    margin-top: 10px;
    margin-bottom: 10px;
}

.news-body p {
    margin-bottom: 12px;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.news-body ul {
    margin: 12px 0;
    padding-left: 24px;
}

.news-body ul li {
    margin-bottom: 6px;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.news-image {
    width: 100%;
    max-width: 800px;
    height: auto;
    border-radius: 12px;
    margin: 30px 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* ========================================
   MOBILE TOUCH TARGET OPTIMIZATION
   Minimum 52-56px touch targets for all
   interactive elements on mobile
   ======================================== */

@media (max-width: 768px) {
    /* Primary action buttons - 56px minimum */
    .play-button,
    .start-button,
    .submit-button {
        min-height: 56px;
        padding: 16px 24px;
    }

    /* Game control buttons - critical for gameplay */
    .control-button {
        min-height: 52px;
        min-width: 52px;
        padding: 14px 16px;
    }

    /* D-pad layout - larger touch targets */
    .control-layout-dpad {
        max-width: 220px;
        gap: 10px;
    }

    .control-layout-dpad .control-button {
        min-height: 56px;
        min-width: 56px;
    }

    /* Joystick layout - larger touch targets */
    .control-layout-joystick {
        max-width: 260px;
        gap: 10px;
    }

    .control-layout-joystick .control-button {
        min-height: 56px;
        min-width: 56px;
    }

    /* Link buttons (profile page) */
    .link-button {
        min-height: 48px;
        padding: 12px 20px;
    }

    /* Shop tabs - easier to tap */
    .shop-tab {
        min-height: 48px;
        padding: 12px 16px;
    }

    /* Profile tabs */
    .profile-tab {
        min-height: 48px;
        padding: 12px 16px;
    }

    /* Social auth buttons */
    .social-auth-btn {
        min-height: 52px;
        padding: 14px 24px;
    }

    /* Modal close button */
    .modal-close {
        min-width: 48px;
        min-height: 48px;
    }

    /* Camera toggle button */
    .camera-toggle-btn {
        min-width: 48px;
        min-height: 48px;
    }

    /* Form inputs - larger for touch */
    .form-input,
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    select,
    textarea {
        min-height: 48px;
        padding: 12px 16px;
        font-size: 16px; /* Prevents iOS zoom on focus */
    }

    /* Package/Prize purchase buttons */
    .package-button,
    .prize-button,
    .redeem-button {
        min-height: 52px;
        padding: 14px 20px;
    }

    /* Cart buttons */
    .cart-btn,
    .checkout-button {
        min-height: 52px;
    }

    /* Navigation links in menus */
    .user-menu-dropdown a,
    .user-menu-dropdown button {
        min-height: 48px;
        padding: 12px 16px;
    }

    /* Social column tab buttons */
    .social-tab-btn {
        min-height: 44px;
        padding: 10px 12px;
    }

    /* Quantity controls */
    .quantity-btn {
        min-width: 44px;
        min-height: 44px;
    }

    /* Close buttons (generic) */
    .close-btn,
    .close-button,
    [class*="close"] {
        min-width: 44px;
        min-height: 44px;
    }

    /* Icon buttons */
    .icon-btn,
    .icon-button {
        min-width: 44px;
        min-height: 44px;
    }
}

/* ========================================
   MOBILE TOUCH ACTION OPTIMIZATION
   Eliminates 300ms tap delay & prevents
   accidental zoom on double-tap
   ======================================== */

@media (max-width: 768px) {
    /* ==========================================
       MOBILE TOUCH UX - Prevent text selection on UI elements
       NOTE: Game/admin control buttons are excluded - they have their own handling
       ========================================== */

    /* UI buttons only - NOT game controls */
    .play-button,
    .start-button,
    .submit-button,
    .link-button,
    .shop-tab,
    .profile-tab,
    .package-button,
    .prize-button,
    .redeem-button,
    .cart-btn,
    .checkout-button,
    .user-menu-button,
    .user-menu-dropdown a,
    .user-menu-dropdown button,
    .login-button,
    .social-tab-btn,
    .social-auth-btn,
    .modal-close,
    .close-btn,
    .close-button,
    .camera-toggle-btn,
    .quantity-btn,
    .nav-link,
    .footer-nav a,
    .banner-card {
        -webkit-tap-highlight-color: rgba(255, 107, 107, 0.15);
        -webkit-user-select: none;
        user-select: none;
    }

    /* Tabs - No text selection */
    .shop-tabs,
    .profile-tabs,
    .social-tabs,
    .modal-tabs {
        -webkit-user-select: none;
        user-select: none;
    }

    /* Cards - Prevent accidental selection */
    .package-card,
    .prize-card,
    .game-card,
    .stat-card,
    .linked-account-item {
        -webkit-user-select: none;
        user-select: none;
    }

    /* Navigation elements */
    nav,
    .player-panel,
    .player-panel-content,
    header,
    footer,
    .footer-nav {
        -webkit-user-select: none;
        user-select: none;
    }

    /* Allow text selection in form inputs and text content */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="tel"],
    textarea,
    .form-input,
    p,
    .tab-content p,
    .form-hint,
    .error-message,
    .success-message {
        -webkit-user-select: text;
        user-select: text;
    }
}
