/* Global theme, taken from the design mockup. Page specific rules stay in the
   .razor.css files next to their component. */

:root {
    /* Filled per league by the .league-scope wrapper; this is the neutral fallback. */
    --accent: #2f81f7;
    --accent-border: rgba(47, 129, 247, 0.5);
    --accent-glass: rgba(47, 129, 247, 0.14);

    --surface: rgba(14, 19, 25, 0.55);
    --surface-strong: rgba(14, 19, 25, 0.62);
    --border: rgba(255, 255, 255, 0.09);
    --border-strong: rgba(255, 255, 255, 0.12);

    --text: #eef2f5;
    --text-muted: rgba(255, 255, 255, 0.6);
    --text-faint: rgba(255, 255, 255, 0.45);

    --correct: #34d399;
    --wrong: #f45b5b;

    --radius-card: 20px;
    --radius-control: 12px;

    /* Smallest touch target on the iPad, the primary device. */
    --touch: 44px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html {
    -webkit-text-size-adjust: 100%;
}

html, body {
    min-height: 100%;
}

body {
    font-family: 'Barlow', system-ui, sans-serif;
    background: #070b0f;
    color: var(--text);
}

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

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.14);
    border-radius: 8px;
}

/* Condensed for headlines, semi condensed with tabular figures for numbers, so
   scores and points do not shift width as they change. */
.cnd {
    font-family: 'Barlow Condensed', sans-serif;
    letter-spacing: 0.01em;
}

.num {
    font-family: 'Barlow Semi Condensed', sans-serif;
    font-variant-numeric: tabular-nums;
}

h1, h2, h3 {
    font-weight: 700;
}

button, input, select, textarea {
    font-family: inherit;
}

/* ---------- background ---------- */

/* One fixed blurred field behind the whole layout, never per card. The scale hides
   the soft edges the blur produces. */
.app-field {
    position: fixed;
    inset: 0;
    z-index: -2;
    background: url('../img/field.jpg') center / cover no-repeat;
    filter: blur(15px) brightness(0.52) saturate(1.2);
    transform: scale(1.1);
    pointer-events: none;
}

.app-vignette {
    position: fixed;
    inset: 0;
    z-index: -1;
    background: radial-gradient(120% 90% at 50% -10%,
        rgba(10, 16, 22, 0.35),
        rgba(6, 10, 14, 0.82) 70%,
        rgba(4, 7, 10, 0.94));
    pointer-events: none;
}

.app-shell {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    width: 100%;
    /* clip, not hidden: "hidden" turns this element into a scroll container, and the
       sticky top bar inside it then has nothing to stick to while the page scrolls. */
    overflow-x: clip;
    isolation: isolate;
}

/* Older Safari without overflow: clip keeps the guard against sideways scrolling; the
   top bar scrolls away there, which is what it did before. */
@supports not (overflow: clip) {
    .app-shell {
        overflow-x: hidden;
    }
}

/* ---------- shared building blocks ---------- */

.page {
    display: flex;
    justify-content: center;
    padding: 22px 22px 26px;
}

.page-inner {
    width: 100%;
    max-width: 1180px;
}

.card {
    padding: 18px 20px;
    border-radius: var(--radius-card);
    background: var(--surface);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid var(--border);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.42);
}

.card-title {
    margin-bottom: 14px;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
}

.muted {
    color: var(--text-muted);
}

.loading {
    padding: 24px;
    color: var(--text-muted);
}

h1:focus {
    outline: none;
}

/* ---------- animations ---------- */

@keyframes popin {
    0% { transform: scale(0.94); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes glowpulse {
    0%, 100% { opacity: 0.55; }
    50% { opacity: 1; }
}

/* Respect the system setting instead of animating regardless. */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}

#blazor-error-ui {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    background: #2a1215;
    color: #ff8a80;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
}

#blazor-error-ui .dismiss {
    position: absolute;
    top: 0.5rem;
    right: 0.75rem;
    cursor: pointer;
}
