/* Goot – colours taken from the game: minimap water, terrain levels,
   Hmota crystals and the five races. */
:root {
  --water: #173246;
  --water-deep: #0f2230;
  --terrain: #6b8a4c;
  --crystal: #5fd6ff;
  --ink: #eaf1f4;
  --ink-soft: #b6c6cf;
  --nature: #6fae4f;
  --shamans: #e07a55;
  --machines: #9fb0c0;
  --humans: #d9b54a;
  --orcs: #c9604f;
  --game: #f2c14e;
  --display: "Chakra Petch", "Segoe UI", sans-serif;
  --body: "Figtree", "Segoe UI", sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { background: var(--water-deep); }

body {
  margin: 0;
  background: var(--water);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--body);
}

img { max-width: 100%; display: block; }

a { color: var(--crystal); }
a:focus-visible, .button:focus-visible {
  outline: 3px solid var(--crystal);
  outline-offset: 3px;
}

h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.1; margin: 0; }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin-bottom: 1.25rem; }
h3 { font-size: 1.3rem; margin-bottom: .4rem; }

code {
  background: rgba(0, 0, 0, .3);
  padding: .1em .35em;
  border-radius: 3px;
  font-size: .92em;
  overflow-wrap: anywhere;
}

.fine { color: var(--ink-soft); font-size: .92rem; margin: 0; }

/* i18n.js: hidden until the Czech texts are in (see index.html). */
.i18n-pending body { visibility: hidden; }
/* Old anchor ids (#stazeni, #galerie) kept for existing links. */
.anchor-alias { display: block; }

/* Language switch (i18n.js): top right, above the hero picture. */
.corner {
  position: absolute;
  top: 14px;
  right: clamp(16px, 5vw, 72px);
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}
.lang {
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: 6px;
  background: rgba(15, 34, 48, .72);
}
.lang button {
  font: 700 .85rem/1 var(--display);
  letter-spacing: .06em;
  color: var(--ink-soft);
  background: none;
  border: 0;
  border-radius: 4px;
  padding: .45rem .6rem;
  min-width: 44px;
  min-height: 32px;
  cursor: pointer;
}
.lang button:hover { color: var(--ink); }
.lang button[aria-pressed="true"] { background: var(--crystal); color: var(--water-deep); }
.lang button:focus-visible { outline: 3px solid var(--crystal); outline-offset: 2px; }

/* Hero: a staged battle rendered in the game, with a faceted low-poly bottom edge. */
.hero {
  position: relative;
  min-height: min(88vh, 760px);
  display: flex;
  align-items: flex-end;
  padding: 0 clamp(16px, 5vw, 72px) clamp(56px, 9vh, 96px);
  clip-path: polygon(0 0, 100% 0, 100% 91%, 86% 96%, 71% 92%, 52% 99%, 33% 93%, 17% 98%, 0 94%);
  background: var(--water-deep);
}

.hero-shot {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* The clash sits right of centre, the bottom left is calm grass for the text. */
  object-position: 50% 50%;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(15deg, rgba(15, 34, 48, .72) 0%, rgba(15, 34, 48, .3) 34%, rgba(15, 34, 48, 0) 62%),
    linear-gradient(180deg, rgba(15, 34, 48, 0) 45%, rgba(15, 34, 48, .82) 88%);
}

.hero-text { position: relative; z-index: 1; max-width: 40rem; }

h1 {
  font-size: clamp(3.4rem, 11vw, 7.5rem);
  letter-spacing: -.01em;
  text-shadow: 0 3px 0 var(--water-deep), 0 0 32px rgba(15, 34, 48, .8);
}

.lead { font-size: clamp(1.1rem, 2vw, 1.3rem); margin: .6rem 0 1.4rem; max-width: 36rem; }

.download { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: .6rem; }

/* .button sets display, which would override the hidden attribute. */
[hidden] { display: none !important; }

.button {
  display: inline-block;
  font: 700 1.1rem/1 var(--display);
  padding: 1rem 1.5rem;
  color: var(--ink);
  text-decoration: none;
  background: rgba(234, 241, 244, .14);
  clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
}
.button:hover { background: rgba(234, 241, 244, .24); }
.button.primary { background: var(--crystal); color: var(--water-deep); padding-inline: 1.9rem; }
.button.primary:hover { background: #8fe3ff; }
/* Not released yet: a hatched, non-clickable badge instead of the download button. */
.button.soon, .button.soon:hover {
  cursor: default;
  color: var(--water-deep);
  background: repeating-linear-gradient(135deg, var(--game) 0 12px, #e4ae36 12px 24px);
}

main { padding: 0 clamp(16px, 5vw, 72px); max-width: 1180px; margin: 0 auto; }

section { padding: clamp(48px, 8vw, 88px) 0 0; }

/* Live rooms. */
.rooms-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .25rem 1.5rem; }
.rooms-head h2 { margin-bottom: .75rem; }

.room-list { list-style: none; margin: 0 0 1.25rem; padding: 0; display: grid; gap: 10px; }

.room {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--water-deep);
  border-left: 4px solid var(--state, var(--ink-soft));
}
.room.lobby { --state: var(--crystal); }
.room.game { --state: var(--game); }
.room.offline { --state: #5b6b76; color: var(--ink-soft); }

/* A Hmota crystal as the status marker. */
.gem {
  width: 18px;
  height: 22px;
  background: var(--state, var(--ink-soft));
  clip-path: polygon(50% 0, 100% 35%, 80% 100%, 20% 100%, 0 35%);
}
.room.lobby .gem { animation: glow 2.4s ease-in-out infinite; }
@keyframes glow { 50% { opacity: .55; } }

.room-name { font: 700 1.15rem/1.2 var(--display); }
.room-meta { color: var(--ink-soft); font-size: .95rem; }
.room-meta .warn { color: var(--game); }
.room-count { font: 700 1.5rem/1 var(--display); text-align: right; white-space: nowrap; }
.room-count small { display: block; font: 400 .8rem/1.3 var(--body); color: var(--ink-soft); }

.howto { max-width: 44rem; color: var(--ink-soft); }
.howto strong { color: var(--ink); }

/* Races. */
.race-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: clamp(16px, 3vw, 32px); }
.race .shot { overflow: hidden; aspect-ratio: 16 / 10; margin-bottom: 1rem; border-bottom: 5px solid var(--race); }
.race .shot img { width: 100%; height: 100%; object-fit: cover; }
.race h3 { color: var(--race); }
.race p { margin: 0; color: var(--ink-soft); }
.race.nature { --race: var(--nature); }
.race.shamans { --race: var(--shamans); }
.race.machines { --race: var(--machines); }
.race.humans { --race: var(--humans); }
.race.orcs { --race: var(--orcs); }

/* Tactical AI. */
.kicker {
  font: 700 .85rem/1 var(--display);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--game);
  margin: 0 0 .6rem;
}
.intro { max-width: 44rem; margin: 0 0 1.75rem; }
.ai-grid {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}
.ai-grid li {
  background: var(--water-deep);
  padding: 18px 20px 20px;
  border-top: 3px solid var(--crystal);
}
.ai-grid h3 { font-size: 1.15rem; }
.ai-grid p { margin: 0; color: var(--ink-soft); }
.ai .fine { max-width: 44rem; }
.ai .fine strong { color: var(--ink); font-weight: 600; }

/* Gallery. */
.gallery-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.gallery-grid .wide { grid-column: span 2; grid-row: span 2; }
.gallery-grid a { display: block; height: 100%; overflow: hidden; background: var(--water-deep); }
.gallery-grid img {
  width: 100%;
  height: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  transition: transform .25s ease;
}
.gallery-grid a:hover img { transform: scale(1.04); }
.gallery-grid a:focus-visible { outline: 3px solid var(--crystal); outline-offset: 3px; }

.lightbox {
  border: 0;
  padding: 0;
  max-width: min(96vw, 1600px);
  background: transparent;
  color: var(--ink);
  overflow: visible;
}
.lightbox::backdrop { background: rgba(10, 22, 32, .88); }
.lightbox figure { margin: 0; }
.lightbox img { max-width: 100%; max-height: 82vh; width: auto; margin: 0 auto; }
.lightbox figcaption { padding: .6rem 3rem 0 0; color: var(--ink-soft); }
.lightbox button {
  position: absolute;
  border: 0;
  width: 44px;
  height: 44px;
  font: 700 1.8rem/1 var(--display);
  color: var(--water-deep);
  background: var(--crystal);
  cursor: pointer;
}
.lightbox .lb-close { top: -52px; right: 0; }
.lightbox .lb-prev, .lightbox .lb-next { top: calc(50% - 40px); }
.lightbox .lb-prev { left: 8px; }
.lightbox .lb-next { right: 8px; }
.lightbox button:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }

/* Features. */
.feature-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 0 clamp(16px, 4vw, 48px); }
.feature-cols ul { margin: 0; padding-left: 1.1rem; }
.feature-cols li { margin-bottom: .7rem; max-width: 34rem; }
.feature-cols li::marker { color: var(--terrain); }
.wide-shot { margin-top: 1.5rem; width: 100%; aspect-ratio: 21 / 9; object-fit: cover; }

/* Downloads: not released yet. */
.soon-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  padding: 18px 20px;
  margin-bottom: 2rem;
  background: var(--water-deep);
  border-left: 4px solid var(--game);
}
.soon-box p { margin: 0; max-width: 40rem; color: var(--ink-soft); }
.soon-badge {
  font: 700 1.1rem/1 var(--display);
  padding: .7rem 1.1rem;
  color: var(--water-deep);
  background: var(--game);
  clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
}

/* Downloads. */
.alpha-note {
  max-width: 44rem;
  margin: 0 0 1.25rem;
  padding: 12px 16px;
  color: var(--ink-soft);
  background: var(--water-deep);
  border-left: 4px solid var(--game);
}
.alpha-note strong { color: var(--ink); }
.files { list-style: none; padding: 0; margin: 0 0 2rem; display: flex; flex-wrap: wrap; gap: 12px; }
.files a { display: block; }
.files .size { font: 400 .85rem var(--body); opacity: .8; margin-left: .4rem; }
.get-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: clamp(16px, 3vw, 32px); }
.get-cols p { margin: 0; color: var(--ink-soft); }

footer {
  margin-top: clamp(56px, 9vw, 96px);
  padding: 28px clamp(16px, 5vw, 72px) 36px;
  background: var(--water-deep);
  color: var(--ink-soft);
  font-size: .9rem;
}
footer p { max-width: 60rem; margin: 0 auto; }

@media (max-width: 700px) {
  .gallery-grid { grid-template-columns: 1fr 1fr; }
  .gallery-grid .wide { grid-column: 1 / -1; grid-row: auto; }
  /* Wide first picture + five: the last one fills its row. */
  .gallery-grid li:last-child { grid-column: 1 / -1; }
}

@media (max-width: 560px) {
  .hero { min-height: min(92vh, 780px); padding-bottom: 88px; }
  .hero-shot { object-position: 64% 50%; }
  .room { grid-template-columns: 18px 1fr; }
  .room-count { grid-column: 2; text-align: left; }
  .room-count small { display: inline; margin-left: .4rem; }
}

@media (prefers-reduced-motion: reduce) {
  .room.lobby .gem { animation: none; }
  .gallery-grid img { transition: none; }
}

.coffee {
  max-width: 230px;
  padding: .6rem .7rem .7rem;
  border-radius: 6px;
  background: rgba(15, 34, 48, .72);
  text-align: right;
}
.coffee p { margin: 0 0 .5rem; font: .85rem/1.35 var(--body); color: var(--ink-soft); }
.coffee p a { color: var(--crystal); }
.coffee-button { display: inline-flex; align-items: center; gap: .45rem; font-size: .95rem; padding: .6rem 1.1rem; background: var(--game); color: var(--water-deep); }
@media (max-width: 560px) { .coffee p { display: none; } .coffee { padding: 0; background: none; } }
.coffee-button:hover { background: #f7d27a; }
