:root {
  --sky-top: #a7ecff;
  --sky-mid: #cff9ff;
  --sky-bottom: #fff8ee;
  --mint: #85e2b3;
  --mint-deep: #3f8f69;
  --peach: #ffcfb2;
  --rose: #ff8fb4;
  --cream: #fff9ef;
  --ink: #3e4862;
  --ink-soft: #6e7896;
  --panel: rgba(255, 255, 255, 0.78);
  --panel-strong: rgba(255, 255, 255, 0.88);
  --line: rgba(126, 166, 187, 0.34);
  --shadow: rgba(90, 125, 156, 0.2);
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: "Trebuchet MS", "Arial Rounded MT Bold", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 14% 18%, rgba(255, 173, 205, 0.42), transparent 32%),
    radial-gradient(circle at 85% 14%, rgba(255, 239, 169, 0.45), transparent 24%),
    radial-gradient(circle at 50% 110%, rgba(151, 226, 199, 0.52), transparent 34%),
    linear-gradient(180deg, var(--sky-top), var(--sky-mid) 52%, var(--sky-bottom));
}

.sky-sparkles,
.cloud-ribbon {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.sky-sparkles {
  background-image:
    radial-gradient(circle at 12% 22%, rgba(255, 255, 255, 0.9) 0 3px, transparent 4px),
    radial-gradient(circle at 76% 16%, rgba(255, 255, 255, 0.86) 0 4px, transparent 5px),
    radial-gradient(circle at 65% 28%, rgba(255, 255, 255, 0.72) 0 2px, transparent 3px),
    radial-gradient(circle at 24% 74%, rgba(255, 255, 255, 0.6) 0 2px, transparent 3px),
    radial-gradient(circle at 88% 62%, rgba(255, 255, 255, 0.76) 0 2px, transparent 3px);
  opacity: 0.7;
}

.cloud-ribbon::before,
.cloud-ribbon::after {
  content: "";
  position: absolute;
  inset: auto auto 16% -10%;
  width: 120%;
  height: 180px;
  background:
    radial-gradient(circle at 8% 58%, rgba(255, 255, 255, 0.72) 0 32px, transparent 33px),
    radial-gradient(circle at 18% 46%, rgba(255, 255, 255, 0.84) 0 46px, transparent 47px),
    radial-gradient(circle at 28% 56%, rgba(255, 255, 255, 0.66) 0 34px, transparent 35px),
    radial-gradient(circle at 43% 50%, rgba(255, 255, 255, 0.74) 0 40px, transparent 41px),
    radial-gradient(circle at 58% 48%, rgba(255, 255, 255, 0.84) 0 44px, transparent 45px),
    radial-gradient(circle at 70% 58%, rgba(255, 255, 255, 0.68) 0 34px, transparent 35px),
    radial-gradient(circle at 86% 52%, rgba(255, 255, 255, 0.78) 0 42px, transparent 43px);
  filter: blur(8px);
  opacity: 0.45;
}

.cloud-ribbon::after {
  inset: 4% -8% auto auto;
  width: 82%;
  height: 120px;
  opacity: 0.38;
  transform: scale(0.94);
}

.game-shell,
.ad-zone {
  position: relative;
  z-index: 1;
}

.game-shell {
  width: min(1240px, 94vw);
  margin: 18px auto 20px;
  padding: 18px;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.7)),
    radial-gradient(circle at top right, rgba(255, 218, 173, 0.4), transparent 34%);
  box-shadow:
    0 24px 70px rgba(95, 128, 158, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(8px);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.title-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.eyebrow {
  margin: 0;
  color: var(--mint-deep);
  font-size: 0.82rem;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  font-weight: 800;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.3rem);
  line-height: 0.98;
  letter-spacing: 0.8px;
}

h1 span {
  display: inline-block;
  color: #ff6f96;
  transform: rotate(-2deg);
}

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

.quick-links a {
  padding: 7px 12px;
  border-radius: 999px;
  text-decoration: none;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(139, 185, 204, 0.34);
  box-shadow: 0 8px 18px rgba(90, 125, 156, 0.08);
}

.quick-links a:hover {
  transform: translateY(-1px);
}

.hud {
  display: grid;
  grid-template-columns: repeat(4, minmax(112px, 1fr));
  gap: 10px;
  flex: 1;
}

.hud-item,
.meta-chip,
.status-card,
.legend-card,
.panel-block,
.board-frame,
.ad-zone {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 14px 30px var(--shadow);
}

.hud-item {
  border-radius: 18px;
  padding: 11px 12px;
}

.hud-item label,
.meta-chip label,
.legend-card label,
.section-kicker {
  display: block;
  margin: 0 0 6px;
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.85px;
  text-transform: uppercase;
}

.hud-item strong {
  font-size: 1.15rem;
}

.arena-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 16px;
}

.arena-panel,
.sidebar {
  min-width: 0;
}

.board-toolbar {
  display: flex;
  gap: 12px;
  align-items: stretch;
  justify-content: space-between;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.status-card {
  flex: 1 1 380px;
  min-height: 84px;
  border-radius: 20px;
  padding: 14px 16px;
  background:
    linear-gradient(140deg, rgba(255, 255, 255, 0.88), rgba(255, 247, 231, 0.84)),
    radial-gradient(circle at top right, rgba(255, 190, 207, 0.32), transparent 38%);
}

.status-line {
  margin: 0;
  line-height: 1.55;
}

.toolbar-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: flex-start;
}

button {
  border: none;
  border-radius: 999px;
  padding: 11px 18px;
  font-family: inherit;
  font-weight: 900;
  letter-spacing: 0.45px;
  cursor: pointer;
  color: #28433d;
  background: linear-gradient(135deg, #b7f3d0, #ffd9bb);
  box-shadow: 0 12px 22px rgba(108, 151, 122, 0.18);
}

button:hover {
  transform: translateY(-1px);
}

button.secondary {
  color: #5b4769;
  background: linear-gradient(135deg, #f6daff, #ffeef7);
}

button.soft {
  color: #6a5a38;
  background: linear-gradient(135deg, #fff7c7, #fff0dc);
}

select {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(139, 185, 204, 0.42);
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  font: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

select:focus {
  outline: 2px solid rgba(133, 226, 179, 0.55);
  outline-offset: 2px;
}

.meta-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.meta-chip {
  border-radius: 18px;
  padding: 12px 14px;
}

.meta-chip strong {
  font-size: 1.05rem;
}

.board-frame {
  border-radius: 26px;
  padding: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(247, 255, 252, 0.82)),
    radial-gradient(circle at top left, rgba(255, 216, 167, 0.3), transparent 32%);
}

.canvas-wrap {
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid rgba(150, 196, 211, 0.44);
  background: linear-gradient(180deg, #dff9ff, #fff4dd);
}

canvas {
  display: block;
  width: min(100%, 920px);
  height: auto;
  max-width: 100%;
}

.board-bottom {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  margin-top: 12px;
}

.legend-card {
  border-radius: 20px;
  padding: 14px 16px;
}

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

.legend-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  font-size: 0.84rem;
  font-weight: 700;
}

kbd {
  border-radius: 7px;
  padding: 2px 7px;
  background: rgba(255, 214, 221, 0.78);
  border: 1px solid rgba(255, 165, 186, 0.5);
  font-size: 0.74rem;
}

.hint {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.55;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.panel-block {
  border-radius: 22px;
  padding: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 250, 242, 0.84)),
    radial-gradient(circle at top right, rgba(199, 255, 230, 0.3), transparent 36%);
}

.panel-block h2 {
  margin: 0 0 10px;
  font-size: 1.02rem;
}

.panel-block p {
  margin: 10px 0 0;
  line-height: 1.55;
}

.field-label {
  display: block;
  margin: 12px 0 6px;
  color: var(--ink-soft);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.85px;
  text-transform: uppercase;
}

.color-track {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.unlock-chip {
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(139, 185, 204, 0.34);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.35;
}

.unlock-chip.is-active {
  background: linear-gradient(135deg, #c8f7d7, #fff0c7);
  border-color: rgba(92, 154, 116, 0.4);
}

.unlock-chip.is-locked {
  color: var(--ink-soft);
  background: rgba(245, 246, 250, 0.88);
  border-style: dashed;
}

.helper-list {
  display: grid;
  gap: 10px;
}

.helper-chip {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
}

.helper-chip strong {
  display: block;
  margin-bottom: 4px;
}

.helper-chip p {
  margin: 0;
  color: var(--ink-soft);
}

.helper-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: inline-block;
  position: relative;
}

.helper-hop {
  background: linear-gradient(135deg, #fff0a8, #ffd3bb);
}

.helper-hop::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 8px;
  width: 20px;
  height: 24px;
  border-radius: 12px 12px 10px 10px;
  border: 3px solid #5d715d;
  border-bottom-width: 5px;
}

.helper-cute {
  background: linear-gradient(135deg, #c6f6db, #e7fff0);
}

.helper-cute::before,
.helper-heart::before {
  content: "";
  position: absolute;
  inset: 11px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.78);
}

.helper-cute::after {
  content: "";
  position: absolute;
  left: 15px;
  top: 15px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #85e2b3;
  box-shadow: 10px 0 0 #85e2b3;
}

.helper-heart {
  background: linear-gradient(135deg, #ffd5e6, #ffeef6);
}

.helper-heart::after {
  content: "";
  position: absolute;
  left: 14px;
  top: 12px;
  width: 16px;
  height: 16px;
  background: #ff8fb4;
  transform: rotate(45deg);
  border-radius: 4px;
  box-shadow:
    -7px 0 0 #ff8fb4,
    0 -7px 0 #ff8fb4;
}

.ad-zone {
  width: min(1240px, 94vw);
  margin: 0 auto 22px;
  padding: 14px;
  border-radius: 20px;
  background: var(--panel-strong);
}

.ad-zone ins.adsbygoogle {
  width: 100%;
  min-height: 90px;
}

.overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 14px;
  background: rgba(93, 131, 156, 0.24);
  backdrop-filter: blur(6px);
  z-index: 10;
}

.overlay.hidden {
  display: none;
}

.panel {
  width: min(92vw, 560px);
  padding: 24px;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(255, 247, 239, 0.94)),
    radial-gradient(circle at top right, rgba(255, 199, 215, 0.36), transparent 34%);
  box-shadow: 0 28px 60px rgba(90, 125, 156, 0.22);
}

.overlay-tag {
  margin: 0 0 8px;
  color: var(--mint-deep);
  text-transform: uppercase;
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 1px;
}

.panel h2 {
  margin: 0 0 12px;
  font-size: 1.9rem;
}

.panel p {
  margin: 0 0 12px;
  line-height: 1.6;
}

.overlay-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.hidden {
  display: none;
}

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

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

@media (max-width: 760px) {
  .game-shell {
    width: 96vw;
    padding: 14px;
    margin-top: 12px;
  }

  .board-bottom,
  .meta-row {
    grid-template-columns: 1fr;
  }

  .toolbar-actions {
    width: 100%;
  }

  .toolbar-actions button {
    flex: 1 1 150px;
  }

  .panel {
    padding: 20px;
  }
}
