:root {
  --bg: #eef5f8;
  --card: #ffffff;
  --ink: #203d43;
  --muted: #6b8086;
  --green: #345f54;
  --green-soft: #e3efe8;
  --lime: #d9ed87;
  --line: #dce7e9;
  --warn: #b5532f;
  --radius: 20px;
  --display: 'Unbounded', 'Arial Black', Arial, sans-serif;
  --body: 'Manrope', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--body); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #799f3c; outline-offset: 3px; }

.top {
  max-width: 1080px; margin: 0 auto; padding: 18px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.logo { font: 700 22px var(--display); text-decoration: none; display: flex; align-items: center; gap: 8px; letter-spacing: -1px; }
.logo-mark {
  background: var(--green); color: var(--lime); width: 36px; height: 36px; border-radius: 12px;
  display: grid; place-items: center; transform: rotate(-9deg); font-size: 24px;
}
.logo-q { color: #7b9947; margin-left: -6px; }
nav { display: flex; gap: 18px; align-items: center; font-weight: 700; font-size: 14px; }
nav a { text-decoration: none; color: var(--muted); }
nav a.active { color: var(--ink); }
.link { border: 0; background: none; padding: 0; color: var(--muted); font-weight: 700; font-size: 14px; }

.page { max-width: 1080px; margin: 0 auto; padding: 0 16px 64px; }
h1, h2, h3 { font-family: var(--display); letter-spacing: -0.5px; line-height: 1.2; margin: 0 0 12px; }
h1 { font-size: clamp(26px, 5vw, 42px); }
h2 { font-size: 20px; }
h3 { font-size: 17px; }
.lead { color: var(--muted); max-width: 560px; margin: 0 0 24px; }
.muted { color: var(--muted); font-size: 14px; }

.card { background: var(--card); border-radius: var(--radius); padding: 22px; box-shadow: 0 1px 0 var(--line); }
.grid { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); align-items: start; }
@media (max-width: 820px) { .grid { grid-template-columns: minmax(0, 1fr); } }

.step { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.step b { background: var(--green-soft); color: var(--green); width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 14px; }
.step h2 { margin: 0; }

label.field { display: block; font-weight: 700; font-size: 14px; margin: 14px 0 6px; }
input[type=text], input[type=email], input[type=password], select {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: #fff;
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 8px 14px; font-size: 14px; font-weight: 600;
}
.chip[aria-pressed=true] { background: var(--green); color: #fff; border-color: var(--green); }
.chip.item { display: inline-flex; align-items: center; gap: 6px; background: var(--green-soft); border-color: transparent; }
.chip.item button { border: 0; background: none; padding: 0 2px; font-size: 16px; line-height: 1; color: var(--muted); }
.stepper { display: inline-flex; align-items: center; gap: 12px; }
.stepper button { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: #fff; font-size: 18px; }

.gap-top { margin-top: 8px; }
.section-gap { margin-top: 28px; }
.chips select { width: auto; border-radius: 999px; padding: 7px 12px; }
.add-row { display: flex; gap: 8px; margin: 12px 0; }
.add-row input { flex: 1; }
.suggest { margin-top: 8px; }

.btn {
  border: 0; border-radius: 16px; padding: 14px 20px; font-weight: 800; background: var(--green); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn.secondary { background: var(--green-soft); color: var(--green); }
.btn.big { width: 100%; padding: 18px; font-size: 18px; margin-top: 18px; }
.btn:disabled { opacity: 0.6; cursor: progress; }

.photo-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.photo-buttons label {
  border: 1.5px dashed #b9cfd2; border-radius: 16px; padding: 14px; text-align: center; font-weight: 700; font-size: 14px; cursor: pointer; background: #f7fbfb;
}
.photo-buttons input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.sketch { font-size: 13px; color: var(--muted); margin-top: 8px; }

.quota { font-size: 14px; color: var(--muted); margin-top: 10px; text-align: center; }

/* Игра */
.game-head { margin: 8px 0 18px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.tag { background: #fff; border-radius: 999px; padding: 4px 12px; font-size: 13px; font-weight: 700; color: var(--muted); }
.safety { background: #fff7e8; border-radius: 16px; padding: 12px 16px; font-size: 14px; margin: 14px 0 22px; }
.stage { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 20px; margin-bottom: 18px; }
@media (max-width: 720px) { .stage { grid-template-columns: minmax(0, 1fr); } }
.picture {
  aspect-ratio: 1; border-radius: 18px; background: linear-gradient(135deg, #e7f2d0, #cfe5e6); overflow: hidden;
  display: grid; place-items: center; text-align: center; color: var(--green); font-weight: 700; font-size: 14px; padding: 12px;
}
.picture img { width: 100%; height: 100%; object-fit: cover; display: block; }
.picture .emoji { font-size: 64px; display: block; }
.stage p { margin: 6px 0; }
.stage details { margin-top: 10px; font-size: 14px; }
.stage-num { color: var(--green); font: 700 13px var(--display); }
.video { background: var(--green); color: #fff; }
.video h2 { color: var(--lime); }
.video ol { padding-left: 20px; }
.video .tagline { color: var(--lime); font-weight: 700; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }

/* Списки */
.games { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.game-card { text-decoration: none; background: #fff; border-radius: 18px; overflow: hidden; display: block; }
.game-card .picture { border-radius: 0; aspect-ratio: 16 / 10; }
.game-card div.meta { padding: 12px 14px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table-wrap { overflow-x: auto; }
.switch { width: 22px; height: 22px; }

.auth { max-width: 420px; margin: 24px auto; }
.tabs { display: flex; gap: 8px; margin-bottom: 8px; }
.error { color: var(--warn); font-size: 14px; min-height: 20px; margin-top: 10px; }

#toast {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--ink); color: #fff;
  padding: 12px 18px; border-radius: 14px; max-width: calc(100% - 32px); font-size: 14px; z-index: 10;
}
.spinner { width: 18px; height: 18px; border: 3px solid rgba(255, 255, 255, 0.4); border-top-color: #fff; border-radius: 50%; animation: spin 0.8s linear infinite; }
.picture .spinner { border-color: rgba(52, 95, 84, 0.25); border-top-color: var(--green); width: 32px; height: 32px; margin: 0 auto 8px; }
@keyframes spin { to { transform: rotate(360deg); } }

@media print {
  .top, .actions, .video, details { display: none !important; }
  body { background: #fff; }
}
