@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Merriweather:wght@700&display=swap');

/* ── Variables ── */
:root {
    --primary:      #c0202a;
    --primary-dark: #9b1515;
    --primary-glow: rgba(192, 32, 42, 0.28);
    --accent:       #c0202a;
    --accent-hover: #9b1515;
    --gold:         #f5a623;
    --gold-light:   #fbbf24;
    --gold-dark:    #d97706;
    --gold-glow:    rgba(245, 166, 35, 0.30);
    --green:        #1e6b32;
    --navy:         #0e0808;
    --navy-2:       #170c0c;
    --navy-3:       #221212;
    --text:         #1a0e0e;
    --text-muted:   #6b5757;
    --bg:           #f5f0f0;
    --surface:      #ffffff;
    --surface-2:    #fdf8f8;
    --border:       #e8d8d8;
    --shadow-sm:    0 1px 3px rgba(15,30,61,.08), 0 1px 2px rgba(15,30,61,.06);
    --shadow-md:    0 4px 16px rgba(15,30,61,.12), 0 2px 6px rgba(15,30,61,.08);
    --shadow-lg:    0 10px 32px rgba(15,30,61,.16), 0 4px 12px rgba(15,30,61,.10);
    --radius:       12px;
    --radius-sm:    8px;
    --radius-pill:  999px;
}

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

/* ── Base ── */
body {
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    margin: 0;
    padding: 0;
    text-align: center;
    line-height: 1.6;
}

h1, h2, h3, h4 {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    line-height: 1.2;
    margin-top: 0;
}

a { color: var(--primary); }

/* ── Header ── */
header {
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 50%, #1e3a8a 100%);
    color: #fff;
    padding: 28px 24px;
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 80% 120% at 50% -20%, rgba(192,32,42,.30) 0%, transparent 70%);
    pointer-events: none;
}

header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--gold-dark), var(--gold-light), var(--gold), var(--gold-light), var(--gold-dark), transparent);
}

header h1 {
    margin: 0;
    font-size: clamp(1.4rem, 4vw, 2.2rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    position: relative;
    z-index: 1;
    background: linear-gradient(135deg, #fff 30%, var(--gold-light) 60%, #fff 80%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,.4));
}

/* ── Navigation ── */
nav {
    background: var(--navy-3);
    padding: 10px 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 12px rgba(0,0,0,.25);
}

.nav-toggle {
    display: none;
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.2);
    border-radius: var(--radius-sm);
    padding: 8px 14px;
    font-size: 1.1rem;
    cursor: pointer;
    color: #fff;
    width: 100%;
    text-align: left;
    transition: background .2s;
}

.nav-toggle:hover { background: rgba(255,255,255,.18); }

.nav-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    padding: 4px 0;
}

nav a {
    text-decoration: none;
    color: rgba(255,255,255,.8);
    padding: 7px 16px;
    border-radius: var(--radius-pill);
    font-size: 0.88rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    transition: background .2s, color .2s, transform .15s;
    white-space: nowrap;
}

nav a:hover {
    background: rgba(245,166,35,.18);
    color: var(--gold-light);
    transform: translateY(-1px);
}

/* ── Layout ── */
.container {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    max-width: 1300px;
    margin: 28px auto;
    padding: 0 20px;
    align-items: flex-start;
}

/* ── Sidebar ── */
.sidebar {
    width: 220px;
    flex-shrink: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px 18px;
    box-shadow: var(--shadow-sm);
    border-top: 3px solid var(--gold);
}

.sidebar h3 {
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--gold-dark);
    margin-bottom: 10px;
}

.sidebar p {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.55;
}

.sidebar a:not(.discord-button) {
    color: var(--primary);
    font-weight: 600;
}

/* ── Main ── */
main {
    flex-grow: 1;
    min-width: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 28px;
    box-shadow: var(--shadow-sm);
}

main h2 {
    font-size: 1.6rem;
    letter-spacing: -0.02em;
    margin-bottom: 6px;
    color: var(--navy);
}

main > p:first-of-type {
    color: var(--text-muted);
    margin-top: 0;
}

/* ── Footer ── */
footer {
    background: var(--navy);
    color: rgba(255,255,255,.55);
    padding: 18px 24px;
    margin-top: 40px;
    font-size: 0.85rem;
}

.footer-text {
    margin: 0;
    color: var(--gold);
    opacity: 0.85;
}

/* ── Discord / CTA Button ── */
.discord-button {
    display: inline-block;
    background: linear-gradient(135deg, var(--accent), #ff6b6b);
    color: #fff;
    padding: 9px 18px;
    border-radius: var(--radius-pill);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 600;
    margin: 8px 0;
    transition: transform .2s, box-shadow .2s;
    box-shadow: 0 3px 10px rgba(255,71,87,.35);
}

.discord-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(255,71,87,.45);
}

/* ── Tables ── */
.table-scroll {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    margin: 20px 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    font-size: 0.9rem;
}

th {
    background: linear-gradient(135deg, var(--navy), #3d0c0c);
    color: #fff;
    font-weight: 600;
    font-size: 0.82rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 12px 16px;
    text-align: left;
}

td {
    border-bottom: 1px solid var(--border);
    padding: 11px 16px;
    text-align: left;
}

tbody tr:last-child td { border-bottom: none; }

tbody tr:nth-child(even) { background: var(--surface-2); }

tbody tr {
    transition: background .15s;
}

tbody tr:hover { background: #eef2fd; }

tbody td a {
    color: var(--primary);
    font-weight: 500;
    text-decoration: none;
}

tbody td a:hover { text-decoration: underline; }

.flag-icon { margin-right: 8px; }

/* ── War results grid ── */
.war-results {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
    margin-top: 20px;
    text-align: left;
}

.war-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    transition: transform .22s, box-shadow .22s;
    overflow: hidden;
}

.war-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.war-card h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--navy);
    margin-bottom: 10px;
}

.war-card img {
    width: 100%;
    border-radius: var(--radius-sm);
    height: auto;
    display: block;
}

/* ── Future page ── */
.future-section {
    text-align: left;
    padding: 20px 22px;
    margin: 16px 0;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-left: 4px solid var(--gold);
    border-radius: var(--radius-sm);
}

.future-section h3 {
    color: var(--gold-dark);
    font-size: 1rem;
    margin-bottom: 8px;
}

.future-section ul { line-height: 1.9; margin: 0; padding-left: 20px; }
.future-section p { margin: 0; color: var(--text-muted); font-size: 0.93rem; }

/* ── Contact form ── */
form {
    display: flex;
    flex-direction: column;
    align-items: center;
}

label {
    align-self: flex-start;
    margin: 10px 0 4px;
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

input, textarea {
    width: 100%;
    max-width: 420px;
    padding: 10px 14px;
    margin: 4px 0 10px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: 'Inter', sans-serif;
    font-size: 0.93rem;
    color: var(--text);
    background: var(--surface-2);
    transition: border-color .2s, box-shadow .2s;
    outline: none;
}

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

button[type="submit"] {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    padding: 11px 28px;
    border: none;
    border-radius: var(--radius-pill);
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    transition: transform .2s, box-shadow .2s;
    box-shadow: 0 4px 14px var(--primary-glow);
    margin-top: 4px;
}

button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--primary-glow);
}

.success-message, .error-message {
    margin: 16px 0;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    display: none;
}

.success-message {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.error-message {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* ── Atlas League result cards ── */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 18px;
    margin-top: 20px;
    text-align: left;
}

.result-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    transition: transform .22s, box-shadow .22s;
    overflow: hidden;
}

.result-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.result-card h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--navy);
    margin-bottom: 8px;
}

.result-card p { font-size: 0.9rem; color: var(--text-muted); }

.result-card img {
    width: 100%;
    border-radius: var(--radius-sm);
    height: auto;
    display: block;
    margin-top: 10px;
}

.win  { border-left: 4px solid var(--green); }
.loss { border-left: 4px solid var(--primary); }

.win  h3 { color: var(--green); }
.loss h3 { color: var(--primary-dark); }

.back-link {
    display: inline-block;
    margin-bottom: 20px;
    color: var(--primary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
}

.back-link:hover { text-decoration: underline; }

/* ── General image ── */
img {
    border-radius: var(--radius-sm);
    max-width: 100%;
    height: auto;
}

/* ════════════════════════════════
   MOBILE — max-width: 768px
   ════════════════════════════════ */
@media (max-width: 768px) {
    .nav-toggle { display: block; }

    .nav-links {
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        padding: 8px 0 4px;
    }

    .nav-links.open { display: flex; }

    nav a {
        text-align: center;
        font-size: 0.95rem;
        padding: 10px;
        background: rgba(255,255,255,.08);
    }

    nav a:hover { background: rgba(255,255,255,.16); }

    .container {
        flex-direction: column;
        padding: 0 12px;
        margin: 16px auto;
        gap: 14px;
    }

    .sidebar { width: 100%; }

    main { padding: 18px 16px; }

    table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    th, td {
        font-size: 0.82rem;
        padding: 9px 11px;
        white-space: nowrap;
    }

    .war-results,
    .results-grid {
        grid-template-columns: 1fr;
    }

    input, textarea { max-width: 100%; }
}

@media (max-width: 480px) {
    header h1 { font-size: 1.25rem; }
    main h2   { font-size: 1.3rem; }
}
