/* ══════════════════════════════════════════════════════════════════════════
   Wildmagic — Landing Page
   ══════════════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;700;900&family=JetBrains+Mono:wght@400;700&display=swap');

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

:root {
    --gold: #d4aa40;
    --gold-bright: #f5d57a;
    --gold-dark: #a37b1e;
    --bg-deep: #0a0808;
    --bg-panel: rgba(30, 25, 18, 0.92);
    --text-dim: rgba(255, 255, 255, 0.25);
    --text-mid: rgba(255, 255, 255, 0.55);
    --text-bright: rgba(255, 255, 255, 0.85);
    --border-gold: rgba(196, 160, 70, 0.25);
}

html { scroll-behavior: smooth; }

body {
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    background: var(--bg-deep);
    color: var(--text-mid);
    overflow-x: hidden;
}

/* ── Hero ──────────────────────────────────────────────────────────────── */

.wm-hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 24px;
    position: relative;
    background:
        radial-gradient(ellipse at 30% 20%, rgba(90, 50, 20, 0.35) 0%, transparent 60%),
        radial-gradient(ellipse at 70% 80%, rgba(50, 20, 80, 0.25) 0%, transparent 60%),
        var(--bg-deep);
    overflow: hidden;
}

.wm-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='1' height='1' x='30' y='30' fill='%23d4aa4008'/%3E%3C/svg%3E") repeat;
    pointer-events: none;
}

.wm-hero-content {
    position: relative;
    z-index: 2;
    max-width: 720px;
}

.wm-title {
    font-family: 'Cinzel', serif;
    font-size: clamp(38px, 10vw, 86px);
    font-weight: 900;
    letter-spacing: 0.08em;
    color: var(--gold);
    text-shadow:
        0 0 40px rgba(212, 170, 64, 0.4),
        0 0 100px rgba(212, 170, 64, 0.15);
    animation: wm-glow 4s ease-in-out infinite alternate;
    line-height: 1;
}

.wm-title-rune {
    font-size: 0.45em;
    vertical-align: middle;
    color: rgba(212, 170, 64, 0.45);
    animation: wm-spin 14s linear infinite;
    display: inline-block;
}

@keyframes wm-glow {
    0%   { text-shadow: 0 0 40px rgba(212, 170, 64, 0.4), 0 0 100px rgba(212, 170, 64, 0.15); }
    100% { text-shadow: 0 0 60px rgba(212, 170, 64, 0.6), 0 0 140px rgba(212, 170, 64, 0.25); }
}

@keyframes wm-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.wm-subtitle {
    font-size: 12px;
    letter-spacing: 0.35em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-top: 12px;
}

.wm-tagline {
    font-family: 'Cinzel', serif;
    font-size: clamp(14px, 2.5vw, 20px);
    color: var(--text-mid);
    margin-top: 32px;
    line-height: 1.7;
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
}

.wm-cta-group {
    margin-top: 48px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

/* ── Buttons ──────────────────────────────────────────────────────────── */

.wm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 40px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    text-decoration: none;
    border: 1px solid var(--border-gold);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.25s ease;
    user-select: none;
    position: relative;
    overflow: hidden;
}

.wm-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(212, 170, 64, 0.08) 50%, transparent 100%);
    transform: translateX(-100%);
    transition: transform 0.4s ease;
}

.wm-btn:hover::before { transform: translateX(0); }

.wm-btn-buy {
    color: var(--bg-deep);
    background: linear-gradient(135deg, var(--gold-bright), var(--gold), var(--gold-dark));
    border-color: var(--gold);
    font-size: 15px;
    padding: 18px 48px;
}

.wm-btn-buy:hover {
    box-shadow: 0 0 30px rgba(212, 170, 64, 0.35);
    transform: translateY(-1px);
}

.wm-btn-buy:active { transform: scale(0.97); }

.wm-btn-play {
    color: var(--bg-deep);
    background: linear-gradient(135deg, #7aed8a, #40d460, #2aad3e);
    border-color: #40d460;
    font-size: 15px;
    padding: 18px 48px;
}

.wm-btn-play:hover {
    box-shadow: 0 0 30px rgba(64, 212, 96, 0.35);
    transform: translateY(-1px);
}

.wm-login-link {
    font-size: 11px;
    letter-spacing: 0.1em;
    color: var(--text-dim);
}

.wm-login-link a {
    color: var(--gold);
    text-decoration: none;
    border-bottom: 1px solid rgba(212, 170, 64, 0.3);
    transition: border-color 0.2s;
}

.wm-login-link a:hover { border-color: var(--gold); }

/* ── Scroll indicator ─────────────────────────────────────────────────── */

.wm-scroll-hint {
    position: absolute;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--text-dim);
    animation: wm-bob 2s ease-in-out infinite;
}

.wm-scroll-hint::after {
    content: '\2193';
    display: block;
    text-align: center;
    margin-top: 4px;
    font-size: 14px;
}

@keyframes wm-bob {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50%      { transform: translateX(-50%) translateY(6px); }
}

/* ── Sections ─────────────────────────────────────────────────────────── */

.wm-section {
    padding: 100px 24px;
    max-width: 960px;
    margin: 0 auto;
}

.wm-section-title {
    font-family: 'Cinzel', serif;
    font-size: clamp(24px, 4vw, 36px);
    font-weight: 700;
    color: var(--gold);
    letter-spacing: 0.06em;
    margin-bottom: 48px;
    text-align: center;
    text-shadow: 0 0 20px rgba(212, 170, 64, 0.2);
}

/* ── Media Section (trailer + screenshots) ────────────────────────────── */

.wm-media-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.wm-trailer-placeholder {
    aspect-ratio: 16 / 9;
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed var(--border-gold);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--text-dim);
    font-size: 12px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.wm-trailer-placeholder iframe {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 8px;
}

.wm-trailer-icon {
    font-size: 48px;
    color: var(--gold);
    opacity: 0.4;
}

.wm-screenshots {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.wm-screenshot {
    aspect-ratio: 16 / 9;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.1);
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    transition: border-color 0.3s;
    overflow: hidden;
}

.wm-screenshot:hover {
    border-color: var(--border-gold);
}

.wm-screenshot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ── Features ─────────────────────────────────────────────────────────── */

.wm-features {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
}

.wm-feature {
    background: var(--bg-panel);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    padding: 32px 28px;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.wm-feature:hover {
    border-color: var(--border-gold);
    box-shadow: 0 0 30px rgba(212, 170, 64, 0.05);
}

.wm-feature-icon {
    font-size: 28px;
    margin-bottom: 16px;
    display: block;
}

.wm-feature-title {
    font-family: 'Cinzel', serif;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-bright);
    letter-spacing: 0.04em;
    margin-bottom: 10px;
}

.wm-feature-desc {
    font-size: 12px;
    line-height: 1.7;
    color: var(--text-mid);
}

/* ── Bottom CTA ───────────────────────────────────────────────────────── */

.wm-bottom-cta {
    text-align: center;
    padding: 80px 24px 120px;
}

.wm-bottom-cta .wm-section-title {
    margin-bottom: 32px;
}

/* ── Footer ───────────────────────────────────────────────────────────── */

.wm-footer {
    text-align: center;
    padding: 32px 24px;
    font-size: 10px;
    letter-spacing: 0.15em;
    color: rgba(255, 255, 255, 0.12);
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.wm-footer a {
    color: var(--gold);
    text-decoration: none;
    opacity: 0.5;
    transition: opacity 0.2s;
}
.wm-footer a:hover { opacity: 1; }

/* ── Login Modal ──────────────────────────────────────────────────────── */

.wm-modal {
    position: fixed;
    inset: 0;
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wm-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
}

.wm-modal-panel {
    position: relative;
    background: var(--bg-panel);
    border: 1px solid var(--border-gold);
    border-radius: 8px;
    padding: 36px 32px;
    width: 90vw;
    max-width: 380px;
}

.wm-modal-title {
    font-family: 'Cinzel', serif;
    font-size: 20px;
    font-weight: 700;
    color: var(--gold);
    margin-bottom: 8px;
}

.wm-modal-desc {
    font-size: 11px;
    color: var(--text-dim);
    margin-bottom: 20px;
    line-height: 1.6;
}

.wm-input {
    width: 100%;
    padding: 12px 16px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    color: var(--text-bright);
    outline: none;
    transition: border-color 0.2s;
}

.wm-input:focus {
    border-color: var(--gold);
}

.wm-input::placeholder {
    color: rgba(255, 255, 255, 0.2);
}

.wm-modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    width: 28px;
    height: 28px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    color: rgba(255, 255, 255, 0.3);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: all 0.15s;
}
.wm-modal-close:hover {
    color: rgba(255, 255, 255, 0.7);
    border-color: rgba(255, 255, 255, 0.3);
}

.wm-error {
    font-size: 11px;
    color: #ff6b6b;
    margin-top: 10px;
    min-height: 16px;
    letter-spacing: 0.05em;
}

/* ── Ambient particles ────────────────────────────────────────────────── */

.wm-particles {
    position: absolute;
    inset: 0;
    z-index: 1;
    overflow: hidden;
    pointer-events: none;
}

.wm-particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: rgba(212, 170, 64, 0.25);
    border-radius: 50%;
    animation: wm-float linear infinite;
}

@keyframes wm-float {
    0%   { transform: translateY(100vh) scale(1); opacity: 0; }
    10%  { opacity: 1; }
    90%  { opacity: 1; }
    100% { transform: translateY(-10vh) scale(0); opacity: 0; }
}

/* ── Game shell (placeholder) ─────────────────────────────────────────── */

.wm-game-shell {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    text-align: center;
}

.wm-game-msg {
    max-width: 480px;
    padding: 24px;
}

.wm-game-msg h1 {
    font-family: 'Cinzel', serif;
    font-size: 24px;
    color: var(--gold);
    letter-spacing: 0.1em;
    margin-bottom: 16px;
}

.wm-game-msg p {
    font-size: 13px;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.35);
}

.wm-game-msg code {
    background: rgba(255, 255, 255, 0.06);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
}

/* ── Responsive ───────────────────────────────────────────────────────── */

@media (max-width: 640px) {
    .wm-features { grid-template-columns: 1fr; }
    .wm-screenshots { grid-template-columns: 1fr; }
}