:root {
    --blue: #2a85f0;
    --blue-dark: #1b66c4;
    --bg: #171717;
    --ink: #0a0a0a;
    --paper: #ffffff;
    --muted: #8d8d8d;
    --red: #d62839;
    --green: #1f9d55;
    --font: "Verdana", "DejaVu Sans", "Segoe UI", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { min-height: 100%; }

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font);
    color: #fff;
    background-color: var(--bg);
    background-image:
        linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
    background-size: 46px 46px;
    position: relative;
    overflow-x: hidden;
}

body::before,
body::after {
    content: "";
    position: fixed;
    background: var(--blue);
    border-radius: 50%;
    z-index: -1;
    pointer-events: none;
}
body::before {
    width: 46vmax; height: 46vmax;
    top: -30vmax; left: -22vmax;
}
body::after {
    width: 52vmax; height: 52vmax;
    right: -26vmax; bottom: -36vmax;
}

.page {
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    padding: 28px 18px 60px;
}
.page.wide { max-width: 1040px; }

.brand {
    display: block;
    width: clamp(150px, 42vw, 230px);
    height: auto;
    margin: 0 auto 26px;
}

.title-box {
    border: 10px solid var(--blue);
    border-radius: 44px;
    padding: 18px 16px 22px;
    margin-bottom: 26px;
    text-align: center;
}
.title-box h1 {
    margin: 0;
    font-size: clamp(2rem, 9vw, 3.6rem);
    line-height: 1.1;
    font-weight: 800;
    letter-spacing: -.01em;
}
.title-box.small h1 { font-size: clamp(1.5rem, 6vw, 2.4rem); }

.panel {
    background: var(--paper);
    color: var(--ink);
    border: 12px solid #000;
    border-radius: 34px;
    padding: 26px 24px 28px;
}
.panel p { margin: 0 0 18px; line-height: 1.5; }
.panel .lead { font-weight: 700; }
.panel .lead b { color: var(--blue-dark); word-break: break-all; }

label.field { display: block; font-weight: 700; margin-bottom: 8px; }

input[type="email"],
input[type="text"] {
    width: 100%;
    font: inherit;
    font-weight: 700;
    padding: 14px 16px;
    border: 4px solid #000;
    border-radius: 14px;
    background: #fff;
    color: var(--ink);
    margin-bottom: 18px;
    outline: none;
}
input:focus { border-color: var(--blue); }
input::placeholder { color: #aaa; font-weight: 400; }

input.code {
    text-align: center;
    font-size: 1.8rem;
    letter-spacing: .5em;
    padding-left: calc(16px + .5em);
}

.btn {
    display: block;
    width: 100%;
    font: inherit;
    font-weight: 800;
    font-size: 1.05rem;
    color: #fff;
    background: var(--blue);
    border: 0;
    border-radius: 16px;
    padding: 15px 20px;
    cursor: pointer;
    transition: background .15s, transform .1s;
}
.btn:hover { background: var(--blue-dark); }
.btn:active { transform: translateY(2px); }
.btn.auto { display: inline-block; width: auto; }
.btn.danger { background: var(--red); }
.btn.danger:hover { background: #b01f2d; }
.btn.ok { background: var(--green); }
.btn.ok:hover { background: #17783f; }

.error {
    background: #ffe9ec;
    color: #8a1020;
    border: 3px solid var(--red);
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 18px;
    font-size: .92rem;
    font-weight: 700;
}

.note {
    margin: 22px 6px 0;
    font-size: .74rem;
    line-height: 1.5;
    font-style: italic;
    font-weight: 700;
    color: var(--muted);
}


.vote-head { text-align: center; margin-bottom: 30px; }
.vote-head .who {
    margin: 14px 0 0;
    font-weight: 700;
    font-size: .95rem;
}
.vote-head .who span { color: #7db4f7; }

.cand-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 24px;
    margin-bottom: 34px;
}

.cand { display: block; cursor: pointer; }
.cand input {
    position: absolute;
    opacity: 0;
    width: 1px; height: 1px;
}
.cand-box {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #fff;
    color: var(--ink);
    border: 9px solid #000;
    border-radius: 28px;
    overflow: hidden;
    transition: border-color .15s, transform .15s;
}
.cand:hover .cand-box { transform: translateY(-3px); }
.cand-img {
    aspect-ratio: 3 / 4;
    background: #ddd;
    overflow: hidden;
}
.cand-img img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
}
.cand-name {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    font-weight: 800;
    font-size: 1.05rem;
    border-top: 4px solid #000;
    transition: background .15s, color .15s, border-color .15s;
}
.tick {
    flex: none;
    width: 28px; height: 28px;
    border: 4px solid #000;
    border-radius: 8px;
    background: #fff;
    position: relative;
}
.cand input:checked + .cand-box { border-color: var(--blue); }
.cand input:checked + .cand-box .cand-name {
    background: var(--blue);
    color: #fff;
    border-top-color: var(--blue);
}
.cand input:checked + .cand-box .tick { border-color: #fff; background: var(--blue); }
.cand input:checked + .cand-box .tick::after {
    content: "";
    position: absolute;
    left: 6px; top: 1px;
    width: 8px; height: 14px;
    border: solid #fff;
    border-width: 0 4px 4px 0;
    transform: rotate(45deg);
}
.cand input:focus-visible + .cand-box { outline: 4px dashed #fff; outline-offset: 4px; }

.vote-submit { max-width: 360px; margin: 0 auto; }
.empty {
    text-align: center;
    font-weight: 700;
    color: var(--muted);
    margin: 40px 0;
}

.admin-top {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 26px;
}
.admin-top h1 { margin: 0; font-size: clamp(1.6rem, 5vw, 2.3rem); font-weight: 800; }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; margin-bottom: 24px; }

.panel.slim { border-width: 8px; border-radius: 26px; padding: 20px 22px 24px; margin-bottom: 24px; }
.panel.slim h2 { margin: 0 0 16px; font-size: 1.15rem; font-weight: 800; }
.stat-label { font-size: .8rem; font-weight: 700; color: #666; margin-bottom: 4px; }
.stat-num { font-size: 2.8rem; font-weight: 800; color: var(--blue-dark); line-height: 1; }

.bar-item { margin-bottom: 16px; }
.bar-item:last-child { margin-bottom: 0; }
.bar-meta {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: .88rem;
    font-weight: 700;
    margin-bottom: 6px;
}
.bar-meta span:last-child { color: var(--blue-dark); white-space: nowrap; }
.bar-track {
    height: 22px;
    border: 3px solid #000;
    border-radius: 12px;
    background: #eee;
    overflow: hidden;
}
.bar-fill { height: 100%; background: var(--blue); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .85rem; }
th {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 4px solid #000;
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .04em;
}
td { padding: 10px 12px; border-bottom: 2px solid #ddd; white-space: nowrap; }
td.mono { font-family: Consolas, "DejaVu Sans Mono", monospace; font-size: .78rem; color: #555; }

@media (max-width: 480px) {
    .panel { border-width: 9px; padding: 22px 18px 24px; }
    .title-box { border-width: 8px; border-radius: 34px; }
}

.done-panel { text-align: center; }
.done-tick {
    width: 96px; height: 96px;
    margin: 4px auto 22px;
    border: 8px solid #000;
    border-radius: 50%;
    background: var(--blue);
    position: relative;
}
.done-tick::after {
    content: "";
    position: absolute;
    left: 29px; top: 10px;
    width: 20px; height: 40px;
    border: solid #fff;
    border-width: 0 9px 9px 0;
    transform: rotate(45deg);
}
.done-panel h2 { margin: 0 0 12px; font-size: 1.5rem; font-weight: 800; }
.done-panel p { margin: 0; color: #444; }

.lock {
    width: 64px; height: 50px;
    margin: 36px auto 22px;
    background: #000;
    border-radius: 10px;
    position: relative;
}
.lock::before {
    content: "";
    position: absolute;
    left: 12px; top: -28px;
    width: 40px; height: 36px;
    border: 8px solid #000;
    border-bottom: 0;
    border-radius: 24px 24px 0 0;
}
.lock::after {
    content: "";
    position: absolute;
    left: 26px; top: 15px;
    width: 12px; height: 12px;
    background: #fff;
    border-radius: 50%;
}
 
.panel.center { text-align: center; }
.panel.center h2 { margin: 0 0 10px; font-size: 1.4rem; font-weight: 800; }
.panel.center .sub { color: #444; margin-bottom: 22px; }
 
.timer {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 22px;
}
.time-box {
    background: var(--blue);
    color: #fff;
    border: 4px solid #000;
    border-radius: 16px;
    padding: 12px 4px 10px;
}
.time-box b {
    display: block;
    font-size: clamp(1.6rem, 8vw, 2.4rem);
    line-height: 1.1;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}
.time-box span {
    display: block;
    margin-top: 4px;
    font-size: .62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
}
.dates { font-size: .82rem; font-weight: 700; color: #333; line-height: 1.7; }
.dates em { font-style: normal; color: var(--blue-dark); }
 