:root {
  --bg1: #f9f2c8;
  --bg2: #dafbe8;
  --bg3: #deecff;
  --ink: #12221a;
  --ink-soft: #3d5f4a;
  --card: rgba(255, 255, 255, 0.9);
  --line: rgba(20, 52, 35, 0.2);
  --brand: #2ebf67;
  --brand-deep: #1a9a4d;
  --accent: #f7932e;
  --danger: #ba2f2f;
  --ok: #1a7b42;
  --focus: #0e7cc7;
  --shadow: 0 14px 34px rgba(17, 46, 32, 0.16);
  --radius: 18px;
  --radius-sm: 12px;
  --speed: 180ms;
  --space-1: 8px;
  --space-2: 12px;
  --space-3: 16px;
  --space-4: 22px;
  --space-5: 30px;
  --space-6: 40px;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  font-family: "Manrope", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at 10% 0%, #fff7dd 0%, transparent 32%),
    radial-gradient(circle at 100% 18%, #e7f4ff 0%, transparent 28%),
    linear-gradient(155deg, var(--bg1), var(--bg2) 44%, var(--bg3));
}

h1,
h2,
h3,
h4,
.brand strong {
  font-family: "Baloo 2", cursive;
  line-height: 1.06;
  margin-top: 0;
}

p {
  margin-top: 0;
}

a {
  color: inherit;
}

.skip-link {
  position: absolute;
  left: 8px;
  top: -42px;
  padding: 8px 12px;
  border-radius: 8px;
  background: #000;
  color: #fff;
  z-index: 200;
}

.skip-link:focus {
  top: 8px;
}

.shell,
main,
.footer {
  width: min(1120px, calc(100% - 20px));
  margin-inline: auto;
}

.shell {
  margin-top: 10px;
  padding: 10px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 8px;
  z-index: 60;
  display: grid;
  gap: 10px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  min-width: 0;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 900;
  background: linear-gradient(180deg, var(--brand), var(--brand-deep));
  box-shadow: 0 8px 18px rgba(24, 101, 53, 0.28);
}

.brand small {
  display: block;
  color: var(--ink-soft);
  font-size: 0.78rem;
}

.nav {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.nav::-webkit-scrollbar {
  height: 8px;
}

.nav::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(31, 74, 50, 0.2);
}

.nav a {
  white-space: nowrap;
  border-radius: 11px;
  text-decoration: none;
  color: var(--ink-soft);
  font-weight: 800;
  padding: 8px 12px;
  border: 1px solid transparent;
  transition: transform var(--speed) ease, background var(--speed) ease, border-color var(--speed) ease;
}

.nav a:hover,
.nav a:focus-visible,
.nav a.active {
  background: rgba(46, 191, 103, 0.16);
  border-color: rgba(30, 119, 62, 0.25);
  color: var(--ink);
  transform: translateY(-1px);
}

.points {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.points span {
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  padding: 6px 10px;
  font-weight: 800;
  font-size: 0.82rem;
  position: relative;
  overflow: hidden;
}

.points strong {
  display: inline-block;
  min-width: 1ch;
}

.points strong.value-pop {
  animation: value-pop 620ms ease;
}

.points-delta {
  position: absolute;
  right: 9px;
  top: 4px;
  font-size: 0.72rem;
  font-weight: 900;
  color: var(--ok);
  pointer-events: none;
  animation: rise-fade 980ms ease forwards;
}

main {
  padding: var(--space-3) 0 var(--space-6);
  display: grid;
  gap: var(--space-4);
}

main > section + section {
  margin-top: 0;
}

.section,
.panel,
.hero,
.step,
.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  background: var(--card);
}

.hero,
.section,
.panel,
.step,
.card {
  padding: clamp(16px, 3.5vw, var(--space-4));
}

.hero > * + *,
.section > * + *,
.panel > * + *,
.step > * + *,
.card > * + * {
  margin-top: var(--space-3);
}

.section > h2,
.panel > h3,
.hero > h1,
.card > h3,
.card > h4,
.tab-card > h3,
.tab-card > h4 {
  margin-bottom: var(--space-2);
}

.hero p,
.section p,
.card p,
.tab-card p {
  line-height: 1.55;
}

.hero h1 {
  font-size: clamp(1.8rem, 5vw, 3.1rem);
  margin-bottom: 8px;
}

.hero-home {
  overflow: hidden;
  position: relative;
}

.hero-home::before {
  content: "";
  position: absolute;
  inset: -40% -20% auto;
  height: 65%;
  background: radial-gradient(circle at center, rgba(46, 191, 103, 0.16), transparent 70%);
  pointer-events: none;
}

.hero-layout {
  position: relative;
  z-index: 1;
  display: grid;
  gap: var(--space-4);
}

.hero-actions {
  display: grid;
  gap: 8px;
}

.hero-kpis {
  display: grid;
  gap: var(--space-2);
  margin: var(--space-2) 0;
}

.mini-kpi {
  border: 1px solid rgba(26, 86, 56, 0.22);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.92);
  padding: 9px;
}

.mini-kpi p {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink-soft);
}

.mini-kpi strong {
  font-size: 1rem;
}

.hero-stage {
  --mx: 0px;
  --my: 0px;
  position: relative;
  min-height: 290px;
  border: 1px solid rgba(21, 64, 43, 0.24);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(252, 255, 253, 0.92), rgba(230, 248, 237, 0.92));
  overflow: hidden;
  transform: translate3d(var(--mx), var(--my), 0);
  transition: transform 260ms ease;
}

.hero-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(to right, rgba(28, 93, 61, 0.1) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(28, 93, 61, 0.1) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.5), transparent 90%);
  animation: map-pan 14s linear infinite;
}

.hero-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-lines line {
  stroke: rgba(21, 95, 61, 0.35);
  stroke-width: 1.2;
  stroke-linecap: round;
  stroke-dasharray: 3 3;
  animation: dash 9s linear infinite;
}

.hero-node {
  position: absolute;
  left: var(--x);
  top: var(--y);
  transform: translate(-50%, -50%);
  border: 1px solid rgba(27, 86, 56, 0.34);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  font-weight: 800;
  font-size: 0.74rem;
  padding: 6px 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: transform var(--speed) ease, background var(--speed) ease, box-shadow var(--speed) ease;
}

.hero-node span {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  font-size: 0.7rem;
  font-weight: 900;
  color: #fff;
  background: linear-gradient(180deg, var(--brand), var(--brand-deep));
}

.hero-node:hover,
.hero-node:focus-visible {
  transform: translate(-50%, calc(-50% - 2px));
}

.hero-node.active {
  background: rgba(225, 255, 236, 0.98);
  border-color: rgba(24, 122, 64, 0.54);
  box-shadow: 0 8px 22px rgba(27, 95, 60, 0.22);
}

.hero-avatar {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  position: absolute;
  left: 13%;
  top: 16%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle at 35% 30%, #fff2d6, #ffc667 65%, #f09a22 100%);
  box-shadow: 0 0 0 3px rgba(255, 177, 70, 0.35), 0 0 28px rgba(255, 159, 48, 0.55);
  transition: left 320ms ease, top 320ms ease;
  animation: hero-avatar-pulse 1.8s ease-in-out infinite;
}

.hero-detail {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  border: 1px solid rgba(20, 67, 44, 0.24);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.92);
  padding: var(--space-2);
}

.hero-detail h3 {
  margin-bottom: 3px;
}

.hero-detail p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.86rem;
}

.grid-2,
.grid-3 {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-3);
}

.btn,
.choice,
.chip,
.tab-btn,
.hero-node {
  -webkit-tap-highlight-color: transparent;
}

.btn {
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 11px 14px;
  font: inherit;
  font-weight: 900;
  letter-spacing: 0.01em;
  cursor: pointer;
  width: 100%;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  transition: transform var(--speed) ease, box-shadow var(--speed) ease, opacity var(--speed) ease;
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.62;
  cursor: not-allowed;
}

.btn-primary {
  color: #fff;
  background: linear-gradient(180deg, var(--brand), var(--brand-deep));
  box-shadow: 0 10px 20px rgba(26, 111, 59, 0.28);
}

.btn-secondary {
  color: #1a402e;
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(30, 81, 56, 0.26);
}

.btn-danger {
  color: #fff;
  background: linear-gradient(180deg, #d95050, #b73b3b);
}

.choice,
.chip,
.tab-btn {
  border: 1px solid rgba(29, 75, 52, 0.24);
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  transition: transform var(--speed) ease, border-color var(--speed) ease, background var(--speed) ease;
}

.choice {
  border-radius: 14px;
  padding: 12px 12px 12px 42px;
  text-align: left;
  position: relative;
}

.choice::before,
.chip::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1.8px solid rgba(22, 66, 44, 0.46);
  background: #fff;
}

.choice::after,
.chip::after {
  content: "";
  position: absolute;
  left: 16px;
  top: calc(50% - 5px);
  width: 4px;
  height: 8px;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(40deg) scale(0);
  transition: transform var(--speed) ease;
}

.choice.active,
.chip.active,
.tab-btn.active,
.choice:hover,
.chip:hover,
.tab-btn:hover,
.choice:focus-visible,
.chip:focus-visible,
.tab-btn:focus-visible {
  border-color: rgba(22, 120, 62, 0.46);
  background: rgba(221, 255, 234, 0.98);
  transform: translateY(-1px);
}

.choice.active::before,
.chip.active::before {
  border-color: rgba(22, 120, 62, 0.7);
  background: linear-gradient(180deg, var(--brand), var(--brand-deep));
}

.choice.active::after,
.chip.active::after {
  transform: rotate(40deg) scale(1);
}

.choice p {
  margin-bottom: 0;
  color: var(--ink-soft);
}

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

.chip {
  position: relative;
  border-radius: 999px;
  padding: 7px 14px 7px 34px;
  font-weight: 800;
  cursor: pointer;
}

label,
legend {
  font-weight: 800;
}

label {
  display: grid;
  gap: var(--space-1);
  margin-top: var(--space-2);
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(27, 70, 49, 0.26);
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
  background: rgba(255, 255, 255, 0.95);
  color: var(--ink);
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.btn:focus-visible,
.choice:focus-visible,
.chip:focus-visible,
.tab-btn:focus-visible,
.nav a:focus-visible,
.hero-node:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

textarea {
  resize: vertical;
}

input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 1.1rem;
  height: 1.1rem;
  margin: 0;
  border: 1.6px solid rgba(23, 62, 43, 0.52);
  border-radius: 4px;
  background: #fff;
  display: grid;
  place-content: center;
}

input[type="checkbox"]::before {
  content: "";
  width: 0.6rem;
  height: 0.6rem;
  transform: scale(0);
  transition: transform var(--speed) ease;
  clip-path: polygon(14% 44%, 0 60%, 43% 100%, 100% 18%, 84% 4%, 41% 71%);
  background: #fff;
}

input[type="checkbox"]:checked {
  background: linear-gradient(180deg, var(--brand), var(--brand-deep));
  border-color: rgba(20, 103, 55, 0.8);
}

input[type="checkbox"]:checked::before {
  transform: scale(1);
}

.notice {
  margin-top: var(--space-2);
  font-weight: 800;
  border-radius: 10px;
  padding: 7px 9px;
  border: 1px dashed rgba(28, 73, 49, 0.18);
  background: rgba(255, 255, 255, 0.7);
}

.notice.error {
  color: var(--danger);
}

.notice.success {
  color: var(--ok);
}

.stepper {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.step-pill {
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 5px 10px;
  font-weight: 800;
  font-size: 0.82rem;
  background: rgba(255, 255, 255, 0.84);
}

.step-pill.active {
  border-color: rgba(22, 120, 62, 0.5);
  background: rgba(46, 191, 103, 0.2);
}

.tooltip-row {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.hidden {
  display: none !important;
}

.path-card,
.quest-card,
.mission-card,
.tab-card,
.player-card,
.chat-card,
.world-card,
.shop-card {
  border: 1px solid rgba(27, 68, 47, 0.2);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  padding: var(--space-3);
}

.skill-tree-card {
  border: 1px solid rgba(27, 68, 47, 0.22);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.95);
  padding: var(--space-3);
  display: grid;
  gap: var(--space-2);
}

.skill-tree-card.done {
  border-color: rgba(22, 120, 62, 0.42);
  background: rgba(225, 255, 236, 0.98);
}

.skill-tree-card.locked {
  opacity: 0.9;
}

.skill-tree-card h5 {
  margin: 0;
  font-size: 1.02rem;
}

.path-card.active,
.quest-card.done {
  border-color: rgba(23, 120, 63, 0.5);
  background: rgba(223, 255, 235, 0.98);
}

.quest-card.locked {
  opacity: 0.74;
  background: rgba(244, 248, 245, 0.9);
}

.quest-card {
  position: relative;
  overflow: hidden;
}

.quest-card::after {
  content: "";
  position: absolute;
  inset: auto -40px -38px;
  height: 76px;
  background: radial-gradient(circle at center, rgba(46, 191, 103, 0.16), transparent 70%);
  pointer-events: none;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.01em;
  border: 1px solid rgba(20, 67, 45, 0.22);
  background: rgba(255, 255, 255, 0.86);
}

.status-chip::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #7b8a80;
}

.status-ready {
  border-color: rgba(23, 120, 63, 0.3);
  color: #18693d;
}

.status-ready::before {
  background: #2ebf67;
  box-shadow: 0 0 0 4px rgba(46, 191, 103, 0.18);
}

.status-locked {
  border-color: rgba(93, 102, 97, 0.3);
  color: #5a6b60;
}

.status-done {
  border-color: rgba(23, 120, 63, 0.4);
  color: #16693c;
  background: rgba(223, 255, 235, 0.95);
}

.status-done::before {
  background: linear-gradient(180deg, var(--brand), var(--brand-deep));
}

.path-card ul,
.quest-card ul,
.tab-card ul {
  margin: var(--space-2) 0 0;
  padding-left: 18px;
}

.tab-shell {
  margin-top: var(--space-3);
}

.tab-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.tab-btn {
  border-radius: 10px;
  padding: 9px 11px;
  font-weight: 800;
  cursor: pointer;
}

.progress {
  width: 100%;
  height: 14px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(24, 66, 45, 0.16);
}

.progress > span {
  width: 0;
  height: 100%;
  display: block;
  background: linear-gradient(90deg, var(--brand), var(--accent));
  transition: width 240ms ease;
}

.inline-check {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  margin: var(--space-2) 0;
}

.tool-checks {
  margin: var(--space-3) 0;
  border: 1px solid rgba(27, 68, 47, 0.22);
  border-radius: 12px;
  padding: 10px;
  display: grid;
  gap: var(--space-2);
}

.tool-checks legend {
  padding: 0 6px;
}

.tool-checks label {
  margin: 0;
  font-weight: 700;
  display: flex;
  gap: 8px;
  align-items: center;
}

#target-list,
#draft-list,
#daily-quest-grid,
#income-events,
#income-wall-list,
#revenue-leaderboard {
  display: grid;
  gap: var(--space-2);
}

#income-milestones,
#unlock-tree {
  display: grid;
  gap: var(--space-2);
}

#income-events .mission-card,
#income-wall-list .mission-card,
#revenue-leaderboard .mission-card {
  padding: 10px 12px;
}

.world-map {
  position: relative;
  min-height: 320px;
  border: 1px solid rgba(25, 72, 49, 0.24);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(248, 255, 251, 0.95), rgba(242, 249, 255, 0.95));
  overflow: hidden;
}

.world-node {
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px rgba(20, 32, 25, 0.12);
}

.world-node.offline {
  opacity: 0.45;
}

.world-label {
  position: absolute;
  transform: translate(10px, -4px);
  font-size: 0.75rem;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.84);
  padding: 2px 6px;
  border-radius: 8px;
}

.chat-log {
  max-height: 220px;
  overflow: auto;
  display: grid;
  gap: var(--space-1);
}

.chat-line {
  border-radius: 10px;
  border: 1px solid rgba(26, 67, 46, 0.15);
  background: rgba(255, 255, 255, 0.88);
  padding: 6px 8px;
}

ol {
  padding-left: 20px;
}

.footer {
  border-top: 1px solid rgba(25, 72, 49, 0.18);
  padding: var(--space-2) 0 var(--space-5);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  flex-wrap: wrap;
}

.footer a {
  margin-left: 10px;
}

.game-toast-container {
  position: fixed;
  right: 12px;
  bottom: 12px;
  z-index: 300;
  display: grid;
  gap: 8px;
  width: min(340px, calc(100vw - 24px));
  pointer-events: none;
}

.game-toast {
  pointer-events: none;
  border: 1px solid rgba(23, 92, 57, 0.34);
  border-radius: 14px;
  background: rgba(235, 255, 244, 0.98);
  color: #18432d;
  box-shadow: 0 12px 28px rgba(15, 42, 29, 0.2);
  padding: 10px 12px;
  transform: translateY(12px);
  opacity: 0;
  transition: transform 200ms ease, opacity 200ms ease;
}

.game-toast.show {
  transform: translateY(0);
  opacity: 1;
}

.game-toast.error {
  border-color: rgba(165, 46, 46, 0.36);
  background: rgba(255, 238, 238, 0.98);
  color: #6e2222;
}

.game-toast-title {
  margin: 0;
  font-weight: 900;
  font-size: 0.86rem;
}

.game-toast-body {
  margin: 2px 0 0;
  font-weight: 700;
  font-size: 0.86rem;
}

@keyframes map-pan {
  from {
    transform: translateY(0);
  }

  to {
    transform: translateY(34px);
  }
}

@keyframes dash {
  from {
    stroke-dashoffset: 0;
  }

  to {
    stroke-dashoffset: -40;
  }
}

@keyframes hero-avatar-pulse {
  0%,
  100% {
    transform: translate(-50%, -50%) scale(1);
  }

  50% {
    transform: translate(-50%, -50%) scale(1.08);
  }
}

@keyframes value-pop {
  0% {
    transform: scale(1);
  }

  35% {
    transform: scale(1.22);
  }

  100% {
    transform: scale(1);
  }
}

@keyframes rise-fade {
  0% {
    opacity: 0;
    transform: translateY(8px);
  }

  20% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: translateY(-12px);
  }
}

@media (min-width: 700px) {
  .shell,
  main,
  .footer {
    width: min(1120px, calc(100% - 24px));
  }

  .points {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #daily-quest-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .hero-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .btn {
    width: auto;
  }

  .tool-checks {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 980px) {
  .shell {
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
  }

  .nav,
  .points {
    overflow: visible;
  }

  .points {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
  }

  .hero-layout {
    grid-template-columns: minmax(0, 1.02fr) minmax(0, 0.98fr);
    gap: var(--space-5);
    align-items: stretch;
  }

  .grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 399px) {
  .points {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-node {
    font-size: 0.68rem;
  }
}
