:root {
  --bg: #0d1117;
  --panel: #161b22;
  --text: #e6edf3;
  --muted: #8b949e;
  --accent: #f5b301;
  --accent-text: #0d1117;
  --error: #ff5c5c;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 32px;
  border-bottom: 1px solid #222a33;
}
.logo { font-size: 24px; font-weight: 800; }
.logo span { color: var(--accent); }
.tag { color: var(--muted); font-size: 14px; }

main { max-width: 1100px; margin: 0 auto; padding: 48px 16px; }

.hero { text-align: center; margin-bottom: 48px; }
.hero h1 { font-size: clamp(24px, 4vw, 40px); margin: 0 0 16px; }
.lead { color: var(--muted); font-size: 18px; margin: 0; }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 56px;
}
.card {
  background: var(--panel);
  border: 1px solid #222a33;
  border-radius: 16px;
  padding: 24px;
  text-align: center;
}
.card h2 { margin: 12px 0 8px; font-size: 20px; }
.card p { margin: 0; color: var(--muted); }
.icon { width: 64px; height: 64px; color: var(--accent); }

.cta { text-align: center; }
.button {
  display: inline-block;
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 700;
  font-size: 18px;
  padding: 16px 40px;
  border-radius: 12px;
  text-decoration: none;
}
.button:hover { filter: brightness(1.1); }

a.logo { color: var(--text); text-decoration: none; }

.world {
  background: var(--panel);
  border: 1px solid #222a33;
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 48px;
}
.world-map { width: 100%; height: auto; display: block; }
.world-map .grid line { stroke: #222a33; stroke-dasharray: 4 6; }
.world-map .c { fill: #1f2630; stroke: #0d1117; stroke-width: 0.6; }
.world-map .c.zone { fill: rgba(245, 179, 1, 0.28); stroke: rgba(245, 179, 1, 0.6); }
.world-map .c.on { fill: var(--accent); stroke: var(--accent); }
.world-map .pin text { paint-order: stroke; stroke: #161b22; stroke-width: 4px; }
.world-map .region-label { fill: var(--accent); font-weight: 800; font-size: 22px; letter-spacing: 4px; }
.world-map .pin text { fill: var(--text); font-size: 16px; font-weight: 700; }

.regions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 32px;
}
.region-title { font-size: 24px; margin: 0 0 16px; }
.region-title span { display: block; font-size: 14px; color: var(--muted); font-weight: 400; }

.tree { list-style: none; margin: 0; padding: 0 0 0 20px; border-left: 2px solid var(--accent); }
.tree li { position: relative; padding: 6px 0 6px 28px; }
.tree li::before {
  content: "";
  position: absolute; left: -20px; top: 50%;
  width: 40px; border-top: 2px solid #3a4552;
}
.tree li::after {
  content: "";
  position: absolute; left: 14px; top: calc(50% - 5px);
  border: 5px solid transparent; border-left-color: #3a4552;
}

.country {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 8px 14px;
  background: var(--panel); border: 1px solid #222a33; border-radius: 10px;
  color: var(--muted);
}
.country img { width: 28px; height: 20px; object-fit: cover; border-radius: 3px; }
span.country { opacity: 0.55; }
span.country::after { content: "скоро"; font-size: 12px; margin-left: 6px; }
a.country.on {
  color: var(--accent-text); background: var(--accent); border-color: var(--accent);
  font-weight: 700; text-decoration: none;
}
a.country.on:hover { filter: brightness(1.1); }
.tree li:has(a.country.on)::before { border-top-color: var(--accent); }
.tree li:has(a.country.on)::after { border-left-color: var(--accent); }

.back { color: var(--muted); text-decoration: none; display: inline-block; margin-bottom: 16px; }
.back:hover { color: var(--text); }
.flag { width: 44px; height: 30px; object-fit: cover; border-radius: 4px; vertical-align: -3px; }

.map-box {
  background: var(--panel); border: 1px solid #222a33; border-radius: 16px;
  padding: 24px; margin-bottom: 40px;
}
.region-map { width: 100%; max-width: 820px; height: auto; display: block; margin: 0 auto; }
.region-map .c { stroke-linejoin: round; }
.region-map .c.zone { fill: #262d36; stroke: #3d4652; stroke-width: 1.2; }
.region-map .c.on { fill: var(--accent); stroke: #ffd45c; stroke-width: 1.5; }
.region-map .lbl { fill: #c9d1d9; font-size: 17px; font-weight: 600; }
.region-map .lbl.on { fill: #0d1117; font-size: 26px; font-weight: 800; }
.region-map .leader { fill: none; stroke: #5b6572; stroke-width: 1.2; }
.region-map .dot { fill: #c9d1d9; }

.group-title { font-size: 18px; color: var(--muted); font-weight: 600; margin: 28px 0 12px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.tile {
  display: grid; grid-template-columns: 48px 1fr; grid-template-rows: auto auto;
  column-gap: 12px; align-items: center;
  background: var(--panel); border: 1px solid #222a33; border-radius: 14px;
  padding: 14px; color: var(--text); text-decoration: none;
}
.tile .badge {
  grid-row: 1 / span 2; width: 48px; height: 48px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: #222a33; color: var(--accent); font-weight: 800; font-size: 14px;
}
.tile b { font-size: 16px; }
.tile small { color: var(--muted); font-size: 13px; }
a.tile.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 8px 24px rgba(245, 179, 1, 0.15); }
a.tile.on .badge { background: var(--accent); color: var(--accent-text); }
a.tile.on small { color: var(--accent); }
a.tile.on:hover { transform: translateY(-2px); }

.pay > input[type="radio"] { display: none; }
.switch {
  display: flex; gap: 6px; width: max-content; margin: 0 auto 24px;
  background: var(--panel); border: 1px solid #222a33; border-radius: 12px; padding: 6px;
}
.switch label { padding: 10px 28px; border-radius: 8px; cursor: pointer; color: var(--muted); font-weight: 700; }
#mode-payin:checked ~ .switch label[for="mode-payin"],
#mode-payout:checked ~ .switch label[for="mode-payout"] { background: var(--accent); color: var(--accent-text); }

.panel { display: none; grid-template-columns: 1fr 1fr; gap: 20px; }
#mode-payin:checked ~ .panel-payin,
#mode-payout:checked ~ .panel-payout { display: grid; }
@media (max-width: 760px) { .panel { grid-template-columns: 1fr; } }

.pay-form, .result {
  background: var(--panel); border: 1px solid #222a33; border-radius: 16px; padding: 24px;
}
.pay-form h2 { margin: 0 0 16px; font-size: 20px; }
.field { display: block; margin-bottom: 16px; }
.field span { display: block; color: var(--muted); font-size: 14px; margin-bottom: 6px; }
.field input {
  width: 100%; padding: 12px 14px; font-size: 18px;
  background: var(--bg); color: var(--text);
  border: 2px solid #2b3440; border-radius: 10px; outline: none;
}
.field input:focus { border-color: var(--accent); }
.field input[readonly] { color: var(--muted); }
.field input:user-invalid { border-color: var(--error); }
.field .hint { display: none; color: var(--error); font-style: normal; font-size: 14px; margin-top: 6px; }
.field input:user-invalid + .hint { display: block; }

.pay-form button {
  width: 100%; padding: 14px; font-size: 18px; font-weight: 700; cursor: pointer;
  background: var(--accent); color: var(--accent-text); border: none; border-radius: 12px;
}
.pay-form:invalid button { opacity: 0.4; pointer-events: none; }
.error { color: var(--error); margin-top: 12px; font-weight: 600; }

.result { display: flex; flex-direction: column; justify-content: center; }
.result .placeholder { color: var(--muted); text-align: center; margin: 0; }

.ok { text-align: center; }
.ok p { margin: 0; }
.ok-label { color: var(--muted); font-size: 14px; margin-top: 12px !important; }
.ok-amount { font-size: 36px; font-weight: 800; color: var(--accent); }
.ok-number { font-size: 26px; font-weight: 700; letter-spacing: 1px; }
.ok-note { color: var(--muted); font-size: 13px; margin-top: 18px !important; }

.admin { margin-top: 48px; padding-top: 24px; border-top: 1px dashed #2b3440; text-align: center; }
.admin h2 { font-size: 14px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 2px; }
.admin button {
  padding: 10px 24px; font-size: 15px; font-weight: 700; cursor: pointer;
  background: transparent; color: var(--accent); border: 2px solid var(--accent); border-radius: 10px;
}
.admin button:hover { background: var(--accent); color: var(--accent-text); }
.admin p { color: var(--muted); font-size: 14px; min-height: 20px; }
