/* ═══════════════════════════════════════════════════════════════
   EvoRealm UO — Shared Base Styles
   ═══════════════════════════════════════════════════════════════ */

/* ── Reset ────────────────────────────────────────────────────── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ── Design Tokens (CSS Custom Properties) ────────────────────── */
:root {
    /* Color Palette — Warm Parchment (easy on eye, UO classic) */
    --bg:          #1a140d;
    --bg-alt:      #221a10;
    --bg-card:     #2a2114;
    --bg-card-alt: #332a1a;
    --surface:     #3a2e1e;
    --border:      #4a3a20;
    --border-glow: #c9a24a22;

    --text:        #e8dcc8;
    --text-dim:    #a09080;
    --text-bright: #f5ecd8;

    --accent:      #c9a24a;
    --accent-glow: #c9a24a30;
    --accent-light:#d8b86a;
    --gold:        #c9a24a;
    --gold-dim:    #c9a24a33;

    --success:     #7abf8a;
    --danger:      #c97a6a;
    --info:        #8ab4c9;

    /* Spacing */
    --gap:         1.5rem;
    --gap-lg:      3rem;
    --radius:      12px;
    --radius-sm:   8px;
    --radius-pill: 9999px;

    /* Transitions */
    --ease: cubic-bezier(.25,.8,.25,1);

    /* Typography */
    --font-ui: 'Inter', system-ui, -apple-system, sans-serif;
    --font-display: 'Cinzel', serif;
    --font-mono: 'Cascadia Code', 'Fira Code', monospace;

    /* Z-index scale */
    --z-nav:       1000;
    --z-modal:     2000;
    --z-toast:     3000;
    --z-tooltip:   4000;
}

/* ── Base HTML/Body ───────────────────────────────────────────── */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
    -webkit-font-smoothing: antialiased;
    background: var(--bg);
}

body {
    font-family: var(--font-ui);
    background: transparent;
    color: var(--text);
    line-height: 1.7;
    overflow-x: hidden;
}

/* ── Links ────────────────────────────────────────────────────── */
a {
    color: var(--accent-light);
    text-decoration: none;
    transition: color .2s var(--ease);
}
a:hover { color: var(--gold); }

/* ── Images ───────────────────────────────────────────────────── */
img { max-width: 100%; display: block; }

/* ── Code ─────────────────────────────────────────────────────── */
code {
    background: var(--surface);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: .85em;
    color: var(--accent-light);
    font-family: var(--font-mono);
}

/* ── Container ────────────────────────────────────────────────── */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ── Typography ───────────────────────────────────────────────── */
h1, h2, h3, h4 {
    font-family: var(--font-display);
    color: var(--text-bright);
    line-height: 1.2;
}

.section-title {
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    text-align: center;
    margin-bottom: .5rem;
    background: linear-gradient(135deg, var(--accent-light), var(--gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-subtitle {
    text-align: center;
    color: var(--text-dim);
    max-width: 640px;
    margin: 0 auto var(--gap-lg);
    font-size: 1.05rem;
}

.subsection-title {
    font-size: 1.3rem;
    margin: var(--gap-lg) 0 var(--gap);
    padding-left: .5rem;
    border-left: 3px solid var(--accent);
}

.accent { color: var(--gold); -webkit-text-fill-color: var(--gold); }

.small-note {
    font-size: .82rem;
    color: var(--text-dim);
    margin-top: .5rem;
}

/* ── Buttons ──────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .75rem 2rem;
    border-radius: var(--radius-pill);
    font-weight: 600;
    font-size: .95rem;
    cursor: pointer;
    border: none;
    transition: all .3s var(--ease);
    text-decoration: none;
    font-family: var(--font-ui);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), #6033ff);
    color: #fff;
    box-shadow: 0 4px 24px var(--accent-glow);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px var(--accent-glow);
    color: #fff;
}

.btn-outline {
    background: transparent;
    color: var(--text);
    border: 2px solid var(--border);
}
.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent-light);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}
.btn-danger:hover { background: #ef4444; }

.btn-success {
    background: var(--success);
    color: var(--bg);
}
.btn-success:hover { background: #2dd38a; }

.btn-gold {
    background: var(--gold);
    color: var(--bg);
    font-weight: 700;
}
.btn-gold:hover { background: #ffe44d; }

.btn-sm { padding: .5rem 1.2rem; font-size: .8rem; }
.btn-lg { padding: 1rem 2.5rem; font-size: 1.05rem; }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none !important; }

/* ── Form Elements ────────────────────────────────────────────── */
.form-label {
    display: block;
    font-size: .82rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: .4rem;
    margin-top: 1rem;
}
.form-label:first-child { margin-top: 0; }

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: inherit;
    font-size: .9rem;
    outline: none;
    transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%239594b0' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

.form-textarea { resize: vertical; line-height: 1.6; }

/* ── Modal System ─────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal);
    background: rgba(0, 0, 0, .7);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: fadeIn .2s ease;
}
.modal-overlay.hidden { display: none; }

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp .25s var(--ease);
}

.modal-sm { max-width: 380px; }

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.modal-header h2 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-bright);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 1.6rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color .2s;
}
.modal-close:hover { color: var(--danger); }

.modal-body { padding: 1.5rem; }

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: .75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
}

.modal-footer-col {
    flex-direction: column;
    align-items: stretch;
    gap: .75rem;
}

.btn-full { width: 100%; justify-content: center; }

/* ── Toast Notifications ──────────────────────────────────────── */
.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.toast {
    padding: .75rem 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: .85rem;
    box-shadow: 0 8px 30px rgba(0,0,0,.4);
    animation: toastIn .3s var(--ease);
    max-width: 340px;
}

.toast.success { border-color: var(--success); }
.toast.error   { border-color: var(--danger); }

@keyframes toastIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ── Utility Classes ──────────────────────────────────────────── */
.hidden { display: none !important; }
.text-dim { color: var(--text-dim); font-size: .88rem; }
.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; }

/* ── Respect Reduced Motion ───────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
    html { scroll-behavior: auto; }
}


/* ── Retro UO — Hybrid EvoRealm + Classic (conservative) ──────────── */
:root {
    /* stone/parchment accents layered on dark EvoRealm */
    --stone: #2a2218;
    --stone-light: #3a2e1e;
    --parchment: #e8dcc8;
    --parchment-dim: #c9b896;
    --gump-border: #5a4a2e;
    --gump-highlight: #8a7a5a;
}

/* ── Responsive Breakpoints ───────────────────────────────────── */
@media (max-width: 768px) {
    .container { padding: 0 1rem; }
    .section-title { font-size: clamp(1.5rem, 5vw, 2rem); }
    .btn { padding: .6rem 1.5rem; }
}

@media (max-width: 480px) {
    :root { --gap: 1rem; --gap-lg: 2rem; }
    .btn { padding: .5rem 1rem; font-size: .85rem; }
}