/* ==========================================================
   Hitz / Track-Tipp – dark "stage" design
   Rainbow accents taken from the logo equalizer.
   ========================================================== */

:root {
    color-scheme: dark;

    --hz-bg: #0b0a1a;
    --hz-bg-2: #15122e;
    --hz-surface: rgba(255, 255, 255, 0.055);
    --hz-surface-strong: rgba(255, 255, 255, 0.09);
    --hz-border: rgba(255, 255, 255, 0.12);
    --hz-text: #f4f2ff;
    --hz-muted: #a9a3c9;
    --hz-accent: #8b5cf6;
    --hz-accent-2: #22d3ee;
    --hz-success: #22c55e;
    --hz-error: #f43f5e;
    --hz-gradient: linear-gradient(120deg, #8b5cf6 0%, #3b82f6 50%, #22d3ee 100%);
    --hz-rainbow: linear-gradient(90deg, #7c3aed, #2563eb, #0891b2, #16a34a, #ca8a04, #ea580c, #dc2626);
    --hz-radius: 18px;
    --hz-font-display: 'Fredoka', 'Trebuchet MS', system-ui, sans-serif;
    --hz-font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

    /* Telerik (Kendo) theme overrides */
    --kendo-font-family: var(--hz-font-body);
    --kendo-color-app-surface: var(--hz-bg);
    --kendo-color-on-app-surface: var(--hz-text);
    --kendo-color-subtle: var(--hz-muted);
    --kendo-color-surface: #1a1735;
    --kendo-color-surface-alt: #221e42;
    --kendo-color-border: rgba(255, 255, 255, 0.14);
    --kendo-color-base: #29244f;
    --kendo-color-base-hover: #332d5f;
    --kendo-color-base-active: #3c356d;
    --kendo-color-base-subtle: #221e42;
    --kendo-color-base-subtle-hover: #2b2652;
    --kendo-color-primary: #8b5cf6;
    --kendo-color-primary-hover: #7c4cf0;
    --kendo-color-primary-active: #6d3fe0;
    --kendo-color-primary-subtle: #3b2a6e;
    --kendo-color-primary-emphasis: #b79cfb;
    --kendo-color-primary-on-surface: #a78bfa;
    --kendo-color-on-primary: #fff;
    --kendo-color-tertiary: #06b6d4;
    --kendo-color-tertiary-hover: #0aa5c0;
    --kendo-color-tertiary-active: #0894ac;
    --kendo-color-success: #22c55e;
    --kendo-color-success-hover: #1fb455;
    --kendo-color-success-active: #1ca34d;
    --kendo-color-error: #f43f5e;
    --kendo-color-error-hover: #e63655;
    --kendo-color-error-active: #d42f4c;
    --kendo-color-warning: #f59e0b;
    --kendo-color-on-warning: #1a1200;
    --kendo-border-radius-md: 0.5rem;
    --kendo-border-radius-lg: 0.75rem;
}

html, body {
    font-family: var(--hz-font-body);
    color: var(--hz-text);
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    background:
        radial-gradient(1200px 600px at 15% -10%, rgba(139, 92, 246, 0.28), transparent 60%),
        radial-gradient(900px 500px at 95% 0%, rgba(34, 211, 238, 0.16), transparent 60%),
        radial-gradient(800px 600px at 50% 110%, rgba(244, 63, 94, 0.12), transparent 60%),
        var(--hz-bg);
    background-attachment: fixed;
}

h1:focus {
    outline: none;
}

h1, h2, h3 {
    font-family: var(--hz-font-display);
    font-weight: 600;
    margin: 0;
}

a {
    color: var(--hz-accent-2);
}

code {
    padding: 1px 5px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.1);
}

.text-muted {
    color: var(--hz-muted);
}

/* ---------- Layout ---------- */

.hz-header {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 16px 0;
}

.hz-header img {
    height: 92px;
    filter: drop-shadow(0 6px 24px rgba(139, 92, 246, 0.35));
}

.hz-main {
    flex: 1;
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 12px 24px 32px;
    box-sizing: border-box;
}

.hz-footer {
    padding: 14px;
    color: var(--hz-muted);
    font-size: 12px;
    text-align: center;
}

/* ---------- Building blocks ---------- */

.hz-panel {
    padding: 22px;
    border: 1px solid var(--hz-border);
    border-radius: var(--hz-radius);
    background: var(--hz-surface);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(10px);
}

.hz-panel-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 16px;
    font-size: 20px;
}

.hz-panel-title .hz-step {
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--hz-gradient);
    font-size: 14px;
}

.hz-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid var(--hz-border);
    border-radius: 999px;
    background: var(--hz-surface);
    font-size: 13px;
    white-space: nowrap;
}

.hz-pill b {
    font-family: var(--hz-font-display);
    font-size: 15px;
}

/* A pill that is a link (e.g. "Game history") */
a.hz-link {
    color: inherit;
    text-decoration: none;
    transition: border-color 0.15s, background 0.15s;
}

a.hz-link:hover {
    border-color: rgba(139, 92, 246, 0.7);
    background: rgba(139, 92, 246, 0.18);
}

.hz-gradient-text {
    background: var(--hz-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hz-avatar {
    display: inline-grid;
    flex: none;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--avatar-color, var(--hz-accent));
    color: #fff;
    font-family: var(--hz-font-display);
    font-weight: 700;
    font-size: 18px;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08);
}

.hz-progress {
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
}

.hz-progress > span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--hz-rainbow);
    background-size: 400px 100%;
    transition: width 0.6s ease;
}

.hz-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--hz-gradient);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.hz-ok {
    color: var(--hz-success);
}

.hz-fail {
    color: var(--hz-error);
}

/* ---------- Telerik tweaks ---------- */

.k-button {
    font-weight: 600;
}

.k-button-lg {
    padding-block: 12px;
    font-size: 16px;
}

.k-button-solid-primary.hz-cta {
    border: none;
    background: var(--hz-gradient);
    box-shadow: 0 8px 24px rgba(139, 92, 246, 0.4);
}

.k-button-solid-primary.hz-cta:hover {
    filter: brightness(1.08);
}

.k-window {
    border: 1px solid var(--hz-border);
    border-radius: 22px;
    overflow: hidden;
    background: #14112b;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}

.k-window-titlebar {
    border-bottom: 1px solid var(--hz-border);
    background: rgba(255, 255, 255, 0.04);
    font-family: var(--hz-font-display);
    font-size: 18px;
}

.k-overlay {
    background-color: rgba(5, 4, 15, 0.75);
    backdrop-filter: blur(4px);
}

.k-grid {
    border-color: var(--hz-border);
    border-radius: 12px;
    overflow: hidden;
    background: transparent;
}

.k-grid .k-table-thead,
.k-grid-header {
    background: rgba(255, 255, 255, 0.05);
}

/* ---------- Blazor error UI ---------- */

#blazor-error-ui {
    background: #3b0d18;
    color: #fff;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.blazor-error-boundary {
    padding: 1rem;
    background: #b32121;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

/* History, accounts, user and log out: one row below the logo, right-aligned with the page content */
.hz-header-user {
    display: flex;
    justify-content: flex-end;
    flex-basis: 100%;
    max-width: 1280px;
    padding: 0 8px;
    box-sizing: border-box;
}

/* ---------- iPhone / phones ---------- */

@media (max-width: 600px) {
    .hz-header {
        padding: 8px 12px 0;
    }

    .hz-header-user {
        padding: 0;
    }

    .hz-main {
        padding: 8px 12px 24px;
    }

    .hz-panel {
        padding: 16px;
    }

    .hz-panel-title {
        margin-bottom: 12px;
        font-size: 18px;
    }
}

/* iOS Safari zooms into inputs with text smaller than 16px when they are tapped */
@supports (-webkit-touch-callout: none) {
    .k-input-inner,
    .k-input,
    .k-picker,
    .k-input-value-text,
    input,
    select,
    textarea {
        font-size: 16px;
    }
}

/* A pill that is a button (e.g. "ℹ Song info") */
button.hz-pill {
    color: inherit;
    font: inherit;
    font-size: 13px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

button.hz-pill:hover {
    border-color: rgba(139, 92, 246, 0.7);
    background: rgba(139, 92, 246, 0.18);
}

/* Inline confirmation for deleting and logging out: "Question? [Yes] [Cancel]" */
.hz-confirm {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 4px 4px 4px 10px;
    border: 1px solid color-mix(in srgb, var(--hz-error) 60%, transparent);
    border-radius: 12px;
    background: color-mix(in srgb, var(--hz-error) 14%, transparent);
    font-size: 13px;
    font-weight: 600;
}

.hz-confirm button {
    padding: 5px 10px;
    border: 0;
    border-radius: 8px;
    background: var(--hz-surface-strong);
    color: inherit;
    font: inherit;
    cursor: pointer;
}

.hz-confirm button.hz-confirm-yes {
    background: var(--hz-error);
    color: #fff;
}
