/* antdefeater.com - Ant Defeater. Light, sunny, phone first */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: ui-rounded, "SF Pro Rounded", "Nunito", "Varela Round", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  color: #2b2614;
  background:
    radial-gradient(120% 50% at 50% 0%, #fff4c9 0%, transparent 70%),
    linear-gradient(180deg, #fff8df 0%, #f3f6dc 45%, #e4efc6 100%);
  background-attachment: fixed;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}
button, input { font: inherit; }
.app[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.app {
  position: relative; display: flex; flex-direction: column;
  min-height: 100vh; min-height: 100svh; max-width: 640px; margin: 0 auto;
  padding: max(8px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
}
.top { text-align: center; padding: 0 40px; }
.logo-h { margin: 0; line-height: 0; }
.logo { width: min(100%, 420px); height: auto; overflow: visible; }
.lg-word { font-family: Impact, "Haettenschweiler", "Anton", "Arial Narrow Bold", "Roboto Condensed", "Arial Black", "Helvetica Neue", Arial, sans-serif; font-weight: 900; font-size: 128px; letter-spacing: 0; }
.lg-sm { font-size: 46px; letter-spacing: .06em; }
.logo-burst { transform-origin: 320px 90px; animation: burst 7s linear infinite; }
@keyframes burst { to { transform: rotate(360deg); } }
.lg-ant { animation: antbob 2.4s ease-in-out infinite; transform-box: fill-box; }
.logo { animation: logoIn .7s cubic-bezier(.2,1.5,.4,1) both; }
@keyframes logoIn { from { transform: scale(.6) rotate(-4deg); opacity: 0; } }
@keyframes antbob { 50% { translate: 0 -3px; } }
.tagline { margin: 2px 0 0; font-size: clamp(.84rem, 3.6vw, 1.12rem); white-space: nowrap; font-weight: 900; color: #3d4a1f; letter-spacing: .01em; }

/* ---------- the Ant Defeater's stage ---------- */
.stage {
  position: relative; margin: 8px auto 0; width: min(100%, 560px);
  height: clamp(250px, 53svh, 460px);
  border-radius: 26px; overflow: hidden;
  border: 3px solid #3d4a1f;
  background: #8fd36a;
  box-shadow: 0 7px 0 rgba(61, 74, 31, .22);
}
#heroCv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: pointer; }
.bubble {
  position: absolute; z-index: 5; left: 10px; top: 10px; width: calc(57% - 14px);
  overflow: visible;
  margin: 0; padding: 8px 11px;
  background: #fffdf3; color: #2b2614; border: 3px solid #2b2614; border-radius: 16px;
  font-weight: 800; font-size: clamp(.78rem, 3.3vw, .98rem); line-height: 1.26;
  box-shadow: 0 4px 0 rgba(43, 38, 20, .2);
  opacity: 0; transform: scale(.9); transform-origin: 70% 100%; transition: opacity .2s, transform .25s cubic-bezier(.2,1.5,.4,1);
}
.bubble.show { opacity: 1; transform: scale(1); }
.bubble::after { content: ""; position: absolute; right: 30%; bottom: -15px; border: 9px solid transparent; border-top: 14px solid #2b2614; border-bottom: 0; }
.bubble::before { content: ""; position: absolute; right: calc(30% + 3px); bottom: -9px; z-index: 1; border: 6px solid transparent; border-top: 10px solid #fffdf3; border-bottom: 0; }
.wisdom-row { display: flex; justify-content: center; margin-top: 10px; }
.more-wisdom { min-height: 40px; padding: .2em 1.1em; font-size: .9rem; background: #fffdf3; color: #3d4a1f; border-color: #3d4a1f; box-shadow: 0 4px 0 #3d4a1f; }
.more-wisdom:hover { background: #fff; }
.more-wisdom:active { box-shadow: 0 1px 0 #3d4a1f; }
.personal { margin: 8px 0 0; text-align: center; font-size: .82rem; font-weight: 800; color: #5a3a10; }
.personal[hidden] { display: none; }

.play-row { display: flex; justify-content: center; gap: 8px; margin-top: 10px; }
.btn {
  font-weight: 900; font-size: .95rem; color: #fff; background: #4a5d23;
  border: 3px solid #2c3618; border-radius: 999px; min-height: 48px; padding: .5em .8em;
  box-shadow: 0 5px 0 #2c3618; cursor: pointer; touch-action: manipulation;
  transition: transform .06s, box-shadow .06s, background .15s;
}
.btn:hover { background: #566b29; }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 #2c3618; }
.btn:focus-visible { outline: 3px dashed #2c3618; outline-offset: 3px; }
.play-btn { background: #e8501c; border-color: #7a1f05; box-shadow: 0 5px 0 #7a1f05; }
.play-btn:hover { background: #f2622c; }
.play-btn:active { box-shadow: 0 1px 0 #7a1f05; }
.board-btn { background: #fffdf3; color: #2c3618; }
.board-btn:hover { background: #fff; }
.play-row .btn { flex: 1 1 0; white-space: nowrap; }
.main-row { width: min(100%, 520px); margin-left: auto; margin-right: auto; }
.main-row .btn { min-height: 54px; font-size: clamp(.86rem, 3.9vw, 1.08rem); }
.main-row .play-btn { flex: 1.25 1 0; }

.world { margin: 12px 0 0; text-align: center; font-size: .8rem; font-weight: 750; line-height: 1.45; color: #4d4528; }
.world[hidden] { display: none; }
.world b { font-weight: 900; color: #5a3a10; }
.foot { text-align: center; color: #4d4528; padding: 10px 2px 0; margin-top: auto; }
.foot p { margin: 0 auto; max-width: 64ch; }
.legal { font-size: .74rem; font-weight: 650; line-height: 1.5; }
.legal-1, .legal-2 { display: block; }
.legal .links { white-space: nowrap; }
.legal-sep { display: none; }
.legal a { color: #5a3a10; font-weight: 800; }
.legal-1 a { display: inline-block; padding: 10px 2px; margin: -8px 0; text-decoration: underline dotted rgba(90,58,16,.55); text-underline-offset: 3px; }
.company { position: relative; display: inline-block; text-decoration: underline dotted rgba(90,58,16,.55); text-underline-offset: 3px; }
.co-ant { position: absolute; left: 0; top: -15px; width: 30px; height: 12px; opacity: 0; pointer-events: none; }
.company:active .co-ant, .company.fly .co-ant { animation: antZip .6s linear; }
@keyframes antZip { 0% { opacity: 1; transform: translateX(0); } 80% { opacity: 1; } 100% { opacity: 0; transform: translateX(200px); } }
.company:focus-visible { outline: 2px dashed #5a3a10; outline-offset: 2px; border-radius: 4px; }

.sound-btn {
  position: absolute; z-index: 7; top: max(8px, env(safe-area-inset-top)); right: max(8px, env(safe-area-inset-right));
  width: 44px; height: 44px; min-height: 44px; padding: 0; display: grid; place-items: center;
}
.sound-btn svg { width: 24px; height: 24px; }
.sound-btn .snd-off { display: none; }
.sound-btn[aria-pressed="false"] { background: #eef0dc; color: #2c3618; }
.sound-btn[aria-pressed="false"] .snd-on { display: none; }
.sound-btn[aria-pressed="false"] .snd-off { display: inline; }
.sound-btn[data-level="low"] .snd-hi { display: none; }
@media (min-width: 800px) { .sound-btn { right: max(8px, calc((100% - 760px) / 2 + 8px)); } }
body:has(#home[hidden]):has(#game[hidden]) .sound-btn { display: none; }
.sound-btn { touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.sound-btn.holding { box-shadow: 0 0 0 3px #ffb703, 0 3px 0 #2b2614; }
.vol-pop { position: fixed; z-index: 40; width: 46px; padding: 6px 0 10px; display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: rgba(255,254,248,.97); border: 2px solid #2b2614; border-radius: 14px; box-shadow: 0 4px 0 #2b2614; touch-action: none; -webkit-user-select: none; user-select: none; }
.vol-pop[hidden] { display: none; }
.vol-pct { font-size: .72rem; font-weight: 900; color: #2b2614; line-height: 1; }
.vol-track { position: relative; width: 12px; height: 128px; border-radius: 999px; background: #d9d6c3; border: 2px solid #2b2614; cursor: ns-resize; }
.vol-track i { position: absolute; left: 0; right: 0; bottom: 0; height: 80%; border-radius: 999px; background: linear-gradient(0deg, #4a5d23, #e8501c); }
.vol-track span { position: absolute; left: 50%; bottom: 80%; width: 24px; height: 24px; margin: 0 0 -12px -12px; border-radius: 50%; background: #fffdf3; border: 3px solid #2b2614; box-shadow: 0 2px 0 #2b2614; }

/* ---------- game ---------- */
html.playing, html.playing body { overflow: hidden; overscroll-behavior: none; }
html.playing .sound-btn { position: fixed; z-index: 30; width: 38px; height: 38px; min-height: 38px; top: max(6px, env(safe-area-inset-top)); right: calc(max(6px, env(safe-area-inset-right)) + 88px); background: rgba(255,253,243,.92); color: #2b2614; border: 2px solid #2b2614; box-shadow: 0 3px 0 #2b2614; }
html.playing .sound-btn svg { width: 20px; height: 20px; }
.game[hidden], .sheet[hidden] { display: none !important; }
.game { position: fixed; inset: 0; z-index: 10; background: #5d9c3f; touch-action: none; user-select: none; -webkit-user-select: none; cursor: crosshair; }
#cv { position: absolute; inset: 0; display: block; touch-action: none; }
.hud {
  position: absolute; z-index: 4; left: max(6px, env(safe-area-inset-left)); right: calc(max(6px, env(safe-area-inset-right)) + 132px); top: max(6px, env(safe-area-inset-top));
  display: flex; align-items: center; gap: 6px; pointer-events: none;
}
.lives { display: flex; gap: 2px; padding: 5px 8px; background: rgba(255,255,255,.82); border: 2px solid rgba(90,50,20,.35); border-radius: 999px; }
.lives svg { width: 20px; height: 18px; display: block; }
.lives .off { opacity: .28; filter: grayscale(1); }
.lives .new { animation: pop .45s cubic-bezier(.2,1.6,.4,1); }
.hud-mid { flex: 1; text-align: center; line-height: 1; color: #fff; text-shadow: 0 2px 0 rgba(30,20,5,.7), 0 0 8px rgba(0,0,0,.35); }
.hud-mid b { display: block; font-size: 1.7rem; font-weight: 900; }
.hud-mid span { font-size: .78rem; font-weight: 800; }
.hud-left { position: relative; }
.hud-tags { position: absolute; left: 0; top: calc(100% + 4px); display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.rage { position: relative; width: min(150px, 36vw); height: 14px; margin: 5px auto 0; border-radius: 999px; background: rgba(30,20,10,.45); border: 2px solid rgba(255,255,255,.85); overflow: hidden; }
.rage i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: linear-gradient(90deg, #ffb703, #ff5a1a, #d62828); border-radius: 999px; transition: width .15s; }
.rage em { position: absolute; inset: 0; font-style: normal; font-size: 9px; line-height: 10px; font-weight: 900; letter-spacing: .14em; color: #fff; text-shadow: 0 1px 0 rgba(0,0,0,.6); }
.rage.full { animation: ragepulse .35s ease-in-out infinite; }
@keyframes ragepulse { 50% { box-shadow: 0 0 0 3px rgba(255,90,26,.7); } }
.game-ctrls { position: absolute; z-index: 6; top: max(6px, env(safe-area-inset-top)); right: max(6px, env(safe-area-inset-right)); display: flex; gap: 6px; }
.ctrl-btn { width: 38px; height: 38px; min-height: 38px; padding: 0; display: grid; place-items: center; color: #2b2614; background: rgba(255,254,248,.92); border: 2px solid #2b2614; box-shadow: 0 3px 0 #2b2614; }
.ctrl-btn:hover { background: #fff; }
.ctrl-btn:active { transform: translateY(3px); box-shadow: 0 0 0 #2b2614; }
.ctrl-btn svg { width: 20px; height: 20px; }
.game.paused .combo.on { animation-play-state: paused; }
.sheet-small { z-index: 22; -webkit-user-select: none; user-select: none; touch-action: manipulation; }
.mini-card { width: min(320px, 100%); padding: 14px 14px 16px; }
.mini-card h2 { font-size: 1.5rem; color: #2b2614; }
.mini-text { margin: 4px 0 12px; font-weight: 800; color: #4d4528; }
.btn.wide { width: 100%; min-height: 52px; font-size: 1.1rem; }
.leave-btn { background: #fffdf3; color: #2b2614; border-color: #2b2614; box-shadow: 0 5px 0 #2b2614; }
.leave-btn:hover { background: #fff; }
.leave-btn:active { box-shadow: 0 1px 0 #2b2614; }
.combo { font-weight: 900; color: #fff; background: #ff7a1a; border: 2px solid #8a3000; border-radius: 999px; padding: 1px 8px; font-size: .9rem; visibility: hidden; }
.combo.on { visibility: visible; animation: wobble .4s ease-in-out infinite; }
@keyframes wobble { 25% { transform: rotate(-5deg) scale(1.06); } 75% { transform: rotate(5deg) scale(1.1); } }
.power { font-weight: 900; font-size: .74rem; color: #2b2614; background: #ffe066; border: 2px solid #8a6400; border-radius: 999px; padding: 1px 7px; visibility: hidden; white-space: nowrap; }
.power.on { visibility: visible; }
.banner {
  position: absolute; z-index: 4; left: 50%; top: calc(max(6px, env(safe-area-inset-top)) + 84px);
  transform: translate(-50%, -12px); opacity: 0; pointer-events: none; text-align: center;
  background: rgba(255,254,248,.92); border: 3px solid #2b2614; border-radius: 16px; padding: 4px 14px 6px; white-space: nowrap;
  transition: opacity .25s, transform .35s cubic-bezier(.2,1.5,.4,1);
}
.banner.show { opacity: 1; transform: translate(-50%, 0); }
.banner strong { display: block; font-size: 1.1rem; color: #d62828; letter-spacing: .02em; }
.banner span { display: block; font-weight: 800; font-size: .8rem; }
.hint {
  position: absolute; z-index: 4; left: 50%; top: calc(max(6px, env(safe-area-inset-top)) + 150px); transform: translateX(-50%);
  display: flex; align-items: center; gap: 8px; pointer-events: none; width: max-content; max-width: calc(100% - 24px); text-align: center; line-height: 1.2;
  background: rgba(255,254,248,.94); border: 2.5px solid #2b2614; border-radius: 18px; padding: 5px 12px;
  font-weight: 900; font-size: .82rem; color: #2b2614; transition: opacity .4s;
}
.hint.gone { opacity: 0; }
.hint .finger { font-size: 1.05rem; animation: fing 1.1s ease-in-out infinite; }
@keyframes fing { 0%, 100% { transform: translateY(-6px); } 50% { transform: translateY(6px); } }
.flash { position: absolute; inset: 0; z-index: 3; pointer-events: none; opacity: 0; background: radial-gradient(ellipse at center, transparent 40%, rgba(255,40,60,.55)); transition: opacity .35s; }
.flash.on { opacity: 1; transition: none; }
.flash.hot { background: radial-gradient(ellipse at center, rgba(255,120,0,.1) 30%, rgba(255,60,0,.6)); }
.flash.gold { background: radial-gradient(ellipse at center, transparent 40%, rgba(255,210,60,.5)); }

/* ---------- sheets ---------- */
.sheet { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 16px 12px; background: rgba(30, 34, 12, .55); backdrop-filter: blur(3px); }
.card {
  width: min(440px, 100%); max-height: min(94svh, 760px); overflow: auto;
  background: linear-gradient(180deg, #fffdf3, #fff6d8); border: 3px solid #2b2614; border-radius: 24px;
  padding: 16px 14px 12px; text-align: center; box-shadow: 0 10px 0 rgba(40, 20, 10, .3);
  animation: cardIn .35s cubic-bezier(.2,1.4,.4,1);
}
@keyframes cardIn { from { transform: translateY(20px) scale(.95); opacity: 0; } }
.card h2 { margin: 0; }
.over-kicker { margin: 0; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; font-size: .74rem; color: #e8501c; }
.rank { margin: 2px 0; font-size: 1.6rem; color: #5a3a10; text-shadow: 0 3px 0 #ffd36b; }
.bigscore { margin: 0; font-size: 2.6rem; font-weight: 900; line-height: 1; color: #2b2614; }
.metres { margin: 2px 0 0; font-weight: 850; color: #4d4528; }
.funny { margin: 6px 0 0; font-weight: 850; font-style: italic; color: #7a1f05; }
.newbest { display: inline-block; margin: 6px 0 0; background: #ffe066; color: #6a4a00; font-weight: 900; border-radius: 999px; padding: 2px 12px; border: 2px solid #8a6400; animation: pop .4s cubic-bezier(.2,1.6,.4,1); }
@keyframes pop { from { transform: scale(.4); } }
.newbest[hidden], .nudge[hidden], .name-form[hidden], .board-empty[hidden] { display: none !important; }
.extra, .nudge { margin: 6px 0 0; font-weight: 750; }
.nudge { color: #c0541a; font-weight: 850; }
.name-form { margin-top: 10px; }
.name-form label { display: block; font-weight: 900; margin-bottom: 6px; }
.name-row { display: flex; gap: 8px; }
.name-row input { flex: 1; min-width: 0; min-height: 48px; border: 3px solid #2c3618; border-radius: 999px; padding: 0 14px; background: #fff; color: #2b2614; font-weight: 750; }
.name-row input:focus-visible { outline: 3px dashed #2c3618; outline-offset: 2px; }
.text-back { margin-top: 6px; background: none; border: 0; color: #5a3a10; font-weight: 800; text-decoration: underline; text-underline-offset: 3px; min-height: 44px; cursor: pointer; }
.tabs { display: flex; gap: 8px; justify-content: center; margin: 10px 0; }
.tab { min-height: 42px; padding: .3em 1em; border-radius: 999px; border: 3px solid #2c3618; background: #fff; color: #2c3618; font-weight: 900; box-shadow: 0 4px 0 #2c3618; cursor: pointer; }
.tab:active { transform: translateY(3px); box-shadow: 0 1px 0 #2c3618; }
.tab[aria-selected="true"] { background: #4a5d23; color: #fff; }
.board-list { list-style: none; margin: 0; padding: 0; text-align: left; }
.board-list li { display: grid; grid-template-columns: 2rem 1fr auto auto; gap: 8px; align-items: center; padding: 7px 4px; border-bottom: 1px dashed rgba(90, 50, 20, .25); font-weight: 750; }
.board-list li:nth-child(1) span:first-child { color: #c98a00; }
.board-list .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-list .mt { font-size: .78rem; color: #4d4528; }
.board-list .sc { font-weight: 900; color: #2c3618; }
.board-list .you { background: #fff4cc; border-radius: 10px; }
.board-empty { font-weight: 750; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 25; overflow: hidden; }
.confetti i { position: absolute; top: -12px; width: 10px; height: 14px; border-radius: 2px; animation: fall 1.6s ease-in forwards; }
@keyframes fall { to { transform: translateY(105vh) rotate(260deg); } }

@media (min-width: 800px) {
  .app { max-width: 760px; padding-top: 16px; }
  .stage { width: min(100%, 620px); height: clamp(300px, 48vh, 400px); }
  .bubble { font-size: 1.04rem; padding: 10px 14px; }
  .logo { width: 470px; }
  .legal-1, .legal-2, .legal-sep { display: inline; }
  .hud-mid b { font-size: 2rem; }
}
@media (max-height: 700px) and (max-width: 500px) { .stage { height: 232px; } .logo { width: min(100%, 330px); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
/* ---------- legal pages ---------- */
html.doc-html, .doc-html body { height: auto; }
.doc { max-width: 760px; margin: 0 auto; padding: 16px 14px 28px; }
.doc-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.doc-brand { margin: 0; font-size: 1.8rem; font-weight: 900; color: #c8401a; }
.doc-brand a { color: inherit; text-decoration: none; }
.doc-brand span { color: #2c3618; }
a.btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.doc-back { font-size: .95rem; }
.doc-card {
  margin-top: 14px; background: rgba(255,254,248,.92);
  border: 3px solid #1d3c28; border-radius: 22px; padding: 16px 16px 8px;
}
.doc h1 { margin: 0 0 4px; font-size: 1.8rem; }
.doc h2 { margin: 1.2em 0 .3em; font-size: 1.2rem; }
.doc h3 { margin: .8em 0 .2em; font-size: 1.02rem; }
.doc p, .doc li { line-height: 1.45; }
.doc .updated, .doc .lead { color: #2c3618; }
.doc .quip { font-weight: 800; color: #0e6294; margin-bottom: 0; }
.doc a:not(.btn) { color: #2c3618; font-weight: 750; }
.doc .summary, .doc .company-box { background: #f3fbee; border-radius: 14px; padding: 8px 12px; }
.doc .toc ol { margin: 6px 0 0; padding-left: 1.2em; }
.doc table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 6px 8px; border-bottom: 1px solid rgba(20,92,50,.2); }
.doc-end { text-align: center; margin: 16px 0; }
.doc-foot { text-align: center; font-size: .82rem; font-weight: 700; color: #3d6a40; }
.doc-foot a { color: #2c3618; font-weight: 800; }
