@import url("/static/fonts/fonts.css");

:root {
  --bg: #f5efe3;
  --surface: #fffaf1;
  --surface-2: #efe6d4;
  --ink: #1f2a26;
  --ink-soft: #55625c;
  --line: #d9ccb4;
  --grass: #4f9f45;
  --grass-dark: #37772f;
  --dirt: #7a4e2d;
  --lava: #f07a1f;
  --lava-dark: #b8560c;
  --teal: #2f9c8b;
  --sky: #cfe9f2;
  --danger: #c0392b;
  --danger-bg: #fbe3df;
  --ok-bg: #e2f2dc;
  --radius: 6px;
  --pixel: "Pixelify Sans", "Trebuchet MS", system-ui, sans-serif;
  --text: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141a17;
    --surface: #1c2420;
    --surface-2: #232d28;
    --ink: #eef3ea;
    --ink-soft: #a6b3ab;
    --line: #34403a;
    --grass: #6cbf5f;
    --grass-dark: #4f9f45;
    --lava: #ff9a45;
    --lava-dark: #d06a1c;
    --teal: #54c2af;
    --sky: #1d2b30;
    --danger: #ff8a7a;
    --danger-bg: #3a1f1b;
    --ok-bg: #1f3320;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.6 var(--text);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--teal); text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--pixel); font-weight: 700; line-height: 1.15; margin: 0 0 .5em; letter-spacing: .01em; }
h1 { font-size: clamp(2.6rem, 7vw, 4.6rem); }
h2 { font-size: clamp(1.7rem, 4vw, 2.4rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; }
code, .mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .92em; }

.wrap { max-width: 1120px; margin: 0 auto; padding-inline: 20px; }
.narrow { max-width: 640px; }

/* ---------- шапка ---------- */
.top {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.top .wrap { display: flex; align-items: center; gap: 20px; min-height: 64px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font: 700 1.35rem var(--pixel); }
.brand img { width: 34px; height: 34px; border-radius: 8px; image-rendering: pixelated; }
.nav { display: flex; gap: 4px 18px; margin-left: auto; flex-wrap: wrap; }
.nav a { color: var(--ink-soft); text-decoration: none; font-weight: 600; padding: 6px 0; }
.nav a:hover { color: var(--ink); }
@media (max-width: 640px) { .nav { margin-left: 0; width: 100%; padding-bottom: 10px; } }

/* ---------- кнопки ---------- */
.btn {
  --b: var(--grass); --b-dark: var(--grass-dark);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border: 0; border-radius: var(--radius);
  background: var(--b); color: #fff; font: 700 1.05rem var(--pixel); letter-spacing: .02em;
  text-decoration: none; cursor: pointer;
  box-shadow: 0 4px 0 var(--b-dark);
  transition: transform .08s ease, box-shadow .08s ease, filter .15s ease;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--b-dark); }
.btn:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; }
.btn.lava { --b: var(--lava); --b-dark: var(--lava-dark); }
.btn.ghost { background: var(--surface); color: var(--ink); box-shadow: 0 4px 0 var(--line); border: 1px solid var(--line); }
.btn.small { padding: 7px 12px; font-size: .9rem; box-shadow: 0 3px 0 var(--b-dark); }
.btn.ghost.small { box-shadow: 0 3px 0 var(--line); }
.btn.danger { --b: var(--danger); --b-dark: #8e2a20; }
.btn[disabled] { opacity: .55; pointer-events: none; }

/* ---------- обложка ---------- */
.hero { position: relative; overflow: hidden; background: var(--sky); border-bottom: 4px solid var(--dirt); }
.hero picture img { width: 100%; height: 100%; object-fit: cover; object-position: 70% 50%; position: absolute; inset: 0; }
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(12,22,30,.82) 0%, rgba(12,22,30,.62) 38%, rgba(12,22,30,0) 72%);
}
.hero .wrap { position: relative; z-index: 1; padding-block: clamp(56px, 10vw, 120px); color: #fff; }
.hero h1 { text-shadow: 0 4px 0 rgba(0,0,0,.35); }
.hero .lead { font-size: 1.2rem; max-width: 30em; color: #eaf2ee; }
.hero .actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 26px; }
@media (max-width: 720px) { .hero::after { background: rgba(12,22,30,.66); } }

.address {
  display: inline-flex; align-items: stretch; margin-top: 8px; border-radius: var(--radius); overflow: hidden;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.28); backdrop-filter: blur(6px);
}
.address span { padding: 10px 14px; font: 700 1.25rem var(--pixel); }
.address button {
  border: 0; border-left: 1px solid rgba(255,255,255,.28); background: transparent; color: #fff;
  padding: 0 14px; font: 600 .95rem var(--text); cursor: pointer;
}
.address button:hover { background: rgba(255,255,255,.14); }

.status { display: inline-flex; align-items: center; gap: 10px; margin: 18px 0 0; font-weight: 600; color: #eaf2ee; flex-wrap: wrap; }
.dot { width: 12px; height: 12px; border-radius: 2px; background: #8a8a8a; box-shadow: 0 0 0 3px rgba(255,255,255,.15); }
.dot.on { background: #7be06a; animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(123,224,106,.18); } }
@media (prefers-reduced-motion: reduce) { .dot.on { animation: none; } html { scroll-behavior: auto; } }
.status .names { font-weight: 400; opacity: .85; }

/* ---------- секции ---------- */
section { padding-block: clamp(48px, 8vw, 88px); }
section + section { border-top: 1px solid var(--line); }
.kicker { font: 700 .85rem var(--pixel); text-transform: uppercase; letter-spacing: .12em; color: var(--lava-dark); margin-bottom: 6px; }
@media (prefers-color-scheme: dark) { .kicker { color: var(--lava); } }
.intro { color: var(--ink-soft); max-width: 40em; margin-bottom: 32px; }

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; counter-reset: step; padding: 0; margin: 0; list-style: none; }
.steps li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; position: relative; }
.steps li::before {
  counter-increment: step; content: counter(step);
  display: grid; place-items: center; width: 40px; height: 40px; margin-bottom: 12px;
  background: var(--grass); color: #fff; font: 700 1.3rem var(--pixel); border-radius: 4px; box-shadow: 0 3px 0 var(--grass-dark);
}
.steps p { color: var(--ink-soft); margin: 0; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; display: flex; flex-direction: column; gap: 10px; }
.card .os { display: flex; align-items: center; gap: 12px; }
.card .os svg { width: 30px; height: 30px; flex: none; fill: var(--ink); }
.card h3 { margin: 0; }
.card .meta { color: var(--ink-soft); font-size: .92rem; }
.card ol { margin: 4px 0 8px; padding-left: 1.2em; color: var(--ink-soft); font-size: .96rem; }
.card ol li + li { margin-top: 4px; }
.card .btn { margin-top: auto; align-self: flex-start; }
.card .soon { margin-top: auto; color: var(--ink-soft); font-style: italic; }
.note { font-size: .9rem; color: var(--ink-soft); background: var(--surface-2); border-radius: var(--radius); padding: 10px 12px; }

.map-teaser { display: grid; grid-template-columns: 1.2fr 1fr; gap: 28px; align-items: center; }
.map-teaser .frame { border: 4px solid var(--dirt); border-radius: var(--radius); overflow: hidden; aspect-ratio: 16/10; background: var(--surface-2); }
.map-teaser .frame img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 820px) { .map-teaser { grid-template-columns: 1fr; } }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
th { font: 700 .85rem var(--text); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); background: var(--surface-2); }
td code { background: var(--surface-2); padding: 2px 6px; border-radius: 4px; white-space: nowrap; }

.rules { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px 28px; padding: 0; list-style: none; }
.rules li { padding-left: 30px; position: relative; }
.rules li::before { content: ""; position: absolute; left: 0; top: .45em; width: 14px; height: 14px; background: var(--lava); box-shadow: 3px 3px 0 var(--lava-dark); }

/* ---------- формы ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(22px, 4vw, 36px); margin-block: 40px 64px; }
.field { margin-bottom: 18px; }
.field label, .legend { display: block; font-weight: 700; margin-bottom: 6px; }
.field .hint { font-size: .88rem; color: var(--ink-soft); margin-top: 5px; }
input[type=text], input[type=password], input[type=email] {
  width: 100%; padding: 12px 14px; font: 1rem var(--text); color: var(--ink);
  background: var(--bg); border: 2px solid var(--line); border-radius: var(--radius);
}
input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px color-mix(in srgb, var(--teal) 25%, transparent); }
.switch { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 20px; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch label {
  display: flex; flex-direction: column; gap: 2px; padding: 14px; cursor: pointer;
  border: 2px solid var(--line); border-radius: var(--radius); background: var(--bg);
}
.switch label b { font: 700 1.1rem var(--pixel); }
.switch label span { font-size: .88rem; color: var(--ink-soft); }
.switch input:checked + label { border-color: var(--grass); background: color-mix(in srgb, var(--grass) 12%, var(--bg)); }
.switch input:focus-visible + label { outline: 3px solid var(--teal); outline-offset: 2px; }
@media (max-width: 460px) { .switch { grid-template-columns: 1fr; } }

.alert { padding: 12px 14px; border-radius: var(--radius); margin-bottom: 18px; font-weight: 600; }
.alert.error { background: var(--danger-bg); color: var(--danger); }
.alert.ok { background: var(--ok-bg); }

.big-name { font: 700 1.6rem var(--pixel); background: var(--surface-2); padding: 8px 14px; border-radius: var(--radius); display: inline-block; }
.waiting { display: flex; gap: 12px; align-items: center; }
.spinner { width: 22px; height: 22px; background: var(--grass); animation: spin 1.2s steps(4) infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- админка ---------- */
.badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: .82rem; font-weight: 700; white-space: nowrap; }
.badge.active { background: var(--ok-bg); color: var(--grass-dark); }
.badge.waiting { background: var(--surface-2); color: var(--ink-soft); }
.badge.blocked { background: var(--danger-bg); color: var(--danger); }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row-actions form { display: flex; gap: 6px; }
.row-actions input { width: 150px; padding: 6px 10px; }
.stat { display: flex; gap: 24px; flex-wrap: wrap; margin-bottom: 24px; }
.stat div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; }
.stat b { display: block; font: 700 1.6rem var(--pixel); }

footer { padding-block: 32px; color: var(--ink-soft); font-size: .92rem; border-top: 1px solid var(--line); }
footer .wrap { display: flex; gap: 12px 24px; flex-wrap: wrap; justify-content: space-between; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0;
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: var(--radius); font-weight: 600;
  transition: opacity .2s ease, transform .2s ease; pointer-events: none; z-index: 20;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- версия 2: логотип, возможности, рейтинг, галерея ---------- */
.hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.nav-cta {
  background: var(--lava); color: #fff !important; padding: 6px 12px !important; border-radius: var(--radius);
  box-shadow: 0 3px 0 var(--lava-dark);
}
.nav-cta:hover { filter: brightness(1.06); }

.hero h1.logo { margin: 0 0 18px; }
.hero h1.logo img { width: min(640px, 100%); height: auto; image-rendering: pixelated; filter: drop-shadow(0 6px 0 rgba(0,0,0,.25)); }

.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.feature {
  display: flex; gap: 16px; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px;
  transition: transform .15s ease, box-shadow .15s ease;
}
.feature:hover { transform: translateY(-2px); box-shadow: 0 6px 0 var(--line); }
.feature img { width: 96px; height: 96px; flex: none; border-radius: 18px; }
.feature h3 { margin: 0 0 4px; }
.feature p { margin: 0; color: var(--ink-soft); font-size: .95rem; }
@media (prefers-reduced-motion: reduce) { .feature { transition: none; } .feature:hover { transform: none; } }

.games-band {
  position: relative; color: #fff; border-top: 0 !important;
  background: #1c3d5a url("/static/img/games-bg.webp") center / cover no-repeat;
}
.games-band::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(10,24,40,.85), rgba(10,24,40,.45)); }
.games-band .wrap { position: relative; }
.games-band .kicker { color: #ffcf6b; }
.game-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-top: 18px; }
.game { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25); border-radius: var(--radius); padding: 16px; backdrop-filter: blur(4px); }
.game b { display: block; font: 700 1.4rem var(--pixel); margin-bottom: 6px; }
.game span { color: #e2ecf2; }

.split { display: flex; gap: 28px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.split > div { flex: 1 1 320px; }
.split-img { width: 200px; height: 200px; border-radius: 32px; }

.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.shot { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; color: var(--ink); text-decoration: none; }
.shot img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: var(--surface-2); }
.shot span { padding: 10px 12px; font-weight: 600; }
.shot em { font-style: normal; font-weight: 400; color: var(--ink-soft); }

.page-head { padding-bottom: 24px; }
.boards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.board { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.board h3 { margin-bottom: 12px; }
.board ol { list-style: none; margin: 0; padding: 0; }
.board li { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.board li:last-child { border-bottom: 0; }
.board .place { width: 28px; height: 28px; display: grid; place-items: center; flex: none; border-radius: 4px; background: var(--surface-2); font: 700 .95rem var(--pixel); }
.board li.gold .place { background: #f4c542; color: #3b2a00; }
.board li.silver .place { background: #c9d1d9; color: #26303a; }
.board li.bronze .place { background: #d99a5f; color: #3a1f07; }
.board .who { flex: 1; font-weight: 700; overflow-wrap: anywhere; }
.board .val { font: 700 1.05rem var(--pixel); white-space: nowrap; }
.board small { font-weight: 400; color: var(--ink-soft); }
input[type=file] { width: 100%; padding: 10px; border: 2px dashed var(--line); border-radius: var(--radius); background: var(--bg); color: var(--ink); }
.page-head + section { border-top: 0; }
