/* =============================================================================
   BarGames - Shared Styles (variables, base reset, headers, shared components)
   ============================================================================= */

/* CSS Variables - Baloo Bar Branding */
:root {
    /* Primary */
    --baloo-orange: #D35400;
    --baloo-orange-hover: #E67E22;

    /* Gradients */
    --gradient-teal: linear-gradient(135deg, #5DADE2 0%, #1ABC9C 100%);
    --gradient-terracotta: linear-gradient(135deg, #E67E22 0%, #C0392B 100%);
    --gradient-sand: linear-gradient(180deg, #F4D03F 0%, #F39C12 100%);

    /* Pride rainbow */
    --pride-stripe: linear-gradient(90deg,
        #E40303 0%, #FF8C00 16.67%, #FFED00 33.33%,
        #008026 50%, #24408E 66.67%, #732982 83.33%, #732982 100%);

    /* Neutrals */
    --dark-bg: #1A252F;
    --card-bg: #FFFFFF;
    --text-dark: #2C3E50;
    --text-light: #FFFFFF;
    --text-muted: #7F8C8D;

    /* Bingo ball colors */
    --ball-yellow: #F1C40F;
    --ball-pink: #E91E63;
    --ball-green: #2ECC71;
    --ball-blue: #3498DB;
    --ball-purple: #9B59B6;

    /* Vintage board colors */
    --wood-dark: #5D4037;
    --wood-medium: #8D6E63;
    --cell-bg: #F5E6C8;
    --cell-border: #5D4037;
    --cell-text: #4A3728;

    /* Sizes */
    --header-height: 80px;
    --border-radius: 16px;
    --border-radius-sm: 8px;

    /* TV Scale (controlled by JS) */
    --tv-scale: 1;

    /* Host page — warm dark palette */
    --host-bg: #181A1E;
    --host-surface-1: #282F36;
    --host-surface-2: #323A42;
    --host-surface-3: #3C454E;
    --host-glass: rgba(255, 255, 255, 0.04);

    /* Warm borders */
    --host-border: rgba(255, 200, 120, 0.12);
    --host-border-hover: rgba(255, 200, 120, 0.25);
    --host-border-active: rgba(230, 126, 34, 0.5);

    /* Amber accent */
    --host-amber: #E8913A;
    --host-amber-light: #F0A54E;
    --host-amber-glow: rgba(232, 145, 58, 0.25);
    --host-amber-subtle: rgba(232, 145, 58, 0.08);

    /* Typography */
    --font-body: 'DM Sans', -apple-system, sans-serif;
    --font-display: 'DM Sans', -apple-system, sans-serif;

    /* Refined text colors */
    --host-text: #E8E0D8;
    --host-text-muted: #9A8F85;
    --host-text-dim: #6B6259;
}

/* =============================================================================
   Base Styles
   ============================================================================= */

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

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
    background: var(--dark-bg);
    color: var(--text-light);
}

.tv-page {
    overflow: hidden;
}

/* Pride Stripe */
.pride-stripe {
    height: 4px;
    background: var(--pride-stripe);
    width: 100%;
    position: relative;
    z-index: 200;
}

/* =============================================================================
   Header Styles
   ============================================================================= */

.tv-header, .host-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 32px;
    background: rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 200;
}

.host-page .host-header {
    padding: 12px 16px;
    background: var(--host-surface-1);
    border-bottom: none;
    position: sticky;
    top: 0;
    z-index: 200;
}

.host-page .host-header::after {
    content: '';
    display: block;
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 4px;
    background: var(--pride-stripe);
}

.host-page .pride-stripe {
    display: none;
}

/* Bright warm header for TV */
.tv-page .tv-header {
    background: linear-gradient(180deg, color-mix(in srgb, var(--venue-text, #5c3a21) 60%, transparent) 0%, color-mix(in srgb, var(--venue-text, #5c3a21) 30%, transparent) 100%);
}

.tv-page .tv-header h1 {
    color: var(--venue-text, #5c3a21);
    text-shadow: 1px 1px 2px rgba(255,255,255,0.5);
}

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

.header-logo {
    height: 48px;
    width: auto;
}

.header-left h1 {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: 2px;
}

.host-page .header-left h1 {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--host-text);
}

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

.live-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #E74C3C;
    font-weight: 700;
    font-size: 1.2rem;
}

.tv-page .live-indicator {
    color: #c0392b;
    text-shadow: 0 1px 2px rgba(255,255,255,0.3);
}

/* TV Goal Display (Single sign: LÍNEA → BINGO) */
.tv-goal-display {
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, #d4a017 0%, #F1C40F 40%, #c9a80a 100%);
    padding: 10px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3), inset 0 2px 4px rgba(255,255,255,0.3);
    transition: background 0.5s ease;
    margin-right: 24px;
}

.tv-goal-display.goal-for-bingo {
    background: linear-gradient(135deg, #1e8449 0%, #2ECC71 40%, #1fa855 100%);
}

.tv-goal-display.goal-for-bingo:has(.won) {
    background: linear-gradient(135deg, #6b7b6e 0%, #95a5a6 40%, #7f8c8d 100%);
}

.tv-goal-label {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #000;
    font-weight: 700;
    white-space: nowrap;
}

.tv-goal-text {
    font-size: 1.5rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #fff;
    text-shadow: 2px 2px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000;
    transition: all 0.5s ease;
    white-space: nowrap;
}

.tv-goal-text.won {
    color: #95a5a6;
    text-shadow: 1px 1px 0 rgba(0,0,0,0.3);
}

.tv-goal-text.won::before {
    content: "\2713\00a0";
}

.live-dot {
    width: 12px;
    height: 12px;
    background: #E74C3C;
    border-radius: 50%;
    animation: pulse 1.5s ease-in-out infinite;
}

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

.header-qr {
    display: none;
}

/* Language Dropdown */
.lang-dropdown {
    padding: 8px 12px;
    border-radius: var(--border-radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.3);
    color: var(--text-light);
    font-size: 16px;
    cursor: pointer;
    min-width: 120px;
}

/* Warm theme language dropdown for TV */
.tv-page .lang-dropdown {
    border: 1px solid rgba(139, 69, 19, 0.4);
    background: rgba(255, 255, 255, 0.6);
    color: #5c3a21;
}

.language-selector {
    position: absolute;
    bottom: 16px;
    right: 16px;
}

.language-selector.game-lang {
    z-index: 100;
}

/* =============================================================================
   Shared Styles (used by Jose and other pages)
   ============================================================================= */

.connection-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.status-dot.connected {
    background: var(--ball-green);
}

.status-dot.disconnected {
    background: #E74C3C;
}
