﻿[hidden] { display: none !important; }

/* ============================================================
   РљРѕР»РѕР±РєРѕРІС‹Р№ РєСѓР»СЊС‚ вЂ” РѕС„РѕСЂРјР»РµРЅРёРµ
   РџР°Р»РёС‚СЂР°: С‚С‘РїР»РѕРµ С‚РµСЃС‚Рѕ, СЂР¶Р°РЅР°СЏ РєРѕСЂРєР°, Р»РµСЃРЅР°СЏ Р·РµР»РµРЅСЊ
   ============================================================ */

:root {
  --bg-1: #f7ecd9;
  --bg-2: #e8d3ae;
  --surface: #fffaf1;
  --surface-2: #f6e8d2;
  --ink: #33220f;
  --ink-soft: #6b533a;
  --line: rgba(120, 88, 50, 0.18);
  --gold: #f3c969;
  --gold-deep: #d9a53c;
  --green: #3f7a4e;
  --green-soft: #dff0e2;
  --red: #b8452f;
  --red-soft: #f8ddd6;
  --shadow-sm: 0 1px 2px rgba(70, 45, 15, 0.08), 0 2px 8px rgba(70, 45, 15, 0.06);
  --shadow-md: 0 4px 14px rgba(70, 45, 15, 0.10), 0 12px 32px rgba(70, 45, 15, 0.08);
  --radius: 18px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100dvh;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 15% -10%, #fff6e4 0%, transparent 60%),
    radial-gradient(900px 500px at 110% 0%, #f5dfb6 0%, transparent 55%),
    linear-gradient(160deg, var(--bg-1) 0%, var(--bg-2) 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

button {
  font: inherit;
  color: inherit;
}

.app {
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(12px, 2.4vw, 28px);
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 100dvh;
}

/* ---------------- РЁР°РїРєР° ---------------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(8px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  font-size: 22px;
  border-radius: 14px;
  background: linear-gradient(145deg, #ffe9a8, var(--gold));
  box-shadow: inset 0 -2px 0 rgba(120, 80, 20, 0.2);
}

.brand-text h1 {
  margin: 0;
  font-size: clamp(17px, 2.2vw, 21px);
  letter-spacing: -0.01em;
}

.brand-text p {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--ink-soft);
}

.topbar-actions {
  display: flex;
  gap: 8px;
}

.icon-btn {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  font-size: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease;
}

.icon-btn:hover {
  background: var(--surface-2);
}

.icon-btn:active {
  transform: scale(0.94);
}

.icon-btn[aria-pressed="false"] {
  opacity: 0.55;
}

/* ---------------- РЎРµС‚РєР° ---------------- */

.layout {
  display: grid;
  grid-template-columns: minmax(240px, 0.9fr) minmax(320px, 1.25fr) minmax(260px, 1fr);
  gap: 16px;
  align-items: start;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 16px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.panel-head h2 {
  margin: 0;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
}

.panel-news,
.panel-helpers {
  max-height: min(72dvh, 720px);
  overflow: auto;
  scrollbar-width: thin;
}

/* ---------------- РќРѕРІРѕСЃС‚Рё ---------------- */

.news-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.news-item {
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.45;
  background: var(--surface-2);
  border-left: 3px solid var(--gold-deep);
  border-radius: 10px;
  animation: newsIn 0.28s ease both;
}

.news-item.warning {
  background: var(--red-soft);
  border-left-color: var(--red);
}

.news-item.success {
  background: var(--green-soft);
  border-left-color: var(--green);
}

@keyframes newsIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
}

/* ---------------- РЎС†РµРЅР° ---------------- */

.panel-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 520px;
  padding: 22px 18px 18px;
  background:
    radial-gradient(420px 260px at 50% 0%, #fff6e0 0%, transparent 70%),
    var(--surface);
  overflow: hidden;
}

.statue {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 0;
  padding: 8px 0 0;
  background: none;
  border: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.statue:focus-visible {
  outline: 3px solid var(--gold-deep);
  outline-offset: 6px;
  border-radius: 24px;
}

.statue-outline {
  position: absolute;
  inset: 6px 12px 46px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(243, 201, 105, 0.35), transparent 65%);
  filter: blur(6px);
  z-index: 0;
  transition: transform 0.2s ease;
}

.kolobok {
  position: relative;
  width: clamp(110px, 22vw, 140px);
  height: clamp(110px, 22vw, 140px);
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 28%, #fff2c2 0%, transparent 42%),
    linear-gradient(150deg, #ffe08a 0%, #f3c969 48%, #cf9c33 100%);
  box-shadow:
    0 12px 24px rgba(120, 80, 20, 0.22),
    inset 0 -8px 16px rgba(140, 92, 20, 0.22),
    inset 0 4px 10px rgba(255, 255, 255, 0.5);
  z-index: 1;
  transform-origin: 50% 100%;
  transition: transform 0.15s ease;
}

.kolobok.is-jumping {
  animation: jump 0.42s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes jump {
  0% { transform: translateY(0) scale(1, 1); }
  18% { transform: translateY(0) scale(1.07, 0.91); }
  46% { transform: translateY(-46px) scale(0.95, 1.07); }
  72% { transform: translateY(-8px) scale(1.02, 0.98); }
  100% { transform: translateY(0) scale(1, 1); }
}

.eye {
  position: absolute;
  top: 32%;
  width: 14%;
  height: 14%;
  border-radius: 50%;
  background: #2b1d0e;
  box-shadow: inset 0 2px 2px rgba(255, 255, 255, 0.35);
}

.eye.left { left: 24%; }
.eye.right { right: 24%; }

.blush {
  position: absolute;
  bottom: 32%;
  width: 16%;
  height: 9%;
  border-radius: 50%;
  background: #e88f63;
  opacity: 0.55;
  filter: blur(1px);
}

.blush.left { left: 11%; }
.blush.right { right: 11%; }

.mouth {
  position: absolute;
  left: 50%;
  bottom: 24%;
  width: 38%;
  height: 18%;
  transform: translateX(-50%);
  border-bottom: 4px solid #8a3c17;
  border-radius: 0 0 60% 60%;
}

.pedestal {
  width: clamp(120px, 24vw, 150px);
  height: 22px;
  margin-top: -14px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(70, 45, 15, 0.28) 0%, rgba(70, 45, 15, 0.10) 55%, transparent 72%);
  filter: blur(1px);
  z-index: 0;
}

.floaters {
  position: relative;
  width: 100%;
  height: 56px;
  pointer-events: none;
}

.floater {
  position: absolute;
  font-weight: 800;
  font-size: 20px;
  color: #a8640f;
  text-shadow: 0 1px 0 #fff6dd;
  animation: floatUp 0.85s ease-out forwards;
  pointer-events: none;
  z-index: 5;
}

@keyframes floatUp {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(-64px) scale(1.15); }
}

.counter-block {
  display: grid;
  justify-items: center;
  gap: 4px;
  margin-top: 4px;
  text-align: center;
}

.counter-label {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.counter {
  font-size: clamp(28px, 5vw, 40px);
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  padding: 6px 20px;
  border-radius: 999px;
  background: #2f2213;
  color: var(--gold);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.08), var(--shadow-sm);
}

.counter-rate {
  font-size: 12px;
  color: var(--green);
  font-weight: 700;
}

.reward-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 12px;
}

.bags-line {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--ink-soft);
}

/* ---------------- РљРЅРѕРїРєРё ---------------- */

.btn {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform 0.1s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px) scale(0.99); }

.btn-reward {
  background: linear-gradient(180deg, #ffe6a6, var(--gold));
  border-color: #e2b657;
}

.btn-reward:hover { background: linear-gradient(180deg, #ffdf95, #efbf58); }

.btn-soft { background: var(--surface-2); }

.btn-danger {
  background: var(--red-soft);
  border-color: #e3b2a6;
  color: var(--red);
}

.btn-danger:hover { background: #f4cec4; }

.ghost-btn {
  background: none;
  border: 0;
  color: var(--ink-soft);
  font-size: 12px;
  cursor: pointer;
}

/* ---------------- РџРµСЂРµРєР»СЋС‡Р°С‚РµР»Рё ---------------- */

.mode-switch,
.multiplier-row {
  display: flex;
  gap: 6px;
}

.multiplier-row {
  margin-bottom: 10px;
}

.chip {
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}

.chip:hover { background: #efe0c6; }

.chip.is-active {
  background: #2f2213;
  color: var(--gold);
  border-color: #2f2213;
}

/* ---------------- РџРѕСЃР»РµРґРѕРІР°С‚РµР»Рё ---------------- */

.helpers-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.helper {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 10px;
  width: 100%;
  padding: 11px 12px 10px;
  text-align: left;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform 0.1s ease, background 0.15s ease, border-color 0.15s ease;
}

.helper:hover { background: #f1dfc1; }
.helper:active { transform: scale(0.993); }

.helper.is-blocked {
  opacity: 0.55;
  cursor: not-allowed;
}

.helper-name {
  font-weight: 800;
  font-size: 14px;
}

.helper-owned {
  justify-self: end;
  align-self: center;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 800;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.6);
  border-radius: 999px;
}

.helper-meta {
  grid-column: 1 / -1;
  font-size: 11px;
  color: var(--ink-soft);
}

.helper-desc {
  grid-column: 1 / -1;
  font-size: 11px;
  line-height: 1.35;
  color: #7a5c3c;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.helper-foot {
  grid-column: 1 / -1;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
  padding-top: 7px;
  border-top: 1px dashed var(--line);
}

.helper-cost {
  font-size: 17px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.helper-cost small {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-soft);
}

.helper-note {
  font-size: 11px;
  font-weight: 700;
  color: var(--red);
}

.helper-note.ok { color: var(--green); }

/* ---------------- РќР°СЃС‚СЂРѕР№РєРё ---------------- */

.settings {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.settings-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.settings-group:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.settings-group h3 {
  margin: 0;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
}

.settings-danger h3 { color: var(--red); }

.switch {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  cursor: pointer;
}

.switch input {
  width: 17px;
  height: 17px;
  accent-color: var(--gold-deep);
  cursor: pointer;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hint {
  margin: 0;
  font-size: 11px;
  line-height: 1.45;
  color: var(--ink-soft);
}

/* ---------------- РџРѕРґРІР°Р» ---------------- */

.footer {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  padding: 8px 0 4px;
  font-size: 12px;
  color: var(--ink-soft);
}

.footer .dot { opacity: 0.5; }

/* ---------------- РњРѕРґР°Р»РєРё Рё С‚РѕСЃС‚С‹ ---------------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(43, 29, 14, 0.45);
  backdrop-filter: blur(3px);
  z-index: 50;
  animation: fadeIn 0.16s ease;
}

@keyframes fadeIn { from { opacity: 0; } }

.modal {
  width: min(420px, 100%);
  padding: 20px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  animation: popIn 0.18s ease;
}

@keyframes popIn {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
}

.modal h2 {
  margin: 0 0 8px;
  font-size: 18px;
}

.modal p {
  margin: 0 0 14px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-soft);
}

.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.progress {
  height: 8px;
  margin: 14px 0 4px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold), var(--gold-deep));
  transition: width 0.2s linear;
}

.toasts {
  position: fixed;
  right: 16px;
  bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 60;
  pointer-events: none;
}

.toast {
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  background: #2f2213;
  color: #ffe9b0;
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  animation: toastIn 0.22s ease;
}

.toast.error { background: var(--red); color: #fff; }
.toast.ok { background: var(--green); color: #fff; }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(8px); }
}

/* ---------------- РђРґР°РїС‚РёРІ ---------------- */

@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr 1fr;
  }

  .panel-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 520px;
  padding: 22px 18px 18px;
  background:
    radial-gradient(420px 260px at 50% 0%, #fff6e0 0%, transparent 70%),
    var(--surface);
  overflow: hidden;
}

@media (max-width: 680px) {
  .panel-stage {
    min-height: auto;
    padding: 16px 14px;
  }

  .layout {
    grid-template-columns: 1fr;
  }

  .panel-news,
  .panel-helpers {
    max-height: none;
  }

  .helper-desc {
    -webkit-line-clamp: 3;
    line-clamp: 3;
  }

  .counter {
    font-size: 32px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
