/* Shared display styles for /display/* pages.
 * Official DEF CON 34 Pantone palette — see docs/design-guidelines.md
 *   2955C  navy   #0D294A   primary background
 *   5473C  teal   #105F88   secondary bg / row stripe
 *   314C   blue   #017FA4   info / rank 3
 *   3248C  mint   #8CCDB8   subtle accents / success
 *   143C   gold   #F1B435   primary highlight / rank 1
 *   1925C  red    #E0004E   alerts / errors
 */
:root {
    --dc-navy:  #0D294A;
    --dc-teal:  #105F88;
    --dc-blue:  #017FA4;
    --dc-mint:  #8CCDB8;
    --dc-gold:  #F1B435;
    --dc-red:   #E0004E;

    --text-white: #fff;
    --text-muted: #888;
    --err-bg:    #330000;
}

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

/* Viewport-scaled root font: every rem-based size (which is nearly all of
 * them) grows continuously from laptop to TV. Anchored so a ~1000px viewport
 * keeps today's 16px baseline:
 *   1366px laptop → ~18px   1920px monitor/TV → ~21px   4K TV → 27px (cap)
 * Layout-critical widths below are in rem for the same reason — the whole
 * design scales proportionally instead of shrinking into a corner. */
html { font-size: clamp(15px, 0.55vw + 10.5px, 27px); }

body {
    font-family: 'Courier New', monospace;
    background: var(--dc-navy);
    color: var(--dc-gold);
    padding: 20px;
    min-height: 100vh;
}

/* 62.5rem = 1000px at the 16px baseline; grows with the root font on TVs. */
.container { max-width: 62.5rem; margin: 0 auto; position: relative; }

.header-eyebrow {
    font-size: 1rem;
    letter-spacing: 0.3em;
    color: var(--dc-mint);
    text-transform: uppercase;
    margin-bottom: 4px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    border-bottom: 2px solid var(--dc-gold);
    padding-bottom: 15px;
    position: relative;
}

h1 {
    font-size: 2.2rem;
    text-shadow: 0 0 10px var(--dc-gold);
    margin-bottom: 5px;
}

.subtitle { color: var(--dc-mint); font-size: 0.9rem; }

.stale {
    position: absolute;
    top: 0;
    right: 0;
    color: var(--dc-red);
    font-size: 0.8rem;
    padding: 4px 8px;
    border: 1px solid var(--dc-red);
    border-radius: 3px;
}

.event-strip {
    color: var(--dc-mint);
    font-size: 0.9rem;
    margin-top: 5px;
}

table { width: 100%; border-collapse: collapse; margin-top: 10px; }
th, td { padding: 0.625rem; text-align: left; border: 1px solid var(--dc-gold); }
th {
    background: var(--dc-gold);
    color: var(--dc-navy);
    font-weight: bold;
    text-align: center;
}
tr:nth-child(even) { background: var(--dc-navy); }
tr:nth-child(odd) { background: var(--dc-teal); }

.rank { text-align: center; width: 4.375rem; font-weight: bold; }
.rank-1 { color: var(--dc-gold); font-size: 1.3rem; }
.rank-2 { color: var(--dc-mint); font-size: 1.2rem; }
.rank-3 { color: var(--dc-blue); font-size: 1.1rem; }

.team-name { text-align: left; color: var(--text-white); }
.score { text-align: right; font-size: 1.1rem; font-weight: bold; color: var(--dc-gold); }
.timestamp { text-align: center; color: var(--text-muted); font-size: 0.8rem; }

.loading { text-align: center; color: var(--dc-mint); padding: 20px; }
.error {
    background: var(--err-bg);
    border: 1px solid var(--dc-red);
    color: var(--dc-red);
    padding: 10px;
    margin: 10px 0;
    border-radius: 3px;
}

.refresh-timer { color: var(--text-muted); font-size: 0.8rem; text-align: center; margin-top: 20px; }

.admin-link {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--dc-gold);
}
a { color: var(--dc-mint); text-decoration: none; }
a:hover { text-decoration: underline; }

/* CiH band sections */
.band-section {
    border: 1px solid var(--dc-gold);
    padding: 15px;
    margin-bottom: 20px;
    background: var(--dc-navy);
}
.band-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 10px;
}
.band-name {
    font-size: 1.4rem;
    font-weight: bold;
    color: var(--dc-gold);
}
.band-count { color: var(--dc-mint); font-size: 0.9rem; }

.band--no-entries .band-rows { color: var(--text-muted); font-style: italic; }
.band--no-qualifiers { border-left: 3px solid var(--dc-red); }
.band--partial-finalists { border-left: 3px solid var(--dc-mint); }
.band--full-finalists { border-left: 3px solid var(--dc-gold); }

.band-row {
    display: grid;
    /* 3.125/4.375/6.25/7.5rem = 50/70/100/120px at baseline */
    grid-template-columns: 3.125rem 4.375rem 1fr 6.25rem 7.5rem;
    gap: 0.625rem;
    padding: 0.5rem;
    align-items: center;
    border-bottom: 1px solid var(--dc-teal);
}
.band-row:last-child { border-bottom: none; }

.row-rank { font-weight: bold; text-align: center; }
.row-tag {
    font-family: 'Courier New', monospace;
    color: var(--dc-mint);
    text-align: center;
}
.row-team { color: var(--text-white); text-overflow: ellipsis; overflow: hidden; white-space: nowrap; }
.row-swr { text-align: right; font-weight: bold; color: var(--dc-gold); }
.row-status { text-align: right; font-size: 0.85rem; }

.band-row--finalist {
    background: rgba(241, 180, 53, 0.08);
    animation: finalist-pulse 4s ease-in-out infinite;
}
.band-row--finalist .row-rank::before { content: "★ "; color: var(--dc-gold); }

.band-row--qualified .row-status { color: var(--dc-mint); }
.band-row--not_qualified { opacity: 0.6; }
.band-row--not_qualified .row-status { color: var(--text-muted); }

@keyframes finalist-pulse {
    0%, 100% { box-shadow: 0 0 0 rgba(241, 180, 53, 0); }
    50% { box-shadow: 0 0 15px rgba(241, 180, 53, 0.25); }
}

/* Rotation display */
.slide {
    min-height: 70vh;
}
.slide-indicator {
    position: fixed;
    bottom: 10px;
    right: 10px;
    color: var(--dc-mint);
    font-size: 0.8rem;
}
.placeholder {
    text-align: center;
    padding: 80px 20px;
    color: var(--dc-mint);
    font-size: 1.4rem;
}

@media (max-width: 640px) {
    body { padding: 10px; }
    h1 { font-size: 1.6rem; }
    .band-header {
        display: block;
    }
    .band-row {
        grid-template-columns: 2.75rem 3.625rem minmax(0, 1fr) 4.5rem;
        gap: 6px;
        font-size: 0.85rem;
    }
    .row-status {
        grid-column: 3 / 5;
        text-align: left;
    }
    th, td { padding: 8px; }
}