/**
 * Quantum Brain Strategy v2.7.1 - Enhanced Widget Stylesheet
 * Modern cohesive design with display normalization
 */

/* === CSS VARIABLES - DESIGN SYSTEM === */
:root {
  /* Core palette */
  --bg-deep: #24223a;
  --bg-panel: #2f2c4a;
  --bg-card: #3a3660;

  /* Accents */
  --accent-primary: #1abc9c; /* teal */
  --accent-danger: #e15b5b;  /* AI */
  --accent-gold: #f2c94c;

  /* Text */
  --text-primary: #f1f2f6;
  --text-secondary: #b8b9d0;

  /* Effects */
  --radius-lg: 14px;
  --radius-md: 10px;
  --shadow-card: 0 8px 20px rgba(0,0,0,0.35);
}

/* === CSS RESET & NORMALIZATION === */
/* Ensures consistent rendering across all browsers and systems */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    font-size: 16px;
    line-height: 1.5;
}

body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    overflow: hidden;
}

/* Normalize form elements */
button, input, select, textarea {
    font-family: inherit;
    font-size: 100%;
    line-height: 1.15;
    margin: 0;
}

button, select {
    text-transform: none;
}

button, [type="button"], [type="reset"], [type="submit"] {
    -webkit-appearance: button;
    cursor: pointer;
}

button::-moz-focus-inner,
[type="button"]::-moz-focus-inner,
[type="reset"]::-moz-focus-inner,
[type="submit"]::-moz-focus-inner {
    border-style: none;
    padding: 0;
}

/* Normalize canvas */
canvas {
    display: block;
    max-width: 100%;
}

/* Remove default list styles */
ul, ol {
    list-style: none;
}

/* Normalize links */
a {
    background-color: transparent;
    text-decoration: none;
    color: inherit;
}

/* Normalize images */
img {
    border-style: none;
    max-width: 100%;
    height: auto;
}

/* === AI FUEL GAUGES (Integrated in Scoreboard) === */
/* LAYER 3: Interactive cards - highest elevation with left accent strip */
.fuel-gauge {
    background: #47426a;
    border-radius: 8px;
    padding: 12px 14px;
    border: none;
    border-left: 4px solid #FF5722;
    margin-bottom: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

.fuel-gauge:last-child {
    margin-bottom: 0;
}

.fuel-gauge:hover {
    background: #4f4775;
    transform: translateX(2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.3);
}

.fuel-gauge-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.fuel-icon {
    font-size: 1.3rem;
    min-width: 24px;
}

.fuel-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 0 10px rgba(255, 87, 34, 0.6);
}

.fuel-bar-container {
    width: 100%;
    height: 16px;
    background: #2b2f45;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 8px;
    border: none;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.fuel-bar {
    height: 100%;
    background: #FF5722;
    border-radius: 8px;
    transition: width 0.5s ease, box-shadow 0.3s ease;
    box-shadow: none;
    position: relative;
}

.fuel-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.2) 0%, transparent 100%);
    border-radius: 8px 8px 0 0;
}

/* Glow only at higher fill levels (80%+) */
.fuel-bar[style*="width: 100%"],
.fuel-bar[style*="width: 9"],
.fuel-bar[style*="width: 8"] {
    box-shadow: 0 0 8px rgba(255, 87, 34, 0.6);
}

.fuel-count {
    text-align: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 0 8px rgba(255, 87, 34, 0.4);
}

.fuel-count span {
    color: #FF5722;
    font-weight: 700;
    font-size: 1rem;
}


/* === SPLASH SCREEN === */
.splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0a1628;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    animation: fadeOut 0.5s ease-out 5.5s forwards;
}

.splash-screen img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
        visibility: hidden;
    }
}

/* === GLOBAL STYLES === */
body {
    margin: 0;
    padding: 10px;
    /* System font stack for maximum compatibility */
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', Arial, sans-serif;
    background: #0a0e27;
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
    position: relative;
}

/* === REALISTIC NEURAL NETWORK BACKGROUND === */

/* Base layer - Deep brain tissue texture */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(ellipse at 15% 25%, rgba(75, 0, 130, 0.4) 0%, transparent 40%),
        radial-gradient(ellipse at 85% 75%, rgba(138, 43, 226, 0.35) 0%, transparent 45%),
        radial-gradient(ellipse at 50% 10%, rgba(72, 61, 139, 0.3) 0%, transparent 35%),
        radial-gradient(ellipse at 25% 80%, rgba(106, 90, 205, 0.25) 0%, transparent 40%),
        radial-gradient(ellipse at 70% 35%, rgba(123, 104, 238, 0.2) 0%, transparent 50%);
    z-index: -3;
    animation: brainPulse 6s ease-in-out infinite;
}

/* Neural connections layer - Synaptic network */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        /* Neurons - larger nodes */
        radial-gradient(circle at 15% 20%, rgba(147, 112, 219, 0.4) 2px, transparent 3px),
        radial-gradient(circle at 85% 15%, rgba(138, 43, 226, 0.35) 2px, transparent 3px),
        radial-gradient(circle at 25% 65%, rgba(123, 104, 238, 0.4) 2px, transparent 3px),
        radial-gradient(circle at 70% 45%, rgba(106, 90, 205, 0.35) 2px, transparent 3px),
        radial-gradient(circle at 45% 85%, rgba(147, 112, 219, 0.3) 2px, transparent 3px),
        radial-gradient(circle at 90% 70%, rgba(138, 43, 226, 0.4) 2px, transparent 3px),
        radial-gradient(circle at 10% 50%, rgba(123, 104, 238, 0.35) 2px, transparent 3px),
        radial-gradient(circle at 60% 10%, rgba(106, 90, 205, 0.3) 2px, transparent 3px),
        /* Synapses - smaller connections */
        radial-gradient(circle at 35% 30%, rgba(186, 85, 211, 0.15) 1px, transparent 1.5px),
        radial-gradient(circle at 65% 60%, rgba(147, 112, 219, 0.15) 1px, transparent 1.5px),
        radial-gradient(circle at 50% 40%, rgba(138, 43, 226, 0.15) 1px, transparent 1.5px),
        radial-gradient(circle at 20% 75%, rgba(123, 104, 238, 0.15) 1px, transparent 1.5px),
        radial-gradient(circle at 80% 35%, rgba(106, 90, 205, 0.15) 1px, transparent 1.5px),
        radial-gradient(circle at 40% 55%, rgba(147, 112, 219, 0.15) 1px, transparent 1.5px);
    background-size: 
        100% 100%, 100% 100%, 100% 100%, 100% 100%, 100% 100%, 100% 100%, 100% 100%, 100% 100%,
        300px 300px, 350px 350px, 280px 280px, 320px 320px, 290px 290px, 310px 310px;
    background-position: 
        0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0,
        0 0, 50px 80px, 100px 40px, 150px 120px, 200px 60px, 250px 100px;
    z-index: -2;
    opacity: 0.8;
    animation: synapticActivity 15s linear infinite;
}

/* Additional texture layer for depth */
.game-container::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        linear-gradient(135deg, rgba(25, 25, 112, 0.05) 0%, transparent 100%),
        linear-gradient(225deg, rgba(72, 61, 139, 0.05) 0%, transparent 100%);
    z-index: -1;
    pointer-events: none;
}

/* Realistic neural network animations */
@keyframes brainPulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    25% {
        opacity: 0.85;
        transform: scale(1.02);
    }
    50% {
        opacity: 0.9;
        transform: scale(1);
    }
    75% {
        opacity: 0.95;
        transform: scale(1.01);
    }
}

@keyframes synapticActivity {
    0% {
        transform: translate(0, 0) rotate(0deg);
        opacity: 0.8;
    }
    25% {
        opacity: 0.9;
    }
    50% {
        transform: translate(-15px, -15px) rotate(0.5deg);
        opacity: 0.85;
    }
    75% {
        opacity: 0.95;
    }
    100% {
        transform: translate(0, 0) rotate(0deg);
        opacity: 0.8;
    }
}

/* Glowing effect for neural activity */
@keyframes neuralGlow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(138, 43, 226, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(138, 43, 226, 0.5);
    }
}

h1 {
    margin: 10px 0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    text-align: center;
    font-size: clamp(1.2rem, 3vw, 2rem);
}

/* === GAME LAYOUT === */
.game-container {
    position: relative;
    display: flex;
    gap: 15px;
    align-items: flex-start;
    justify-content: center;
    width: 100%;
    height: calc(100vh - 80px);
    max-width: 100vw;
}

/* When the multiplayer top bar is visible, push the board down so it isn't hidden under it */
.game-container.mp-bar-visible {
    padding-top: 50px;
    height: calc(100vh - 80px - 50px);
}

/* === RIGHT SIDEBAR === */
/* LAYER 1: Deep space purple background (matching left sidebar) */
.right-sidebar-container {
    background: #2a2640;
    border-radius: 12px;
    backdrop-filter: blur(20px);
    width: 320px;
    max-height: 90vh;
    flex-shrink: 0;
    border: 1px solid rgba(255,255,255,0.15);
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.3s ease;
}

.right-sidebar-container.collapsed {
    width: 60px;
    position: relative;
}

/* Add a visible expand button when collapsed */
.right-sidebar-container.collapsed::before {
    content: "◀";
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: transparent;
    color: white;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    z-index: 100;
    transition: all 0.3s ease;
}

.right-sidebar-container.collapsed::before:hover {
    background: rgba(255,255,255,0.2);
    transform: translateX(-50%) scale(1.1);
}

.right-sidebar-container.collapsed .notifications-content {
    opacity: 0;
    pointer-events: none;
}

.right-sidebar-container.collapsed .notifications-title {
    opacity: 0;
    pointer-events: none;
}

/* Ensure toggle button remains visible and clickable when collapsed */
.right-sidebar-container.collapsed .notifications-toggle {
    opacity: 1 !important;
    pointer-events: auto !important;
    position: relative;
    z-index: 10;
}

/* Ensure the notifications header remains clickable when collapsed */
.right-sidebar-container.collapsed .notifications-header {
    pointer-events: auto !important;
}

/* === NOTIFICATIONS WIDGET === */
.notifications-widget {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.notifications-header {
    background: rgba(255,255,255,0.15);
    padding: 16px;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: space-between;
}

.notifications-toggle {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    min-width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notifications-toggle:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.05);
}

.notifications-toggle-icon {
    transition: transform 0.3s ease;
}

.right-sidebar-container.collapsed .notifications-toggle-icon {
    transform: rotate(180deg);
}

.notifications-icon {
    font-size: 1.3rem;
    min-width: 24px;
}

.notifications-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.notifications-content {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.notification-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    opacity: 0.5;
}

.placeholder-icon {
    font-size: 3rem;
    margin-bottom: 12px;
}

.placeholder-text {
    font-size: 0.95rem;
    color: rgba(255,255,255,0.8);
}

/* Notification Item Styles */
.notification-item {
    background: rgba(255,255,255,0.08);
    border-left: 4px solid;
    border-radius: 8px;
    padding: 12px;
    animation: slideInRight 0.3s ease-out;
    transition: all 0.3s ease;
}

.notification-item:hover {
    background: rgba(255,255,255,0.12);
    transform: translateX(-2px);
}

.notification-item.win {
    border-color: #4CAF50;
    background: rgba(76, 175, 80, 0.15);
}

.notification-item.lose {
    border-color: #f44336;
    background: rgba(244, 67, 54, 0.15);
}

.notification-item.capture {
    border-color: #2196F3;
    background: rgba(33, 150, 243, 0.15);
}

.notification-item.special {
    border-color: #FF9800;
    background: rgba(255, 152, 0, 0.15);
}

.notification-item.info {
    border-color: #2196F3;
    background: rgba(33, 150, 243, 0.15);
}

.notification-item.success {
    border-color: #4CAF50;
    background: rgba(76, 175, 80, 0.15);
}

.notification-item.warning {
    border-color: #FF9800;
    background: rgba(255, 152, 0, 0.15);
}

.notification-item.error {
    border-color: #f44336;
    background: rgba(244, 67, 54, 0.15);
}

.notification-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.notification-type {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    color: #fff;
}

.notification-icon {
    font-size: 1.1rem;
}

.notification-time {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.6);
}

.notification-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.notification-message {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.9);
    line-height: 1.4;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Scrollbar styling for notifications */
.notifications-content::-webkit-scrollbar {
    width: 6px;
}

.notifications-content::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.05);
    border-radius: 3px;
}

.notifications-content::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 3px;
}

.notifications-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.3);
}

#gameCanvas {
    border: 1px solid rgba(30, 80, 180, 0.4);
    border-radius: 8px;
    box-shadow: 0 0 30px rgba(20, 60, 180, 0.25), 0 0 60px rgba(10, 20, 80, 0.4);
    cursor: pointer;
    background: #FFFFFF;
    flex-shrink: 0;
}

/* === ENHANCED SIDEBAR === */
/* LAYER 1: Deep space purple background with gradient */
.sidebar-container {
    background: linear-gradient(180deg, #26243f, #1f1d33);
    border-radius: 12px;
    backdrop-filter: blur(20px);
    width: 230px;
    max-height: 90vh;
    flex-shrink: 0;
    border: 1px solid rgba(255,255,255,0.15);
    box-shadow: inset -1px 0 rgba(255,255,255,0.05), 0 8px 32px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.3s ease;
}

.sidebar-container.collapsed {
    width: 60px;
    position: relative;
}

/* ::before expand hint removed — toggle button already shows the arrow */

.sidebar-header {
    background: rgba(255,255,255,0.15);
    padding: 6px 8px 6px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 40px;
}

.sidebar-title {
    flex: 1;
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    transition: opacity 0.3s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-container.collapsed .sidebar-title {
    display: none;
}

.sidebar-container.collapsed .sidebar-header {
    padding: 6px 8px;
    justify-content: center;
}

.sidebar-toggle {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: 5px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
    min-width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-toggle:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.05);
}

.toggle-icon {
    transition: transform 0.3s ease;
}

.sidebar-container.collapsed .toggle-icon {
    transform: rotate(180deg);
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 6px;
    transition: opacity 0.3s ease;
}

/* === SIDEBAR FOOTER (pinned End Game) === */
.sidebar-footer {
    padding: 7px 10px;
    border-top: 1px solid rgba(255,255,255,0.12);
    flex-shrink: 0;
    background: rgba(0,0,0,0.15);
}

.sidebar-footer .end-game-button {
    width: 100%;
}

/* Game events section compact feed */
#notificationsContent {
    padding: 0;
    max-height: 160px;
    overflow-y: auto;
}
/* Override the ID-level max-height when collapsed (ID specificity beats class-only collapse rule) */
#gameEventsSidebarSection.collapsed #notificationsContent {
    max-height: 0;
    overflow-y: hidden;
}
#notificationsContent .notification-item {
    padding: 6px 10px;
    font-size: 0.78em;
}

.sidebar-container.collapsed .sidebar-footer {
    display: none;
}

/* Hide right sidebar (moved to left sidebar) */
.right-sidebar-container {
    display: none !important;
}

.sidebar-container.collapsed .sidebar-content {
    opacity: 0;
    pointer-events: none;
}

/* Ensure toggle button remains visible and clickable when collapsed */
.sidebar-container.collapsed .sidebar-toggle {
    opacity: 1 !important;
    pointer-events: auto !important;
    position: relative;
    z-index: 10;
}

/* Ensure the sidebar header remains clickable when collapsed */
.sidebar-container.collapsed .sidebar-header {
    pointer-events: auto !important;
}

/* === POLISHED SCROLLBAR STYLING FOR LEFT SIDEBAR === */
.sidebar-content::-webkit-scrollbar {
    width: 8px;
}

.sidebar-content::-webkit-scrollbar-track {
    background: #2b2847;
    border-radius: 4px;
}

.sidebar-content::-webkit-scrollbar-thumb {
    background: rgba(26, 188, 156, 0.3);
    border-radius: 4px;
    transition: background 0.3s ease;
}

.sidebar-content::-webkit-scrollbar-thumb:hover {
    background: rgba(26, 188, 156, 0.5);
}

/* === SETTINGS SECTION BADGE === */
.section-meta {
    font-size: 0.7em;
    color: rgba(255,255,255,0.45);
    margin-left: 4px;
    margin-right: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
    flex-shrink: 1;
}

/* === COMPACT SETTINGS (merged section) === */
.compact-setting {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 7px;
}
.compact-setting:last-of-type {
    margin-bottom: 0;
}
.compact-label {
    font-size: 0.88em;
    width: 18px;
    flex-shrink: 0;
    text-align: center;
}
.compact-select {
    flex: 1;
    background: rgba(0,0,0,0.35);
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 6px;
    color: #cbd5e1;
    font-size: 0.78em;
    padding: 5px 7px;
    cursor: pointer;
    font-family: inherit;
    min-width: 0;
}
.compact-select:focus {
    outline: 1px solid rgba(0,217,255,0.5);
    border-color: rgba(0,217,255,0.4);
}
.setting-value-label {
    flex: 1;
    font-size: 0.78em;
    color: #e2e8f0;
    background: rgba(0,0,0,0.25);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    padding: 5px 8px;
    min-width: 0;
}

/* === SIDEBAR TOOL STRIP === */
.sidebar-tools-row {
    display: flex;
    gap: 5px;
    padding: 4px 0 6px;
}
.tool-btn {
    flex: 1;
    padding: 7px 4px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.11);
    border-radius: 6px;
    color: #94a3b8;
    font-size: 0.74em;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
    text-align: center;
}
.tool-btn:hover {
    background: rgba(255,255,255,0.13);
    color: #e2e8f0;
}

/* === SCOREBOARD STYLES === */
.scoreboard-container {
    background: var(--bg-panel);
    border-radius: var(--radius-md);
    padding: 10px;
    box-shadow: var(--shadow-card);
    margin-bottom: 8px;
    transition: opacity 0.3s ease;
}

.sidebar-container.collapsed .scoreboard-container {
    opacity: 0;
    pointer-events: none;
}

.scoreboard-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

.scoreboard-icon {
    font-size: 1rem;
    min-width: 16px;
}

.scoreboard-title {
    font-weight: 600;
    font-size: 0.85rem;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.scoreboard-content {
    margin-bottom: 12px;
}

.score-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 0;
}

.player-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.player-icon {
    font-size: 0.9rem;
    min-width: 15px;
}

.player-name {
    font-weight: 500;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.9);
}

.player-info.human .player-name {
    color: #1abc9c;
}

.player-info.ai .player-name {
    color: #FF5722;
}

.score-display {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.score-value {
    font-weight: 700;
    font-size: 0.95rem;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.score-label {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.7);
    font-weight: 500;
}

.score-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    margin: 4px 0;
}

.scoreboard-stats {
    display: flex;
    justify-content: space-between;
    padding-top: 8px;
    border-top: 1px solid rgba(255,255,255,0.15);
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-label {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.7);
    font-weight: 500;
}

.stat-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

/* === SIDEBAR SECTIONS === */
/* LAYER 2: Section containers - elevated from background */
.sidebar-section {
    margin-bottom: 6px;
    border-radius: 7px;
    overflow: hidden;
    background: #3a3555;
    border: 1px solid rgba(255,255,255,0.1);
    transition: all 0.3s ease;
}

.sidebar-section:hover {
    background: #42395f;
    border-color: rgba(255,255,255,0.15);
}

.section-header {
    padding: 7px 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 7px;
    background: transparent;
    transition: all 0.3s ease;
    user-select: none;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.section-header:hover {
    background: rgba(255,255,255,0.08);
}

.section-icon {
    font-size: 0.85rem;
    min-width: 15px;
    opacity: 0.7;
}

.section-title {
    flex: 1;
    font-weight: 600;
    font-size: 0.75rem;
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.section-toggle {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
    color: rgba(255,255,255,0.7);
}

.sidebar-section.collapsed .section-toggle {
    transform: rotate(-90deg);
}

.section-content {
    padding: 10px;
    border-top: 1px solid rgba(255,255,255,0.1);
    transition: all 0.3s ease;
    max-height: 1000px;
    overflow: hidden;
}

.sidebar-section.collapsed .section-content {
    max-height: 0;
    padding: 0 10px;
    opacity: 0;
}

/* === SETTING GROUPS === */
.setting-group {
    margin-bottom: 16px;
}

.setting-group:last-child {
    margin-bottom: 0;
}

.setting-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 8px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.setting-select {
    background: rgba(255,255,255,0.15);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 10px 12px;
    border-radius: 6px;
    width: 100%;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.setting-select:hover {
    background: rgba(255,255,255,0.25);
    border-color: rgba(255,255,255,0.5);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.setting-select:focus {
    outline: none;
    background: rgba(255,255,255,0.3);
    border-color: #4CAF50;
    box-shadow: 0 0 12px rgba(76, 175, 80, 0.4);
}

.setting-select.small {
    padding: 8px 10px;
    font-size: 12px;
}

.setting-select option {
    background: #2a5298;
    color: white;
    padding: 8px;
    font-weight: 500;
}

.setting-button {
    background: rgba(255,255,255,0.15);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 10px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    width: 100%;
    text-align: center;
}

.setting-button:hover {
    background: rgba(255,255,255,0.25);
    border-color: rgba(255,255,255,0.5);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.setting-button:focus {
    outline: none;
    box-shadow: 0 0 12px rgba(255,255,255,0.4);
}

.setting-button.primary {
    background: rgba(33, 150, 243, 0.3);
    border-color: rgba(33, 150, 243, 0.5);
}

.setting-button.primary:hover {
    background: rgba(33, 150, 243, 0.4);
    border-color: rgba(33, 150, 243, 0.7);
}

.setting-button.secondary {
    background: rgba(156, 39, 176, 0.3);
    border-color: rgba(156, 39, 176, 0.5);
}

.setting-button.secondary:hover {
    background: rgba(156, 39, 176, 0.4);
    border-color: rgba(156, 39, 176, 0.7);
}

.setting-button.success {
    background: rgba(76, 175, 80, 0.3);
    border-color: rgba(76, 175, 80, 0.5);
}

.setting-button.success:hover {
    background: rgba(76, 175, 80, 0.4);
    border-color: rgba(76, 175, 80, 0.7);
}

.setting-button.danger {
    background: rgba(244, 67, 54, 0.3);
    border-color: rgba(244, 67, 54, 0.5);
}

.setting-button.danger:hover {
    background: rgba(244, 67, 54, 0.4);
    border-color: rgba(244, 67, 54, 0.7);
}

.setting-button.small {
    padding: 6px 12px;
    font-size: 11px;
    flex: 1;
}

.setting-button.large {
    padding: 14px 20px;
    font-size: 14px;
    font-weight: 700;
}

.button-group {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.setting-info {
    margin-top: 8px;
    padding: 8px 12px;
    background: rgba(255,255,255,0.08);
    border-radius: 4px;
    border-left: 3px solid rgba(76, 175, 80, 0.6);
}

.info-stats {
    font-size: 12px;
    font-weight: 600;
    color: rgba(255,255,255,0.9);
    margin-bottom: 4px;
}

.setting-info div:last-child {
    font-size: 11px;
    color: rgba(255,255,255,0.7);
    line-height: 1.4;
}

/* === STATIC DISPLAY (for Difficulty, Category, Age Range) === */
.static-display {
    background: var(--bg-card);
    color: var(--text-primary);
    border-radius: var(--radius-md);
    padding: 12px;
    text-align: center;
    font-weight: 600;
    font-size: 13px;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05);
    transition: all 0.3s ease;
}

/* === DIFFICULTY WIDGET === */
.difficulty-widget {
    background: transparent;
    padding: 0;
    border-radius: 0;
    border: none;
    box-shadow: none;
    margin-bottom: 0;
}

.difficulty-title {
    font-weight: bold;
    margin-bottom: 8px;
    font-size: 0.95rem;
    text-align: left;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    gap: 6px;
}

.difficulty-selector {
    margin-bottom: 0;
}

.difficulty-select {
    background: rgba(255,255,255,0.18);
    color: white;
    border: 1px solid rgba(255,255,255,0.35);
    padding: 8px;
    border-radius: 6px;
    width: 100%;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.difficulty-select:hover {
    background: rgba(255,255,255,0.25);
    border-color: rgba(255,255,255,0.5);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.difficulty-select:focus {
    outline: none;
    background: rgba(255,255,255,0.3);
    border-color: #9C27B0;
    box-shadow: 0 0 12px rgba(156, 39, 176, 0.4);
}

.difficulty-select option {
    background: #2a5298;
    color: white;
    padding: 8px;
    font-weight: 500;
}

.difficulty-info {
    display: none;
}

#difficultyDescription {
    display: none;
}

/* === CATEGORY WIDGET === */
.category-title {
    font-weight: bold;
    margin-bottom: 8px;
    font-size: 1rem;
    text-align: left;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    gap: 8px;
}

.category-selector {
    margin-bottom: 0;
}

.category-select {
    background: rgba(255,255,255,0.18);
    color: white;
    border: 1px solid rgba(255,255,255,0.35);
    padding: 8px;
    border-radius: 6px;
    width: 100%;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.category-select:hover {
    background: rgba(255,255,255,0.25);
    border-color: rgba(255,255,255,0.5);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.category-select:focus {
    outline: none;
    background: rgba(255,255,255,0.3);
    border-color: #4CAF50;
    box-shadow: 0 0 12px rgba(76, 175, 80, 0.4);
}

.category-select option {
    background: #2a5298;
    color: white;
    padding: 8px;
    font-weight: 500;
}

.category-info {
    margin-top: 12px;
    padding: 12px;
    background: rgba(255,255,255,0.08);
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.15);
}

.category-count {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.count-icon {
    font-size: 0.9rem;
    min-width: 16px;
    opacity: 0.7;
}

.count-value {
    font-weight: 700;
    font-size: 2rem;
    color: #1abc9c !important;
    text-shadow: 0 0 12px rgba(26, 188, 156, 0.6) !important;
    line-height: 1;
}

.count-label {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.6);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.category-description {
    font-size: 0.85rem;
    line-height: 1.4;
    color: rgba(255,255,255,0.85);
}

/* === AGE RANGE WIDGET === */
.age-range-widget {
    background: transparent;
    padding: 0;
    border-radius: 0;
    border: none;
    box-shadow: none;
    margin-top: 0;
}

.age-range-title {
    font-weight: bold;
    margin-bottom: 8px;
    font-size: 1rem;
    text-align: left;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    gap: 8px;
}

.age-range-selector {
    margin-bottom: 0;
}

.age-range-select {
    background: rgba(255,255,255,0.18);
    color: white;
    border: 1px solid rgba(255,255,255,0.35);
    padding: 8px;
    border-radius: 6px;
    width: 100%;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.age-range-select:hover {
    background: rgba(255,255,255,0.25);
    border-color: rgba(255,255,255,0.5);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.age-range-select:focus {
    outline: none;
    background: rgba(255,255,255,0.3);
    border-color: #FF9800;
    box-shadow: 0 0 12px rgba(255, 152, 0, 0.4);
}

.age-range-select option {
    background: #2a5298;
    color: white;
    padding: 8px;
    font-weight: 500;
}

.age-range-description {
    margin-top: 12px;
    padding: 10px 12px;
    background: rgba(255,255,255,0.08);
    border-radius: 6px;
    border-left: 3px solid rgba(255, 152, 0, 0.6);
    font-size: 0.85rem;
    line-height: 1.4;
    color: rgba(255,255,255,0.85);
}

/* === VIEW TOGGLE WIDGET === */
.view-toggle-widget {
    background: transparent;
    padding: 0;
    border-radius: 0;
    border: none;
    box-shadow: none;
    margin-top: 0;
}

.view-toggle-title {
    font-weight: bold;
    margin-bottom: 8px;
    font-size: 1rem;
    text-align: left;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    gap: 8px;
}

.view-toggle-selector {
    margin-bottom: 0;
}

.view-toggle-button {
    background: rgba(255,255,255,0.18);
    color: white;
    border: 1px solid rgba(255,255,255,0.35);
    padding: 8px;
    border-radius: 6px;
    width: 100%;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

/* Background picker */
.bg-picker-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 5px;
}
.bg-swatch {
    aspect-ratio: 1;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.15s, transform 0.1s, box-shadow 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75em;
    color: rgba(255,255,255,0.6);
    position: relative;
}
.bg-swatch:hover {
    border-color: rgba(255,255,255,0.5);
    transform: scale(1.08);
}
.bg-swatch.active {
    border-color: #00d9ff;
    box-shadow: 0 0 8px rgba(0,217,255,0.5);
}
.bg-swatch::after {
    content: attr(title);
    position: absolute;
    bottom: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.85);
    color: #fff;
    font-size: 0.7em;
    white-space: nowrap;
    padding: 2px 6px;
    border-radius: 4px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s;
    z-index: 100;
}
.bg-swatch:hover::after { opacity: 1; }

.view-toggle-button:hover {
    background: rgba(255,255,255,0.25);
    border-color: rgba(255,255,255,0.5);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.view-toggle-button:focus {
    outline: none;
    background: rgba(255,255,255,0.3);
    border-color: #6f42c1;
    box-shadow: 0 0 12px rgba(111, 66, 193, 0.4);
}

/* === SPECIAL HEXAGONS WIDGET === */
.special-hexagons-widget {
    background: transparent;
    padding: 0;
    border-radius: 0;
    border: none;
    box-shadow: none;
    margin-top: 0;
}

.special-hexagons-title {
    font-weight: bold;
    margin-bottom: 8px;
    font-size: 1rem;
    text-align: left;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    gap: 8px;
}

.special-hexagons-selector {
    margin-bottom: 0;
}

.special-hexagons-button {
    background: rgba(255,193,7,0.2);
    color: white;
    border: 1px solid rgba(255,193,7,0.4);
    padding: 8px;
    border-radius: 6px;
    width: 100%;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.special-hexagons-button:hover {
    background: rgba(255,193,7,0.3);
    border-color: rgba(255,193,7,0.6);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255,193,7,0.3);
}

.special-hexagons-button:focus {
    outline: none;
    background: rgba(255,193,7,0.4);
    border-color: #ffc107;
    box-shadow: 0 0 12px rgba(255,193,7,0.5);
}

/* === MUSIC STREAMING WIDGET === */
.music-streaming-widget {
    background: transparent;
    padding: 0;
    border-radius: 0;
    border: none;
    box-shadow: none;
    margin-top: 0;
}

.music-streaming-title {
    font-weight: bold;
    margin-bottom: 8px;
    font-size: 1rem;
    text-align: left;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    gap: 8px;
}

.music-streaming-selector {
    margin-bottom: 8px;
}

.music-platform-select {
    background: rgba(255,255,255,0.18);
    color: white;
    border: 1px solid rgba(255,255,255,0.35);
    padding: 8px;
    border-radius: 6px;
    width: 100%;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.music-platform-select:hover {
    background: rgba(255,255,255,0.25);
    border-color: rgba(255,255,255,0.5);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.music-platform-select:focus {
    outline: none;
    background: rgba(255,255,255,0.3);
    border-color: #9C27B0;
    box-shadow: 0 0 12px rgba(156, 39, 176, 0.4);
}

.music-platform-select option {
    background: #2a5298;
    color: white;
    padding: 8px;
    font-weight: 500;
}

.music-controls {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 8px;
    padding: 12px;
    margin-top: 8px;
}

.music-playlist-selector {
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.playlist-label {
    display: block;
    font-size: 11px;
    font-weight: bold;
    color: #fff;
    margin-bottom: 6px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.playlist-select {
    background: rgba(255,255,255,0.15);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 6px 8px;
    border-radius: 4px;
    width: 100%;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 6px;
}

.playlist-select:hover {
    background: rgba(255,255,255,0.25);
    border-color: rgba(255,255,255,0.5);
}

.playlist-select:focus {
    outline: none;
    background: rgba(255,255,255,0.3);
    box-shadow: 0 0 8px rgba(255,255,255,0.4);
}

.playlist-select option {
    background: #2a5298;
    color: white;
    padding: 6px;
    font-weight: 500;
}

.custom-playlist-btn {
    background: rgba(76, 175, 80, 0.2);
    color: white;
    border: 1px solid rgba(76, 175, 80, 0.4);
    padding: 6px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 10px;
    font-weight: 500;
    transition: all 0.3s ease;
    width: 100%;
}

.custom-playlist-btn:hover {
    background: rgba(76, 175, 80, 0.3);
    border-color: rgba(76, 175, 80, 0.6);
    transform: translateY(-1px);
}

.custom-playlist-btn:focus {
    outline: none;
    background: rgba(76, 175, 80, 0.4);
    box-shadow: 0 0 8px rgba(76, 175, 80, 0.5);
}

.music-player-info {
    margin-bottom: 10px;
    text-align: center;
}

.current-track {
    font-size: 12px;
    font-weight: bold;
    color: #fff;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.current-artist {
    font-size: 11px;
    color: rgba(255,255,255,0.8);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.music-player-controls {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 10px;
}

.music-control-btn {
    background: rgba(255,255,255,0.15);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 6px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
    min-width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.music-control-btn:hover {
    background: rgba(255,255,255,0.25);
    border-color: rgba(255,255,255,0.5);
    transform: translateY(-1px);
}

.music-control-btn:focus {
    outline: none;
    background: rgba(255,255,255,0.3);
    box-shadow: 0 0 8px rgba(255,255,255,0.4);
}

.music-volume-control {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.volume-icon {
    font-size: 12px;
    min-width: 16px;
}

.volume-slider {
    flex: 1;
    height: 4px;
    background: rgba(255,255,255,0.2);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
    appearance: none;
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.volume-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.music-connection-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: rgba(255,255,255,0.8);
}

.status-indicator {
    font-size: 8px;
}

.status-text {
    font-weight: 500;
}

/* === END GAME WIDGET === */
.end-game-widget {
    background: transparent;
    padding: 0;
    border-radius: 0;
    border: none;
    box-shadow: none;
    margin-top: 0;
}

.end-game-title {
    font-weight: bold;
    margin-bottom: 8px;
    font-size: 1rem;
    text-align: left;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    gap: 8px;
}

.end-game-selector {
    margin-bottom: 0;
}

.end-game-button {
    background: rgba(220, 53, 69, 0.2);
    color: white;
    border: 1px solid rgba(220, 53, 69, 0.4);
    padding: 8px;
    border-radius: 6px;
    width: 100%;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.end-game-button:hover {
    background: rgba(220, 53, 69, 0.3);
    border-color: rgba(220, 53, 69, 0.6);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.end-game-button:focus {
    outline: none;
    background: rgba(220, 53, 69, 0.4);
    border-color: #dc3545;
    box-shadow: 0 0 12px rgba(220, 53, 69, 0.5);
}

/* === VIEW TOGGLE === */
.view-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 100;
}

.toggle-button {
    background: rgba(255,255,255,0.1);
    color: white;
    border: 2px solid rgba(255,255,255,0.3);
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.toggle-button:hover {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.5);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.toggle-button:active {
    transform: translateY(0);
}

/* === COMPACT UI === */
.compact-ui {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(15px);
    border-top: 1px solid rgba(255,255,255,0.2);
    z-index: 1000;
}

.ui-main-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    min-height: 50px;
}

.ui-left, .ui-center, .ui-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ui-center {
    flex: 1;
    justify-content: center;
}

.status-compact {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 14px;
    font-weight: 500;
}

.compact-control {
    background: rgba(255,255,255,0.15);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.compact-control:hover {
    background: rgba(255,255,255,0.25);
    border-color: rgba(255,255,255,0.5);
    transform: translateY(-1px);
}

.compact-select {
    background: rgba(255,255,255,0.15);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.expand-toggle {
    background: rgba(255, 152, 0, 0.2);
    border-color: rgba(255, 152, 0, 0.4);
}

.expand-toggle:hover {
    background: rgba(255, 152, 0, 0.3);
}

.ui-expanded {
    display: none;
    background: rgba(255,255,255,0.08);
    border-top: 1px solid rgba(255,255,255,0.15);
    padding: 20px;
    max-height: 300px;
    overflow-y: auto;
}

.expanded-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.expanded-section {
    background: rgba(255,255,255,0.1);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.2);
}

.expanded-section h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.expanded-section .content {
    font-size: 12px;
    line-height: 1.4;
    color: rgba(255,255,255,0.9);
}

/* === BUTTONS === */
button {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    width: 100%;
    margin-top: 8px;
    transition: background 0.3s;
}

button:hover {
    background: #45a049;
}

button:disabled {
    background: #666;
    cursor: not-allowed;
}

/* === WIN OVERLAY === */
.win-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.win-message {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    padding: 40px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    border: 2px solid rgba(255,255,255,0.3);
    backdrop-filter: blur(10px);
}

.win-title {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.win-subtitle {
    font-size: 1.2rem;
    margin-bottom: 25px;
    opacity: 0.9;
}

.win-button {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 2px solid rgba(255,255,255,0.5);
    padding: 12px 30px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s ease;
    width: auto;
    margin: 0;
}

.win-button:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-2px);
}

/* === SPECIAL EVENT OVERLAY === */
.special-event-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(10, 15, 30, 0.95) 0%, rgba(0, 0, 0, 0.98) 100%);
    backdrop-filter: blur(15px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1500;
    animation: fadeIn 0.3s ease-out;
}

.special-event-message {
    background: linear-gradient(145deg, #1e1e3f 0%, #2a2a5e 50%, #1a1a3a 100%);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 
        0 0 60px rgba(138, 43, 226, 0.5),
        0 0 120px rgba(138, 43, 226, 0.3),
        inset 0 0 80px rgba(138, 43, 226, 0.1);
    border: 3px solid rgba(186, 85, 211, 0.6);
    backdrop-filter: blur(10px);
    position: relative;
    max-width: 600px;
    overflow: hidden;
}

/* Add glowing border animation */
.special-event-message::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    background: linear-gradient(45deg, 
        rgba(138, 43, 226, 0.8), 
        rgba(186, 85, 211, 0.6), 
        rgba(147, 112, 219, 0.8),
        rgba(138, 43, 226, 0.8));
    background-size: 400% 400%;
    border-radius: 20px;
    z-index: -1;
    animation: borderGlow 4s ease infinite;
    filter: blur(12px);
}

@keyframes borderGlow {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.special-event-title {
    font-size: 2.2rem;
    font-weight: bold;
    margin-bottom: 20px;
    text-shadow: 
        0 0 20px rgba(186, 85, 211, 0.8),
        0 0 40px rgba(138, 43, 226, 0.6),
        2px 2px 6px rgba(0,0,0,0.8);
    color: #ffffff;
    letter-spacing: 1px;
}

.special-event-text {
    font-size: 1.2rem;
    margin-bottom: 25px;
    opacity: 0.95;
    color: #e8e8ff;
    line-height: 1.6;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
}

.special-event-button {
    background: linear-gradient(135deg, #8B00FF 0%, #BA55D3 50%, #9370DB 100%);
    color: white;
    border: 2px solid rgba(255,255,255,0.4);
    padding: 14px 35px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s ease;
    width: auto;
    margin: 0;
    box-shadow: 
        0 4px 15px rgba(139, 0, 255, 0.4),
        0 0 25px rgba(139, 0, 255, 0.2);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.special-event-button:hover {
    background: linear-gradient(135deg, #9B10FF 0%, #CA65E3 50%, #A380EB 100%);
    transform: translateY(-3px);
    box-shadow: 
        0 6px 20px rgba(139, 0, 255, 0.6),
        0 0 35px rgba(139, 0, 255, 0.4);
}

.special-event-button:active {
    transform: translateY(-1px);
}

/* Advantage type - keep team color (applied via inline styles in UI.js) */
.special-event-message.advantage {
    /* Team color applied via inline styles */
}

/* Disadvantage type - dark space theme with red accents */
.special-event-message.disadvantage {
    background: linear-gradient(145deg, #1a0a0f 0%, #2d1520 50%, #1a0a14 100%);
    border-color: rgba(220, 53, 69, 0.6);
    box-shadow: 
        0 0 60px rgba(220, 53, 69, 0.5),
        0 0 120px rgba(220, 53, 69, 0.3),
        inset 0 0 80px rgba(220, 53, 69, 0.1);
}

.special-event-message.disadvantage::before {
    background: linear-gradient(45deg, 
        rgba(220, 53, 69, 0.8), 
        rgba(244, 67, 54, 0.6), 
        rgba(200, 35, 51, 0.8),
        rgba(220, 53, 69, 0.8));
    background-size: 400% 400%;
}

.special-event-message.disadvantage .special-event-title {
    text-shadow: 
        0 0 20px rgba(220, 53, 69, 0.8),
        0 0 40px rgba(244, 67, 54, 0.6),
        2px 2px 6px rgba(0,0,0,0.8);
}

.special-event-message.disadvantage .special-event-button {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    box-shadow: 
        0 4px 15px rgba(220, 53, 69, 0.4),
        0 0 25px rgba(220, 53, 69, 0.2);
}

.special-event-message.disadvantage .special-event-button:hover {
    background: linear-gradient(135deg, #e74c3c 0%, #d62c1a 100%);
    box-shadow: 
        0 6px 20px rgba(220, 53, 69, 0.6),
        0 0 35px rgba(220, 53, 69, 0.4);
}

/* Team spawn type - purple/cosmic theme */
.special-event-message.team_spawn {
    background: linear-gradient(145deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    border-color: rgba(156, 39, 176, 0.6);
    box-shadow: 
        0 0 60px rgba(156, 39, 176, 0.5),
        0 0 120px rgba(156, 39, 176, 0.3),
        inset 0 0 80px rgba(156, 39, 176, 0.1);
}

.special-event-message.team_spawn::before {
    background: linear-gradient(45deg, 
        rgba(156, 39, 176, 0.8), 
        rgba(186, 85, 211, 0.6), 
        rgba(138, 43, 226, 0.8),
        rgba(156, 39, 176, 0.8));
    background-size: 400% 400%;
}

/* === RESPONSIVE DESIGN === */
@media (max-width: 768px) {
    .game-container {
        flex-direction: column;
        height: auto;
        gap: 10px;
    }
    
    .category-panel {
        width: 100%;
        max-width: 400px;
        order: 2;
        max-height: none;
    }
    
    #gameCanvas {
        order: 1;
        width: 100%;
        max-width: 400px;
        height: 300px;
    }
    
    .view-toggle {
        position: relative;
        top: auto;
        right: auto;
        margin: 10px 0;
    }
    
    .compact-ui {
        position: relative;
        margin-top: 10px;
    }
    
    .ui-main-bar {
        flex-direction: column;
        gap: 10px;
        padding: 15px;
    }
    
    .ui-left, .ui-center, .ui-right {
        width: 100%;
        justify-content: center;
    }
    
    .expanded-content {
        grid-template-columns: 1fr;
    }
}

/* === TURN INDICATOR === */
.turn-indicator {
    font-weight: bold;
    padding: 4px 8px;
    border-radius: 4px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
}

/* === LEGEND ITEMS === */
#legendItems {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    font-size: 11px;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    border: 1px solid rgba(255,255,255,0.3);
}

/* === SWITCH TOGGLE === */
.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255,255,255,0.2);
    transition: .4s;
    border: 1px solid rgba(255,255,255,0.3);
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider {
    background-color: rgba(76, 175, 80, 0.4);
    border-color: rgba(76, 175, 80, 0.6);
}

input:focus + .slider {
    box-shadow: 0 0 8px rgba(76, 175, 80, 0.4);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

/* === BUTTON GROUP ENHANCEMENTS === */
.button-group {
    display: flex;
    gap: 4px;
    margin-top: 8px;
}

.button-group .setting-button {
    flex: 1;
    margin: 0;
    padding: 8px 6px;
    font-size: 11px;
    border-radius: 4px;
}

.button-group .setting-button.active {
    background: rgba(76, 175, 80, 0.4);
    border-color: rgba(76, 175, 80, 0.6);
    color: white;
}

.button-group .setting-button:hover {
    background: rgba(255,255,255,0.25);
    border-color: rgba(255,255,255,0.5);
}

.button-group .setting-button.active:hover {
    background: rgba(76, 175, 80, 0.5);
    border-color: rgba(76, 175, 80, 0.7);
}

/* === UTILITY CLASSES === */
.hidden {
    display: none !important;
}

.visible {
    display: block !important;
}

.text-center {
    text-align: center;
}

.text-bold {
    font-weight: bold;
}

.mb-10 {
    margin-bottom: 10px;
}

.mt-10 {
    margin-top: 10px;
}

/* === MUSIC WIDGET STYLES === */
.music-widget-container {
    margin-top: 15px;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
}

.music-widget {
    display: none;
    width: 100%;
}

.music-widget iframe {
    width: 100%;
    border: none;
    border-radius: 8px;
    background: transparent;
}

.pandora-info {
    padding: 20px;
    text-align: center;
    background: rgba(0, 84, 131, 0.2);
    border-radius: 8px;
}

.pandora-info p {
    margin: 8px 0;
    color: rgba(255,255,255,0.9);
}

.pandora-link {
    display: inline-block;
    background: rgba(0, 84, 131, 0.4);
    color: white;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 6px;
    border: 1px solid rgba(0, 84, 131, 0.6);
    font-weight: bold;
    transition: all 0.3s ease;
    margin: 10px 0;
}

.pandora-link:hover {
    background: rgba(0, 84, 131, 0.6);
    border-color: rgba(0, 84, 131, 0.8);
    transform: translateY(-1px);
    text-decoration: none;
    color: white;
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    font-size: 12px;
    margin-top: 10px;
    border: 1px solid rgba(255,255,255,0.2);
}

.status-indicator {
    font-size: 12px;
    min-width: 16px;
}

.status-text {
    font-weight: 500;
    color: rgba(255,255,255,0.9);
}

/* Music notification styles */
.music-notification {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Custom playlist dialog styles */
.custom-playlist-overlay {
    backdrop-filter: blur(10px);
}

.custom-playlist-overlay input[type="text"] {
    box-sizing: border-box;
}

.custom-playlist-overlay input[type="text"]:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
}

.custom-playlist-overlay input[type="text"]:focus {
    outline: none !important;
    background: rgba(255, 255, 255, 0.25) !important;
    border-color: #00d9ff !important;
    box-shadow: 0 0 12px rgba(0, 217, 255, 0.5) !important;
}

.custom-playlist-overlay input[type="text"]::placeholder {
    color: rgba(255, 255, 255, 0.5) !important;
}

.custom-playlist-overlay button:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(0,0,0,0.4) !important;
}

.custom-playlist-overlay button:active {
    transform: translateY(0) !important;
}

.custom-playlist-overlay #cancelBtn:hover {
    background: rgba(255, 255, 255, 0.25) !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
}

.custom-playlist-overlay #addBtn:hover {
    background: linear-gradient(135deg, #45a049 0%, #4CAF50 100%) !important;
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4) !important;
}

/* === NEW MUSIC WIDGET UX STYLES === */

/* ── Volume Sliders ───────────────────────────────────────────── */
.volume-controls {
    margin-bottom: 14px;
}

.volume-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.volume-label {
    font-size: 12px;
    color: #c8b8f0;
    width: 52px;
    flex-shrink: 0;
    white-space: nowrap;
}

.volume-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.15);
    outline: none;
    cursor: pointer;
    transition: background 0.2s;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #a855f7;
    cursor: pointer;
    box-shadow: 0 0 6px rgba(168, 85, 247, 0.7);
    transition: transform 0.1s, box-shadow 0.1s;
}

.volume-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #a855f7;
    cursor: pointer;
    border: none;
    box-shadow: 0 0 6px rgba(168, 85, 247, 0.7);
}

.volume-slider:hover::-webkit-slider-thumb {
    transform: scale(1.25);
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.9);
}

.volume-slider:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.volume-value {
    font-size: 11px;
    color: #9ca3af;
    width: 32px;
    text-align: right;
    flex-shrink: 0;
}

/* Music Toggle Group */
.music-toggle-group {
    margin-bottom: 12px;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: all 0.3s ease;
}

.toggle-label:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
}

.toggle-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #4CAF50;
}

.toggle-text {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #f1f2f6 !important;
    letter-spacing: 0.3px !important;
    text-transform: none !important;
    text-shadow: 0 0 8px rgba(147, 112, 219, 0.4), 0 1px 3px rgba(0, 0, 0, 0.5) !important;
    user-select: none;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
}

/* Music Header with Toggle */
.music-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    margin-bottom: 16px;
}

.music-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.music-icon {
    font-size: 18px;
}

.music-title {
    font-size: 16px;
    font-weight: 600;
    color: rgba(255,255,255,0.95);
}

/* Toggle Switch */
.music-toggle-switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
}

.music-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.music-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255,255,255,0.2);
    transition: .4s;
    border-radius: 28px;
    border: 2px solid rgba(255,255,255,0.3);
}

.music-toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .music-toggle-slider {
    background-color: #4CAF50;
    border-color: #4CAF50;
}

input:checked + .music-toggle-slider:before {
    transform: translateX(24px);
}

/* Library Section */
.library-section {
    margin-bottom: 20px;
}

.library-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.library-icon {
    font-size: 16px;
}

.library-title {
    font-size: 15px;
    font-weight: 600;
    color: rgba(255,255,255,0.9);
}

.add-playlist-btn {
    width: 100%;
    padding: 12px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.add-playlist-btn:hover {
    background: #45a049;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

.add-icon {
    font-size: 16px;
}

.add-text {
    font-size: 14px;
}

/* Favorite Section */
.favorite-section {
    margin-bottom: 20px;
}

.favorite-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.favorite-icon {
    font-size: 16px;
}

.favorite-title {
    font-size: 15px;
    font-weight: 600;
    color: rgba(255,255,255,0.9);
}

.favorite-playlist {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.2);
}

.playlist-item {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.95);
    font-size: 14px;
    cursor: pointer;
    padding: 4px;
    text-align: left;
}

.playlist-item:hover {
    color: white;
}

.play-icon {
    font-size: 14px;
}

.playlist-name {
    font-weight: 500;
}

.playlist-actions {
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.7);
    font-size: 16px;
    cursor: pointer;
    padding: 4px 8px;
    transition: all 0.3s ease;
}

.playlist-actions:hover {
    color: white;
    transform: scale(1.1);
}

.playlist-delete {
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.7);
    font-size: 16px;
    cursor: pointer;
    padding: 4px 8px;
    transition: all 0.3s ease;
}

.playlist-delete:hover {
    color: #ff4444;
    transform: scale(1.1);
}

/* Playlist Library */
.playlist-library {
    margin-top: 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.playlist-library .library-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.playlist-count {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
}

.playlist-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.playlist-card {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
}

.playlist-card:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-1px);
}

.playlist-card.active {
    background: rgba(76, 175, 80, 0.2);
    border-color: rgba(76, 175, 80, 0.5);
}

.playlist-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.playlist-card .playlist-icon {
    font-size: 18px;
}

.playlist-remove-btn {
    background: rgba(244, 67, 54, 0.2);
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

.playlist-remove-btn:hover {
    background: rgba(244, 67, 54, 0.4);
    transform: scale(1.1);
}

.playlist-remove-btn .remove-icon {
    color: white;
    font-size: 18px;
    font-weight: bold;
    line-height: 1;
}

.playlist-card-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.playlist-card .playlist-name {
    color: white;
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.playlist-card .playlist-platform {
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
}

.playlist-active-indicator {
    position: absolute;
    top: 8px;
    right: 40px;
    background: rgba(76, 175, 80, 0.9);
    color: white;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

/* Now Playing Section */
.now-playing-section {
    margin-top: 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.now-playing-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.now-playing-icon {
    font-size: 16px;
}

.now-playing-title {
    font-size: 15px;
    font-weight: 600;
    color: rgba(255,255,255,0.9);
}

.now-playing-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.album-art {
    width: 100%;
    aspect-ratio: 1;
    background: rgba(0,0,0,0.3);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.album-placeholder {
    font-size: 48px;
    opacity: 0.5;
}

.track-info {
    text-align: center;
}

.track-title {
    font-size: 16px;
    font-weight: 600;
    color: white;
    margin-bottom: 4px;
}

.track-artist {
    font-size: 14px;
    color: rgba(255,255,255,0.7);
}

.playback-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 8px;
}

.control-btn {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.control-btn:hover {
    background: rgba(255,255,255,0.25);
    transform: scale(1.05);
}

.control-btn.play-btn {
    width: 48px;
    height: 48px;
    background: #4CAF50;
    border-color: #4CAF50;
}

.control-btn.play-btn:hover {
    background: #45a049;
    transform: scale(1.1);
}

.control-icon {
    font-size: 18px;
}

.play-btn .control-icon {
    font-size: 20px;
}

/* === INSTRUCTIONS MODAL === */
.instructions-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10500;
    backdrop-filter: blur(10px);
    animation: fadeIn 0.3s ease-out;
}

.instructions-content {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    border-radius: 16px;
    max-width: 800px;
    max-height: 90vh;
    width: 90%;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
}

.instructions-header {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px 24px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.instructions-header h2 {
    margin: 0;
    font-size: 1.8rem;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.instructions-close {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 24px;
    font-weight: bold;
    transition: all 0.3s ease;
    padding: 0;
    line-height: 1;
}

.instructions-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg) scale(1.1);
}

.instructions-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.instructions-section {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.instructions-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.instructions-section h3 {
    margin: 0 0 12px 0;
    font-size: 1.3rem;
    color: #00d9ff;
    text-shadow: 0 0 10px rgba(0, 217, 255, 0.5);
}

.instructions-section p {
    margin: 0 0 12px 0;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
}

.instructions-section ul {
    margin: 0;
    padding-left: 20px;
    list-style: none;
}

.instructions-section ul li {
    margin-bottom: 8px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.9);
    position: relative;
    padding-left: 20px;
}

.instructions-section ul li:before {
    content: "▸";
    position: absolute;
    left: 0;
    color: #00d9ff;
    font-weight: bold;
}

.instructions-section strong {
    color: #00d9ff;
    font-weight: 600;
}

.special-hex-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 12px;
}

.special-hex-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    background: rgba(255, 255, 255, 0.08);
    padding: 12px;
    border-radius: 8px;
    border-left: 4px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.special-hex-item:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateX(4px);
}

.special-hex-item:nth-child(1) {
    border-left-color: #2196F3;
}

.special-hex-item:nth-child(2) {
    border-left-color: #4CAF50;
}

.special-hex-item:nth-child(3) {
    border-left-color: #f44336;
}

.special-hex-item:nth-child(4) {
    border-left-color: #9C27B0;
}

.hex-icon {
    font-size: 2rem;
    min-width: 40px;
    text-align: center;
}

.special-hex-item > div {
    flex: 1;
}

.special-hex-item strong {
    display: block;
    margin-bottom: 6px;
    font-size: 1.05rem;
}

.special-hex-item p {
    margin: 4px 0;
    font-size: 0.9rem;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.85);
}

.instructions-footer {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px 24px;
    border-top: 2px solid rgba(255, 255, 255, 0.2);
    display: flex;
    justify-content: center;
}

.instructions-button-primary {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 14px 32px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.instructions-button-primary:hover {
    background: linear-gradient(135deg, #45a049 0%, #4CAF50 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

.instructions-button {
    background: rgba(33, 150, 243, 0.3);
    color: white;
    border: 1px solid rgba(33, 150, 243, 0.5);
    padding: 10px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    width: 100%;
    text-align: center;
}

.instructions-button:hover {
    background: rgba(33, 150, 243, 0.4);
    border-color: rgba(33, 150, 243, 0.7);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

/* Scrollbar styling for instructions */
.instructions-body::-webkit-scrollbar {
    width: 8px;
}

.instructions-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.instructions-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

.instructions-body::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.4);
}

/* Responsive Instructions */
@media (max-width: 768px) {
    .instructions-content {
        max-width: 95%;
        max-height: 95vh;
    }
    
    .instructions-header h2 {
        font-size: 1.4rem;
    }
    
    .instructions-section h3 {
        font-size: 1.1rem;
    }
    
    .special-hex-grid {
        grid-template-columns: 1fr;
    }
    
    .hex-icon {
        font-size: 1.5rem;
        min-width: 32px;
    }
}

/* === AI RESERVES - IMPROVED DESIGN === */
/* AI Reserves Container */
.ai-reserves {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,0.12);
}

.ai-reserves-header {
    font-size: 0.85rem;
    font-weight: 600;
    opacity: 0.85;
    margin-bottom: 8px;
    color: rgba(255,255,255,0.9);
}

.ai-reserves-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Team Row */
.ai-team-row {
    display: grid;
    grid-template-columns: 1fr 90px 24px;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.ai-team-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: rgba(255,255,255,0.9);
    font-weight: 500;
}

/* Reserve Bar */
.reserve-bar {
    position: relative;
    height: 12px;
    background: rgba(47, 44, 79, 0.8);
    border-radius: 6px;
    overflow: visible; /* Changed from hidden to visible */
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.reserve-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    min-width: 8px;
    border-radius: 5px;
    background-color: #6b6f99; /* Fallback color - will be overridden by inline style from JavaScript */
    transition: width 0.35s ease, background-color 0.35s ease;
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* Reserve Count */
.reserve-count {
    text-align: right;
    font-size: 0.75rem;
    opacity: 0.85;
    font-weight: 600;
    color: rgba(255,255,255,0.9);
}

/* State Colors removed - team colors are now used instead */

/* Active AI Turn */
.ai-team-row.active {
    background: rgba(26,188,156,0.08);
    border-radius: 6px;
    padding-left: 6px;
}

/* === MUSIC TOGGLE LABEL IMPROVEMENTS === */
/* Ensure checkboxes are properly styled and visible */
.music-toggle-group input[type="checkbox"]:checked {
    filter: brightness(1.2);
}

.music-toggle-group input[type="checkbox"]:focus {
    outline: 2px solid rgba(76, 175, 80, 0.5);
    outline-offset: 2px;
}

/* Active state for checked labels */
.toggle-label:has(input:checked) {
    background: rgba(76, 175, 80, 0.15);
    border-color: rgba(76, 175, 80, 0.4);
}

.toggle-label:has(input:checked) .toggle-text {
    color: #ffffff !important;
    font-weight: 800 !important;
    text-shadow: 0 0 15px rgba(76, 175, 80, 0.7), 0 2px 4px rgba(0, 0, 0, 0.7) !important;
}
