/* Dromos Draw — "ON AIR" broadcast console theme */

:root {
    /* Dromos FM brand: yellow #E2CA38 (grad #EBD850→#C8B12A), olive #595C4A, black, white */
    --bg: #10110a;
    --bg-raise: #171910;
    --bg-panel: #1e2115;
    --line: #343827;
    --line-soft: #282b1d;
    --text: #f3f1e3;
    --text-dim: #adab95;
    --text-faint: #767861;
    --amber: #E2CA38;
    --amber-soft: rgba(226, 202, 56, .12);
    --olive: #595C4A;
    --red: #ff3b30;
    --red-soft: rgba(255, 59, 48, .12);
    --green: #3ddc84;
    --font-display: "Sofia Sans Extra Condensed", sans-serif;
    --font-body: "Sofia Sans", sans-serif;
    --font-mono: "JetBrains Mono", monospace;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.55;
    min-height: 100vh;
    position: relative;
}

/* Grain + vignette atmosphere */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
}
body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    background:
        radial-gradient(1200px 500px at 50% -10%, rgba(226, 202, 56, .07), transparent 60%),
        radial-gradient(900px 600px at 50% 110%, rgba(89, 92, 74, .18), transparent 60%);
}

.wrap {
    position: relative;
    z-index: 2;
    max-width: 980px;
    margin: 0 auto;
    padding: 0 20px 80px;
}

/* ── Header ─────────────────────────────── */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 0 18px;
    border-bottom: 1px solid var(--line-soft);
    margin-bottom: 34px;
}
.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: var(--text);
}
.brand img { height: 46px; width: 46px; border-radius: 10px; box-shadow: 0 4px 14px rgba(0, 0, 0, .45); }
.login-card img.logo { height: 96px; width: 96px; border-radius: 20px; margin-bottom: 18px; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); }
.brand .onair {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 15px;
    letter-spacing: .14em;
    color: var(--red);
    border: 1px solid rgba(255, 59, 48, .5);
    background: var(--red-soft);
    border-radius: 4px;
    padding: 3px 9px 2px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    text-transform: uppercase;
}
.brand .onair::before {
    content: "";
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--red);
    box-shadow: 0 0 8px var(--red);
    animation: blink 1.6s infinite;
}
@keyframes blink { 0%, 60% { opacity: 1; } 80% { opacity: .25; } 100% { opacity: 1; } }
.brand h1 {
    font-family: var(--font-display);
    font-size: 30px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
    line-height: 1;
}
.brand h1 span { color: var(--amber); }
.topbar form button {
    background: none;
    border: 1px solid var(--line);
    color: var(--text-faint);
    font-family: var(--font-body);
    font-size: 14px;
    padding: 7px 14px;
    border-radius: 6px;
    cursor: pointer;
    transition: color .15s, border-color .15s;
}
.topbar form button:hover { color: var(--text); border-color: var(--text-faint); }

/* ── Panels & typography ────────────────── */
.panel {
    background: linear-gradient(180deg, var(--bg-panel), var(--bg-raise));
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 28px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, .35);
}
.eyebrow {
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: .22em;
    text-transform: uppercase;
    color: var(--amber);
    margin-bottom: 10px;
}
h2.title {
    font-family: var(--font-display);
    font-size: clamp(38px, 7vw, 58px);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .02em;
    line-height: .95;
    margin-bottom: 26px;
}
h2.title em { font-style: normal; color: var(--amber); }
.sub { color: var(--text-dim); max-width: 60ch; }

/* ── Forms ──────────────────────────────── */
label.fld {
    display: block;
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin: 20px 0 7px;
}
input[type="text"], input[type="password"], input[type="number"], select {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 17px;
    padding: 12px 14px;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus {
    border-color: var(--amber);
    box-shadow: 0 0 0 3px var(--amber-soft);
}
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 20px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #000;
    background: linear-gradient(160deg, #EBD850, #C8B12A);
    border: none;
    border-radius: 10px;
    padding: 14px 30px;
    cursor: pointer;
    text-decoration: none;
    transition: transform .12s, box-shadow .2s, filter .15s;
    box-shadow: 0 6px 22px rgba(226, 202, 56, .22);
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.05); }
.btn:active { transform: translateY(1px); }
.btn.ghost {
    background: none;
    color: var(--text-dim);
    border: 1px solid var(--line);
    box-shadow: none;
    font-size: 16px;
}
.btn.ghost:hover { color: var(--text); border-color: var(--text-faint); }
.btn.danger {
    background: none;
    border: 1px solid rgba(255, 59, 48, .4);
    color: var(--red);
    box-shadow: none;
    font-size: 15px;
    padding: 9px 16px;
}
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.errors {
    background: var(--red-soft);
    border: 1px solid rgba(255, 59, 48, .4);
    color: #ffb0aa;
    border-radius: 10px;
    padding: 13px 16px;
    margin-bottom: 20px;
    font-size: 15px;
}
.flash {
    background: rgba(61, 220, 132, .1);
    border: 1px solid rgba(61, 220, 132, .35);
    color: #a9edc8;
    border-radius: 10px;
    padding: 13px 16px;
    margin-bottom: 20px;
    font-size: 15px;
}

/* ── Login ──────────────────────────────── */
.login-stage {
    min-height: 82vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.login-card { width: 100%; max-width: 420px; text-align: center; padding: 40px 34px; }
.login-card .onair-big {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 17px;
    letter-spacing: .2em;
    color: var(--red);
    border: 1px solid rgba(255, 59, 48, .5);
    background: var(--red-soft);
    border-radius: 5px;
    padding: 5px 14px 4px;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 20px;
}
.login-card .onair-big::before {
    content: "";
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--red);
    box-shadow: 0 0 10px var(--red);
    animation: blink 1.6s infinite;
}
.login-card h1 {
    font-family: var(--font-display);
    font-size: 44px;
    font-weight: 800;
    text-transform: uppercase;
    line-height: .95;
    margin-bottom: 6px;
}
.login-card h1 span { color: var(--amber); }
.login-card p { color: var(--text-dim); font-size: 15px; }
.login-card .btn { width: 100%; margin-top: 24px; }

/* ── History table ──────────────────────── */
.draw-list { list-style: none; display: grid; gap: 12px; }
.draw-list li a {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 4px 16px;
    align-items: center;
    text-decoration: none;
    color: var(--text);
    background: linear-gradient(180deg, var(--bg-panel), var(--bg-raise));
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 18px 22px;
    transition: border-color .15s, transform .12s;
}
.draw-list li a:hover { border-color: var(--amber); transform: translateX(4px); }
.draw-list .dtitle { font-family: var(--font-display); font-size: 24px; font-weight: 700; letter-spacing: .02em; }
.draw-list .dmeta { color: var(--text-faint); font-size: 14px; font-family: var(--font-mono); }
.draw-list .dstat {
    grid-row: span 2;
    text-align: right;
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-dim);
    line-height: 1.8;
}
.draw-list .dstat b { color: var(--amber); font-size: 16px; }
.empty {
    text-align: center;
    color: var(--text-faint);
    padding: 60px 20px;
    border: 1px dashed var(--line);
    border-radius: 14px;
}

/* ── Upload ─────────────────────────────── */
.dropzone {
    border: 2px dashed var(--line);
    border-radius: 14px;
    padding: 46px 24px;
    text-align: center;
    cursor: pointer;
    transition: border-color .15s, background .15s;
    background: rgba(255, 255, 255, .01);
}
.dropzone:hover, .dropzone.dragover { border-color: var(--amber); background: var(--amber-soft); }
.dropzone .dz-icon { font-size: 40px; margin-bottom: 10px; }
.dropzone .dz-label { font-family: var(--font-display); font-size: 24px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.dropzone .dz-hint { color: var(--text-faint); font-size: 14px; margin-top: 6px; }
.dropzone.hasfile { border-color: var(--amber); }
.dropzone.hasfile .dz-label { color: var(--amber); }

/* ── Preview table ──────────────────────── */
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
table.sample { width: 100%; border-collapse: collapse; font-size: 15px; }
table.sample th, table.sample td {
    padding: 9px 14px;
    border-bottom: 1px solid var(--line-soft);
    text-align: left;
    white-space: nowrap;
}
table.sample th {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: .14em;
    color: var(--text-faint);
    text-transform: uppercase;
    background: rgba(255, 255, 255, .02);
}
table.sample td.is-name { color: #fff; background: rgba(255, 255, 255, .03); }
table.sample td.is-phone { color: var(--amber); background: var(--amber-soft); font-family: var(--font-mono); font-size: 14px; }
.map-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 640px) { .map-grid { grid-template-columns: 1fr; } }
.checkline { display: flex; align-items: center; gap: 10px; margin-top: 20px; color: var(--text-dim); font-size: 15px; }
.checkline input { width: 18px; height: 18px; accent-color: var(--amber); }

/* ── Draw stage ─────────────────────────── */
.statgrid { display: flex; gap: 14px; flex-wrap: wrap; margin: 22px 0; }
.stat {
    flex: 1;
    min-width: 130px;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 16px 18px;
}
.stat .k { font-family: var(--font-mono); font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--text-faint); }
.stat .v { font-family: var(--font-display); font-size: 36px; font-weight: 800; color: var(--amber); line-height: 1.1; }
.stat .v.small { font-size: 20px; color: var(--text-dim); }

.runline { display: flex; gap: 14px; align-items: end; flex-wrap: wrap; margin-top: 8px; }
.runline .fldgroup { flex: 0 0 150px; }
.runline .fldgroup label.fld { margin-top: 0; }
.runline .btn.run { font-size: 26px; padding: 15px 44px; }

/* Slot machine */
.slot-stage {
    margin-top: 30px;
    display: none;
    text-align: center;
    padding: 40px 16px 30px;
    background:
        repeating-linear-gradient(0deg, transparent 0 3px, rgba(0,0,0,.22) 3px 4px),
        radial-gradient(600px 300px at 50% 0%, rgba(226,202,56,.08), transparent 70%),
        var(--bg);
    border: 1px solid var(--line);
    border-radius: 16px;
}
.slot-stage.active { display: block; }
.slot-label {
    font-family: var(--font-mono);
    font-size: 13px;
    letter-spacing: .3em;
    text-transform: uppercase;
    color: var(--red);
    margin-bottom: 22px;
    animation: blink 1.2s infinite;
}
.slot-digits {
    display: inline-flex;
    gap: 14px;
    justify-content: center;
}
.slot-digits .digit {
    font-family: var(--font-mono);
    font-size: clamp(64px, 14vw, 120px);
    font-weight: 700;
    color: var(--amber);
    background: linear-gradient(180deg, #050403, #14100c 45%, #050403);
    border: 1px solid var(--line);
    border-radius: 12px;
    width: clamp(80px, 17vw, 140px);
    line-height: 1.35;
    text-shadow: 0 0 24px rgba(226, 202, 56, .55);
    box-shadow: inset 0 8px 18px rgba(0, 0, 0, .8), 0 4px 20px rgba(0, 0, 0, .5);
}
.slot-digits.locked .digit {
    color: #fff;
    text-shadow: 0 0 26px rgba(255, 255, 255, .55);
    animation: lockpulse .5s ease-out;
}
@keyframes lockpulse {
    0% { transform: scale(1.12); }
    100% { transform: scale(1); }
}
.slot-sub { margin-top: 18px; color: var(--text-faint); font-family: var(--font-mono); font-size: 13px; letter-spacing: .12em; }

/* Winner reveal */
.winner-reveal {
    display: none;
    margin-top: 26px;
    animation: rise .5s ease-out;
}
.winner-reveal.active { display: block; }
@keyframes rise {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: none; }
}
.winner-card {
    display: inline-block;
    background: linear-gradient(180deg, rgba(226, 202, 56, .16), rgba(226, 202, 56, .05));
    border: 1px solid rgba(226, 202, 56, .55);
    border-radius: 14px;
    padding: 20px 38px;
}
.winner-card .pos { font-family: var(--font-mono); font-size: 12px; letter-spacing: .24em; color: var(--amber); text-transform: uppercase; }
.winner-card .wname { font-family: var(--font-display); font-size: clamp(34px, 7vw, 52px); font-weight: 800; line-height: 1.05; color: #fff; }
.winner-card .wphone { font-family: var(--font-mono); font-size: 20px; color: var(--amber); letter-spacing: .06em; }

/* Winners list */
.winners-list { list-style: none; display: grid; gap: 10px; margin-top: 24px; }
.winners-list li {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 14px 18px;
    animation: rise .4s ease-out both;
}
.winners-list li .pos {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 22px;
    color: #000;
    background: linear-gradient(160deg, #EBD850, #C8B12A);
    border-radius: 8px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.winners-list li .wname { font-family: var(--font-display); font-size: 24px; font-weight: 700; flex: 1; }
.winners-list li .wphone { font-family: var(--font-mono); font-size: 16px; color: var(--amber); }

.actionsrow { display: flex; gap: 12px; margin-top: 28px; flex-wrap: wrap; align-items: center; }
.mt { margin-top: 26px; }
.hidden { display: none !important; }
