/* ══════════════════════════════════════════════
   CSS VARIABLES & RESET
══════════════════════════════════════════════ */
:root {
    --bg:          #07071a;
    --bg2:         #0d0d26;
    --bg3:         #12122e;
    --card:        rgba(255,255,255,0.04);
    --card-border: rgba(255,255,255,0.08);
    --gold:        #FFD700;
    --gold-dim:    rgba(255,215,0,0.15);
    --gold-glow:   rgba(255,215,0,0.4);
    --purple:      #7C3AED;
    --purple-dim:  rgba(124,58,237,0.15);
    --blue:        #3B82F6;
    --green:       #10B981;
    --red:         #EF4444;
    --text:        #f0f0ff;
    --text2:       #9090b8;
    --text3:       #5a5a80;
    --radius:      14px;
    --radius-sm:   8px;
    --shadow:      0 8px 32px rgba(0,0,0,0.4);
    --fb:          #1877F2;
    --transition:  0.2s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ══════ HEADER LOGO ══════ */
.brand-logo-link { display: flex; align-items: center; }
.brand-logo-img  { height: 32px; width: auto; filter: brightness(1.1); }
.brand-divider   { width: 1px; height: 32px; background: var(--card-border); margin: 0 14px; }

/* ══════ FOOTER ══════ */
.app-footer {
    position: relative; z-index: 1;
    display: flex; align-items: center; justify-content: center; gap: 10px;
    padding: 14px 24px;
    border-top: 1px solid var(--card-border);
    background: rgba(7,7,26,0.95);
    font-size: 0.8rem;
}
.footer-logo  { height: 22px; width: auto; opacity: 0.85; transition: opacity var(--transition); }
.footer-brand:hover .footer-logo { opacity: 1; }
.footer-sep   { color: var(--text3); }
.footer-text  { color: var(--text3); }
.footer-link  {
    color: var(--gold); text-decoration: none; font-weight: 600;
    transition: var(--transition);
}
.footer-link:hover { color: white; }

/* ══════ DRUM WATERMARK ══════ */
.drum-watermark {
    display: flex; align-items: center; gap: 7px;
    opacity: 0.35; transition: opacity var(--transition);
    text-decoration: none; margin-bottom: 6px;
}
.drum-watermark:hover { opacity: 0.65; }
.drum-watermark img  { height: 18px; width: auto; filter: brightness(0) invert(1); }
.drum-watermark span { font-size: 0.72rem; color: var(--text3); letter-spacing: 1px; }

/* ══════ PARTICLE BACKGROUND ══════ */
#bg-canvas {
    position: fixed; inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: 0.5;
}

/* ══════ SCROLLBAR ══════ */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--purple); }

/* ══════ TYPOGRAPHY ══════ */
h2 { font-size: 0.95rem; font-weight: 600; display: flex; align-items: center; gap: 8px; }
h2 i { color: var(--gold); }
label { font-size: 0.82rem; color: var(--text2); display: block; margin-bottom: 5px; }
small { font-size: 0.78rem; color: var(--text3); }

/* ══════════════════════════════════════════════
   HEADER
══════════════════════════════════════════════ */
.app-header {
    position: sticky; top: 0; z-index: 100;
    display: flex; align-items: center; gap: 20px;
    padding: 14px 24px;
    background: rgba(7,7,26,0.9);
    border-bottom: 1px solid var(--card-border);
    backdrop-filter: blur(20px);
}

.header-brand { display: flex; align-items: center; gap: 12px; }
.brand-logo { font-size: 2rem; }
.brand-name {
    font-family: 'Orbitron', monospace;
    font-size: 1.1rem; font-weight: 900;
    background: linear-gradient(135deg, var(--gold), #fff);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    letter-spacing: 1px;
}
.brand-tagline { font-size: 0.72rem; color: var(--text3); letter-spacing: 1px; text-transform: uppercase; }

.header-stats { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.stat-box { text-align: center; padding: 4px 16px; }
.stat-value { display: block; font-family: 'Orbitron', monospace; font-size: 1.3rem; font-weight: 700; color: var(--gold); }
.stat-label { font-size: 0.68rem; color: var(--text3); text-transform: uppercase; letter-spacing: 0.5px; }
.stat-separator { width: 1px; height: 32px; background: var(--card-border); }

.header-actions { display: flex; gap: 10px; margin-left: 20px; }
.hdr-btn {
    display: flex; align-items: center; gap: 7px;
    padding: 8px 16px; border: 1px solid var(--card-border);
    background: var(--card); color: var(--text2);
    border-radius: var(--radius-sm); cursor: pointer;
    font-size: 0.82rem; transition: var(--transition);
}
.hdr-btn:hover { background: rgba(255,255,255,0.08); color: var(--text); }
.hdr-btn-danger:hover { border-color: var(--red); color: var(--red); }

/* ══════════════════════════════════════════════
   LAYOUT
══════════════════════════════════════════════ */
.app-layout {
    position: relative; z-index: 1;
    display: grid;
    grid-template-columns: 320px 1fr 300px;
    gap: 16px;
    padding: 16px;
    min-height: calc(100vh - 65px);
    align-items: start;
}

/* ══════ PANEL ══════ */
.panel {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.panel-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--card-border);
    background: rgba(255,255,255,0.02);
}
.panel-header-btns { display: flex; gap: 6px; }

.badge {
    background: var(--purple-dim); color: var(--purple);
    border: 1px solid var(--purple);
    font-size: 0.75rem; font-weight: 700;
    padding: 2px 10px; border-radius: 20px;
}

/* ══════ TABS ══════ */
.tabs {
    display: flex; gap: 0;
    border-bottom: 1px solid var(--card-border);
    background: rgba(0,0,0,0.2);
}
.tab {
    flex: 1; padding: 10px 6px;
    background: transparent; border: none;
    color: var(--text3); cursor: pointer;
    font-size: 0.78rem; font-weight: 500;
    display: flex; align-items: center; justify-content: center; gap: 5px;
    border-bottom: 2px solid transparent; margin-bottom: -1px;
    transition: var(--transition);
}
.tab:hover { color: var(--text2); }
.tab.active { color: var(--gold); border-bottom-color: var(--gold); }

.tab-content { display: none; padding: 14px; }
.tab-content.active { display: block; }

/* ══════ DROP ZONE ══════ */
.drop-zone {
    border: 2px dashed var(--card-border);
    border-radius: var(--radius);
    padding: 24px 16px;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
}
.drop-zone:hover, .drop-zone.drag-over {
    border-color: var(--gold);
    background: var(--gold-dim);
}
.drop-icon { font-size: 2rem; color: var(--text3); margin-bottom: 8px; }
.drop-zone p { font-size: 0.88rem; color: var(--text2); margin: 6px 0 10px; }
.drop-or { font-size: 0.78rem; color: var(--text3); display: block; margin-bottom: 10px; }
.btn-upload {
    display: inline-block; padding: 8px 18px;
    background: var(--card); border: 1px solid var(--card-border);
    border-radius: var(--radius-sm); color: var(--text);
    cursor: pointer; font-size: 0.82rem;
    transition: var(--transition);
}
.btn-upload:hover { border-color: var(--gold); color: var(--gold); }

.column-picker {
    margin-top: 12px; padding-top: 12px;
    border-top: 1px solid var(--card-border);
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.column-picker label { margin: 0; color: var(--text2); font-size: 0.82rem; }
.select-field {
    flex: 1; padding: 7px 10px;
    background: var(--bg3); border: 1px solid var(--card-border);
    color: var(--text); border-radius: var(--radius-sm);
    font-size: 0.82rem;
}

/* ══════ FACEBOOK ══════ */
.fb-section { display: flex; flex-direction: column; gap: 10px; }
.fb-info {
    background: rgba(24,119,242,0.1);
    border: 1px solid rgba(24,119,242,0.25);
    border-radius: var(--radius-sm);
    padding: 10px 12px; font-size: 0.82rem;
    color: #5b9cf6; display: flex; align-items: center; gap: 8px;
}
.btn-fb {
    width: 100%; padding: 11px;
    background: var(--fb); border: none;
    color: white; border-radius: var(--radius-sm);
    cursor: pointer; font-size: 0.88rem; font-weight: 600;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    transition: var(--transition);
}
.btn-fb:hover { background: #1466d0; }
.fb-status {
    font-size: 0.8rem; min-height: 20px; color: var(--text3);
    display: flex; align-items: center; gap: 6px;
}

/* ══════ FACEBOOK TOKEN ══════ */
.fb-token-wrap { display: flex; flex-direction: column; gap: 5px; }
.btn-get-token {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 12px; font-size: 0.78rem;
    background: rgba(24,119,242,0.1); border: 1px solid rgba(24,119,242,0.3);
    color: #5b9cf6; border-radius: var(--radius-sm);
    text-decoration: none; transition: var(--transition); width: fit-content;
}
.btn-get-token:hover { background: rgba(24,119,242,0.2); }
.btn-help {
    width: 18px; height: 18px; border-radius: 50%;
    background: var(--bg3); border: 1px solid var(--card-border);
    color: var(--text3); font-size: 0.72rem; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    margin-left: 6px; vertical-align: middle;
}
.btn-help:hover { border-color: var(--gold); color: var(--gold); }
.fb-token-help-box {
    background: rgba(255,215,0,0.04); border: 1px solid rgba(255,215,0,0.15);
    border-radius: var(--radius-sm); padding: 12px 14px;
    font-size: 0.8rem; color: var(--text2);
}
.fb-token-help-box ol { margin: 8px 0 8px 16px; display: flex; flex-direction: column; gap: 4px; }
.fb-token-help-box code {
    background: rgba(255,255,255,0.08); padding: 1px 5px;
    border-radius: 3px; font-size: 0.78rem; color: var(--gold);
}
.fb-token-help-box strong { color: var(--text); }
.fb-token-help-box small { color: var(--text3); display: block; margin-top: 6px; }

/* ══════ MANUAL ══════ */
.manual-section { display: flex; flex-direction: column; gap: 10px; }

/* ══════ INPUTS ══════ */
.input-field, .textarea-field {
    width: 100%; padding: 9px 12px;
    background: var(--bg3); border: 1px solid var(--card-border);
    color: var(--text); border-radius: var(--radius-sm);
    font-size: 0.85rem; font-family: inherit;
    transition: border-color var(--transition);
}
.input-field:focus, .textarea-field:focus {
    outline: none; border-color: var(--purple);
}
.textarea-field { resize: vertical; }

/* ══════ BUTTONS ══════ */
.btn-primary {
    width: 100%; padding: 10px;
    background: linear-gradient(135deg, var(--purple), #5b21b6);
    border: none; color: white; border-radius: var(--radius-sm);
    cursor: pointer; font-size: 0.87rem; font-weight: 600;
    display: flex; align-items: center; justify-content: center; gap: 7px;
    transition: var(--transition);
}
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-sm { padding: 7px 14px; font-size: 0.8rem; width: auto; }

.icon-btn {
    width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
    background: transparent; border: 1px solid var(--card-border);
    color: var(--text3); border-radius: var(--radius-sm);
    cursor: pointer; transition: var(--transition);
}
.icon-btn:hover { border-color: var(--gold); color: var(--gold); }

.btn-text-sm {
    background: none; border: none; color: var(--text3);
    font-size: 0.75rem; cursor: pointer; margin-left: auto;
}
.btn-text-sm:hover { color: var(--red); }

/* ══════ PARTICIPANTS LIST ══════ */
.list-toolbar {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 14px;
    border-bottom: 1px solid var(--card-border);
}
.search-wrap { flex: 1; position: relative; }
.search-wrap i { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); color: var(--text3); font-size: 0.8rem; }
.search-field {
    width: 100%; padding: 7px 9px 7px 30px;
    background: var(--bg3); border: 1px solid var(--card-border);
    color: var(--text); border-radius: var(--radius-sm); font-size: 0.82rem;
}
.search-field:focus { outline: none; border-color: var(--purple); }

.participants-list {
    list-style: none;
    max-height: 320px; overflow-y: auto;
    padding: 6px;
}
.participant-item {
    display: flex; align-items: center; gap: 8px;
    padding: 7px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem; transition: background var(--transition);
}
.participant-item:hover { background: rgba(255,255,255,0.04); }
.participant-item.blacklisted { opacity: 0.4; text-decoration: line-through; }
.participant-num { color: var(--text3); font-size: 0.75rem; min-width: 24px; }
.participant-name { flex: 1; }
.participant-actions { display: none; gap: 4px; }
.participant-item:hover .participant-actions { display: flex; }
.p-action-btn {
    width: 22px; height: 22px; display: flex; align-items: center; justify-content: center;
    background: transparent; border: none; color: var(--text3);
    cursor: pointer; border-radius: 4px; font-size: 0.72rem;
    transition: var(--transition);
}
.p-action-btn:hover { background: rgba(255,255,255,0.08); color: var(--text); }
.p-action-btn.blacklist-btn:hover { color: var(--red); }

.empty-hint {
    text-align: center; padding: 30px 16px; color: var(--text3);
    list-style: none;
}
.empty-hint i { font-size: 1.8rem; margin-bottom: 10px; }
.empty-hint p { font-size: 0.88rem; color: var(--text2); margin-bottom: 4px; }
.empty-hint-sm { font-size: 0.82rem; color: var(--text3); padding: 14px; text-align: center; }

/* ══════════════════════════════════════════════
   LOTTERY MACHINE (CENTER)
══════════════════════════════════════════════ */
.panel-center {
    display: flex; flex-direction: column;
    align-items: center;
    background: linear-gradient(180deg, rgba(124,58,237,0.04), var(--card));
}

.machine-wrap {
    width: 100%; max-width: 540px; margin: 0 auto;
    padding: 28px 24px;
    display: flex; flex-direction: column; align-items: center; gap: 28px;
}

.machine-status-bar {
    font-family: 'Orbitron', monospace;
    font-size: 0.85rem; font-weight: 600;
    letter-spacing: 2px; text-transform: uppercase;
    color: var(--text3); text-align: center;
    padding: 8px 24px;
    border: 1px solid var(--card-border);
    border-radius: 20px;
    background: rgba(0,0,0,0.3);
    min-width: 280px;
    transition: color 0.4s, border-color 0.4s;
}
.machine-status-bar.running { color: var(--gold); border-color: var(--gold-dim); }
.machine-status-bar.done    { color: var(--green); border-color: rgba(16,185,129,0.3); }

/* ══════ DRUM ══════ */
.drum-outer {
    position: relative; width: 100%;
    display: flex; align-items: center; justify-content: center;
}

.drum-glow-ring {
    position: absolute; inset: -20px;
    border-radius: 50%;
    background: radial-gradient(ellipse at center, var(--gold-dim), transparent 70%);
    pointer-events: none; opacity: 0;
    transition: opacity 0.5s;
}
.drum-outer.spinning .drum-glow-ring { opacity: 1; }

.drum-window {
    width: 100%; height: 320px;
    overflow: hidden; position: relative;
    border-radius: 18px;
    border: 2px solid var(--card-border);
    background: rgba(0,0,0,0.6);
    box-shadow: inset 0 0 40px rgba(0,0,0,0.5), var(--shadow);
}

.drum-list {
    position: absolute; top: 0; left: 0; width: 100%;
    will-change: transform;
}

.drum-item {
    height: 80px;
    display: flex; align-items: center; justify-content: center;
    font-family: 'Orbitron', monospace;
    font-size: clamp(1rem, 3vw, 1.6rem); font-weight: 700;
    color: var(--text2);
    padding: 0 20px; text-align: center;
    word-break: break-word; line-height: 1.2;
    transition: color 0.1s, text-shadow 0.1s;
}
.drum-item.active {
    color: var(--gold);
    text-shadow: 0 0 30px var(--gold-glow);
}
.drum-placeholder { color: var(--text3) !important; font-size: 2rem !important; }

.drum-fade {
    position: absolute; left: 0; right: 0; height: 100px; z-index: 2; pointer-events: none;
}
.drum-fade.top    { top: 0;    background: linear-gradient(to bottom, rgba(0,0,0,0.95), transparent); }
.drum-fade.bottom { bottom: 0; background: linear-gradient(to top,   rgba(0,0,0,0.95), transparent); }

.drum-selector-line {
    position: absolute; left: 0; right: 0; height: 2px;
    background: linear-gradient(to right, transparent, var(--gold-glow), var(--gold), var(--gold-glow), transparent);
    z-index: 3; pointer-events: none;
    box-shadow: 0 0 10px var(--gold-glow);
}
.drum-selector-line.top    { top:    calc(50% - 40px); }
.drum-selector-line.bottom { bottom: calc(50% - 40px); }

/* ══════ CONTROLS ══════ */
.machine-controls {
    width: 100%; display: flex; flex-direction: column; align-items: center; gap: 20px;
}

.winners-count-box { display: flex; align-items: center; gap: 16px; }
.count-label { font-size: 0.82rem; color: var(--text2); }
.count-ctrl { display: flex; align-items: center; gap: 12px; }
.count-btn {
    width: 34px; height: 34px;
    background: var(--bg3); border: 1px solid var(--card-border);
    color: var(--text); font-size: 1.2rem; border-radius: 50%;
    cursor: pointer; transition: var(--transition);
    display: flex; align-items: center; justify-content: center;
}
.count-btn:hover { border-color: var(--gold); color: var(--gold); }
.count-value {
    font-family: 'Orbitron', monospace;
    font-size: 1.4rem; font-weight: 700; min-width: 28px; text-align: center;
    color: var(--gold);
}

/* ══════ START BUTTON ══════ */
.btn-start {
    width: 100%; max-width: 340px; padding: 18px;
    background: linear-gradient(135deg, #92400e, var(--gold), #92400e);
    background-size: 200% 200%; background-position: 0% 50%;
    border: none; color: #1a0a00;
    border-radius: 50px; cursor: pointer;
    font-family: 'Orbitron', monospace;
    font-size: 1rem; font-weight: 900; letter-spacing: 2px;
    display: flex; align-items: center; justify-content: center; gap: 12px;
    transition: background-position 0.4s, transform 0.2s, box-shadow 0.3s;
    box-shadow: 0 4px 24px rgba(255,215,0,0.25);
    position: relative; overflow: hidden;
}
.btn-start:hover:not(:disabled) {
    background-position: 100% 50%;
    box-shadow: 0 8px 32px rgba(255,215,0,0.5);
    transform: translateY(-2px);
}
.btn-start:active:not(:disabled) { transform: translateY(0); }
.btn-start:disabled { opacity: 0.3; cursor: not-allowed; }
.btn-start.running {
    background: linear-gradient(135deg, #1e1e3a, #3b3b6e);
    color: var(--text2); box-shadow: none; cursor: not-allowed;
}
.start-icon { font-size: 1.1rem; }
.start-text { font-size: 0.9rem; }

.machine-options { display: flex; gap: 20px; }
.toggle-opt {
    display: flex; align-items: center; gap: 9px;
    font-size: 0.82rem; color: var(--text2); cursor: pointer;
}
.toggle-opt input { display: none; }
.toggle-track {
    width: 36px; height: 20px; background: var(--bg3);
    border: 1px solid var(--card-border); border-radius: 20px;
    position: relative; transition: background var(--transition);
    flex-shrink: 0;
}
.toggle-thumb {
    position: absolute; top: 3px; left: 3px;
    width: 12px; height: 12px; border-radius: 50%;
    background: var(--text3); transition: transform var(--transition), background var(--transition);
}
.toggle-opt input:checked + .toggle-track { background: var(--purple-dim); border-color: var(--purple); }
.toggle-opt input:checked + .toggle-track .toggle-thumb { transform: translateX(16px); background: var(--purple); }

/* ══════════════════════════════════════════════
   RESULTS PANEL
══════════════════════════════════════════════ */
.results-section { padding: 14px; border-bottom: 1px solid var(--card-border); }
.history-section { padding: 14px; }

.section-title {
    font-size: 0.75rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: 1px; color: var(--text3);
    margin-bottom: 10px; display: flex; align-items: center;
}

.winners-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }

.winner-item {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 14px; border-radius: var(--radius-sm);
    background: rgba(255,215,0,0.04); border: 1px solid rgba(255,215,0,0.1);
    animation: slideInRight 0.4s ease;
}
.winner-medal { font-size: 1.3rem; min-width: 28px; }
.winner-info { flex: 1; }
.winner-item-name { font-weight: 600; font-size: 0.9rem; }
.winner-item-time { font-size: 0.72rem; color: var(--text3); margin-top: 2px; }

.history-list { display: flex; flex-direction: column; gap: 8px; max-height: 280px; overflow-y: auto; }
.history-entry {
    background: rgba(255,255,255,0.02); border: 1px solid var(--card-border);
    border-radius: var(--radius-sm); overflow: hidden;
}
.history-entry-header {
    padding: 8px 12px; display: flex; align-items: center; gap: 8px;
    cursor: pointer; font-size: 0.8rem; color: var(--text2);
}
.history-entry-header:hover { background: rgba(255,255,255,0.03); }
.history-entry-header i { margin-left: auto; font-size: 0.7rem; color: var(--text3); }
.history-entry-body { padding: 0 12px 10px; font-size: 0.8rem; color: var(--text3); }
.history-entry-body.collapsed { display: none; }

/* ══════════════════════════════════════════════
   WINNER OVERLAY
══════════════════════════════════════════════ */
.winner-overlay {
    position: fixed; inset: 0; z-index: 1000;
    background: rgba(0,0,0,0.85);
    display: flex; align-items: center; justify-content: center;
    backdrop-filter: blur(6px);
    animation: fadeIn 0.3s ease;
}

.winner-card {
    background: linear-gradient(135deg, var(--bg2), var(--bg3));
    border: 2px solid var(--gold);
    border-radius: 24px; padding: 48px 56px;
    text-align: center; max-width: 480px; width: 90%;
    box-shadow: 0 0 60px rgba(255,215,0,0.3), var(--shadow);
    animation: popIn 0.5s cubic-bezier(0.175,0.885,0.32,1.275);
}

.overlay-logo {
    display: block;
    margin-bottom: 20px;
}
.overlay-logo img {
    height: 28px;
    width: auto;
    opacity: 0.75;
    filter: brightness(0) invert(1);
    transition: opacity var(--transition);
}
.overlay-logo:hover img { opacity: 1; }

.winner-trophy-anim {
    font-size: 5rem; margin-bottom: 16px;
    animation: trophyBounce 0.6s ease 0.2s both;
    display: inline-block;
}
.winner-badge {
    font-family: 'Orbitron', monospace;
    font-size: 0.75rem; font-weight: 700; letter-spacing: 4px;
    color: var(--gold); margin-bottom: 20px;
    text-transform: uppercase;
}
.winner-name {
    font-family: 'Orbitron', monospace;
    font-size: clamp(1.4rem, 4vw, 2.2rem); font-weight: 900;
    color: white; margin-bottom: 8px;
    text-shadow: 0 0 30px rgba(255,255,255,0.3);
    word-break: break-word;
}
.winner-pos { font-size: 0.9rem; color: var(--text2); margin-bottom: 32px; }

.btn-overlay-next {
    padding: 13px 36px;
    background: var(--gold); border: none; color: #1a0a00;
    border-radius: 50px; cursor: pointer;
    font-weight: 700; font-size: 0.9rem;
    display: inline-flex; align-items: center; gap: 8px;
    transition: var(--transition);
}
.btn-overlay-next:hover { background: #fff; }

/* ══════════════════════════════════════════════
   MODAL
══════════════════════════════════════════════ */
.modal-backdrop {
    position: fixed; inset: 0; z-index: 900;
    background: rgba(0,0,0,0.7);
    display: flex; align-items: center; justify-content: center;
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease;
}
.modal {
    background: var(--bg2); border: 1px solid var(--card-border);
    border-radius: var(--radius); width: 90%; max-width: 480px;
    box-shadow: var(--shadow);
    animation: popIn 0.3s ease;
}
.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px; border-bottom: 1px solid var(--card-border);
}
.modal-header h3 { font-size: 0.95rem; display: flex; align-items: center; gap: 8px; }
.modal-header h3 i { color: var(--red); }
.modal-close {
    background: none; border: none; color: var(--text3);
    font-size: 1.4rem; cursor: pointer; line-height: 1; padding: 4px 8px;
}
.modal-close:hover { color: var(--text); }
.modal-body { padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.modal-body p { font-size: 0.85rem; color: var(--text2); }

/* ══════════════════════════════════════════════
   NOTIFICATIONS
══════════════════════════════════════════════ */
#notifications {
    position: fixed; top: 80px; right: 20px; z-index: 2000;
    display: flex; flex-direction: column; gap: 8px;
    max-width: 320px;
}
.notif {
    padding: 12px 16px; border-radius: var(--radius-sm);
    font-size: 0.85rem; font-weight: 500;
    display: flex; align-items: center; gap: 10px;
    animation: slideInRight 0.3s ease;
    box-shadow: var(--shadow);
}
.notif.success { background: #064e3b; border: 1px solid #10b981; color: #a7f3d0; }
.notif.error   { background: #450a0a; border: 1px solid var(--red); color: #fca5a5; }
.notif.info    { background: #1e1b4b; border: 1px solid var(--purple); color: #c4b5fd; }
.notif.fade-out { opacity: 0; transition: opacity 0.3s; }

/* ══════════════════════════════════════════════
   LOADING SPINNER
══════════════════════════════════════════════ */
.spinner {
    width: 16px; height: 16px;
    border: 2px solid rgba(255,255,255,0.2);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: inline-block; flex-shrink: 0;
}

/* ══════════════════════════════════════════════
   ANIMATIONS
══════════════════════════════════════════════ */
@keyframes fadeIn        { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideInRight  { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: translateX(0); } }
@keyframes popIn         { from { opacity: 0; transform: scale(0.8); } to { opacity: 1; transform: scale(1); } }
@keyframes spin          { to { transform: rotate(360deg); } }
@keyframes trophyBounce  { from { transform: scale(0) rotate(-20deg); } 60% { transform: scale(1.2) rotate(5deg); } to { transform: scale(1) rotate(0deg); } }
@keyframes pulseGold     { 0%,100% { box-shadow: 0 0 16px var(--gold-dim); } 50% { box-shadow: 0 0 36px var(--gold-glow); } }
@keyframes drumFlash     { 0%,100% { background: transparent; } 50% { background: var(--gold-dim); } }

.drum-window.flash { animation: drumFlash 0.15s ease 3; }

/* ══════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════ */
@media (max-width: 1100px) {
    .app-layout { grid-template-columns: 280px 1fr 260px; }
}
@media (max-width: 900px) {
    .app-layout { grid-template-columns: 1fr; }
    .header-stats { display: none; }
    .machine-options { flex-wrap: wrap; }
}
@media (max-width: 500px) {
    .app-header { flex-wrap: wrap; gap: 10px; }
    .header-actions { margin-left: 0; }
    .winner-card { padding: 32px 24px; }
}
