/* COLONY BATTLE ARENA — the site, in the game's own design language.
   The palette and the face are the ones locked for the menu (godot/src/MenuStyle.cs):
   background #101215, steel #252A31, text #EAEFF6 / dim #8D96A3, orange #F48A2C,
   orange glow #FFB04A, blue accent #55B9FF, Oxanium SemiBold, UPPERCASE with wide tracking. */

:root {
    --bg: #000000;
    --bg-deep: #000000;
    --steel: #252A31;
    --steel-light: #2E343C;
    --text: #EAEFF6;
    --dim: #8D96A3;
    --orange: #F48A2C;
    --orange-glow: #FFB04A;
    --blue: #55B9FF;
    --plate: 14px;            /* the chamfer of a command plate */
    --measure: 1100px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Oxanium, "Segoe UI", system-ui, -apple-system, sans-serif;
    font-weight: 500;
    font-size: 17px;
    line-height: 1.65;
    min-height: 100vh;
}

.wrap { position: relative; z-index: 1; max-width: var(--measure); margin: 0 auto; padding: 0 22px; }

/* ---- header ------------------------------------------------------------- */
header.site {
    border-bottom: 1px solid var(--steel);
    background: rgba(0, 0, 0, 0.86);
    backdrop-filter: blur(6px);
    position: sticky;
    top: 0;
    z-index: 5;
}

header.site .wrap {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-top: 14px;
    padding-bottom: 14px;
    flex-wrap: wrap;
}

.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); }
.brand img { width: 38px; height: 38px; display: block; }
.brand span {
    text-transform: uppercase;
    letter-spacing: 2.5px;
    font-weight: 700;
    font-size: 15px;
}

nav.site { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }

nav.site a {
    color: var(--dim);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 13px;
    padding: 8px 14px;
    border: 1px solid transparent;
    transition: color 120ms ease, border-color 120ms ease;
}

nav.site a:hover, nav.site a:focus-visible { color: var(--text); border-color: var(--steel-light); outline: none; }
nav.site a[aria-current="page"] { color: var(--orange); }

/* ---- hero --------------------------------------------------------------- */
.hero { text-align: center; padding: 76px 0 58px; }

h1 { margin: 0 0 34px; }

/* the game's own wordmark, straight from the main menu */
.hero .wordmark { width: min(560px, 86%); height: auto; display: block; margin: 0 auto; }

/* the pitch: plain text, left-aligned for reading, no colour tricks */
.hero-copy { max-width: 720px; margin: 0 auto; text-align: left; }
.hero-copy p { margin: 0 0 18px; color: #CBD3DE; }
.hero-copy p:last-child { margin-bottom: 0; }

.cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin: 0 0 40px; }

/* a command plate, the chamfered menu button of the game */
.plate {
    display: inline-block;
    padding: 15px 34px;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 3px;
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    background: linear-gradient(180deg, var(--steel-light), var(--steel));
    border: 1px solid #3A424C;
    clip-path: polygon(var(--plate) 0, 100% 0, 100% calc(100% - var(--plate)), calc(100% - var(--plate)) 100%, 0 100%, 0 var(--plate));
    transition: background 140ms ease, color 140ms ease, transform 140ms ease;
}

.plate:hover, .plate:focus-visible {
    background: linear-gradient(180deg, #3A424C, #2A3038);
    transform: translateY(-1px);
    outline: none;
}

.plate.primary {
    color: var(--bg-deep);
    background: linear-gradient(180deg, var(--orange-glow), var(--orange));
    border-color: var(--orange-glow);
}

.plate.primary:hover, .plate.primary:focus-visible { background: linear-gradient(180deg, #FFC46E, var(--orange-glow)); }

.plate[aria-disabled="true"] { opacity: 0.55; pointer-events: none; }

.note { color: var(--dim); font-size: 13px; letter-spacing: 1px; text-transform: uppercase; margin-top: 18px; }

.coming {
    margin: 46px auto 0;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: clamp(3px, 1.2vw, 9px);
    font-size: clamp(20px, 4.4vw, 38px);
    font-weight: 800;
    color: var(--text);
    border-top: 1px solid var(--steel);
    border-bottom: 1px solid var(--steel);
    padding: 18px 10px;
}

/* ---- sections ----------------------------------------------------------- */
section { padding: 54px 0; border-top: 1px solid var(--steel); }

h2 {
    margin: 0 0 8px;
    font-size: clamp(20px, 3.4vw, 27px);
    text-transform: uppercase;
    letter-spacing: 3px;
    font-weight: 700;
}

h2 .rule { display: block; width: 58px; height: 3px; background: var(--orange); margin-top: 14px; }

h3 {
    margin: 30px 0 8px;
    font-size: 17px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--orange-glow);
    font-weight: 700;
}

.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); margin-top: 28px; }
/* four cards read better as one row than as three plus a stray */
.grid.four { grid-template-columns: repeat(auto-fit, minmax(228px, 1fr)); }
.grid.platforms .card h3 { font-size: 15px; letter-spacing: 0.8px; white-space: nowrap; }
.grid.platforms .card p { font-size: 14.5px; }

.card {
    background: linear-gradient(180deg, rgba(37, 42, 49, 0.75), rgba(21, 24, 28, 0.75));
    border: 1px solid var(--steel-light);
    padding: 24px;
    clip-path: polygon(18px 0, 100% 0, 100% calc(100% - 18px), calc(100% - 18px) 100%, 0 100%, 0 18px);
}

.card h3 { margin-top: 0; }
.card h3.exact { text-transform: none; letter-spacing: 1px; }
.card p { margin: 0; color: var(--dim); font-size: 15px; }

/* a whole card as one link */
a.card.link { display: block; text-decoration: none; color: inherit; transition: border-color 140ms ease, transform 140ms ease; }
a.card.link:hover, a.card.link:focus-visible { border-color: var(--orange); transform: translateY(-2px); outline: none; }
/* community: one standard icon over the name, nothing else */
.grid.community .card { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 26px 18px; text-align: center; }
.grid.community h3 { margin: 0; font-size: 14px; letter-spacing: 2px; }
.brand-icon { width: 34px; height: 34px; display: block; fill: var(--text); transition: fill 140ms ease; }
a.card.link:hover .brand-icon, a.card.link:focus-visible .brand-icon { fill: var(--orange); }

/* ---- factions: an art tile each, the stats laid over the art ------------ */
ul.factions { list-style: none; margin: 26px 0 0; padding: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(232px, 1fr)); }

.faction { position: relative; }

/* the tile: the faction's art under a dark wash, its name across the foot */
.faction-plate {
    position: relative;
    aspect-ratio: 4 / 3;
    border: 1px solid var(--steel-light);
    background-color: rgba(37, 42, 49, 0.5);
    background-image:
        linear-gradient(to top, rgba(0, 0, 0, 0.92) 0%, rgba(0, 0, 0, 0.2) 42%, rgba(0, 0, 0, 0.06) 100%),
        var(--art);
    background-size: cover;
    background-position: center 20%;
    clip-path: polygon(16px 0, 100% 0, 100% calc(100% - 16px), calc(100% - 16px) 100%, 0 100%, 0 16px);
    transition: border-color 140ms ease, transform 140ms ease;
    overflow: hidden;
}

.faction:hover .faction-plate, .faction.pinned .faction-plate {
    border-color: var(--orange);
    transform: translateY(-2px);
}

.faction-name {
    position: absolute;
    left: 14px;
    right: 12px;
    bottom: 11px;
    z-index: 3;
    border-left: 2px solid var(--orange);
    padding-left: 10px;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 1.6px;
    font-size: 13px;
    font-weight: 700;
    pointer-events: none;
}

/* the whole tile is the control; it sits above the card so a second click closes it */
.faction-toggle {
    position: absolute;
    inset: 0;
    z-index: 4;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    appearance: none;
}
.faction-toggle:focus-visible { outline: 2px solid var(--orange); outline-offset: -3px; }

.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;
}

/* ---- the stats, laid over the art: the picture fades to black, these fade in ---- */
.statcard {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 8px 13px 36px;
    background: rgba(0, 0, 0, 0.9);
    opacity: 0;
    visibility: hidden;
    transition: opacity 200ms ease, visibility 200ms;
    pointer-events: none;
}

/* the pointer over the tile, or a keyboard on the button, or pinned by a click.
   NOTE: focus-VISIBLE, not focus-within — a mouse click leaves the button focused, and
   focus-within would put a just-closed card straight back up. */
.faction:hover .statcard,
.faction-toggle:focus-visible ~ .statcard,
.faction.pinned .statcard {
    opacity: 1;
    visibility: visible;
}

/* just closed: stay shut while the pointer — or the keyboard focus — is still on the tile */
.faction.dismissed:hover .statcard,
.faction.dismissed .faction-toggle:focus-visible ~ .statcard {
    opacity: 0;
    visibility: hidden;
}

.statcard table { width: 100%; border-collapse: collapse; line-height: 1.2; }
.statcard tr:nth-child(odd) { background: rgba(37, 42, 49, 0.55); }

.statcard th {
    text-align: left;
    padding: 3px 7px;
    color: #CBD3DE;
    font-weight: 600;
    font-size: 10.5px;
    letter-spacing: 1px;
    text-transform: uppercase;
    white-space: nowrap;
}

.statcard td { padding: 3px 7px 3px 0; width: 100%; font-size: 0; line-height: 0; }

.dots { display: inline-flex; gap: 3px; line-height: 0; vertical-align: middle; }
.dots i { display: block; width: 7px; height: 7px; border-radius: 50%; }
.dots i.on { background: var(--orange); box-shadow: 0 0 5px rgba(244, 138, 44, 0.5); }
.dots i.off { border: 1px solid #4A515B; }

/* a touch screen has no hover: the card waits for the tap */
@media (hover: none) {
    .faction:hover .statcard { opacity: 0; visibility: hidden; }
    .faction.pinned .statcard { opacity: 1; visibility: visible; }
}

/* ---- long-form pages (privacy, terms, support) --------------------------- */
/* padding-block only — a shorthand here would wipe the side gutter .wrap sets */
main.doc { padding-block: 54px 20px; }
main.doc h1 { font-size: clamp(26px, 5vw, 40px); letter-spacing: 3px; text-align: left; }
main.doc .updated { color: var(--dim); text-transform: uppercase; letter-spacing: 2px; font-size: 13px; margin-bottom: 34px; }
main.doc h2 { margin-top: 44px; font-size: clamp(18px, 3vw, 23px); }
main.doc p, main.doc li { color: #CBD3DE; }
main.doc a { color: var(--orange-glow); }
main.doc ul { padding-left: 22px; }
main.doc li { margin-bottom: 7px; }

table.data { width: 100%; border-collapse: collapse; margin: 22px 0; font-size: 15px; }
table.data th, table.data td { border: 1px solid var(--steel-light); padding: 11px 13px; text-align: left; vertical-align: top; }
table.data th { background: rgba(37, 42, 49, 0.8); text-transform: uppercase; letter-spacing: 1.6px; font-size: 12.5px; color: var(--text); }
table.data td { color: #CBD3DE; }
.scroll-x { overflow-x: auto; }

.callout {
    border: 1px solid var(--steel-light);
    border-left: 3px solid var(--orange);
    background: rgba(244, 138, 44, 0.07);
    padding: 16px 20px;
    margin: 26px 0;
    font-size: 15px;
}

.todo {
    border: 1px dashed var(--orange);
    background: rgba(244, 138, 44, 0.08);
    padding: 4px 9px;
    color: var(--orange-glow);
    font-size: 13px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    white-space: nowrap;
}

/* ---- footer ------------------------------------------------------------- */
footer.site { border-top: 1px solid var(--steel); margin-top: 60px; padding: 34px 0 54px; color: var(--dim); font-size: 14px; }
footer.site .links { display: flex; gap: 20px; flex-wrap: wrap; margin-bottom: 14px; }
footer.site a { color: var(--dim); text-decoration: none; text-transform: uppercase; letter-spacing: 2px; font-size: 13px; }
footer.site a:hover { color: var(--text); }

@media (max-width: 640px) {
    body { font-size: 16px; }
    .hero { padding: 48px 0 38px; }
    .hero h1 { margin-bottom: 30px; }
    section { padding: 40px 0; }
    nav.site a { padding: 7px 10px; font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
}
