:root {
    color-scheme: light;
    --color-primary: #2563eb;
    --color-primary-dark: #1d4ed8;
    --color-secondary: #7c3aed;
    --color-success: #15803d;
    --color-retry: #c2410c;
    --color-reward: #fbbf24;
    --color-background: #eff6ff;
    --color-surface: #ffffff;
    --color-surface-soft: #f8fafc;
    --color-text: #172033;
    --color-muted: #64748b;
    --color-border: #dbeafe;
    --shadow-soft: 0 12px 32px rgb(30 64 175 / 0.1);
    --shadow-card: 0 18px 42px rgb(30 64 175 / 0.14);
    --radius-small: 12px;
    --radius-medium: 18px;
    --radius-large: 28px;
    --content-width: 1180px;
    --font-ui: "Trebuchet MS", "Segoe UI", Arial, sans-serif;
}

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

html {
    min-width: 320px;
    min-height: 100%;
    scroll-behavior: smooth;
}

body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    color: var(--color-text);
    background:
        radial-gradient(circle at 8% 8%, rgb(191 219 254 / 0.75), transparent 28rem),
        radial-gradient(circle at 92% 12%, rgb(221 214 254 / 0.65), transparent 24rem),
        var(--color-background);
    font-family: var(--font-ui);
    line-height: 1.5;
}

button,
select,
input {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

img {
    max-width: 100%;
}

[hidden] {
    display: none !important;
}

:focus-visible {
    outline: 4px solid var(--color-reward);
    outline-offset: 3px;
}

.skip-link {
    position: fixed;
    z-index: 1000;
    top: 12px;
    left: 12px;
    padding: 10px 16px;
    color: #ffffff;
    background: var(--color-text);
    border-radius: 10px;
    transform: translateY(-150%);
}

.skip-link:focus {
    transform: translateY(0);
}

.app-shell {
    display: flex;
    min-height: 100vh;
    flex-direction: column;
}

.site-header {
    z-index: 10;
    display: flex;
    width: min(calc(100% - 40px), var(--content-width));
    min-height: 80px;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin: 18px auto 0;
    padding: 12px 16px;
    background: rgb(255 255 255 / 0.86);
    border: 1px solid rgb(255 255 255 / 0.9);
    border-radius: 22px;
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(12px);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--color-text);
    text-decoration: none;
}

.brand__mark {
    display: grid;
    width: 52px;
    height: 52px;
    place-items: center;
    color: #ffffff;
    background: linear-gradient(145deg, var(--color-primary), var(--color-secondary));
    border-radius: 16px;
    font-family: "Noto Naskh Arabic", "Segoe UI", serif;
    font-size: 2rem;
    line-height: 1;
    box-shadow: 0 8px 20px rgb(37 99 235 / 0.25);
}

.brand__copy {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.brand__copy strong {
    font-size: 1.05rem;
}

.brand__copy span {
    color: var(--color-muted);
    font-size: 0.9rem;
}

.site-header__actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

#app-content {
    width: min(calc(100% - 40px), var(--content-width));
    flex: 1;
    margin: 0 auto;
}

#app-content:focus {
    outline: none;
}

.site-footer {
    width: min(calc(100% - 40px), var(--content-width));
    margin: 28px auto 0;
    padding: 22px 0 28px;
    color: var(--color-muted);
    text-align: center;
}

.site-footer p {
    margin: 0;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.noscript-message {
    position: fixed;
    right: 16px;
    bottom: 16px;
    left: 16px;
    padding: 16px;
    color: #ffffff;
    background: var(--color-text);
    border-radius: var(--radius-small);
    text-align: center;
}
