:root {
  --bg: #fff8ee;
  --card: #ffffff;
  --ink: #2b2118;
  --muted: #7a6a5a;
  --line: #f0e2cf;
  --cat: #e8590c;
  --cat-soft: #ffe8d6;
  --dog: #2563eb;
  --dog-soft: #dde8ff;
  --gold: #f5b301;
  --shadow: 0 6px 0 rgba(43, 33, 24, .12);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1b1510;
    --card: #261e17;
    --ink: #f6ece0;
    --muted: #b8a692;
    --line: #3a2e23;
    --cat-soft: #3d2312;
    --dog-soft: #172447;
    --shadow: 0 6px 0 rgba(0, 0, 0, .35);
  }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 Nunito, system-ui, sans-serif;
}
a { color: inherit; }
h1, h2, .brand, .chest-amt, .vs, .timer { font-family: "Baloo 2", Nunito, sans-serif; }
h2 { font-size: 1.7rem; margin: 0 0 .6rem; line-height: 1.2; }
main { max-width: 1040px; margin: 0 auto; padding: 0 16px; }

.top {
  max-width: 1040px; margin: 0 auto; padding: 14px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; font-size: 1.5rem; font-weight: 800; }
.brand img { width: 36px; height: 36px; border-radius: 50%; }
nav { display: flex; align-items: center; gap: 14px; font-weight: 700; }
nav a { text-decoration: none; color: var(--muted); }
nav a:hover { color: var(--ink); }
.lang {
  border: 2px solid var(--line); background: var(--card); color: var(--ink);
  border-radius: 999px; padding: 4px 12px; font: inherit; cursor: pointer;
}

.hero { position: relative; border-radius: 24px; overflow: hidden; box-shadow: var(--shadow); }
.hero-art { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.board {
  position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%);
  width: min(560px, calc(100% - 32px));
  background: rgba(255, 252, 246, .94); color: #2b2118;
  border-radius: 20px; padding: 14px 18px; box-shadow: 0 8px 30px rgba(0, 0, 0, .25);
}
.board-top { display: flex; justify-content: space-between; align-items: center; }
.pill { background: #2b2118; color: #fff; border-radius: 999px; padding: 2px 12px; font-weight: 800; font-size: .85rem; }
.timer { font-size: 1.4rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.chest { display: flex; align-items: baseline; justify-content: center; gap: 10px; margin: 2px 0 8px; }
.chest-label { color: #7a6a5a; font-weight: 800; }
.chest-amt { font-size: 2.2rem; font-weight: 800; color: #b07900; }
.tug { display: flex; height: 34px; border-radius: 999px; overflow: hidden; border: 3px solid #2b2118; }
.tug > div { display: flex; align-items: center; color: #fff; font-weight: 800; transition: width .8s ease; min-width: 0; }
.tug-cats { width: 50%; background: var(--cat); justify-content: flex-start; padding-left: 12px; }
.tug-dogs { width: 50%; background: var(--dog); justify-content: flex-end; padding-right: 12px; }
.stream { margin: 8px 0 0; text-align: center; font-weight: 800; font-size: .9rem; border-radius: 12px; padding: 6px 10px; }
.stream.cats { background: #ffe8d6; color: #a63d00; }
.stream.dogs { background: #dde8ff; color: #1d4ed8; }
.tug-note { margin: 6px 0 0; font-size: .82rem; color: #7a6a5a; text-align: center; }

.sides { display: grid; grid-template-columns: 1fr auto 1fr; gap: 16px; align-items: center; margin: 28px 0; }
.side {
  background: var(--card); border: 3px solid var(--line); border-radius: 22px; padding: 20px;
  text-align: center; box-shadow: var(--shadow);
}
.side.cats { border-color: var(--cat); background: linear-gradient(var(--cat-soft), var(--card) 45%); }
.side.dogs { border-color: var(--dog); background: linear-gradient(var(--dog-soft), var(--card) 45%); }
.side > img { width: 96px; height: 96px; border-radius: 50%; margin-top: -4px; }
.side h2 small { font-size: 1rem; color: var(--muted); }
.side dl { margin: 8px 0 16px; }
.side dl div { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.side dt { color: var(--muted); }
.side dd { margin: 0; }
.vs { font-size: 2.6rem; font-weight: 800; color: var(--gold); text-shadow: 0 3px 0 #2b2118; }
.btn {
  display: inline-block; border: 0; border-radius: 14px; padding: 11px 20px; cursor: pointer;
  font: 800 1rem Nunito, sans-serif; color: #fff; text-decoration: none; background: var(--ink);
  box-shadow: 0 4px 0 rgba(0, 0, 0, .25);
}
.btn:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(0, 0, 0, .25); }
.cats .btn { background: var(--cat); }
.dogs .btn { background: var(--dog); }
.btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }
.addr {
  display: block; margin: 10px auto 0; border: 0; background: none; color: var(--muted);
  font: .8rem ui-monospace, monospace; cursor: pointer; max-width: 100%; overflow-wrap: anywhere;
}

.how, .lookup, .rules {
  background: var(--card); border: 3px solid var(--line); border-radius: 22px; padding: 22px; margin: 0 0 24px;
}
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; counter-reset: s; }
.steps li { background: var(--bg); border-radius: 16px; padding: 14px; counter-increment: s; }
.steps li::before {
  content: counter(s); display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  background: var(--gold); color: #2b2118; font-weight: 800; margin-bottom: 6px;
}
.steps b { display: block; margin-bottom: 4px; }
.steps span { color: var(--muted); }
.armies { display: block; width: 100%; border-radius: 16px; margin-top: 16px; }

.lookup p { color: var(--muted); margin-top: 0; }
.lookup form { display: flex; gap: 10px; }
.lookup input {
  flex: 1; min-width: 0; border: 2px solid var(--line); border-radius: 14px; padding: 10px 14px;
  font: 1rem ui-monospace, monospace; background: var(--bg); color: var(--ink);
}
.look-out { margin-top: 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.look-out div { background: var(--bg); border-radius: 14px; padding: 12px 14px; }
.look-out .err { grid-column: 1 / -1; color: var(--cat); }

.rules ul { margin: 0; padding-left: 20px; }
.rules li { margin: 6px 0; }
.rules li:last-child { font-weight: 800; }

footer { max-width: 1040px; margin: 0 auto; padding: 8px 16px 40px; text-align: center; font-size: .85rem; }
footer p { overflow-wrap: anywhere; }
.muted { color: var(--muted); }

@media (max-width: 760px) {
  nav a { display: none; }
  .hero-art { aspect-ratio: 4 / 3; }
  .board { position: static; transform: none; width: auto; border-radius: 0; box-shadow: none; }
  .chest-amt { font-size: 1.8rem; }
  .sides { grid-template-columns: 1fr; }
  .vs { text-align: center; font-size: 2rem; margin: -6px 0; }
  .steps { grid-template-columns: 1fr; }
  .look-out { grid-template-columns: 1fr; }
}
