@font-face {
    font-family: "TT Positive";
    src: url("/static/assets/TT_Positive_Regular.woff") format("woff");
    font-weight: 400;
}

@font-face {
    font-family: "TT Positive";
    src: url("/static/assets/TT_Positive_DemiBold.woff") format("woff");
    font-weight: 700;
}

@font-face {
    font-family: "Bitcount";
    src: url("/static/assets/Bitcount.woff2") format("woff2");
    font-weight: 400 900;
}

:root {
    color-scheme: dark;
    --bg: #111111;
    --panel: #272727;
    --panel-soft: #303030;
    --text: #ffffff;
    --muted: #acacac;
    --line: rgb(255 255 255 / 15%);
    --red: #d61f29;
    --danger: #ff6b72;
    --ok: #ffffff;
}

* {
    box-sizing: border-box;
}

html,
body {
    overscroll-behavior: none;
}

html {
    min-height: 100svh;
    background: var(--bg);
}

body {
    min-height: 100svh;
    margin: 0;
    overflow-x: hidden;
    color: var(--text);
    font-family: "TT Positive", sans-serif;
    font-size: 16px;
    line-height: 1.25;
}

.blur-layer {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.blur-layer span {
    position: absolute;
    width: 50vmin;
    height: 50vmin;
    border-radius: 50%;
    background: var(--red);
    filter: blur(600px);
}

.blur-layer span:first-child {
    top: -25%;
    right: -25%;
}

.blur-layer span:last-child {
    bottom: -25%;
    left: -25%;
}

a {
    color: inherit;
    text-decoration: none;
}

p,
h1,
h2,
ol,
dl,
dd {
    margin: 0;
}

button,
input {
    font: inherit;
}

.logo-block {
    position: fixed;
    top: 16px;
    left: 40px;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 32px;
    min-height: 67px;
    border-radius: 16px;
    background: rgb(17 17 17 / 40%);
    padding: 4px 16px 4px 8px;
    backdrop-filter: blur(16px);
}

.logo-block > img:first-child {
    display: block;
    width: 122px;
    height: 59px;
    object-fit: contain;
}

.vibehack-logo {
    display: block;
    width: 161px;
    height: 26px;
    object-fit: contain;
}

.main-page {
    width: 100%;
    min-height: 100svh;
    padding: 100px 40px 40px;
}

.inner-page {
    padding-top: 118px;
}

.intro {
    display: grid;
    gap: 16px;
    margin-bottom: 20px;
}

.intro h1,
.page-heading h1,
.auth-panel h1,
.admin-head h1 {
    color: var(--red);
    font-size: 48px;
    font-weight: 400;
    line-height: 1.25;
    letter-spacing: 0;
}

.intro p {
    color: var(--text);
    font-size: 24px;
    letter-spacing: 0.24px;
}

.intro-steps {
    display: grid;
    gap: 12px;
    width: 100%;
}

.intro-step {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.intro-step__number {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    border: 1px solid var(--red);
    border-radius: 50%;
}

.intro-step__number img {
    display: block;
    width: auto;
    height: 15px;
}

.intro-step p {
    min-width: 0;
    flex: 1 1 auto;
}

.intro-action {
    display: inline;
    border: 0;
    background: transparent;
    color: var(--red);
    cursor: pointer;
    font: inherit;
    letter-spacing: inherit;
    padding: 0;
    text-decoration: underline;
    text-decoration-thickness: from-font;
    text-underline-offset: 0.08em;
}

.intro-action.is-disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 16px;
    background: var(--panel);
    color: var(--text);
    cursor: pointer;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1.25;
    padding: 16px 24px;
    text-align: center;
    text-transform: uppercase;
}

.button.secondary {
    background: var(--panel-soft);
}

.button.compact {
    border-radius: 10px;
    padding: 9px 14px;
    font-size: 13px;
}

.button.danger {
    color: var(--danger);
}

.button:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.button:focus-visible,
a:focus-visible,
input:focus-visible,
.intro-action:focus-visible {
    outline: 2px solid var(--red);
    outline-offset: 3px;
}

.prompt-dialog {
    width: min(760px, calc(100vw - 32px));
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--panel);
    color: var(--text);
    padding: 0;
}

.prompt-dialog::backdrop {
    background: rgb(0 0 0 / 66%);
}

.prompt-dialog__body {
    display: grid;
    gap: 24px;
    padding: 24px;
}

.prompt-dialog__text {
    color: var(--text);
    font-size: 20px;
    letter-spacing: 0.2px;
    line-height: 1.45;
}

.prompt-dialog__text [contenteditable] {
    font-weight: 700;
    outline: 0;
    user-select: text;
}

.prompt-dialog__text [contenteditable]:focus {
    color: var(--red);
}

.prompt-dialog__text [contenteditable]::selection {
    background: var(--red);
    color: var(--text);
}

.prompt-dialog__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.panel {
    border-radius: 16px;
    background: var(--panel);
    color: var(--text);
}

.landing-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    width: 100%;
}

.landing-stat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--red);
    border-radius: 16px;
    background: rgb(214 31 41 / 10%);
    color: var(--text);
    padding: 32px;
    line-height: 1;
    white-space: nowrap;
}

.landing-stat-value {
    display: inline-flex;
    justify-content: center;
    min-height: 77px;
    font-family: "Bitcount", sans-serif;
    font-variant-numeric: tabular-nums;
    font-size: 64px;
    font-weight: 400;
    letter-spacing: 1.28px;
    line-height: 77px;
    text-align: center;
}

.landing-stat-value--time {
    font-size: 50px;
    letter-spacing: 1px;
}

.stat-char,
.landing-stat-char {
    position: relative;
    display: inline-block;
    overflow: hidden;
    text-align: center;
    vertical-align: baseline;
    white-space: pre;
}

.stat-char-current,
.stat-char-step,
.landing-stat-char-current {
    display: block;
}

.stat-char.is-changing .stat-char-current,
.landing-stat-char.is-changing .landing-stat-char-current {
    visibility: hidden;
}

.stat-char-track {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    animation: stat-slide var(--stat-duration, 420ms) ease-in-out forwards;
}

.landing-stat-label {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.56px;
    line-height: 1.25;
    text-align: center;
}

@keyframes stat-slide {
    from {
        transform: translateY(var(--stat-slide-from, 0%));
    }

    to {
        transform: translateY(var(--stat-slide-to, 0%));
    }
}

.admin-panel h2 {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 0.56px;
    line-height: 1.25;
}

.landing-banner {
    display: block;
    width: 100%;
    height: auto;
    margin-top: 16px;
    border-radius: 16px;
}

.site-footer {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    padding-top: 32px;
    color: var(--muted);
    font-size: 14px;
}

.site-footer nav {
    display: flex;
    gap: 32px;
    align-items: center;
}

.page-heading {
    margin-bottom: 24px;
}

.progress-page {
    display: grid;
    place-items: center;
    padding-top: 118px;
}

.progress-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    max-width: 100%;
    margin-top: -120px;
}

.progress-panel {
    padding: 32px;
}

.progress-card h1 {
    max-width: calc(100vw - 80px);
    overflow: hidden;
    color: var(--text);
    font-family: "Bitcount", sans-serif;
    font-size: 96px;
    font-variation-settings: "wght" 400;
    font-weight: 400;
    letter-spacing: 1.28px;
    line-height: 1.25;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.progress-icons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 36px;
}

.progress-flag {
    display: block;
    width: 72px;
    height: 72px;
}

.progress-flag-slot {
    display: grid;
    justify-items: center;
    gap: 8px;
    min-width: 72px;
}

.progress-flag-time {
    min-height: 22px;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
    font-size: 18px;
    line-height: 1.2;
    white-space: nowrap;
}

.progress-arrow {
    display: block;
    width: 36px;
    height: 36px;
}

.progress-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 48px;
    color: var(--text);
    font-variant-numeric: tabular-nums;
    font-size: 32px;
    font-weight: 400;
    letter-spacing: 0;
    line-height: normal;
    text-align: center;
    white-space: nowrap;
}

.progress-stats p {
    margin: 0;
}

.admin-metrics article {
    display: grid;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel-soft);
    padding: 16px;
}

.admin-metrics span,
.detail-list dt,
.muted {
    color: var(--muted);
}

.admin-metrics strong {
    font-size: 28px;
    font-weight: 700;
}

.auth-layout {
    display: grid;
    place-items: start center;
}

.auth-panel {
    width: min(520px, 100%);
    display: grid;
    gap: 20px;
    padding: 32px;
}

form {
    display: grid;
    gap: 10px;
}

label {
    font-weight: 700;
}

input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #171717;
    color: var(--text);
    padding: 13px 14px;
}

.notice {
    border-radius: 12px;
    background: var(--panel);
    color: var(--text);
    padding: 14px 16px;
}

.notice.error {
    color: var(--danger);
}

.admin-page {
    display: grid;
    gap: 16px;
}

.admin-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.admin-metrics {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.admin-panel {
    display: grid;
    gap: 16px;
    align-content: start;
    padding: 24px;
}

.admin-panel.wide {
    grid-column: 1 / -1;
}

.admin-table {
    display: grid;
}

.table-header,
.table-row {
    display: grid;
    grid-template-columns:
        minmax(200px, 1.4fr) minmax(70px, 0.4fr) minmax(90px, 0.5fr)
        minmax(90px, 0.5fr) minmax(100px, 0.4fr);
    gap: 12px;
    align-items: center;
    border-bottom: 1px solid var(--line);
    padding: 8px 0;
}

.table-header {
    color: var(--muted);
}

.table-row span,
.admin-item span,
.audit-row span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.table-row form,
.admin-item form,
.button-pair form,
.admin-head form {
    margin: 0;
}

.stack,
.audit-list {
    display: grid;
    gap: 10px;
}

.admin-item,
.audit-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    border-bottom: 1px solid var(--line);
    padding-bottom: 10px;
}

.admin-item.simple,
.audit-row {
    align-items: flex-start;
    flex-direction: column;
}

.button-pair {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.detail-list {
    display: grid;
    gap: 10px;
}

.detail-list div {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 8px;
}

.detail-list dd {
    color: var(--text);
}

.empty-row {
    color: var(--muted);
}

@media (max-width: 980px) {
    body {
        background: var(--bg);
    }

    .logo-block {
        left: 16px;
        max-width: calc(100vw - 32px);
    }

    .main-page {
        padding-right: 16px;
        padding-left: 16px;
    }

    .intro h1,
    .page-heading h1,
    .auth-panel h1,
    .admin-head h1 {
        font-size: 38px;
    }

    .intro p {
        font-size: 20px;
    }

    .admin-metrics {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .landing-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-grid {
        grid-template-columns: 1fr;
    }

    .progress-card h1 {
        max-width: calc(100vw - 32px);
        font-size: 56px;
    }
}

@media (max-width: 720px) {
    .logo-block {
        gap: 16px;
        width: fit-content;
        left: 0;
        right: 0;
        margin: auto;
    }

    .logo-block > img:first-child {
        width: 94px;
    }

    .vibehack-logo {
        width: 126px;
        height: auto;
    }

    .main-page {
        padding-top: 100px;
        padding-inline: 12px;
    }

    .intro h1,
    .page-heading h1,
    .auth-panel h1,
    .admin-head h1 {
        font-size: 30px;
        text-align: center;
    }

    .intro p {
        font-size: 20px;
    }

    .intro-steps {
        gap: 10px;
    }

    .intro-step {
        gap: 10px;
        align-items: flex-start;
    }

    .intro-step p {
        text-align: left;
    }

    .intro-step__number {
        width: 28px;
        height: 28px;
        margin-top: 1px;
    }

    .intro-step__number img {
        height: 13px;
    }

    .action-row,
    .admin-head,
    .site-footer {
        align-items: start;
    }

    .button,
    .action-row .button {
        width: 100%;
    }

    .prompt-dialog__actions .button {
        width: 100%;
    }

    .prompt-dialog__text {
        font-size: 17px;
    }

    .landing-stats {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .landing-stat-card,
    .admin-panel,
    .auth-panel {
        padding: 20px;
    }

    .landing-stat-value {
        min-height: 58px;
        font-size: 48px;
        line-height: 58px;
    }

    .landing-stat-value--time {
        font-size: 42px;
    }

    .landing-stat-label {
        font-size: 22px;
    }

    .progress-card {
        gap: 14px;
    }

    .progress-card h1 {
        max-width: calc(100vw - 32px);
        font-size: 30px;
    }

    .progress-icons {
        gap: clamp(10px, 3vw, 24px);
    }

    .progress-flag {
        width: clamp(40px, 12vw, 72px);
        height: clamp(40px, 12vw, 72px);
    }

    .progress-flag-slot {
        min-width: clamp(40px, 12vw, 72px);
    }

    .progress-flag-time {
        min-height: 18px;
        font-size: 12px;
    }

    .progress-arrow {
        width: clamp(22px, 7vw, 36px);
        height: clamp(22px, 7vw, 36px);
    }

    .progress-stats {
        flex-wrap: wrap;
        gap: 14px 24px;
        font-size: 18px;
    }

    .admin-metrics {
        grid-template-columns: 1fr;
    }

    .table-header {
        display: none;
    }

    .table-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .stat-char-track {
        animation: none;
        transform: translateY(var(--stat-slide-to, 0%));
    }
}
