/* Totem SMP prototype kit, shared by the home page and the shop.
   One system for every page:
   - pixel art lives in the art (blocks, items, players); the UI around it is soft and rounded
   - one panel component (white rounded card, textured block "cap", soft shadow)
   - one radius, one shadow, one accent (gold) */
:root {
  --ink: #1f2a44;
  --ink-soft: #3a4562;
  --cream: #fff6e2;
  --sand: #fbeccb;
  --gold: #ffc531;
  --bs: 40px;
  --ease: cubic-bezier(.45, 0, .55, 1);
  --out: cubic-bezier(.22, 1, .36, 1);
  --r: 16px;
  --soft: 0 1px 2px rgba(10,12,24,.12), 0 20px 46px -18px rgba(10,12,24,.6);
  --soft-hi: 0 2px 4px rgba(10,12,24,.14), 0 30px 60px -20px rgba(10,12,24,.7);
  --outline: 3px 0 0 var(--ink), -3px 0 0 var(--ink), 0 3px 0 var(--ink), 0 -3px 0 var(--ink), 3px 3px 0 var(--ink), -3px 3px 0 var(--ink), 3px -3px 0 var(--ink), -3px -3px 0 var(--ink);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
body {
  font-family: Nunito, system-ui, sans-serif; font-weight: 600; font-size: 17px; line-height: 1.6;
  color: var(--ink); background: var(--cream); overflow-x: hidden; -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
b, strong { font-weight: 800; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.pix svg { display: block; width: 100%; height: auto; }
.tex { image-rendering: pixelated; background-size: 24px 24px; }

.mc { font-family: 'MC Display', monospace; font-weight: 400; letter-spacing: .02em; }
.mc-h { font-family: 'MC Display', monospace; font-weight: 400; line-height: 1.15; color: #fff; text-shadow: 0 3px 0 rgba(10,12,24,.45), 0 12px 32px rgba(0,0,0,.35); }
/* on a light card the heading is ink, like the rest of the card's text */
.panel .mc-h, .modal .mc-h, .drawer .mc-h { color: var(--ink); text-shadow: none; }

/* section heading: the menu item that leads here, then the title */
.head { text-align: center; margin-bottom: 52px; }
.head .sprite { width: 52px; margin: 0 auto 18px; }
.head h2 { font-size: clamp(1.9rem, 4.4vw, 2.9rem); }
.head p { font-size: 1.12rem; line-height: 1.6; max-width: 520px; margin: 18px auto 0; color: var(--ink-soft); }

/* button */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-family: 'MC Display', monospace; font-size: 1.05rem; letter-spacing: .02em;
  padding: 13px 26px 15px; border: 0; border-radius: 12px; color: var(--ink);
  background: linear-gradient(180deg, #ffd964, #ffbd1c);
  box-shadow: inset 0 -4px 0 rgba(150,90,0,.3), inset 0 2px 0 rgba(255,255,255,.6), 0 2px 4px rgba(10,12,24,.18), 0 12px 28px -10px rgba(255,165,0,.65);
  transition: transform .3s var(--out), box-shadow .3s var(--out), filter .3s var(--out);
}
.btn:active { transform: translateY(2px) scale(.98); }
@media (hover: hover) { .btn:hover { transform: translateY(-2px); filter: brightness(1.04); box-shadow: inset 0 -4px 0 rgba(150,90,0,.3), inset 0 2px 0 rgba(255,255,255,.6), 0 4px 8px rgba(10,12,24,.18), 0 20px 36px -12px rgba(255,165,0,.75); } }
.btn-xl { font-size: clamp(1.2rem, 2.4vw, 1.5rem); padding: 16px 38px 19px; }

/* the panel: everything below the hero is built from this */
.panel { background: #fff; border-radius: var(--r); box-shadow: var(--soft); position: relative; }
.panel > .cap:first-child { border-radius: var(--r) var(--r) 0 0; }
.panel.lift { transition: transform .35s var(--out), box-shadow .35s var(--out); }
@media (hover: hover) { .panel.lift:hover { transform: translateY(-6px); box-shadow: var(--soft-hi); } }
.cap { height: 28px; }
.panel-body { padding: 22px 24px 24px; }

/* stepped pixel edge between sections, drawn in the colour of the section below */
.edge {
  height: 32px; margin-top: -32px; position: relative; z-index: 4; background: var(--to);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='128' height='32'%3E%3Cpath d='M0 32V16h16V8h16v8h16V0h16v8h16v8h16V8h16v8h16v16z'/%3E%3C/svg%3E") bottom left / 128px 32px repeat-x;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='128' height='32'%3E%3Cpath d='M0 32V16h16V8h16v8h16V0h16v8h16v8h16V8h16v8h16v16z'/%3E%3C/svg%3E") bottom left / 128px 32px repeat-x;
}
section { position: relative; padding: 76px 0 88px; }
.bg-cream { background: var(--cream); }
.bg-sand { background: var(--sand); }

@keyframes bob { 50% { transform: translateY(-8px); } }
/* uses `translate`, so GSAP can still own `transform` on the same element */
@keyframes drift-y { 50% { translate: 0 -8px; } }
.sun { position: absolute; right: 7%; top: 10%; z-index: -3; width: 72px; height: 72px; background: #ffe24a; box-shadow: inset 0 0 0 12px #fff3a6, 0 0 0 12px rgba(255,240,150,.4); }
.cloud { position: absolute; left: 0; z-index: -2; pointer-events: none; will-change: transform; animation: drift linear infinite; }
.cloud.far { z-index: -3; opacity: .7; }
@keyframes drift { from { transform: translate3d(-40vw, 0, 0); } to { transform: translate3d(110vw, 0, 0); } }
.pill { display: inline-flex; align-items: center; gap: 12px; padding: 6px 6px 6px 16px; background: rgba(255,255,255,.78); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-radius: 999px; box-shadow: 0 0 0 1px rgba(255,255,255,.6) inset, 0 10px 30px -12px rgba(20,40,90,.45); font-weight: 800; font-size: .95rem; }
.pill .dot { width: 10px; height: 10px; border-radius: 50%; background: #3ccf4e; box-shadow: 0 0 0 4px rgba(60,207,78,.22); }
.pill .dot.off { background: #ff4b3e; box-shadow: 0 0 0 4px rgba(255,75,62,.22); }
.pill .ip { font-family: 'MC Display', monospace; font-size: .92rem; }
.pill button { background: linear-gradient(180deg, #ffd964, #ffbd1c); border-radius: 999px; padding: 5px 14px; font-weight: 900; font-size: .86rem; box-shadow: inset 0 -2px 0 rgba(150,90,0,.28); transition: filter .2s; }
.pill button:hover { filter: brightness(1.05); }
.sky { position: absolute; inset: 0; z-index: -2; pointer-events: none; }
.ground { position: absolute; left: 0; bottom: 0; z-index: 1; width: 100%; pointer-events: none; }
/* ---------- FOOTER: the same ground as the hero ---------- */
footer { position: relative; color: #fff4e2; background: #5b3a22 var(--dirt, none) 0 0 / var(--bs) var(--bs); image-rendering: pixelated; }
footer::before { content: ""; position: absolute; inset: 0; background: rgba(38,22,10,.6); }
.foot-ground { display: block; width: 100%; position: relative; background: var(--sand); }
.foot { position: relative; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 22px; padding: 30px 0 40px; image-rendering: auto; }
.foot .brand { display: flex; align-items: center; gap: 12px; font-family: 'MC Display', monospace; font-size: 1.25rem; color: #fff; text-shadow: var(--outline); }
.foot .brand img { width: 46px; image-rendering: pixelated; }
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 22px; font-weight: 800; }
.foot nav a:hover { color: #ffe24a; }
.foot small { display: block; width: 100%; font-weight: 700; opacity: .8; font-size: .85rem; }
/* hint: a short message right where you clicked (see hint() in proto.js) */
.hint {
  position: absolute; z-index: 120; translate: -50% 0; pointer-events: none; white-space: nowrap; text-align: center;
  background: var(--ink); color: #fff; border-radius: 10px; padding: 7px 13px 8px; box-shadow: var(--soft);
  font: 800 .9rem/1.25 Nunito, system-ui, sans-serif;
}
.hint span { display: block; font-weight: 700; font-size: .8rem; opacity: .75; }
.hint::after { content: ""; position: absolute; left: var(--ax, 50%); top: 100%; translate: -50% 0; width: 12px; height: 6px; background: inherit; clip-path: polygon(0 0, 100% 0, 50% 100%); }
.hint.below::after { top: auto; bottom: 100%; clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.hint.ok b::before { content: "✓ "; color: #6ee07a; }
.hint.err b::before { content: "! "; color: #ff8a80; }
/* ---------- players drawn flat from their skins ---------- */
.player { position: relative; flex-shrink: 0; }
.player canvas { position: absolute; image-rendering: pixelated; }
.player .rig { position: absolute; top: 0; height: 100%; }
.player .rig.side, .player.is-side .rig.front { display: none; }
.player.is-side .rig.side { display: block; }
.puff { position: absolute; z-index: 5; pointer-events: none; background: #f6eedb; box-shadow: 0 0 0 2px rgba(31,42,68,.3); }
.say {
  position: absolute; left: 50%; bottom: calc(100% + 32px); translate: -50% 0; z-index: 6; white-space: nowrap; pointer-events: none;
  background: #fff; border-radius: 10px; box-shadow: var(--soft); padding: 5px 11px 6px;
  font-family: 'MC Display', monospace; font-size: 13px; line-height: 1.3; color: var(--ink);
}
.say::after { content: ""; position: absolute; left: 50%; top: 100%; translate: -50% 0; width: 10px; height: 6px; background: #fff; clip-path: polygon(0 0, 100% 0, 50% 100%); }
.say.beside { left: calc(100% + 10px); bottom: 45%; translate: 0 0; }
.say.beside::after { left: -9px; top: 50%; translate: 0 -50%; width: 6px; height: 8px; clip-path: polygon(100% 0, 100% 100%, 0 50%); }
.player .tag {
  position: absolute; left: 50%; bottom: 100%; translate: -50% -8px; white-space: nowrap;
  background: rgba(0,0,0,.45); color: #fff; font-family: Monocraft, monospace; font-size: 13px; line-height: 1; padding: 3px 6px 4px;
  text-shadow: 2px 2px 0 #3f3f3f;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
/* 3D Wumpus (assets/wumpus.js) takes over the pixel Discord icon once it loads */
.is-3d { aspect-ratio: 1; }
.is-3d canvas { display: block; width: 100%; height: 100%; cursor: pointer; }

/* items: slices stacked in depth; at rest they face you, on hover they lean a little and show their thickness */
.item3d { perspective: 420px; }
.item3d .spin { display: grid; transform-style: preserve-3d; transition: transform .45s var(--out); }
@media (hover: hover) { a:hover .item3d .spin, .item3d:hover .spin { transform: rotateY(-24deg) rotateX(8deg) rotateZ(-3deg); } }
.item3d .spin > span { grid-area: 1 / 1; transform: translateZ(calc(var(--i) * -1.3px)); filter: brightness(calc(1 - var(--i) * .07)); }
.item3d img { display: block; width: 100%; height: auto; image-rendering: pixelated; }
/* the game's own item textures, a touch more saturated so they hold their own against the bright sky */
.item3d.tex img, img.tex { filter: saturate(1.35) contrast(1.05); }
img.sprite { display: block; image-rendering: pixelated; }
/* a held tool: handle in the hand, head pointing forward */
.player .hand { position: absolute; }
.player .held { position: absolute; left: 25%; top: 92%; width: 260%; translate: 0 -100%; rotate: 38deg; transform-origin: 0 100%; }
.player .held svg { display: block; width: 100%; height: auto; }

/* parts of the page that are off screen stop their CSS animations (set by proto.js) */
.is-off, .is-off *, .is-off *::before, .is-off *::after { animation-play-state: paused !important; }

@media (max-width: 600px) {
  :root { --bs: 28px; }
  .wrap { padding: 0 16px; }
  body { font-size: 16px; }
  section { padding: 60px 0 72px; }
  .sun { display: none; }
  .pill { font-size: .82rem; gap: 8px; padding-left: 10px; }
  .player .tag { font-size: 11px; }
}
