/* Limitless Giveaway — self-contained brand styling.
   No CDN: display font is self-hosted (Anton woff2), everything renders offline
   so the page is safe to run live at the event venue. */

@font-face {
    font-family: 'LimitlessDisplay';
    src: url('/static/fonts/anton.woff2') format('woff2');
    font-weight: 400 900;
    font-style: normal;
    font-display: swap;
}

:root {
    --lim-red: #ED2530;
    --lim-red-dark: #b81620;
    --lim-black: #000000;
    --lim-panel: #0d0d0d;
    --lim-panel-2: #141414;
    --lim-line: #262626;
    --lim-white: #ffffff;
    --lim-mute: #9a9a9a;
    --lim-yellow: #F5C542;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--lim-black);
    color: var(--lim-white);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica,
        Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--lim-red); }

.lim-display {
    font-family: 'LimitlessDisplay', 'Arial Narrow', sans-serif;
    text-transform: uppercase;
    font-style: italic;
    transform: skewX(-7deg);
    letter-spacing: 0.5px;
    line-height: 0.92;
    margin: 0;
}

.lim-wrap {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 18px 64px;
}

/* Top bar / logo */
.lim-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 2px solid var(--lim-red);
    padding-bottom: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.lim-logo { height: 40px; width: auto; display: block; }
.lim-topbar .lim-sub {
    color: var(--lim-mute);
    font-size: 13px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

/* Buttons — squared corners, aggressive */
.lim-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 2px solid var(--lim-white);
    background: transparent;
    color: var(--lim-white);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 13px;
    padding: 11px 18px;
    border-radius: 0;
    cursor: pointer;
    text-decoration: none;
    transition: background .12s, color .12s, border-color .12s;
    white-space: nowrap;
}
.lim-btn:hover { background: var(--lim-white); color: var(--lim-black); }
.lim-btn-red {
    background: var(--lim-red);
    border-color: var(--lim-red);
    color: var(--lim-white);
}
.lim-btn-red:hover { background: var(--lim-red-dark); border-color: var(--lim-red-dark); color: #fff; }
.lim-btn-ghost { border-color: var(--lim-line); color: var(--lim-mute); }
.lim-btn-ghost:hover { background: var(--lim-panel-2); color: #fff; border-color: var(--lim-line); }
.lim-btn:disabled { opacity: .4; cursor: not-allowed; }
.lim-btn-sm { padding: 7px 12px; font-size: 12px; }

/* Panels */
.lim-panel {
    background: var(--lim-panel);
    border: 1px solid var(--lim-line);
    border-radius: 0;
    padding: 20px;
}
.lim-panel + .lim-panel { margin-top: 18px; }
.lim-panel-title {
    font-size: 13px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--lim-mute);
    margin: 0 0 14px;
    font-weight: 700;
}

/* Stat strip */
.lim-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 22px;
}
.lim-stat {
    background: var(--lim-panel);
    border: 1px solid var(--lim-line);
    border-left: 4px solid var(--lim-red);
    padding: 16px;
}
.lim-stat .num {
    font-family: 'LimitlessDisplay', 'Arial Narrow', sans-serif;
    font-style: italic;
    transform: skewX(-7deg);
    font-size: 34px;
    line-height: 1;
}
.lim-stat .lbl {
    color: var(--lim-mute);
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-top: 8px;
}

/* Inputs */
.lim-input, .lim-select {
    width: 100%;
    background: #000;
    border: 1px solid var(--lim-line);
    color: #fff;
    padding: 11px 12px;
    border-radius: 0;
    font-size: 14px;
    outline: none;
}
.lim-input:focus, .lim-select:focus { border-color: var(--lim-red); }
.lim-label {
    display: block;
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--lim-mute);
    margin-bottom: 6px;
}

/* Earning-rule cards */
.lim-rule-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
}
.lim-rule-card {
    background: var(--lim-panel-2);
    border: 1px solid var(--lim-line);
    border-left: 3px solid var(--lim-red);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.lim-rule-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
}
.lim-rule-card-title {
    font-weight: 700;
    font-size: 15px;
    color: #fff;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
}
.lim-rule-card-src {
    color: var(--lim-mute);
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-top: 3px;
}
.lim-rule-fields {
    display: flex;
    flex-direction: column;
    gap: 11px;
}
.lim-rule-field { display: flex; flex-direction: column; gap: 5px; }
.lim-rule-field .lim-label { margin-bottom: 0; }

/* Tables */
.lim-table { width: 100%; border-collapse: collapse; }
.lim-table th {
    text-align: left;
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--lim-mute);
    padding: 10px 12px;
    border-bottom: 1px solid var(--lim-line);
    white-space: nowrap;
}
.lim-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #1b1b1b;
    font-size: 14px;
}
.lim-table tr:hover td { background: var(--lim-panel-2); }
.lim-entries {
    font-family: 'LimitlessDisplay', 'Arial Narrow', sans-serif;
    font-style: italic;
    transform: skewX(-7deg);
    color: var(--lim-red);
    font-size: 18px;
    display: inline-block;
}

/* Upload drop zones */
.lim-drop {
    border: 2px dashed var(--lim-line);
    padding: 22px;
    text-align: center;
    cursor: pointer;
    transition: border-color .12s, background .12s;
}
.lim-drop:hover, .lim-drop.drag { border-color: var(--lim-red); background: #100000; }
.lim-drop.busy { cursor: progress; border-color: var(--lim-red); background: #100000; opacity: .85; pointer-events: none; }

/* Processing spinner */
.lim-spin {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,.22);
    border-top-color: var(--lim-red);
    border-radius: 50%;
    animation: lim-spin .7s linear infinite;
    vertical-align: -4px;
}
.lim-processing {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px;
    font-weight: 700;
    color: #fff;
}
.lim-processing .lim-sub { font-weight: 400; color: rgba(255,255,255,.6); font-size: 12px; }
@keyframes lim-spin { to { transform: rotate(360deg); } }

/* Scrollbar */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.18); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.32); }
* { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.18) transparent; }

/* Toast */
.lim-toast {
    display: none;
    position: fixed;
    left: 50%;
    bottom: 28px;
    transform: translateX(-50%) translateY(500px);
    background: #fff;
    color: #000;
    border-left: 5px solid var(--lim-red);
    padding: 14px 18px;
    font-weight: 700;
    z-index: 1000;
    transition: transform .25s, opacity .2s;
    max-width: 90vw;
    opacity: 0;
}
.lim-toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.lim-toast.err { border-left-color: #ED2530; }
.lim-toast.ok { border-left-color: #21c55d; }

/* Modal */
.lim-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 900;
    padding: 18px;
}
.lim-modal.show { display: flex; }
.lim-modal-card {
    background: var(--lim-panel);
    border: 1px solid var(--lim-line);
    border-top: 4px solid var(--lim-red);
    width: 100%;
    max-width: 440px;
    padding: 22px;
}

.lim-muted { color: var(--lim-mute); }
.lim-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.lim-spacer { flex: 1; }

@media (max-width: 720px) {
    .lim-stats { grid-template-columns: repeat(2, 1fr); }
}
