/* ========================================
   Rungalan Design System
   ======================================== */

:root {
    --bg: #0A0805;
    --bg-2: #14100B;
    --gold: #C9A24B;
    --gold-soft: #E8C97A;
    --cream: #F2EAD9;
}

html {
    scroll-behavior: smooth;
    background: #0A0805;
}

html, body {
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    outline: none !important;
    min-height: 100vh;
}

body {
    font-family: 'Manrope', system-ui, sans-serif;
    background: var(--bg);
    color: var(--cream);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* Remove focus outline on headings (Blazor FocusOnNavigate) */
h1:focus, h2:focus, h3:focus {
    outline: none;
}

/* Typography */
.font-display { font-family: 'Fraunces', serif; font-variation-settings: "SOFT" 50, "WONK" 0, "opsz" 144; }
.font-wonk    { font-family: 'Fraunces', serif; font-variation-settings: "SOFT" 100, "WONK" 1, "opsz" 144; }
.italic-display { font-family: 'Fraunces', serif; font-style: italic; font-variation-settings: "SOFT" 100, "WONK" 1, "opsz" 144; }

/* Warm atmospheric background */
.atmosphere {
    background:
        radial-gradient(ellipse 80% 60% at 70% 0%, rgba(201, 162, 75, 0.12), transparent 60%),
        radial-gradient(ellipse 60% 50% at 10% 30%, rgba(138, 38, 51, 0.08), transparent 60%),
        radial-gradient(ellipse 100% 80% at 50% 100%, rgba(201, 162, 75, 0.06), transparent 70%),
        #0A0805;
}

/* Grain texture overlay */
.grain::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/><feColorMatrix values='0 0 0 0 0.85  0 0 0 0 0.75  0 0 0 0 0.55  0 0 0 0.5 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.35'/></svg>");
    opacity: 0.18;
    mix-blend-mode: overlay;
    pointer-events: none;
    z-index: 1;
}

/* Gold hairlines */
.hairline {
    background: linear-gradient(90deg, transparent, rgba(201, 162, 75, 0.5), transparent);
    height: 1px;
}
.hairline-v {
    background: linear-gradient(180deg, transparent, rgba(201, 162, 75, 0.5), transparent);
    width: 1px;
}

/* Rune separator */
.rune-sep {
    color: var(--gold);
    font-family: 'Noto Sans Runic', serif;
    letter-spacing: 0.4em;
}

/* Star field background */
.star-field {
    background-image:
        radial-gradient(1px 1px at 20% 30%, rgba(232, 201, 122, 0.4), transparent),
        radial-gradient(1px 1px at 60% 70%, rgba(232, 201, 122, 0.3), transparent),
        radial-gradient(1px 1px at 80% 20%, rgba(232, 201, 122, 0.5), transparent),
        radial-gradient(1px 1px at 30% 80%, rgba(232, 201, 122, 0.25), transparent),
        radial-gradient(1px 1px at 90% 50%, rgba(232, 201, 122, 0.35), transparent);
    background-size: 100% 100%;
}

/* Scroll reveal animation — only activate after JS sets .js-ready on html */
.js-ready .reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.9s cubic-bezier(0.22, 1, 0.36, 1), transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}
.js-ready .reveal.in {
    opacity: 1;
    transform: translateY(0);
}

/* Gold CTA button */
.btn-gold {
    background: linear-gradient(180deg, #E8C97A, #C9A24B);
    color: #14100B;
    transition: transform 0.25s ease, box-shadow 0.25s ease, filter 0.25s ease;
    box-shadow: 0 10px 30px -10px rgba(201, 162, 75, 0.5);
    display: inline-block;
    text-decoration: none;
    cursor: pointer;
    border: none;
}
.btn-gold:hover {
    transform: translateY(-2px);
    filter: brightness(1.08);
    box-shadow: 0 14px 40px -10px rgba(201, 162, 75, 0.7);
}

/* Ghost button */
.btn-ghost {
    border: 1px solid rgba(232, 201, 122, 0.35);
    color: var(--cream);
    transition: all 0.25s ease;
    display: inline-block;
    text-decoration: none;
    cursor: pointer;
    background: transparent;
}
.btn-ghost:hover {
    border-color: var(--gold-soft);
    background: rgba(201, 162, 75, 0.08);
}

/* Winner card */
.winner-card {
    background: linear-gradient(180deg, rgba(30, 24, 18, 0.6), rgba(20, 16, 11, 0.9));
    border: 1px solid rgba(201, 162, 75, 0.15);
    transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.winner-card:hover {
    border-color: rgba(232, 201, 122, 0.5);
    transform: translateY(-4px);
    background: linear-gradient(180deg, rgba(42, 34, 24, 0.7), rgba(30, 24, 18, 0.9));
}

/* Form inputs */
.input-gold {
    background: rgba(20, 16, 11, 0.6);
    border: 1px solid rgba(201, 162, 75, 0.2);
    color: var(--cream);
    transition: all 0.2s ease;
}
.input-gold:focus {
    outline: none;
    border-color: var(--gold);
    background: rgba(20, 16, 11, 0.9);
    box-shadow: 0 0 0 3px rgba(201, 162, 75, 0.15);
}
.input-gold::placeholder { color: rgba(242, 234, 217, 0.35); }

/* Eyebrow label */
.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.28em;
    font-size: 0.72rem;
    color: var(--gold);
    font-weight: 500;
}

/* Runic ornament */
.runic-ornament {
    font-family: 'Noto Sans Runic', serif;
    color: rgba(201, 162, 75, 0.4);
}

/* Marquee animation */
@keyframes marquee {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}
.marquee-track {
    display: flex;
    width: max-content;
    animation: marquee 60s linear infinite;
}

/* Corner frame decoration */
.corner-frame {
    position: relative;
}
.corner-frame::before,
.corner-frame::after {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    border-color: var(--gold);
    border-style: solid;
}
.corner-frame::before {
    top: 0; left: 0;
    border-width: 1px 0 0 1px;
}
.corner-frame::after {
    bottom: 0; right: 0;
    border-width: 0 1px 1px 0;
}

/* Timeline line */
.timeline-line {
    background: linear-gradient(180deg,
        transparent 0%,
        rgba(201, 162, 75, 0.3) 10%,
        rgba(201, 162, 75, 0.3) 90%,
        transparent 100%);
}

/* Scrollbar */
::-webkit-scrollbar { width: 10px; background: #0A0805; }
::-webkit-scrollbar-thumb { background: rgba(201, 162, 75, 0.25); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(201, 162, 75, 0.45); }

/* Blazor error UI */
#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    color: #333;
}
#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

/* Identity pages - keep basic form styling */
.blazor-error-boundary {
    background: #b32121;
    padding: 1rem;
    color: white;
}
.blazor-error-boundary::after {
    content: "An error has occurred."
}
.validation-message {
    color: #e50000;
}

/* Admin page */
.admin-card {
    background: linear-gradient(180deg, rgba(30, 24, 18, 0.6), rgba(20, 16, 11, 0.9));
    border: 1px solid rgba(201, 162, 75, 0.15);
    border-radius: 0.5rem;
    padding: 2rem;
}
