/* Shared arcade design system. Pages retain only their layout-specific rules. */
:root {
    --ui-font: "Segoe UI", Arial, Helvetica, sans-serif;
    --ui-text: #f1f7ff;
    --ui-muted: #b8cce2;
    --ui-gold: #ffe16b;
    --ui-cyan: #71e8f2;
    --ui-frame: #c6dceb;
    --ui-line: rgb(174 205 232 / 22%);
    --ui-surface: linear-gradient(155deg, #213d60, #112642 65%, #0d1d35);
    --ui-inset: rgb(4 15 32 / 48%);
    --ui-wood: linear-gradient(155deg, #ab6946, #965233 65%, #804128);
    --ui-wood-inset: #62321f;
    --ui-radius: 16px;
    --ui-radius-small: 10px;
    --ui-width: 1200px;
    --ui-space: 24px;
    --ui-panel-shadow:
        inset 0 1px 0 rgb(255 255 255 / 12%), 0 0 0 2px #061225, 0 6px 0 rgb(0 0 0 / 34%), 0 18px 36px rgb(0 0 0 / 18%);
    --ui-button-green: linear-gradient(#a4ed3a, #61c71b);
    --ui-button-cyan: linear-gradient(#48dbe5, #17a0b8);
    --ui-button-gold: linear-gradient(#ffcf63, #ee952c);
    --ui-button-red: linear-gradient(#f37b6d, #cb4547);
    --ui-button-neutral: linear-gradient(#566d87, #344b65);
    --ui-button-purple: linear-gradient(#c284f1, #9556cd);
    --ui-focus: 3px solid var(--ui-gold);
}

.arcade-page {
    position: relative;
    z-index: 1;
    box-sizing: border-box;
    min-height: 100dvh;
    padding: max(88px, calc(64px + env(safe-area-inset-top))) clamp(20px, 5vw, 80px)
        max(72px, env(safe-area-inset-bottom));
    color: var(--ui-text);
    font-family: var(--ui-font);
}

.arcade-container,
.arcade-header {
    box-sizing: border-box;
    width: min(var(--ui-width), 100%);
    margin-right: auto;
    margin-left: auto;
}

.arcade-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--ui-line);
}

.arcade-heading {
    min-width: 0;
    max-width: 100%;
    flex: 1;
}

.arcade-eyebrow {
    display: block;
    margin-bottom: 9px;
    color: var(--ui-cyan);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    line-height: 1.4;
    text-transform: uppercase;
}

.arcade-title {
    margin: 0;
    font-size: 1rem;
    line-height: 1;
}

/* Blazor focuses the heading on navigation; it is not an interactive control. */
.arcade-title:focus {
    outline: none;
}

.arcade-description {
    max-width: 62ch;
    margin: 12px 0 0;
    color: var(--ui-muted);
    font-size: 0.94rem;
    font-weight: 500;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.arcade-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 12px;
}

html .arcade-panel {
    box-sizing: border-box;
    min-width: 0;
    padding: var(--ui-space);
    border: 2px solid var(--ui-frame);
    border-radius: var(--ui-radius);
    background: var(--ui-surface);
    box-shadow: var(--ui-panel-shadow);
}

html .arcade-panel.arcade-panel--wood {
    --ui-line: rgb(255 226 195 / 24%);
    --ui-muted: #f0d8c7;
    --ui-inset: rgb(67 28 16 / 34%);
    background: var(--ui-wood);
    border-color: #eed9c8;
    box-shadow:
        inset 0 0 0 3px rgb(67 28 16 / 24%),
        inset 0 6px 0 rgb(255 204 150 / 12%),
        0 0 0 2px #28170f,
        0 6px 0 rgb(0 0 0 / 34%),
        0 18px 36px rgb(0 0 0 / 18%);
}

.arcade-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    min-height: 40px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--ui-line);
}

.arcade-section-heading h2 {
    min-width: 0;
    margin: 0;
    font-size: 1rem;
    line-height: 1;
}

.arcade-section-heading > span:not(.geometry-dash-text-accessible) {
    color: var(--ui-muted);
    font-size: 0.75rem;
    font-weight: 600;
}

html .arcade-button {
    position: relative;
    box-sizing: border-box;
    display: inline-flex;
    flex: 0 0 auto;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    border: 2px solid #eef7ff;
    border-radius: var(--ui-radius-small);
    background: var(--button-fill, var(--ui-button-green));
    box-shadow:
        inset 0 0 0 2px rgb(255 255 255 / 20%),
        inset 0 3px 0 rgb(255 255 255 / 14%),
        0 4px 0 var(--button-base, #30660f),
        0 5px 0 1px #081525;
    color: white;
    cursor: pointer;
    font: 800 0.84rem var(--ui-font);
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    transition:
        transform 140ms ease,
        filter 140ms ease,
        box-shadow 140ms ease;
}

.arcade-button--cyan {
    --button-fill: var(--ui-button-cyan);
    --button-base: #106171;
}

.arcade-button--gold {
    --button-fill: var(--ui-button-gold);
    --button-base: #8b5018;
}

.arcade-button--danger {
    --button-fill: var(--ui-button-red);
    --button-base: #792c31;
}

.arcade-button--neutral {
    --button-fill: var(--ui-button-neutral);
    --button-base: #172a42;
}

.arcade-button--purple {
    --button-fill: var(--ui-button-purple);
    --button-base: #54307d;
}

html .arcade-button.arcade-button--compact {
    min-height: 38px;
    padding: 6px 12px;
    border-radius: 8px;
}

html .arcade-button:active:not(:disabled) {
    transform: translateY(3px);
    box-shadow:
        inset 0 0 0 2px rgb(255 255 255 / 20%),
        0 1px 0 var(--button-base, #30660f),
        0 2px 0 1px #081525;
}

html .arcade-button:disabled {
    cursor: not-allowed;
    filter: grayscale(0.65);
    opacity: 0.55;
}

.arcade-pill {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 5px 9px;
    border: 1px solid var(--ui-line);
    border-radius: 7px;
    background: var(--ui-inset);
    color: var(--ui-muted);
    font-size: 0.67rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    line-height: 1.2;
    text-transform: uppercase;
}

.arcade-pill--live {
    border-color: rgb(155 230 105 / 45%);
    background: #1d4b35;
    color: #c2f798;
}

.arcade-pill--live::before {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #9ced62;
    box-shadow: 0 0 7px rgb(156 237 98 / 35%);
    content: "";
}

.arcade-state {
    box-sizing: border-box;
    display: grid;
    min-height: 260px;
    justify-items: center;
    align-content: center;
    gap: 16px;
    padding: 32px 20px;
    border: 1px dashed rgb(174 205 232 / 36%);
    border-radius: var(--ui-radius);
    background: rgb(8 23 44 / 68%);
    text-align: center;
}

.arcade-state p {
    max-width: 50ch;
    margin: 0;
    color: var(--ui-muted);
    font-size: 0.94rem;
    line-height: 1.65;
}

.arcade-state > * {
    min-width: 0;
    max-width: 100%;
}

.arcade-state .can-wrap,
.error-panel .can-wrap {
    margin-inline: auto;
    justify-content: center;
}

.arcade-message {
    box-sizing: border-box;
    padding: 13px 16px;
    border: 1px solid #86bf74;
    border-left-width: 4px;
    border-radius: var(--ui-radius-small);
    background: #193a2e;
    color: #e4f8de;
    font: 600 0.9rem/1.5 var(--ui-font);
}

.arcade-message--error {
    border-color: #ee998e;
    background: #522b2a;
    color: #ffebe5;
}

.arcade-label {
    color: var(--ui-gold);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    line-height: 1.4;
    text-transform: uppercase;
}

html .arcade-input {
    box-sizing: border-box;
    min-width: 0;
    min-height: 46px;
    padding: 11px 13px;
    border: 1px solid rgb(221 238 255 / 65%);
    border-radius: var(--ui-radius-small);
    outline: none;
    background: var(--ui-inset);
    box-shadow: inset 0 2px 4px rgb(0 0 0 / 12%);
    color: var(--ui-text);
    font: 600 0.94rem/1.4 var(--ui-font);
    transition:
        border-color 140ms ease,
        background 140ms ease,
        box-shadow 140ms ease;
}

html .arcade-input::placeholder {
    color: var(--ui-muted);
    opacity: 0.7;
}

html .arcade-input:focus {
    border-color: var(--ui-gold);
    outline: 2px solid rgb(255 225 107 / 30%);
    outline-offset: 2px;
}

html .arcade-input:disabled {
    border-style: dashed;
    opacity: 0.6;
    cursor: not-allowed;
}

html .arcade-input option {
    background: #142b46;
    color: var(--ui-text);
}

html .arcade-input::-webkit-calendar-picker-indicator {
    cursor: pointer;
    filter: invert(1);
    opacity: 0.75;
}

.arcade-avatar {
    box-sizing: border-box;
    flex-shrink: 0;
    border: 2px solid #deedfa;
    border-radius: 50%;
    background: var(--ui-button-cyan);
    box-shadow:
        0 0 0 3px rgb(0 0 0 / 20%),
        0 3px 0 rgb(0 0 0 / 24%);
    object-fit: cover;
}

:where(a, button, summary, select, input, textarea):focus-visible {
    outline: var(--ui-focus);
    outline-offset: 4px;
}

::selection {
    background: #ffe16b;
    color: #12243b;
}

@media (hover: hover) and (pointer: fine) {
    html .arcade-button:hover:not(:disabled) {
        filter: brightness(1.07);
        transform: translateY(-2px);
    }
}

@media (max-width: 900px) {
    .arcade-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 20px;
    }

    .arcade-heading {
        width: 100%;
    }

    .arcade-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 600px) {
    :root {
        --ui-space: 18px;
        --ui-radius: 13px;
    }

    .arcade-page {
        padding: calc(78px + env(safe-area-inset-top)) max(14px, env(safe-area-inset-left))
            calc(40px + env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-right));
    }

    .arcade-header {
        gap: 18px;
        margin-bottom: 24px;
        padding-bottom: 20px;
    }

    .arcade-description {
        font-size: 0.88rem;
    }

    .arcade-actions {
        width: 100%;
        gap: 10px;
    }

    html .arcade-button.arcade-button--compact {
        min-height: 44px;
    }

    html .arcade-input {
        font-size: 1rem;
    }

    .arcade-section-heading {
        gap: 10px;
        padding-bottom: 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

.error-page {
    display: grid;
    place-items: center;
}

html .error-panel.arcade-panel {
    display: grid;
    width: min(680px, 100%);
    justify-items: center;
    gap: 24px;
    padding: clamp(28px, 5vw, 48px);
    text-align: center;
}

.error-panel .arcade-description {
    margin-right: auto;
    margin-left: auto;
}

.error-code {
    color: var(--ui-cyan);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.24em;
}

.error-actions {
    justify-content: center;
}

.error-request {
    max-width: 100%;
    padding-top: 18px;
    border-top: 1px solid var(--ui-line);
    color: var(--ui-muted);
    font-size: 0.68rem;
    overflow-wrap: anywhere;
}

/* Legacy class aliases keep every feature on the shared interaction language. */
.arcade-button.gd-button-blue,
.arcade-button.events-login-button,
.arcade-button.events-ranking-button,
.arcade-button.results-button-blue,
.arcade-button.leaderboard-button,
.arcade-button.player-button-blue,
.arcade-button.upcoming-button-blue,
.arcade-button.profile-upload-button {
    --button-fill: var(--ui-button-cyan);
    --button-base: #106171;
}

.arcade-button.events-admin-button,
.arcade-button.history-results-button {
    --button-fill: var(--ui-button-gold);
    --button-base: #8b5018;
}

.arcade-button.gd-button-danger {
    --button-fill: var(--ui-button-red);
    --button-base: #792c31;
}

.arcade-button.events-logout-button,
.arcade-button.profile-logout,
.arcade-button.history-link-button,
.arcade-button.history-speed-button {
    --button-fill: var(--ui-button-neutral);
    --button-base: #172a42;
}

.arcade-button.history-live-button,
.arcade-button.history-playback-button {
    --button-fill: var(--ui-button-green);
    --button-base: #30660f;
}

.arcade-button.history-playback-button.is-playing {
    --button-fill: var(--ui-button-gold);
    --button-base: #8b5018;
}
