:root {
  --ink: #12324a; --sea: #2f8fd8; --sky: #e9f6ff; --sand: #ffe3a8; --pink: #ff7aa8;
  --green: #2fbf71; --yellow: #ffd23f; --red: #ff5a5f; --card: #ffffff;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; font-family: Fredoka, system-ui, sans-serif; color: var(--ink);
  background: linear-gradient(180deg, #bfe6ff 0%, #e9f6ff 40%, #fff6df 100%) fixed; background-color: var(--sky);
}
a { color: var(--sea); }
h1, h2, h3 { margin: 0; line-height: 1.1; }

.nav {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 24px; background: rgba(255,255,255,.85); backdrop-filter: blur(8px); border-bottom: 3px solid var(--ink);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 22px; color: var(--ink); text-decoration: none; }
.brand img { width: 34px; height: 34px; }
.nav nav { display: flex; gap: 6px; flex-wrap: wrap; }
.nav nav a { color: var(--ink); text-decoration: none; font-weight: 600; padding: 6px 12px; border-radius: 999px; }
.nav nav a:hover { background: var(--sand); }

main { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.hero { display: grid; grid-template-columns: minmax(0,1.25fr) minmax(0,1fr); gap: 32px; align-items: center; padding: 48px 0 32px; }
.pill { display: inline-block; background: #fff; border: 2px solid var(--ink); border-radius: 999px; padding: 4px 14px; font-weight: 600; font-size: 14px; }
.hero h1 { font-size: clamp(34px, 5vw, 58px); margin: 16px 0 14px; }
.hero h1 em { font-style: normal; color: var(--sea); }
.lead { font-size: 19px; line-height: 1.5; margin: 0 0 22px; }
.cta { display: flex; gap: 10px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; font: 600 16px Fredoka, sans-serif;
  color: #fff; background: var(--sea); border: 3px solid var(--ink); border-radius: 14px; padding: 10px 18px; text-decoration: none;
  box-shadow: 0 4px 0 var(--ink); transition: transform .08s, box-shadow .08s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.big { font-size: 20px; padding: 13px 26px; background: var(--green); }
.btn.ghost { background: #fff; color: var(--ink); }
.btn.mini { font-size: 14px; padding: 5px 12px; box-shadow: 0 3px 0 var(--ink); }
.btn.buy { background: var(--pink); width: 100%; margin-top: 12px; }

.cards { display: grid; grid-template-columns: minmax(0,1fr); gap: 16px; min-width: 0; }
.hero-text { min-width: 0; }
.card { background: var(--card); border: 3px solid var(--ink); border-radius: 22px; padding: 20px 22px; box-shadow: 0 6px 0 var(--ink); }
.card .label { font-weight: 600; font-size: 15px; opacity: .75; }
.card.donated { background: linear-gradient(135deg, #fff 0%, #e6fff1 100%); }
.card.donated .value { font-size: 46px; font-weight: 700; color: var(--green); margin: 4px 0; }
.sub { font-size: 14px; opacity: .8; margin-top: 6px; word-break: break-all; }
.small-link { display: inline-block; margin-top: 8px; font-weight: 600; font-size: 14px; }
.ca-row { display: flex; gap: 10px; align-items: center; margin-top: 8px; }
.ca-row code { flex: 1; min-width: 0; background: var(--sky); border: 2px dashed var(--ink); border-radius: 10px; padding: 9px 10px; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.play { padding: 10px 0 30px; scroll-margin-top: 70px; }
#game {
  position: relative; height: min(76vh, 680px); min-height: 440px; border: 4px solid var(--ink); border-radius: 26px; overflow: hidden;
  box-shadow: 0 8px 0 var(--ink); background: #8fd3ff; touch-action: none; user-select: none; -webkit-user-select: none;
}
#game:fullscreen { border: 0; border-radius: 0; height: 100vh; }
#game.fake-fs { position: fixed; inset: 0; height: 100%; z-index: 100; border-radius: 0; border: 0; }
#c { display: block; position: absolute; inset: 0; }
.hud { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; gap: 6px; flex-wrap: wrap; pointer-events: none; }
.chip { background: rgba(255,255,255,.92); border: 2px solid var(--ink); border-radius: 999px; padding: 4px 12px; font-weight: 600; font-size: 15px; }
.chip b { margin-left: 3px; }
.chip.lives b { color: var(--red); letter-spacing: 2px; }
.tools { margin-left: auto; display: flex; gap: 6px; }
.btnchip { pointer-events: auto; cursor: pointer; font-family: inherit; color: var(--ink); }
.toast {
  position: absolute; left: 50%; top: 64px; transform: translate(-50%, -10px); opacity: 0; transition: .25s; pointer-events: none;
  background: var(--ink); color: #fff; font-weight: 600; padding: 8px 16px; border-radius: 999px; white-space: nowrap; font-size: 15px;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.screen { position: absolute; inset: 0; display: grid; grid-template-columns: minmax(0,1fr); place-items: center; background: rgba(18,50,74,.35); padding: 14px; overflow: auto; }
.screen.hidden { display: none; }
.panel { background: #fff; border: 4px solid var(--ink); border-radius: 24px; padding: 22px 24px; max-width: 520px; width: 100%; text-align: center; box-shadow: 0 6px 0 var(--ink); }
.panel h2 { font-size: 34px; margin-bottom: 6px; }
.muted { opacity: .75; }
.small { font-size: 14px; margin-top: 8px; }
.howto { text-align: left; list-style: none; padding: 0; margin: 14px 0 18px; display: grid; gap: 8px; font-size: 15px; }
.howto li { display: flex; gap: 10px; align-items: flex-start; }
.dot { flex: none; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--ink); margin-top: 3px; }
.dot.b { background: var(--sea); } .dot.g { background: var(--green); } .dot.y { background: var(--yellow); } .dot.r { background: var(--red); } .dot.p { background: var(--pink); }
.stats { display: flex; justify-content: center; gap: 30px; margin: 10px 0; }
.stats b { display: block; font-size: 40px; }
.stats span { font-size: 14px; opacity: .75; }
.stats i { font-style: normal; color: var(--green); }
.names { font-size: 14px; line-height: 1.4; margin: 6px 0 12px; }
.submit-row { display: flex; gap: 8px; }
.submit-row input { flex: 1; min-width: 0; width: 100%; font: 500 16px Fredoka, sans-serif; border: 3px solid var(--ink); border-radius: 12px; padding: 8px 12px; color: var(--ink); }
.row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 14px 0 6px; }

.section { padding: 36px 0; scroll-margin-top: 70px; }
.section h2 { font-size: 36px; margin-bottom: 10px; }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 18px; }
.step { background: #fff; border: 3px solid var(--ink); border-radius: 20px; padding: 18px; box-shadow: 0 5px 0 var(--ink); }
.step .num { width: 40px; height: 40px; border-radius: 50%; background: var(--yellow); border: 3px solid var(--ink); display: grid; place-items: center; font-weight: 700; font-size: 20px; margin-bottom: 10px; }
.step h3 { font-size: 19px; margin-bottom: 6px; }
.step p { margin: 0; line-height: 1.45; font-size: 15px; }
.note { background: var(--sand); border: 3px solid var(--ink); border-radius: 18px; padding: 14px 18px; margin-top: 20px; line-height: 1.5; }

.list { display: grid; gap: 10px; margin-top: 14px; }
.don { display: flex; gap: 14px; align-items: center; background: #fff; border: 3px solid var(--ink); border-radius: 16px; padding: 12px 16px; flex-wrap: wrap; }
.don .amt { font-size: 22px; font-weight: 700; color: var(--green); min-width: 110px; }
.don .meta { flex: 1; min-width: 160px; font-size: 15px; }
.empty { background: #fff; border: 3px dashed var(--ink); border-radius: 16px; padding: 18px; text-align: center; opacity: .85; }

.lb { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 8px; max-width: 640px; counter-reset: r; }
.lb li { counter-increment: r; display: flex; align-items: center; gap: 12px; background: #fff; border: 3px solid var(--ink); border-radius: 14px; padding: 10px 14px; font-size: 17px; }
.lb li::before { content: counter(r); width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: 50%; border: 2px solid var(--ink); background: var(--sky); font-weight: 700; }
.lb li:nth-child(1)::before { background: var(--yellow); } .lb li:nth-child(2)::before { background: #e3e8ef; } .lb li:nth-child(3)::before { background: #f3b98a; }
.lb .who { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb .pts { font-weight: 700; }
.lb .sv { font-size: 14px; opacity: .7; }
.lb li.me { background: #e6fff1; }

footer { text-align: center; padding: 30px 20px 40px; font-size: 14px; opacity: .8; }

@media (max-width: 900px) {
  .hero { grid-template-columns: minmax(0,1fr); padding-top: 28px; }
  .steps { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .nav { padding: 8px 12px; flex-direction: column; gap: 4px; }
  .nav nav a { padding: 4px 8px; font-size: 14px; }
  main { padding: 0 16px; }
  .lead { font-size: 17px; }
  .steps { grid-template-columns: 1fr; }
  #game { height: 78vh; min-height: 420px; border-radius: 18px; }
  .chip { font-size: 13px; padding: 3px 9px; }
  .panel { padding: 16px; }
  .panel h2 { font-size: 26px; }
  .howto { font-size: 14px; }
  .card.donated .value { font-size: 38px; }
}
