/* ===========================================================================
   Panzo — game site styling.
   The palette is lifted straight out of the game: skin/ui_skin.json colours,
   util/GameColors.kt and skin/PanzerSkin.kt (team + rarity colours).
   =========================================================================== */

@font-face {
    font-family: 'Xolonium';
    src: url('../fonts/xolonium.ttf') format('truetype');
    font-weight: 400 700;
    font-display: swap;
}

:root {
    /* game window / panel colours (GameColors.kt, ui_skin.json) */
    --sand: #e8d5a2;
    --sand-dark: #d5ad51;
    --wood: #412c17;
    --wood-deep: #2a1b0d;
    --night: #120d07;
    --night-2: #1c140b;

    /* team colours (PanzerSkin.teamColor) */
    --team-red: #ec5b49;
    --team-blue: #4da3de;
    --team-green: #40c863;
    --team-purple: #bb63bb;
    --team-neutral: #b6a152;

    /* HUD */
    --hud-blue: #1ba0e1;
    --gold: #ffd700;
    --gold-dark: #b8860b;
    --danger: #cc3333;
    --health: #33cc33;

    /* rarity tiers (SkinRarity) */
    --common: #c9c9c9;
    --rare: #4fa3ff;
    --epic: #c061ff;
    --legendary: #ffb23c;
    --mythic: #ff4d5e;

    --text: #f4ead2;
    --text-dim: #bda87e;
    --ink: #2a1b0d;

    --panel-radius: 14px;
    --max: 1180px;
    --font-display: 'Xolonium', 'Trebuchet MS', system-ui, sans-serif;
    --font-body: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 92px; }

body {
    margin: 0;
    font-family: var(--font-body);
    color: var(--text);
    background-color: var(--night);
    background-image:
        radial-gradient(ellipse at 50% -10%, rgba(213, 173, 81, .16), transparent 60%),
        url('../img/tile-desert.png');
    background-size: auto, 256px 128px;
    background-attachment: fixed, fixed;
    line-height: 1.65;
    overflow-x: hidden;
}

/* the tiled sand is a texture, not a picture: knock it back behind everything */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: linear-gradient(180deg, rgba(18, 13, 7, .82), rgba(18, 13, 7, .93));
    z-index: -1;
    pointer-events: none;
}

img { max-width: 100%; display: block; }
a { color: var(--sand-dark); }

h1, h2, h3, h4, .display {
    font-family: var(--font-display);
    letter-spacing: .02em;
    line-height: 1.15;
    margin: 0 0 .5em;
}

/* the in-game label look: heavy dark outline around bright text (OutlinedLabel.kt) */
.outlined {
    color: var(--sand);
    text-shadow:
        3px 0 0 var(--ink), -3px 0 0 var(--ink), 0 3px 0 var(--ink), 0 -3px 0 var(--ink),
        2px 2px 0 var(--ink), -2px 2px 0 var(--ink), 2px -2px 0 var(--ink), -2px -2px 0 var(--ink),
        0 6px 18px rgba(0, 0, 0, .6);
}

.wrap { width: min(var(--max), calc(100% - 44px)); margin-inline: auto; }

/* ---------------------------------------------------------------- HUD nav */
.hud {
    position: sticky;
    top: 0;
    z-index: 50;
    background: linear-gradient(180deg, rgba(20, 14, 8, .97), rgba(20, 14, 8, .82));
    border-bottom: 2px solid rgba(213, 173, 81, .35);
    backdrop-filter: blur(6px);
}

.hud-inner {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 10px 0 6px;
}

.hud-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.hud-brand img { width: 38px; height: 38px; image-rendering: auto; }
.hud-brand span {
    font-family: var(--font-display);
    font-size: 1.35rem;
    color: var(--sand);
    letter-spacing: .08em;
}

.hud-bars { flex: 1; min-width: 0; display: none; }
@media (min-width: 900px) { .hud-bars { display: block; } }

.bar {
    height: 12px;
    background: #333;
    border-radius: 3px;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, .6);
}
.bar > i {
    display: block;
    height: 100%;
    width: 78%;
    background: var(--hud-blue);
    box-shadow: 0 0 12px rgba(27, 160, 225, .7);
    animation: bar-pulse 6s ease-in-out infinite;
}
@keyframes bar-pulse { 0%, 100% { width: 62%; } 50% { width: 88%; } }

.hud-hearts { display: flex; gap: 4px; margin-top: 5px; }
.hud-hearts i {
    width: 12px; height: 12px;
    background: var(--team-red);
    clip-path: polygon(50% 100%, 0 38%, 8% 12%, 30% 4%, 50% 20%, 70% 4%, 92% 12%, 100% 38%);
}

.hud-nav { display: none; gap: 20px; }
@media (min-width: 1040px) { .hud-nav { display: flex; } }
.hud-nav a {
    font-family: var(--font-display);
    font-size: .82rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--text-dim);
    text-decoration: none;
    padding: 6px 0;
    border-bottom: 2px solid transparent;
    transition: color .15s, border-color .15s;
}
.hud-nav a:hover, .hud-nav a:focus-visible { color: var(--sand); border-bottom-color: var(--sand-dark); }

/* ------------------------------------------------------------ game buttons */
.btn {
    --btn-face: var(--gold);
    --btn-edge: var(--gold-dark);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display);
    font-size: 1rem;
    letter-spacing: .04em;
    text-decoration: none;
    color: #4a3000;
    background: linear-gradient(180deg, color-mix(in srgb, var(--btn-face) 88%, #fff), var(--btn-face));
    border: 2px solid var(--btn-edge);
    border-radius: 12px;
    padding: 13px 26px;
    box-shadow: 0 5px 0 var(--btn-edge), 0 9px 20px rgba(0, 0, 0, .5);
    cursor: pointer;
    transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 7px 0 var(--btn-edge), 0 14px 26px rgba(0, 0, 0, .55); }
.btn:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--btn-edge); }
.btn--ghost {
    --btn-face: transparent;
    --btn-edge: rgba(232, 213, 162, .45);
    background: rgba(232, 213, 162, .07);
    color: var(--sand);
    box-shadow: 0 5px 0 rgba(232, 213, 162, .2);
}
.btn--red { --btn-face: var(--team-red); --btn-edge: #a5301f; color: #fff5ef; }
.btn--sm { font-size: .85rem; padding: 9px 18px; border-radius: 10px; }

/* ------------------------------------------------------------------- hero */
.hero { position: relative; padding: 0 0 40px; }

.hero-stage {
    position: relative;
    height: clamp(420px, 62vh, 640px);
    overflow: hidden;
    border-bottom: 3px solid rgba(213, 173, 81, .3);
    background: #7a5a38 url('../img/tile-desert.png') repeat;
    background-size: 128px 64px;
}
#battlefield { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }

.hero-scrim {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse at 30% 45%, transparent 20%, rgba(18, 13, 7, .55) 75%),
        linear-gradient(180deg, rgba(18, 13, 7, .78) 0%, rgba(18, 13, 7, .15) 35%, rgba(18, 13, 7, .9) 100%);
}

.hero-content {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    pointer-events: none;
}
.hero-content .wrap { pointer-events: none; }
.hero-content a, .hero-content button { pointer-events: auto; }

.hero-logo { width: 92px; margin-bottom: 10px; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .65)); }

.hero h1 {
    font-size: clamp(3.2rem, 12vw, 7rem);
    letter-spacing: .12em;
    margin: 0 0 .08em;
}
.hero .tagline {
    font-family: var(--font-display);
    font-size: clamp(1rem, 2.6vw, 1.45rem);
    color: var(--sand-dark);
    text-shadow: 0 2px 0 var(--ink), 0 4px 16px rgba(0, 0, 0, .8);
    margin: 0 0 18px;
    max-width: 30ch;
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 16px; }

.hero-hint {
    display: inline-block;
    font-family: var(--font-display);
    font-size: .72rem;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--text-dim);
    background: rgba(18, 13, 7, .62);
    border: 1px solid rgba(213, 173, 81, .3);
    border-radius: 999px;
    padding: 7px 15px;
}
.hero-hint b { color: var(--sand); font-weight: 400; }

/* the hint names the controls the visitor actually has */
.only-keys { display: none; }
@media (hover: hover) and (pointer: fine) {
    .only-keys { display: inline; }
    .only-touch { display: none; }
}

/* the badge strip under the hero */
.badges {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    padding: 22px 0 0;
}
.badge {
    font-family: var(--font-display);
    font-size: .78rem;
    letter-spacing: .06em;
    color: var(--sand);
    background: rgba(65, 44, 23, .75);
    border: 1px solid rgba(213, 173, 81, .35);
    border-radius: 999px;
    padding: 7px 15px;
    white-space: nowrap;
}
.badge b { color: var(--gold); font-weight: 400; }

/* --------------------------------------------------------------- sections */
section { padding: 68px 0; }
section:nth-of-type(even) { background: rgba(20, 14, 8, .55); }

.section-head { text-align: center; margin-bottom: 42px; }
.section-head h2 { font-size: clamp(1.8rem, 4.5vw, 2.8rem); }
.section-head p { color: var(--text-dim); max-width: 62ch; margin: 0 auto; }
.eyebrow {
    display: inline-block;
    font-family: var(--font-display);
    font-size: .74rem;
    letter-spacing: .24em;
    text-transform: uppercase;
    color: var(--sand-dark);
    margin-bottom: 8px;
}

/* the game's sand window panel */
.panel {
    background: linear-gradient(180deg, #f0dfb2 0%, var(--sand) 55%, #dcc38c 100%);
    color: var(--ink);
    border: 3px solid var(--wood);
    border-radius: var(--panel-radius);
    box-shadow: 0 10px 0 rgba(42, 27, 13, .55), 0 18px 40px rgba(0, 0, 0, .5);
    padding: 26px;
}
.panel h3 { color: var(--wood); }

/* dark card, used for the stat/feature grids */
.card {
    position: relative;
    background: linear-gradient(180deg, rgba(48, 33, 18, .92), rgba(28, 19, 10, .95));
    border: 2px solid rgba(213, 173, 81, .28);
    border-radius: var(--panel-radius);
    padding: 22px;
    overflow: hidden;
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.card:hover {
    transform: translateY(-4px);
    border-color: rgba(213, 173, 81, .6);
    box-shadow: 0 14px 30px rgba(0, 0, 0, .5);
}
.card { display: flex; flex-direction: column; }
.card h3 { font-size: 1.12rem; color: var(--sand); margin-bottom: .35em; }
.card p { margin: 0; color: var(--text-dim); font-size: .95rem; }

.grid { display: grid; gap: 20px; }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

/* feature icon tiles built out of game sprites */
.card .icon {
    height: 74px;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
}
.card .icon img { max-height: 74px; width: auto; filter: drop-shadow(0 5px 10px rgba(0, 0, 0, .55)); }

/* ------------------------------------------------------------ world cards */
.world {
    position: relative;
    border-radius: var(--panel-radius);
    border: 3px solid var(--wood);
    overflow: hidden;
    box-shadow: 0 10px 0 rgba(42, 27, 13, .5), 0 16px 34px rgba(0, 0, 0, .45);
    background: #6d5232;
    min-height: 260px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    color: var(--text);
    text-decoration: none;
}
/* Tiles are set per world with a modifier class rather than a custom property:
   a relative url() inside a var() resolves against this stylesheet's folder in
   Chrome, which silently breaks when the value is written in the HTML. */
.world::before {
    content: '';
    position: absolute;
    inset: 0;
    background-size: 128px 128px;
    opacity: .95;
}
.world--desert::before { background-image: url('../img/tile-desert.png'); }
.world--valley::before { background-image: url('../img/tile-grass.png'); }
.world--soon::before { background-image: url('../img/tile-desert.png'); filter: grayscale(.7); }
.world::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(18, 13, 7, .1) 30%, rgba(18, 13, 7, .92) 100%);
}
.world > * { position: relative; z-index: 1; }
.world-body { padding: 22px; }
.world h3 { font-size: 1.5rem; margin-bottom: .2em; }
.world .meta { font-size: .9rem; color: var(--sand-dark); margin: 0 0 10px; }
.world .stars { color: var(--gold); letter-spacing: .18em; font-size: 1rem; }
.world.locked { filter: saturate(.35); }
.world .lock-tag {
    position: absolute;
    top: 14px; right: 14px;
    z-index: 2;
    font-family: var(--font-display);
    font-size: .68rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    background: rgba(18, 13, 7, .85);
    border: 1px solid rgba(213, 173, 81, .4);
    color: var(--sand-dark);
    padding: 5px 11px;
    border-radius: 999px;
}

/* ------------------------------------------------------------- stat cards */
.unit { text-align: center; }
.unit .sprite {
    height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}
.unit .sprite img { max-height: 110px; width: auto; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .6)); }
.unit .role {
    font-family: var(--font-display);
    font-size: .68rem;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--sand-dark);
    display: block;
    margin-bottom: 10px;
}
.stats { list-style: none; margin: 14px 0 0; padding: 0; font-size: .88rem; }
.unit .stats { margin-top: auto; padding-top: 14px; }
.stats li {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 5px 0;
    border-top: 1px dashed rgba(213, 173, 81, .22);
    color: var(--text-dim);
}
.stats li b { color: var(--sand); font-weight: 600; }

/* a health-bar style meter, same colours as util/HealthBarRenderer */
.meter {
    height: 9px;
    background: #333;
    border-radius: 2px;
    overflow: hidden;
    margin-top: 12px;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, .7);
}
.meter > i { display: block; height: 100%; background: var(--danger); }
.meter--player > i { background: var(--health); }

/* ---------------------------------------------------------------- garage */
.skin { text-align: center; }
.skin img { margin: 0 auto 10px; max-height: 130px; width: auto; }
.rarity {
    font-family: var(--font-display);
    font-size: .74rem;
    letter-spacing: .18em;
    text-transform: uppercase;
    padding: 5px 13px;
    border-radius: 999px;
    border: 1px solid currentColor;
    background: rgba(18, 13, 7, .9);
    display: inline-block;
}
.rarity.common { color: var(--common); }
.rarity.rare { color: var(--rare); }
.rarity.epic { color: var(--epic); }
.rarity.legendary { color: var(--legendary); }
.rarity.mythic { color: var(--mythic); }
.skin.rare { box-shadow: 0 0 0 1px rgba(79, 163, 255, .35), 0 12px 26px rgba(79, 163, 255, .12); }
.skin.epic { box-shadow: 0 0 0 1px rgba(192, 97, 255, .35), 0 12px 26px rgba(192, 97, 255, .14); }
.skin.legendary { box-shadow: 0 0 0 1px rgba(255, 178, 60, .4), 0 12px 26px rgba(255, 178, 60, .16); }
.skin.mythic { box-shadow: 0 0 0 1px rgba(255, 77, 94, .4), 0 12px 26px rgba(255, 77, 94, .18); }

/* ----------------------------------------------------------- screenshots */
.shots { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(430px, 1fr)); }
.shot {
    position: relative;
    border: 3px solid var(--wood);
    border-radius: var(--panel-radius);
    overflow: hidden;
    box-shadow: 0 10px 0 rgba(42, 27, 13, .5), 0 16px 32px rgba(0, 0, 0, .45);
    background: #000;
}
.shot img { width: 100%; height: auto; transition: transform .4s ease; }
.shot:hover img { transform: scale(1.04); }
.shot figcaption {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    padding: 26px 16px 12px;
    background: linear-gradient(180deg, transparent, rgba(18, 13, 7, .92));
    font-family: var(--font-display);
    font-size: .85rem;
    letter-spacing: .06em;
    color: var(--sand);
}

/* ------------------------------------------------------------------- FAQ */
.faq { max-width: 820px; margin-inline: auto; }
.faq details {
    background: rgba(48, 33, 18, .75);
    border: 2px solid rgba(213, 173, 81, .25);
    border-radius: 12px;
    margin-bottom: 12px;
    overflow: hidden;
}
.faq summary {
    cursor: pointer;
    padding: 16px 20px;
    font-family: var(--font-display);
    font-size: 1rem;
    color: var(--sand);
    list-style: none;
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
    content: '+';
    font-size: 1.4rem;
    line-height: 1;
    color: var(--sand-dark);
    transition: transform .3s cubic-bezier(.4, 0, .2, 1);
}
.faq details[open] summary::after,
.faq details.is-open summary::after { transform: rotate(45deg); }
.faq details p { margin: 0; padding: 0 20px 18px; color: var(--text-dim); }

/* Only one answer is open at a time (main.js), and it slides open rather than
   snapping: the wrapper animates between grid-template-rows 0fr and 1fr, which
   is the one way to transition to an unknown content height. Scoped to .js so
   the plain <details> still works with scripting off. */
.js .faq .faq-body {
    display: grid;
    grid-template-rows: 0fr;
    opacity: 0;
    transition: grid-template-rows .34s cubic-bezier(.4, 0, .2, 1), opacity .22s ease;
}
.js .faq .faq-body > div { overflow: hidden; }
.js .faq details.is-open .faq-body { grid-template-rows: 1fr; opacity: 1; }

/* ------------------------------------------------------------ CTA + foot */
.cta-band { text-align: center; }
.cta-band .panel { max-width: 760px; margin-inline: auto; text-align: center; }
.cta-band h2 { font-size: clamp(1.7rem, 4vw, 2.5rem); color: var(--wood); }
.cta-band p { color: #5a4326; max-width: 52ch; margin: 0 auto 22px; }

footer {
    background: rgba(12, 8, 4, .9);
    border-top: 2px solid rgba(213, 173, 81, .28);
    padding: 46px 0 34px;
    font-size: .9rem;
    color: var(--text-dim);
}
.foot-grid { display: grid; gap: 26px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
footer h4 {
    font-size: .78rem;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--sand);
    margin-bottom: 10px;
}
footer ul { list-style: none; margin: 0; padding: 0; }
footer li { margin-bottom: 6px; }
footer a { color: var(--text-dim); text-decoration: none; }
footer a:hover { color: var(--sand); text-decoration: underline; }
.foot-bottom {
    margin-top: 30px;
    padding-top: 18px;
    border-top: 1px solid rgba(213, 173, 81, .18);
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: space-between;
    font-size: .82rem;
}

/* --------------------------------------------------------------- article */
.article { max-width: 820px; margin-inline: auto; }
.article .panel { padding: 34px; }
.article h1 { color: var(--wood); font-size: clamp(1.9rem, 5vw, 2.6rem); }
.article h2 { color: var(--wood); font-size: 1.25rem; margin-top: 1.8em; }
.article p, .article li { color: #402c16; }
.article a { color: #9a4a1e; }
.article .meta { color: #7b6242; font-size: .88rem; }
.article code {
    background: rgba(65, 44, 23, .12);
    padding: 1px 6px;
    border-radius: 4px;
    font-size: .9em;
}
.article ul { padding-left: 22px; }
.article li { margin-bottom: 6px; }

/* ------------------------------------------------------------ animations
   Reveals only exist when scripting is on (main.js stamps .js on <html>), so
   the page is never blank for a crawler or a visitor with JS disabled. */
.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
    * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
    html { scroll-behavior: auto; }
    .js .reveal { opacity: 1; transform: none; }
}
