/* $APE, design A: a storybook canopy. Painted jungle, wooden boards, stone slabs. */
:root {
  --night: #0b1a10;
  --moss: #2f5a2a;
  --wood: #7a4a24;
  --wood-d: #4a2a12;
  --wood-l: #a8743e;
  --cream: #ffe9b0;
  --gold: #f6c945;
  --ink: #1a0f06;
  --stone: #3b3f3a;
  --display: "Lilita One", "Luckiest Guy", system-ui, sans-serif;
  --ui: "Nunito", system-ui, sans-serif;
  --r-common: #4caf50;
  --r-uncommon: #3a8fe0;
  --r-rare: #9b59d0;
  --r-epic: #e6a92a;
  --r-legendary: #e0453a;
  --r-mythic: #f06ab0;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--night); color: var(--cream); font: 800 16px/1.4 var(--ui); overflow-x: hidden; }
img { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
[data-r="common"] { --r: var(--r-common); } [data-r="uncommon"] { --r: var(--r-uncommon); } [data-r="rare"] { --r: var(--r-rare); }
[data-r="epic"] { --r: var(--r-epic); } [data-r="legendary"] { --r: var(--r-legendary); } [data-r="mythic"] { --r: var(--r-mythic); }

/* shared wood + text */
.wood {
  position: relative;
  background:
    repeating-linear-gradient(90deg, #0000 0 38px, #0000001a 38px 40px),
    repeating-linear-gradient(0deg, #ffffff08 0 3px, #0000 3px 9px),
    linear-gradient(180deg, var(--wood-l), var(--wood) 40%, var(--wood-d));
  border: 6px solid var(--wood-d);
  border-radius: 14px;
  box-shadow: inset 0 0 0 3px #c89456aa, inset 0 0 40px #0008, 0 14px 30px #000a;
}
.board {
  display: inline-block; margin: 0; padding: 14px 34px 16px;
  background: url("assets/plank.webp") center/100% 100% no-repeat;
  font: clamp(22px, 2.6vw, 36px)/1 var(--display); color: var(--cream);
  text-shadow: 0 3px 0 var(--ink), 0 0 2px var(--ink);
  -webkit-text-stroke: 1px var(--ink);
  white-space: nowrap;
}
.sec-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 20px; margin-bottom: 18px; }
.sec-head p, .troop header p { margin: 0; font: 900 14px/1.2 var(--ui); letter-spacing: .06em; color: #f3e2b5; text-shadow: 0 2px 4px #000; }

/* ---------- top bar ---------- */
.bar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 14px;
  padding: 8px clamp(12px, 3vw, 40px);
  background: linear-gradient(#0b1a10e6, #0b1a1080 70%, #0b1a1000);
  backdrop-filter: blur(3px);
}
.logo img { height: 60px; width: auto; filter: drop-shadow(0 3px 4px #000c); transition: transform .2s; }
.logo:hover img { transform: rotate(-4deg) scale(1.05); }
.chips { display: flex; gap: 10px; }
.chip, .nextbar, .snd, .mode {
  border: 2px solid #1a0f06; border-radius: 12px;
  background:
    repeating-linear-gradient(0deg, #ffffff07 0 2px, #0000 2px 7px),
    linear-gradient(#6b3f1c, #4a2a12 60%, #3a200c);
  box-shadow: inset 0 1px 0 #c8945688, inset 0 -2px 0 #0006, 0 4px 0 #1a0f06, 0 8px 14px #0008;
}
.chip { display: grid; justify-items: center; min-width: 92px; padding: 5px 14px 6px; }
.chip i { font: 900 10px/1.2 var(--ui); font-style: normal; letter-spacing: .12em; color: var(--gold); }
.chip b { font: 21px/1.05 var(--display); color: var(--cream); text-shadow: 0 2px 0 var(--ink); }
.bump { animation: bump .4s; }
@keyframes bump { 40% { transform: scale(1.25); color: var(--gold); } }
.nextbar { margin-left: auto; display: flex; align-items: center; gap: 10px; padding: 9px 16px; }
.nextbar i { font: 900 11px/1 var(--ui); font-style: normal; letter-spacing: .12em; color: var(--gold); }
.nextbar img { width: 28px; transform: rotate(-20deg); }
.track { width: clamp(80px, 14vw, 200px); height: 14px; border-radius: 99px; background: #1a0f06; box-shadow: inset 0 2px 4px #000; overflow: hidden; padding: 2px; }
.track span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #f6c945, #ffe27a); border-radius: inherit; transition: width .6s; }
.nextbar b { font: 19px/1 var(--display); min-width: 44px; text-align: right; color: var(--cream); text-shadow: 0 2px 0 var(--ink); }
.mode { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 12px; font: 900 12px/1 var(--ui); letter-spacing: .08em; }
.mode i { width: 9px; height: 9px; border-radius: 50%; background: #e8a23c; }
.mode.on i { background: #4caf50; box-shadow: 0 0 8px #4caf50; animation: blink 1.4s infinite; }
@keyframes blink { 50% { opacity: .35; } }
.snd { width: 40px; height: 40px; }
.snd:hover, .chip:hover { filter: brightness(1.12); }

/* ---------- hero ---------- */
.hero { position: relative; min-height: clamp(640px, 60vw, 940px); margin-top: -72px; padding-top: 72px; overflow: hidden; display: flex; align-items: flex-start; }
.hero-art { position: absolute; inset: 0; overflow: hidden; background: var(--night); }
/* the stage is sized like object-fit: cover by shared/motion.js, so the cut-out ape stays glued to the art */
.stage { position: absolute; inset: 0; will-change: transform; }
.stage-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 70% 30%; }
.hero-ape { position: absolute; object-fit: contain; object-position: 50% 0; transform-origin: 86% 3%; animation: hang 3.4s ease-in-out infinite; pointer-events: none; }
@keyframes hang { 0%, 100% { transform: rotate(-2deg); } 50% { transform: rotate(2.5deg); } }
.hero-ape.swing { animation: swing 1.3s cubic-bezier(.3, 1.6, .5, 1), hang 3.4s 1.3s ease-in-out infinite; }
@keyframes swing { 0% { transform: rotate(0); } 25% { transform: rotate(14deg); } 55% { transform: rotate(-9deg); } 80% { transform: rotate(4deg); } }
.hero.snapped .hero-copy .plank { animation: shake .4s; }
.hint {
  position: absolute; z-index: 3; left: 50%; bottom: 7%; translate: -50% 0; margin: 0; display: none;
  font: 16px/1 var(--display); letter-spacing: .08em; color: var(--ink); white-space: nowrap;
  padding: 9px 16px 8px; border-radius: 12px; border: 3px solid var(--ink);
  background: linear-gradient(#ffe45c, #f4c21c); box-shadow: 0 4px 0 var(--ink);
  animation: hint 1.3s ease-in-out infinite;
}
.hint::after { content: " ↓"; }
.hero.layered .hint { display: block; }
.hero.snapped .hint { display: none; }
@keyframes hint { 50% { transform: translateY(7px); } }
.hero::after { content: ""; position: absolute; inset: auto 0 0; height: 22%; background: linear-gradient(#0b1a1000, var(--night)); pointer-events: none; }
.hero-copy { position: relative; z-index: 2; padding: clamp(20px, 3vw, 48px) 0 0 clamp(16px, 7vw, 120px); display: grid; justify-items: center; gap: 14px; width: min(640px, 100%); }
.plank {
  margin: 0 0 6px; width: 100%; aspect-ratio: 1.5; display: grid; place-items: center; text-align: center;
  background: url("assets/plank.webp") center/100% 100% no-repeat;
  filter: drop-shadow(0 16px 20px #000b);
  transform-origin: 50% 0; animation: sway 6s ease-in-out infinite;
}
.plank span {
  font: clamp(48px, 7vw, 104px)/.9 var(--display);
  color: #ffe29a;
  background: linear-gradient(#fff4cf 10%, #f3cf85 55%, #d99a3e);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  -webkit-text-stroke: 1.5px #4a2408;
  filter: drop-shadow(0 2px 0 #8a4f1c) drop-shadow(0 3px 0 #5e3010) drop-shadow(0 3px 0 #3a1d08) drop-shadow(0 8px 8px #000a);
  transform: translateY(-3%) rotate(-2deg);
}
@keyframes sway { 50% { transform: rotate(1.2deg); } 0%, 100% { transform: rotate(-.8deg); } }
.buy {
  width: min(380px, 100%); padding: 16px; text-align: center; text-decoration: none;
  font: clamp(26px, 2.6vw, 34px)/1 var(--display); color: var(--ink);
  background: linear-gradient(#ffe45c, #f4c21c); border: 4px solid var(--ink); border-radius: 18px;
  box-shadow: 0 6px 0 #9a6a07, 0 14px 24px #000a;
  transition: transform .15s, box-shadow .15s;
}
.buy:hover { transform: translateY(-3px) rotate(-1deg); }
.buy:active { transform: translateY(4px); box-shadow: 0 2px 0 #9a6a07; }
.ca {
  display: flex; align-items: center; justify-content: center; gap: 12px; width: min(340px, 100%); padding: 11px 20px;
  background: #1a100aee; border: 3px solid var(--wood); border-radius: 14px; box-shadow: 0 8px 16px #0009;
  font: 800 16px/1 ui-monospace, Menlo, monospace; color: #f3e2b5;
}
.ca svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
.tag { margin: 0; font: 900 clamp(14px, 1.2vw, 17px)/1.3 var(--ui); letter-spacing: .06em; text-align: center; text-shadow: 0 2px 6px #000; }

.sign {
  position: absolute; z-index: 2; display: grid; place-items: center; text-align: center;
  background: url("assets/sign.webp") center/contain no-repeat;
  font: clamp(16px, 1.6vw, 24px)/1 var(--display); color: var(--cream);
  text-shadow: 0 2px 0 var(--ink); -webkit-text-stroke: .6px var(--ink);
  filter: drop-shadow(0 10px 12px #000b);
}
.sign span { position: absolute; left: 8%; right: 8%; top: 41%; bottom: 9%; display: grid; place-items: center; line-height: .98; }
.hang { transform-origin: 50% 0; animation: sway 5s ease-in-out infinite; aspect-ratio: 900 / 453; }
.s1 { right: 1.5%; top: 44%; width: clamp(170px, 19vw, 290px); rotate: -9deg; font-size: clamp(14px, 1.3vw, 20px); }
.s3 { left: 1%; top: 58%; width: clamp(130px, 13vw, 200px); rotate: 7deg; font-size: clamp(13px, 1.25vw, 19px); animation-delay: -2s; }
.s4 { position: relative; width: 100%; max-width: 210px; rotate: -6deg; font-size: clamp(14px, 1.35vw, 20px); animation-delay: -1s; }

.vine {
  position: relative; z-index: 3; height: clamp(90px, 12vw, 180px); margin: clamp(-120px, -8vw, -50px) 0 clamp(-60px, -3vw, -20px);
  background: url("assets/vine.webp") center/auto 100% repeat-x;
  filter: drop-shadow(0 8px 10px #000a);
}
.vine .s3 { position: absolute; }

/* ---------- middle: jungle wall ---------- */
.jungle {
  display: grid; gap: clamp(40px, 6vw, 80px); padding: 40px clamp(12px, 4vw, 60px) 0;
  background: url("assets/bg.webp") center top/100% auto repeat-y, var(--night);
}
.jungle > section { max-width: 1180px; width: 100%; margin: 0 auto; }

.duo { display: grid; grid-template-columns: minmax(250px, 330px) 1fr; gap: 26px; align-items: start; padding-top: 30px; }
.duo article::before {
  content: ""; position: absolute; z-index: -1; left: 14%; right: 14%; top: -90px; height: 90px;
  border-inline: 6px solid #6e4a1e;
  border-image: repeating-linear-gradient(170deg, #8a6230 0 6px, #5a3a14 6px 10px) 6;
}
.latest { padding: 58px 20px 22px; text-align: center; }
.latest .board, .troop .board { position: absolute; top: -26px; left: 50%; transform: translateX(-50%) rotate(-1.5deg); }
.troop .board { left: 20px; transform: rotate(-1.5deg); }
.frame {
  position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden;
  border: 6px solid #c8a24a; outline: 3px solid var(--ink);
  background: radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--r) 70%, #fff), var(--r));
}
.frame img { position: absolute; inset: 6% 0 0; width: 100%; height: 94%; object-fit: contain; object-position: bottom; }
.frame em {
  position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%);
  font: 16px/1 var(--display); font-style: normal; padding: 6px 16px; border-radius: 10px;
  background: #102010; border: 3px solid var(--r); color: #fff;
}
.frame.drop img { animation: drop .7s cubic-bezier(.3, 1.4, .5, 1); }
@keyframes drop { from { transform: translateY(-120%) rotate(-12deg); } }
.latest-info { margin-top: 16px; padding: 14px 10px; border-radius: 10px; background: #2a160899; box-shadow: inset 0 2px 10px #000a, 0 1px 0 #c8945655; }
.latest-name { margin: 0 0 6px; font: clamp(24px, 2.2vw, 30px)/1 var(--display); color: #fff; text-shadow: 0 2px 0 var(--ink); }
.latest-meta { margin: 0; font: 900 15px/1.2 var(--ui); letter-spacing: .05em; color: #f3e2b5; }
.latest-tx { display: flex; justify-content: center; align-items: center; gap: 8px; margin: 8px 0 0; font: 800 14px/1 var(--ui); }
.latest-tx a { text-decoration: none; color: #f3e2b5; }
.latest-tx a:hover { color: var(--gold); }
.cp { display: inline-grid; place-items: center; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 6px; background: none; color: #f3e2b5; vertical-align: middle; }
.cp:hover { background: #ffffff1a; color: var(--gold); }
.cp svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }

.troop { padding: 50px 20px 22px; }
.troop header { display: flex; justify-content: flex-end; min-height: 10px; margin: -30px 0 16px; }
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.tile {
  position: relative; aspect-ratio: 1; padding: 0; overflow: hidden; border-radius: 10px;
  border: 4px solid color-mix(in srgb, var(--r) 60%, #fff); outline: 3px solid var(--ink);
  background: radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--r) 60%, #fff), var(--r) 70%, color-mix(in srgb, var(--r) 60%, #000));
  transition: transform .2s, box-shadow .2s;
}
.tile img { position: absolute; inset: 4% 4% 0; width: 92%; height: 96%; object-fit: contain; object-position: bottom; transition: transform .25s; }
.tile > em {
  position: absolute; left: 6px; right: 6px; bottom: 6px; z-index: 2;
  font: 13px/1 var(--display); font-style: normal; letter-spacing: .04em; text-transform: uppercase;
  padding: 5px 0; border-radius: 8px; background: #0d160ddd; border: 2px solid var(--r); color: #fff;
}
.tile .info {
  position: absolute; inset: 0; z-index: 3; display: grid; align-content: center; gap: 4px; padding: 8px;
  background: #0b1a10e0; opacity: 0; transition: opacity .2s; font-size: 13px;
}
.tile .info b { font: 20px/1 var(--display); color: var(--gold); }
.tile:hover, .tile:focus-visible { transform: translateY(-4px) rotate(-1deg); box-shadow: 0 10px 18px #000b; outline-color: var(--gold); }
.tile:hover img { transform: scale(1.07); }
.tile:hover .info, .tile:focus-visible .info { opacity: 1; }
.tile.hit { animation: hit .8s; }
@keyframes hit { 30% { transform: scale(1.12) rotate(3deg); box-shadow: 0 0 0 6px var(--gold), 0 0 30px var(--gold); } }

/* crates */
.power .sec-head { justify-content: space-between; }
.crates { position: relative; isolation: isolate; display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(10px, 2vw, 26px); padding: 0 clamp(0px, 3vw, 50px) 26px; }
.crates::before {
  content: ""; position: absolute; z-index: -1; left: 0; right: 0; bottom: 0; height: 42%;
  border-radius: 22px 22px 8px 8px;
  background: radial-gradient(circle at 30% 0, #7fae3a66, #0000 30%), radial-gradient(circle at 75% 0, #7fae3a55, #0000 25%), linear-gradient(170deg, #5a5f57, #3a3e38 60%, #2c302b);
  border: 4px solid #23261f; border-top: 6px solid #5f8a2c; box-shadow: inset 0 0 40px #0009, 0 16px 30px #000b;
}
.crate { position: relative; display: grid; justify-items: center; text-align: center; width: min(100%, 260px); margin: 0 auto; outline: none; }
.crate img { width: 100%; filter: drop-shadow(0 12px 14px #000c); transition: transform .25s, filter .25s; }
.crate:hover img, .crate:focus-visible img { transform: translateY(-6px) rotate(-2deg); }
.crate .label {
  position: absolute; left: 50%; top: 76%; transform: translate(-50%, -50%);
  display: grid; justify-items: center; gap: 2px; pointer-events: none;
}
.crate .label b {
  padding: 5px 12px 6px; border-radius: 6px; white-space: nowrap;
  font: clamp(13px, 1.4vw, 20px)/1 var(--display); color: var(--ink);
  background: linear-gradient(#f7deaa, #d9b173); border: 3px solid var(--pl, #6b4218); box-shadow: 0 3px 0 #0007;
}
.crate .label strong { font: clamp(16px, 1.6vw, 22px)/1 var(--display); color: #fff; text-shadow: 0 2px 0 var(--ink), 0 0 6px #000; }
.crate:nth-child(2) { --pl: #1d4f9c; } .crate:nth-child(3) { --pl: #5a2a8a; } .crate:nth-child(4) { --pl: #8a1d18; }
.crate .desc { margin-top: 4px; font-size: 13px; color: #f3e2b5; opacity: 0; transition: opacity .2s; text-shadow: 0 1px 3px #000; }
.crate:hover .desc, .crate:focus-visible .desc { opacity: 1; }
.crate.now img { filter: drop-shadow(0 0 20px #f6c945) drop-shadow(0 12px 14px #000c); }
.crate.now::before {
  content: "LAST CLAIM"; position: absolute; bottom: -16px; z-index: 2;
  font: 12px/1 var(--display); letter-spacing: .06em; padding: 5px 10px; border-radius: 8px;
  background: var(--gold); color: var(--ink); border: 2px solid var(--ink);
}
.rules { list-style: none; margin: 18px auto 0; padding: 0; max-width: 980px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.rules li { display: flex; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 10px; background: #0b1a10b3; border: 1px solid #ffffff1c; font-size: 13px; line-height: 1.25; }
.rules b { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--gold); color: var(--ink); font: 18px/1 var(--display); }

/* stone slab table, flanked by a sign and a standing stone */
.jungle > .slab-row { max-width: 1400px; position: relative; z-index: 2; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 800px) minmax(0, 1fr); gap: clamp(10px, 2vw, 30px); align-items: start; }
.slab-row > .s4 { grid-column: 1; grid-row: 1; justify-self: center; margin-top: 30%; }
.slab-row > .stone { grid-column: 3; grid-row: 1; justify-self: center; margin-top: 12%; }
.slab-row > .slab { grid-column: 2; grid-row: 1; }
.slab {
  padding: 34px clamp(12px, 3vw, 34px) 26px; border-radius: 22px;
  background:
    radial-gradient(circle at 20% 10%, #ffffff10, #0000 40%),
    radial-gradient(circle at 80% 90%, #00000040, #0000 50%),
    linear-gradient(160deg, #50554e, #3a3e38 50%, #2c302b);
  border: 5px solid #23261f; box-shadow: inset 0 0 0 3px #6b7166, inset 0 0 50px #0009, 0 20px 40px #000b;
}
.table-wrap { overflow-x: auto; border-radius: 12px; background: #0d1410e8; border: 2px solid #ffffff14; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; padding: 12px 14px; font: 900 12px/1 var(--ui); letter-spacing: .08em; color: #b9b39a; border-bottom: 2px solid #ffffff14; }
td { padding: 10px 14px; border-bottom: 1px solid #ffffff10; font-size: 15px; white-space: nowrap; }
tr.new { animation: rownew 1.4s; }
@keyframes rownew { from { background: #f6c94540; } }
td img { width: 40px; height: 40px; border-radius: 6px; border: 2px solid color-mix(in srgb, var(--r) 60%, #fff); outline: 2px solid var(--ink); background: var(--r); object-fit: cover; object-position: top; }
td .cp { margin-left: 6px; }
td .demo { color: #fff6; }

td .rar { color: var(--r); font: 16px/1 var(--display); text-transform: uppercase; letter-spacing: .03em; }
td a { font-family: ui-monospace, Menlo, monospace; text-decoration: none; color: #f3e2b5; }
td a:hover { color: var(--gold); }
.more { display: block; margin: 16px auto 0; padding: 10px 22px; border-radius: 12px; border: 3px solid var(--ink); background: var(--gold); color: var(--ink); font: 18px/1 var(--display); }

/* ---------- floor ---------- */
.floor {
  position: relative; z-index: 1; min-height: max(560px, 56vw); margin-top: min(-22vw, -120px);
  display: grid; align-content: end; justify-items: center; gap: 14px; padding: 0 16px 18px;
  text-align: center;
}
/* the floor art is its own layer so its bottom edge can melt into the night instead of stopping in a line */
.floor { overflow-x: clip; }
.floor::before {
  content: ""; position: absolute; z-index: -1; top: 0; left: 50%; translate: -50% 0;
  width: max(100%, 1300px); aspect-ratio: 2400 / 1029;
  background: url("assets/floor.webp") center/100% 100% no-repeat;
  -webkit-mask-image: linear-gradient(#0000, #000 12%, #000 55%, #0000 97%); mask-image: linear-gradient(#0000, #000 12%, #000 55%, #0000 97%);
}
.floor-copy { display: grid; justify-items: center; }
.big-logo {
  width: clamp(260px, 32vw, 480px); height: auto; margin-bottom: 8px;
  filter: drop-shadow(0 8px 0 #2e1c0a) drop-shadow(0 18px 24px #000d);
  animation: bob 4s ease-in-out infinite;
}
@keyframes bob { 50% { transform: translateY(-8px) rotate(-1.5deg); } }
.big {
  font: clamp(80px, 11vw, 160px)/.9 var(--display);
  background:
    radial-gradient(circle at 30% 40%, #0000 0 2px, #7a5a2a55 3px, #0000 4px) 0 0/23px 19px,
    radial-gradient(circle at 70% 60%, #0000 0 1px, #5a3c1855 2px, #0000 3px) 0 0/31px 27px,
    linear-gradient(#f6e6bd, #d8bb82 55%, #a88450);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  -webkit-text-stroke: 2px #2e1c0a;
  filter: drop-shadow(0 4px 0 #5a3a18) drop-shadow(0 6px 0 #2e1c0a) drop-shadow(0 14px 18px #000d);
}
.floor-copy span { position: relative; z-index: 1; font: clamp(18px, 1.8vw, 26px)/1 var(--display); letter-spacing: .06em; text-shadow: 0 3px 6px #000, 0 0 2px #000; }
.floor nav {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 12px 14px;
  width: min(1100px, 100%); padding: 10px 0 6px;
}
.floor nav a {
  display: inline-grid; place-items: center; min-height: 48px; padding: 0 22px;
  font: clamp(16px, 1.3vw, 19px)/1 var(--display); letter-spacing: .04em; color: var(--cream);
  text-shadow: 0 2px 0 var(--ink);
  border: 3px solid #1a0f06; border-radius: 12px;
  background:
    repeating-linear-gradient(0deg, #ffffff08 0 2px, #0000 2px 8px),
    linear-gradient(#a8743e, #7a4a24 45%, #5a3418);
  box-shadow: inset 0 2px 0 #e0b07a99, inset 0 -3px 0 #0005, 0 5px 0 #1a0f06, 0 10px 16px #000a;
  transition: transform .15s, box-shadow .15s, color .15s;
}
.floor nav a:hover { transform: translateY(-3px) rotate(-1deg); color: var(--gold); }
.floor nav a:active { transform: translateY(3px); box-shadow: inset 0 2px 0 #e0b07a99, 0 2px 0 #1a0f06; }
.floor nav a.x { width: 48px; padding: 0; border-radius: 50%; }
.socials { display: flex; gap: 12px; margin-left: 10px; }
.floor nav a { text-decoration: none; }
.floor nav a:hover { color: var(--gold); }
.floor .x svg { width: 20px; height: 20px; fill: currentColor; filter: drop-shadow(0 2px 0 var(--ink)); }
.fine { margin: 0; font-size: 11px; color: #fff8; text-shadow: 0 1px 3px #000; }
.stone {
  position: relative; width: clamp(120px, 12vw, 180px); aspect-ratio: .95; padding: 10px;
  background:
    radial-gradient(circle at 20% 15%, #7fae3a88, #0000 22%), radial-gradient(circle at 85% 5%, #7fae3a66, #0000 18%),
    linear-gradient(160deg, #8a8f84, #5d6259 55%, #43473f);
  border: 4px solid #2a2d27; border-radius: 40% 40% 10px 10px / 22% 22% 10px 10px;
  rotate: 5deg; box-shadow: inset 0 0 22px #000a, 0 14px 20px #000b;
  color: #2a2d27; text-shadow: 0 1px 0 #ffffff40; -webkit-text-stroke: 0; font-size: clamp(18px, 1.7vw, 26px);
}
.stone span { position: static; }

/* ---------- motion layer ---------- */
.fx { position: fixed; inset: 0; z-index: 45; overflow: hidden; pointer-events: none; }
.faller { position: absolute; left: 0; top: 0; pointer-events: none; will-change: transform; filter: drop-shadow(0 14px 12px #000a); }
.sky-ape { position: absolute; left: 0; top: 0; aspect-ratio: 1; object-fit: contain; pointer-events: none; filter: drop-shadow(0 10px 10px #000a); }
.pow {
  position: absolute; pointer-events: none; translate: -50% -50%;
  animation: pow .85s cubic-bezier(.2, 1.8, .4, 1) forwards;
  filter: drop-shadow(0 4px 0 var(--ink)) drop-shadow(0 0 1px var(--ink));
}
.pow span {
  display: grid; place-items: center; width: 116px; aspect-ratio: 1;
  font: 28px/1 var(--display); letter-spacing: .03em; color: var(--ink);
  background: radial-gradient(#fff4a8, #f6c945 60%, #e89a1c);
  clip-path: polygon(50% 0, 61% 26%, 90% 10%, 76% 38%, 100% 50%, 76% 62%, 90% 90%, 61% 74%, 50% 100%, 39% 74%, 10% 90%, 24% 62%, 0 50%, 24% 38%, 10% 10%, 39% 26%);
}
.pow.big span { width: 180px; font-size: 44px; color: #fff; -webkit-text-stroke: 1.5px var(--ink); background: radial-gradient(#ffd23f, #f08a1c 55%, #c9471a); }
@keyframes pow {
  0% { transform: scale(.2) rotate(var(--rot)); opacity: 0; }
  25% { transform: scale(1.1) rotate(var(--rot)); opacity: 1; }
  70% { transform: scale(1) rotate(var(--rot)); opacity: 1; }
  100% { transform: scale(1.2) rotate(var(--rot)) translateY(-16px); opacity: 0; }
}
.shake { animation: shake .4s; }
@keyframes shake { 20% { transform: translate(-6px, 3px); } 40% { transform: translate(5px, -4px); } 60% { transform: translate(-3px, 2px); } 80% { transform: translate(2px, -1px); } }

/* things rise into place as they scroll in; crates drop onto the ledge */
.rise { opacity: 0; translate: 0 40px; transition: opacity .5s, translate .6s cubic-bezier(.2, 1.4, .4, 1); }
.rise.in { opacity: 1; translate: 0 0; }
.crate.rise { translate: 0 -160px; transition: opacity .25s, translate .5s cubic-bezier(.5, 0, .75, 0); }
.crate.rise.in { translate: 0 0; }

/* troop cards tilt towards the pointer */
.grid.tilt { perspective: 900px; }
.grid.tilt .tile:hover, .grid.tilt .tile:focus-visible {
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateZ(12px); transition: transform .08s, box-shadow .2s;
}
.grid.tilt .tile::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .2s;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), #ffffff55, transparent 55%);
}
.grid.tilt .tile:hover::after { opacity: 1; }

.toast {
  position: fixed; left: 50%; top: 84px; z-index: 50; transform: translateX(-50%);
  padding: 10px 18px; border-radius: 12px; background: var(--gold); color: var(--ink); border: 3px solid var(--ink);
  font: 18px/1 var(--display);
}

/* ---------- small screens ---------- */
@media (max-width: 1000px) {
  .hide-m { display: none; }
  .duo { grid-template-columns: 1fr; gap: 50px; }
  .latest { max-width: 360px; width: 100%; margin: 0 auto; }
  .crates, .rules { grid-template-columns: repeat(2, 1fr); }
  .crates::before { display: none; }
  .jungle > .slab-row { grid-template-columns: 1fr; }
  .slab-row > .slab { grid-column: 1; }
  .slab-row > .s4, .slab-row > .stone { display: none; }
  .duo article::before { display: none; }
}
@media (max-width: 720px) {
  .hide-s { display: none; }
  .bar { gap: 8px; padding: 6px 10px; flex-wrap: wrap; }
  .logo img { height: 36px; }
  .chip { min-width: 0; padding: 3px 10px; }
  .chip b { font-size: 17px; }
  .nextbar { order: 5; flex-basis: 100%; margin: 0; padding: 4px 10px; }
  .track { flex: 1; }
  .mode { margin-left: auto; }
  .hero { min-height: 0; margin-top: 0; padding-top: 0; flex-direction: column; justify-content: end; }
  .hero-art { position: relative; inset: auto; width: 100%; aspect-ratio: 4 / 3; }
  .hero-copy { margin-top: -90px; padding: 0 16px 20px; width: 100%; }
  .plank { width: 88%; }
  .s1, .hint, .hero.layered .hint { display: none; }
  .s3 { display: none; }
  .floor { margin-top: -40px; min-height: 480px; }
  .floor::before { width: auto; height: 62%; }
  .vine { margin: -10px 0 -10px; }
  .grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .tile > em { font-size: 11px; }
  .rules { grid-template-columns: 1fr; }
  .troop header { justify-content: flex-start; margin: -8px 0 12px; }
  .stone { display: none; }
  .floor nav { gap: 12px 20px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
