/* Breaker Boards - Premium Version with Full Customization */

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

body {
    background: transparent;
    overflow: hidden;
    min-height: 100vh;
    display: flex;
    font-family: 'Lato', sans-serif; /* Default to Lato for settings panel */
}

/* ===== SETTINGS PANEL (400px) - Dark Mode Only ===== */
.settings-panel {
    position: fixed;
    left: 0;
    top: 0;
    width: 400px;
    height: 100vh;
    background: #1a1a1a;
    color: #fff;
    border-right: 1px solid #333;
    overflow-y: auto;
    z-index: 1000;
    font-family: 'Lato', sans-serif;
}

.settings-panel h3,
.settings-panel .team-name-label,
.settings-panel .setting-group label {
    color: #fff;
}

.settings-panel .input-field,
.settings-panel .team-item,
.settings-panel .accordion-header,
.settings-panel .sport-btn,
.settings-panel .theme-btn,
.settings-panel .toggle-option {
    background: #2a2a2a;
    border-color: #444;
    color: #fff;
}

.settings-panel .setting-section {
    border-bottom-color: #333;
}

.settings-header {
    background: #000000;
    padding: 10px 20px;
    text-align: left;
    border-bottom: 1px solid black;
}

.panel-title {
    font-size: 26px;
    font-family: 'Lato', sans-serif;
    font-weight: 700;
    color: white;
    margin: 0;
    text-shadow: 0 0 10px #00bfff, 0 0 20px #00bfff;
}

.settings-content {
    padding: 15px;
}

.setting-section {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #ddd;
}

.setting-section:last-child {
    border-bottom: none;
}

.setting-section h3 {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.team-count {
    font-size: 11px;
    color: #666;
    font-weight: normal;
}

/* Sport Selector - Single Row */
.sport-selector {
    display: flex;
    gap: 6px;
}

.sport-btn {
    flex: 1;
    padding: 8px 12px;
    background: #f5f5f5;
    border: 1px solid #000;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.sport-btn:hover:not(.active) {
    background: #333;
    color: #fff;
}

.sport-btn.active {
    background: #000;
    color: #fff;
    border-width: 2px;
}

.sport-lock-warning {
    margin-top: 10px;
    padding: 6px 10px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
    color: #856404;
    font-size: 11px;
}

/* Input Fields */
.input-field {
    width: 100%;
    padding: 8px 10px;
    background: #f5f5f5;
    border: 1px solid #000;
    border-radius: 4px;
    font-size: 12px;
    color: #000;
}

.input-field:focus {
    outline: none;
    border-color: #333;
}

/* Event Name Inputs - Isolated Styles */
.event-name1,
.event-name2 {
    width: 100%;
    padding: 8px 10px;
    background: #f5f5f5;
    border: 1px solid #000;
    border-radius: 4px;
    font-size: 15px;
    color: #000;
}

.event-name1:focus,
.event-name2:focus {
    outline: none;
    border-color: #333;
}

/* Team List */
.team-list {
    max-height: 350px;
    overflow-y: auto;
    margin-bottom: 10px;
}

.team-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 6px;
}

.team-item.team-won {
    opacity: 0.6;
}

.team-logo-small {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.team-visibility-toggle {
    background: none;
    border: none;
    font-size: 14px;
    cursor: pointer;
    padding: 2px 6px;
}

.team-visibility-toggle.hidden {
    color: #dc3545;
}

.team-info {
    flex: 1;
}

.team-name-label {
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 2px;
}

.team-winner-input {
    width: 100%;
    padding: 4px 6px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 10px;
}

.team-delete-btn {
    background: #dc3545;
    border: none;
    color: white;
    padding: 4px 8px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.2s;
}

.team-delete-btn:hover {
    background: #c82333;
    transform: scale(1.05);
}

.btn-add-team {
    width: 100%;
    padding: 10px;
    background: #28a745;
    border: none;
    border-radius: 4px;
    color: white;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-add-team:hover {
    background: #218838;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

/* Accordion */
.accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 8px;
    background: #2a2a2a;
    border-radius: 4px;
    margin-bottom: 10px;
    transition: all 0.2s;
}

.accordion-header:hover {
    background: #1a1a1a;
    transform: translateX(2px);
}

.accordion-header h3 {
    margin: 0;
    font-size: 13px;
}

.accordion-header i.fa-chevron-down {
    transition: transform 0.3s;
}

.accordion-header.active i.fa-chevron-down {
    transform: rotate(180deg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s;
}

.accordion-content.open {
    max-height: 2000px;
}

/* Buttons in Accordions */
.btn-export,
.btn-download-csv,
.btn-reset {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    margin-bottom: 6px;
    transition: all 0.2s;
}

.btn-export {
    background: #007bff;
    color: white;
}

.btn-export:hover {
    background: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

.btn-download-csv {
    background: #17a2b8;
    color: white;
}

.btn-download-csv:hover {
    background: #138496;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(23, 162, 184, 0.3);
}

.btn-reset {
    background: #dc3545;
    color: white;
}

.btn-reset:hover {
    background: #c82333;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}

/* Design Settings */
.setting-group {
    margin-bottom: 12px;
}

.setting-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 4px;
}

.setting-group small {
    font-size: 10px;
    color: #666;
    margin-top: 2px;
}

.file-input {
    width: 100%;
    padding: 6px;
    background: #f5f5f5;
    border: 1px solid #000;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
}

.logo-preview,
.custom-icon-preview {
    margin-top: 6px;
    text-align: center;
}

.logo-preview img,
.custom-icon-preview img {
    max-width: 80px;
    max-height: 80px;
    object-fit: contain;
}

/* Theme Toggle */
.theme-toggle {
    display: flex;
    gap: 6px;
}

.theme-btn {
    flex: 1;
    padding: 8px;
    background: #f5f5f5;
    border: 1px solid #000;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
}

.theme-btn.active {
    background: #000;
    color: #fff;
}

/* Color Inputs - Side by Side */
.color-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.color-input {
    width: 40px;
    height: 28px;
    border: 1px solid #000;
    border-radius: 4px;
    cursor: pointer;
    flex-shrink: 0;
}

.hex-input {
    flex: 1;
    padding: 6px;
    background: #f5f5f5;
    border: 1px solid #000;
    border-radius: 4px;
    font-family: monospace;
    font-size: 11px;
}

/* Background Options */
.background-options {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    cursor: pointer;
}

.bg-input-group {
    margin-top: 6px;
}

/* Slider */
.slider {
    width: 100%;
    height: 4px;
    background: #ddd;
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: #000;
    border-radius: 50%;
    cursor: pointer;
}

.slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: #000;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

/* Toggle Options */
.toggle-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    background: #f5f5f5;
    border-radius: 4px;
    margin-bottom: 6px;
    cursor: pointer;
}

.toggle-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.toggle-option span {
    font-size: 12px;
}

/* Mask Info Display - Dark Mode */
.mask-info {
    padding: 10px;
    background: #2a2a2a;
    border: 1px solid #444;
    border-radius: 4px;
    font-size: 10px;
    font-family: monospace;
    margin-top: 10px;
    color: #fff;
}

.mask-info strong {
    display: block;
    margin-bottom: 4px;
    font-size: 11px;
    color: #fff;
}

/* ===== MAIN CONTENT (No Theme Applied) ===== */
.main-content {
    margin-left: 400px;
    width: calc(100vw - 400px);
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--main-bg, #1a1a1a);
    position: relative;
}

/* Game Board - FIXED SIZE 750px × auto */
.game-board {
    width: 650px; /* Decreased from 700px */
    height: auto;
    max-height: 85vh;
    background: var(--board-bg, white);
    border: var(--board-border-width, 2px) solid var(--board-border-color, black);
    border-radius: var(--board-radius, 8px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    position: relative;
    font-family: var(--gameboard-font, 'Graduate', cursive); /* Controlled by JavaScript */
}

/* Randomizer Container */
.randomizer-container {
    padding: 1px 6px 2px 1px;
    background: var(--randomizer-bg, transparent);
    display: flex;
    align-items: flex-start;
    gap: 5px;
    min-height: 75px;
    flex-shrink: 0;
    position: relative;
}

.seller-logo {
    width: 75px;
    height: 75px;
    object-fit: contain;
    flex-shrink: 0;
}

/* Right side container for reel and chyron */
.reel-chyron-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Logo Animations */
.seller-logo.animate-spin { animation: logoSpin 0.5s ease-in-out; }
.seller-logo.animate-turn { animation: logoTurn 0.5s ease-in-out; }
.seller-logo.animate-pop { animation: logoPop 0.4s ease-in-out; }
.seller-logo.animate-bounce { animation: logoBounce 0.6s ease-in-out; }
.seller-logo.animate-shake { animation: logoShake 0.5s ease-in-out; }
.seller-logo.animate-pulse { animation: logoPulse 0.5s ease-in-out; }
.seller-logo.animate-wobble { animation: logoWobble 0.6s ease-in-out; }
.seller-logo.animate-zoomoutspin { animation: logoZoomOutSpin 0.7s ease-in-out; }

@keyframes logoSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes logoTurn {
    0%, 100% { transform: rotateY(0deg); }
    50% { transform: rotateY(180deg); }
}

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

@keyframes logoBounce {
    0%, 100% { transform: translateY(0); }
    25% { transform: translateY(-15px); }
    50% { transform: translateY(0); }
    75% { transform: translateY(-8px); }
}

@keyframes logoShake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

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

@keyframes logoWobble {
    0%, 100% { transform: rotate(0deg); }
    15% { transform: rotate(-10deg); }
    30% { transform: rotate(10deg); }
    45% { transform: rotate(-10deg); }
    60% { transform: rotate(10deg); }
    75% { transform: rotate(-5deg); }
}

@keyframes logoZoomOutSpin {
    0% { transform: scale(1) rotate(0deg); opacity: 1; }
    50% { transform: scale(0.3) rotate(180deg); opacity: 0.5; }
    100% { transform: scale(1) rotate(360deg); opacity: 1; }
}

.reel-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 5px;
    margin-top: 6px; /* Space above reel */
}

.reel-display {
    flex: 0 1 auto;
    height: 32px;
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    overflow: hidden;
    min-width: 200px;
}

.reel-name {
    font-size: 22px;
    font-weight: 600;
    text-align: left;
    color: var(--brand-text, #000);
    font-family: inherit; /* Use gameboard font */
}

.remaining-counter {
    font-size: 11px;
    font-weight: 600;
    text-align: right;
    color: var(--brand-text, #000);
    line-height: 1.3;
    flex-shrink: 0;
    margin-left: auto;
}

.remaining-counter .count {
    display: block;
    font-size: 14px;
    font-weight: 700;
}

.reel-display.spinning {
    animation: pulse 0.1s infinite;
}

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

/* Event Chyron - Simple, visible display */
.event-chyron {
    max-height: 40px;
    min-height: 40px;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
}

.event-names {
    width: 100%;
    max-height: 40px;
    min-height: 30px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.event-name-display {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.event-name-primary,
.event-name-secondary {
    font-weight: 400; /* Changed from 600 to regular */
    line-height: 1;
    color: #000000;  /* Color set via inline style */
    white-space: nowrap;
    position: absolute;
    width: 100%;
    text-align: center;  /* Default, overridden by inline style */
    opacity: 0;
    transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out;
    font-family: inherit; /* Use gameboard font */
}

/* Single title - ALWAYS VISIBLE */
.event-names:not(.cycling) .event-name-primary {
    position: relative !important;  /* Not absolute */
    opacity: 1 !important;
    transform: none !important;
}

/* Hide secondary when not cycling */
.event-names:not(.cycling) .event-name-secondary {
    display: none !important;
}

/* Cycling animation */
.event-names.cycling .event-name-primary {
    animation: rollTopToBottom 7s ease-in-out infinite;
}

.event-names.cycling .event-name-secondary {
    animation: rollTopToBottom 7s ease-in-out infinite;
    animation-delay: 3.5s;
}

@keyframes rollTopToBottom {
    0% { 
        opacity: 0;
        transform: translateY(-100%);
    }
    7% { 
        opacity: 1;
        transform: translateY(0);
    }
    43% { 
        opacity: 1;
        transform: translateY(0);
    }
    50% { 
        opacity: 0;
        transform: translateY(100%);
    }
    100% { 
        opacity: 0;
        transform: translateY(100%);
    }
}



/* Winners Container */
/* Winners Container */
.winners-container {
    flex: 0 0 auto;
    overflow-y: auto;
    padding: 8px;
    background: var(--winners-bg, transparent);
    font-family: var(--winners-font, 'Lato', sans-serif); /* Separate font for winners */
}

/* Grid Layout - 4 Columns, Fixed Width */
.winners-grid-detailed {
    display: grid;
    grid-template-columns: 25% 25% 25% 25%; /* Fixed 25% each column */
    gap: 1px;
    width: 100%; /* Ensure grid fills container */
}

.winner-cell-detailed {
    background: transparent;
    border: none;
    padding: 1px;
    display: flex;
    align-items: center;
    gap: 5px;
    min-height: 30px;
    width: 100%; /* Cell fills column */
    max-width: 100%; /* Prevent expansion */
    overflow: hidden; /* Critical: hide overflow content */
}

.winner-cell-detailed img {
    width: 28px;
    height: 28px;
    object-fit: contain;
    flex-shrink: 0;
    margin: 1px;
    transition: all 0.3s;
}

.winner-cell-detailed.team-won img {
    opacity: 0.5;
}

.winner-cell-detailed .winner-name {
    flex: 1;
    font-size: 13px;
    font-weight: 400;
    letter-spacing: -0.02em; 
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--brand-text, #000);
    min-width: 0; /* Critical: allow flex item to shrink below content size */
    max-width: 100%; /* Prevent expansion */
}

/* Responsive font sizing - steps down 1px at a time over 6px range (15 → 14 → 13 → 12 → 11 → 10) */
.winner-cell-detailed .winner-name.step1 {
    font-size: 13px;
}

.winner-cell-detailed .winner-name.step2 {
    font-size: 12px;
}

.winner-cell-detailed .winner-name.step3 {
    font-size: 11px;
}

.winner-cell-detailed .winner-name.step4 {
    font-size: 10px;
}

.winner-cell-detailed .winner-name.step5 {
    font-size: 9px;
}

.winner-cell-detailed.team-won {
    border: 1px solid var(--won-border-color, #ff0000);
    box-shadow: 0 0 var(--won-shadow-distance, 8px) var(--won-border-color, #ff0000);
    border-radius: 4px;
    padding: 2px;
}

/* Team Animation - Lift and Zoom */
.winner-cell-detailed.animating img {
    animation: teamLiftZoom 0.8s ease-out forwards;
}

@keyframes teamLiftZoom {
    0% { transform: scale(1) translateY(0); z-index: 1; }
    30% { transform: scale(10) translateY(-50px); z-index: 1000; }
    70% { transform: scale(10) translateY(-50px); z-index: 1000; }
    100% { transform: scale(10) translateY(200px); opacity: 0; z-index: 1000; }
}

/* Team Color Overlay */
.team-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 500;
}

/* Copyright Footer */
.copyright-footer {
    position: fixed;
    bottom: 10px;
    left: 470px;
    font-size: 10px;
    color: #666;
    font-family: Arial, sans-serif;
}

/* ===== FLOATING BUTTONS (Theme Applies) ===== */
.floating-buttons {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 100;
}

.action-btn {
    width: 50px;
    height: 50px;
    background: white;
    border: 2px solid black;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s;
}

body.theme-dark .action-btn {
    background: #1a1a1a;
    border-color: #fff;
    color: #fff;
}

.action-btn:hover {
    transform: scale(1.1);
}

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

.action-btn.btn-reset-action {
    background: #dc3545;
    border-color: #dc3545;
    color: white;
}

/* ===== MODALS (Theme Applies) ===== */
.modal {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    align-items: flex-start;
    justify-content: flex-end;
    z-index: 2000;
    padding: 30px;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border: 2px solid black;
    border-radius: 8px;
    max-width: 450px;
    width: 100%;
    animation: slideInRight 0.3s;
}

body.theme-dark .modal-content {
    background: #1a1a1a;
    border-color: #fff;
    color: #fff;
}

@keyframes slideInRight {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

.modal-header {
    padding: 15px;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

body.theme-dark .modal-header {
    border-bottom-color: #333;
}

.modal-header h3 {
    font-size: 16px;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
}

.modal-body {
    padding: 15px;
}

.modal-body p {
    font-size: 13px;
    line-height: 1.5;
}

.modal-footer {
    padding: 15px;
    border-top: 1px solid #ddd;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

body.theme-dark .modal-footer {
    border-top-color: #333;
}

.btn-cancel,
.btn-confirm {
    padding: 8px 20px;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
}

.btn-cancel {
    background: #f5f5f5;
    border: 1px solid #000;
}

body.theme-dark .btn-cancel {
    background: #2a2a2a;
    border-color: #fff;
    color: #fff;
}

.btn-confirm {
    background: #007bff;
    color: white;
}

.btn-confirm.btn-danger {
    background: #dc3545;
}

/* ===== SCROLLBAR ===== */
.settings-panel::-webkit-scrollbar,
.team-list::-webkit-scrollbar,
.winners-container::-webkit-scrollbar {
    width: 6px;
}

.settings-panel::-webkit-scrollbar-track,
.team-list::-webkit-scrollbar-track,
.winners-container::-webkit-scrollbar-track {
    background: #f5f5f5;
}

.settings-panel::-webkit-scrollbar-thumb,
.team-list::-webkit-scrollbar-thumb,
.winners-container::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}
