/* Alexandre @ 30 — noon by the pool. Sun-bleached, springy, wet. */

:root {
  --paper:   #fffdf6;
  --sky:     #dff3ff;
  --pool:    #00a9ce;
  --pool-lt: #7fe0f0;
  --deep:    #0077a8;
  --coral:   #ff5a5f;
  --sun:     #ffc93c;
  --mint:    #06d6a0;
  --grape:   #7c5cff;

  --ink:     #073b52;
  --ink-dim: #5d8ba1;
  --line:    #c9e6f2;
  --card:    #ffffff;

  --r-sm: 12px;
  --r:    20px;
  --r-lg: 30px;
  --pad:  clamp(15px, 4vw, 24px);

  /* Soft shadows sit in the water's colour, never in grey. */
  --lift:  0 2px 0 #bfe4f1, 0 10px 22px -12px rgb(7 59 82 / 0.42);
  --lift2: 0 3px 0 #bfe4f1, 0 20px 40px -18px rgb(7 59 82 / 0.5);
  --hard:  4px 4px 0 var(--ink);

  /* Everything overshoots slightly. That is the whole personality. */
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --ease:   cubic-bezier(.22, .9, .3, 1);

  --sans: ui-rounded, "SF Pro Rounded", "Hiragino Maru Gothic ProN", -apple-system,
          system-ui, "Segoe UI Variable", "Segoe UI", Nunito, Quicksand, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--sky);
  overflow-x: hidden;
  padding-bottom: env(safe-area-inset-bottom);
}

/* ------------------------------------------------------------------- scene */

.scene { position: fixed; inset: 0; z-index: -1; overflow: hidden; }

.sky {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(70% 42% at 78% -6%, #fff6d8 0%, rgb(255 246 216 / 0) 62%),
    linear-gradient(178deg, var(--paper) 0%, #e6f7ff 24%, #b7ecf7 58%, #6fd8ec 100%);
}

/* Two turbulence layers, rasterised once and then only transformed — the
   shimmer is free after the first paint, which matters on a phone. */
.caustics {
  position: absolute;
  inset: -25%;
  width: 150%;
  height: 150%;
  opacity: 0.5;
  mix-blend-mode: soft-light;
  will-change: transform;
  animation: swell 19s var(--ease) infinite alternate;
}
.caustics.two {
  opacity: 0.32;
  animation: swell2 27s var(--ease) infinite alternate;
}

@keyframes swell {
  from { transform: translate3d(-2%, 0, 0) scale(1); }
  to   { transform: translate3d(3%, 2.5%, 0) scale(1.16); }
}
@keyframes swell2 {
  from { transform: translate3d(2%, 1%, 0) scale(1.1) rotate(1deg); }
  to   { transform: translate3d(-3%, -2%, 0) scale(1.24) rotate(-1.5deg); }
}

/* Inflatables, drifting the length of the pool. */
.floaties { position: absolute; inset: 0; }
.floaty {
  position: absolute;
  font-size: clamp(38px, 9vw, 74px);
  opacity: 0.22;
  filter: saturate(1.2);
  animation: float-by linear infinite;
}
.floaty:nth-child(1) { top: 12%; animation-duration: 58s; }
.floaty:nth-child(2) { top: 43%; animation-duration: 74s; animation-delay: -22s; font-size: clamp(30px, 7vw, 58px); }
.floaty:nth-child(3) { top: 70%; animation-duration: 66s; animation-delay: -44s; }
.floaty:nth-child(4) { top: 88%; animation-duration: 88s; animation-delay: -11s; font-size: clamp(26px, 6vw, 48px); }

@keyframes float-by {
  from { transform: translateX(-22vw) rotate(-12deg); }
  50%  { transform: translateX(50vw)  rotate(10deg); }
  to   { transform: translateX(122vw) rotate(-8deg); }
}

@media (prefers-reduced-motion: reduce) {
  .caustics, .floaty { animation: none; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1 !important; transform: none !important; }
}

/* ------------------------------------------------------------------ chrome */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px var(--pad);
  padding-top: calc(10px + env(safe-area-inset-top));
  background: rgb(255 253 246 / 0.82);
  backdrop-filter: blur(16px) saturate(1.4);
  border-bottom: 2px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: inherit; }

.brand-num {
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  border-radius: 15px;
  font-weight: 900;
  font-size: 20px;
  letter-spacing: -0.05em;
  color: #fff;
  background: linear-gradient(150deg, var(--sun), var(--coral));
  box-shadow: 0 4px 0 #e04a4f, 0 10px 18px -8px var(--coral);
  animation: bob 3.4s ease-in-out infinite;
}
@keyframes bob {
  50% { transform: translateY(-3px) rotate(-4deg); }
}

.brand-text { display: flex; flex-direction: column; line-height: 1.18; }
.brand-text b { font-size: 15.5px; font-weight: 850; letter-spacing: -0.02em; }
.brand-text small { font-size: 11.5px; color: var(--ink-dim); font-weight: 600; }

.whoami {
  display: flex; align-items: center; gap: 7px;
  padding: 9px 14px;
  font: inherit; font-size: 13px; font-weight: 800;
  color: var(--ink);
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--lift);
  cursor: pointer;
  transition: transform .28s var(--spring), box-shadow .2s;
}
.whoami:hover  { transform: translateY(-2px) rotate(-1deg); box-shadow: var(--lift2); }
.whoami:active { transform: scale(.94); }

.tabs {
  position: sticky;
  top: calc(67px + env(safe-area-inset-top));
  z-index: 19;
  display: flex;
  gap: 8px;
  padding: 12px var(--pad);
  overflow-x: auto;
  scrollbar-width: none;
  background: linear-gradient(180deg, rgb(223 243 255 / 0.9), rgb(223 243 255 / 0));
}
.tabs::-webkit-scrollbar { display: none; }

.tab {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 15px;
  font: inherit; font-size: 13.5px; font-weight: 800;
  white-space: nowrap;
  color: var(--ink);
  text-decoration: none;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 2px 0 #cfeaf5;
  transition: transform .3s var(--spring), background .18s, color .18s, box-shadow .18s;
}
.tab:hover { transform: translateY(-3px) rotate(-1.5deg); box-shadow: var(--lift); }
.tab[aria-current="page"] {
  color: #fff;
  background: linear-gradient(140deg, var(--pool), var(--deep));
  border-color: var(--deep);
  box-shadow: 0 3px 0 #005b80;
  transform: translateY(-1px);
}

.view {
  max-width: 960px;
  margin: 0 auto;
  padding: 6px var(--pad) 60px;
  outline: none;
}

/* Sections rise as you scroll to them; anim.js adds .in. */
.reveal {
  opacity: 0;
  transform: translateY(22px) scale(.98);
  transition: opacity .5s var(--ease), transform .6s var(--spring);
}
.reveal.in { opacity: 1; transform: none; }

.foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  max-width: 960px;
  margin: 0 auto;
  padding: 22px var(--pad) 38px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-dim);
  border-top: 2px solid var(--line);
}

.linkish {
  font: inherit; font-weight: 700;
  color: var(--ink-dim);
  background: none;
  border: 0;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.linkish:hover { color: var(--coral); }

/* ---------------------------------------------------------------- building */

h1, h2, h3 { letter-spacing: -0.035em; line-height: 1.08; margin: 0; }
h1 { font-size: clamp(30px, 7.5vw, 48px); font-weight: 900; }
h2 { font-size: clamp(21px, 4.6vw, 28px); font-weight: 900; }
h3 { font-size: 17px; font-weight: 850; }
p  { margin: 0; }

.section { margin: 34px 0 0; }
.section > h2 { margin-bottom: 5px; }
.section > .sub { color: var(--ink-dim); font-size: 14.5px; font-weight: 600; margin-bottom: 15px; }

.card {
  padding: var(--pad);
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--lift);
}

.stack { display: grid; gap: 12px; }
.row   { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.grow  { flex: 1 1 160px; min-width: 0; }
.muted { color: var(--ink-dim); }
.tiny  { font-size: 12.5px; }
.center{ text-align: center; }

.grid2 { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }

/* --------------------------------------------------------------- controls */

button, input, textarea, select { font: inherit; color: inherit; }

.btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px;
  font-weight: 850; font-size: 14.5px;
  color: #fff;
  background: linear-gradient(140deg, var(--pool), var(--deep));
  border: 0;
  border-radius: 999px;
  box-shadow: 0 4px 0 #005b80, 0 12px 22px -12px var(--deep);
  cursor: pointer;
  overflow: hidden;
  transition: transform .3s var(--spring), box-shadow .18s, filter .18s;
}
.btn:hover  { transform: translateY(-2px); box-shadow: 0 6px 0 #005b80, 0 18px 30px -14px var(--deep); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #005b80; }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }

.btn.ghost {
  color: var(--ink);
  background: var(--card);
  border: 2px solid var(--line);
  box-shadow: 0 4px 0 #cfeaf5;
}
.btn.ghost:hover  { box-shadow: 0 6px 0 #cfeaf5; }
.btn.ghost:active { box-shadow: 0 1px 0 #cfeaf5; }

.btn.warm {
  background: linear-gradient(140deg, var(--sun), var(--coral));
  box-shadow: 0 4px 0 #e04a4f, 0 12px 22px -12px var(--coral);
}
.btn.warm:hover  { box-shadow: 0 6px 0 #e04a4f, 0 18px 30px -14px var(--coral); }
.btn.warm:active { box-shadow: 0 1px 0 #e04a4f; }

.btn.small { padding: 8px 14px; font-size: 13px; box-shadow: 0 3px 0 #005b80; }
.btn.ghost.small { box-shadow: 0 3px 0 #cfeaf5; }

/* Tap ripple, planted at the pointer by anim.js. */
.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgb(255 255 255 / 0.55);
  transform: translate(-50%, -50%) scale(0);
  animation: ripple .6s var(--ease) forwards;
  pointer-events: none;
}
@keyframes ripple {
  to { transform: translate(-50%, -50%) scale(1); opacity: 0; }
}

input[type=text], input[type=number], textarea, select {
  width: 100%;
  padding: 12px 15px;
  font-weight: 600;
  background: #f4fbfe;
  border: 2px solid var(--line);
  border-radius: var(--r-sm);
  outline: none;
  transition: border-color .18s, box-shadow .18s, transform .25s var(--spring);
}
input:focus, textarea:focus, select:focus {
  border-color: var(--pool);
  box-shadow: 0 0 0 4px rgb(0 169 206 / 0.16);
}
textarea { resize: vertical; min-height: 96px; }
label.field { display: grid; gap: 6px; font-size: 13px; font-weight: 800; color: var(--ink-dim); }

:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }

.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 11px;
  font-size: 12px; font-weight: 850;
  color: var(--deep);
  background: #e4f7fd;
  border: 2px solid var(--line);
  border-radius: 999px;
}
.pill.hot { color: #a35a00; background: #fff3d1; border-color: #ffdf95; }
.pill.on  { color: #fff; background: var(--mint); border-color: #05b98a; }

/* ------------------------------------------------------------------- home */

.hero { padding: clamp(20px, 5vw, 38px) var(--pad) 8px; text-align: center; }

.hero .big {
  position: relative;
  display: inline-block;
  font-size: clamp(96px, 34vw, 210px);
  font-weight: 900;
  line-height: .8;
  letter-spacing: -0.07em;
  color: #fff;
  text-shadow:
     4px 4px 0 var(--pool),
     8px 8px 0 var(--sun),
    12px 12px 0 var(--coral),
    0 26px 40px rgb(7 59 82 / 0.28);
  animation: hero-in 1.1s var(--spring) both, sway 6s ease-in-out 1.1s infinite;
}
@keyframes hero-in {
  from { opacity: 0; transform: translateY(-40px) scale(.7) rotate(-8deg); }
  to   { opacity: 1; transform: none; }
}
@keyframes sway {
  50% { transform: rotate(-2.2deg) translateY(-6px); }
}

/* A light sweep across the numerals, like sun off water. */
.hero .big::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(105deg, transparent 38%, rgb(255 255 255 / .95) 50%, transparent 62%);
  background-size: 260% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: sweep 4.6s ease-in-out 1.4s infinite;
}
@keyframes sweep {
  0%, 62% { background-position: 200% 0; }
  100%    { background-position: -60% 0; }
}

.hero .tagline {
  margin-top: 16px;
  font-size: clamp(17px, 4.4vw, 24px);
  font-weight: 900;
  letter-spacing: -0.02em;
}
.hero .when { margin-top: 7px; color: var(--ink-dim); font-size: 14.5px; font-weight: 700; }

.countdown { display: flex; justify-content: center; gap: 9px; margin-top: 22px; flex-wrap: wrap; }
.cd-unit {
  min-width: 76px;
  padding: 12px 8px;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: var(--r-sm);
  box-shadow: var(--lift);
  animation: pop .45s var(--spring) both;
}
.cd-unit:nth-child(2) { animation-delay: .06s; }
.cd-unit:nth-child(3) { animation-delay: .12s; }
.cd-unit:nth-child(4) { animation-delay: .18s; }
@keyframes pop {
  from { opacity: 0; transform: scale(.6) translateY(14px); }
  to   { opacity: 1; transform: none; }
}

.cd-unit b {
  display: block;
  font-size: 30px; font-weight: 900;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.05em;
  color: var(--deep);
}
.cd-unit span { font-size: 10px; font-weight: 850; text-transform: uppercase; letter-spacing: .12em; color: var(--ink-dim); }

/* The seconds tick flips; anim.js toggles .tick. */
.cd-unit b.tick { animation: flip .4s var(--spring); }
@keyframes flip {
  0%   { transform: rotateX(-70deg) scale(1.18); opacity: .4; }
  100% { transform: none; opacity: 1; }
}

.livenow {
  margin-top: 20px;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 22px;
  font-weight: 900; font-size: 16px;
  color: #fff;
  background: linear-gradient(140deg, var(--sun), var(--coral));
  border-radius: 999px;
  box-shadow: 0 5px 0 #e04a4f, 0 16px 30px -14px var(--coral);
  animation: throb 1.6s var(--spring) infinite;
}
@keyframes throb { 50% { transform: scale(1.045); } }

.dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: #fff;
  animation: pulse 1.3s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: .25; transform: scale(.6); } }

.timeline { display: grid; gap: 2px; }
.slot {
  display: grid;
  grid-template-columns: 58px 32px 1fr;
  align-items: start; gap: 11px;
  padding: 12px 0;
  border-bottom: 2px dashed var(--line);
  transition: transform .3s var(--spring);
}
.slot:last-child { border-bottom: 0; }
.slot:hover { transform: translateX(5px); }
.slot time { font-weight: 900; font-variant-numeric: tabular-nums; color: var(--coral); }
.slot .emo { font-size: 21px; transition: transform .35s var(--spring); }
.slot:hover .emo { transform: scale(1.28) rotate(-10deg); }
.slot b { font-weight: 850; }
.slot small { display: block; color: var(--ink-dim); font-size: 13px; font-weight: 600; }

.bring { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.bring li { display: flex; gap: 11px; align-items: flex-start; font-weight: 650; }
.bring li span:first-child { font-size: 20px; line-height: 1.25; }

.dog {
  display: flex; gap: 13px; align-items: center;
  padding: 13px;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--lift);
  transition: transform .32s var(--spring), box-shadow .2s;
}
.dog:hover { transform: translateY(-4px) rotate(-1deg); box-shadow: var(--lift2); }
.dog small { display: block; margin-top: 3px; font-weight: 600; }
.dog b { font-weight: 850; }
.dog .face {
  display: grid; place-items: center;
  width: 58px; height: 58px; flex: 0 0 auto;
  font-size: 26px;
  background: #eaf8fd;
  border: 2px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  transition: transform .35s var(--spring);
}
/* A real dog beats an emoji of a dog. */
/* Circular, so a screenshotted avatar's square corners never show. */
.dog .face.photo {
  padding: 0;
  cursor: zoom-in;
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: var(--lift);
}
.dog:hover .face.photo { transform: rotate(0) scale(1.09); }
.dog .face img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dog:hover .face { transform: rotate(-9deg) scale(1.08); }

/* --------------------------------------------------------------- scavenger */

.hunt-grid { display: grid; gap: 11px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }

.chal {
  position: relative;
  display: flex; flex-direction: column; gap: 6px;
  padding: 14px;
  text-align: left;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--lift);
  cursor: pointer;
  overflow: hidden;
  transition: transform .32s var(--spring), box-shadow .2s, border-color .2s;
}
.chal:hover  { transform: translateY(-5px) rotate(-1deg); box-shadow: var(--lift2); border-color: var(--pool-lt); }
.chal:active { transform: translateY(0) scale(.97); }
.chal .emo { font-size: 30px; transition: transform .4s var(--spring); }
.chal:hover .emo { transform: scale(1.22) rotate(-11deg); }
.chal .title { font-size: 13.5px; font-weight: 800; line-height: 1.28; }
.chal .pts { font-size: 11.5px; font-weight: 900; color: var(--coral); letter-spacing: .03em; }

.chal.done {
  background: linear-gradient(155deg, #e6fff7, #d3f7ff);
  border-color: var(--mint);
  box-shadow: 0 3px 0 #9df0d6, 0 18px 32px -18px var(--mint);
}
.chal.done::after {
  content: "✓";
  position: absolute; top: 9px; right: 11px;
  display: grid; place-items: center;
  width: 25px; height: 25px;
  font-weight: 900; font-size: 14px;
  color: #fff;
  background: var(--mint);
  border-radius: 50%;
  animation: stamp .55s var(--spring) both;
}
@keyframes stamp {
  from { opacity: 0; transform: scale(2.4) rotate(-30deg); }
  to   { opacity: 1; transform: none; }
}
.chal .shot { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 11px; margin-top: 2px; }

.scoreboard { display: grid; gap: 9px; }
.score-row {
  display: grid;
  grid-template-columns: 30px 1fr auto;
  align-items: center; gap: 11px;
  padding: 11px 14px;
  font-weight: 700;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: var(--r-sm);
  box-shadow: 0 2px 0 #cfeaf5;
  transition: transform .3s var(--spring);
}
.score-row:hover { transform: translateX(5px); }
.score-row .rank { font-weight: 900; color: var(--ink-dim); font-variant-numeric: tabular-nums; }
.score-row.lead {
  background: linear-gradient(120deg, #fff6da, #ffeec0);
  border-color: var(--sun);
  box-shadow: 0 3px 0 #f0c95f;
}
.score-row b { font-variant-numeric: tabular-nums; font-weight: 900; color: var(--deep); font-size: 18px; }

/* ----------------------------------------------------------------- gallery */

.gallery { columns: 2; column-gap: 11px; }
@media (min-width: 620px) { .gallery { columns: 3; } }
@media (min-width: 900px) { .gallery { columns: 4; } }

.shot-card {
  break-inside: avoid;
  margin: 0 0 11px;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--lift);
  overflow: hidden;
  transition: transform .32s var(--spring), box-shadow .2s;
}
.shot-card:hover { transform: translateY(-4px) rotate(.6deg); box-shadow: var(--lift2); }
.shot-card img { display: block; width: 100%; height: auto; cursor: zoom-in; background: #eaf8fd; }
.shot-meta { padding: 10px 12px; display: grid; gap: 7px; }
.shot-meta .who { font-size: 12px; font-weight: 700; color: var(--ink-dim); }
.shot-meta .cap { font-size: 13.5px; font-weight: 750; }

.reacts { display: flex; gap: 5px; flex-wrap: wrap; }
.react {
  padding: 4px 9px;
  font-size: 13.5px;
  background: #f0fafe;
  border: 2px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  line-height: 1.35;
  transition: transform .3s var(--spring), background .16s;
}
.react:hover  { transform: translateY(-2px) scale(1.08); }
.react:active { transform: scale(.88); }
.react.on { background: #d4fff2; border-color: var(--mint); }
.react b { font-size: 11px; font-weight: 900; font-variant-numeric: tabular-nums; margin-left: 2px; }

/* ---------------------------------------------------------------- memories */

.slideshow {
  position: relative;
  aspect-ratio: 4 / 3;
  max-height: 66dvh;
  border: 3px solid #fff;
  border-radius: var(--r-lg);
  box-shadow: var(--lift2);
  overflow: hidden;
  background: #cdeef8;
}
@media (min-width: 700px) { .slideshow { aspect-ratio: 16 / 10; } }

.slideshow figure { position: absolute; inset: 0; margin: 0; opacity: 0; transition: opacity .9s var(--ease); }
.slideshow figure.on { opacity: 1; }
.slideshow img { width: 100%; height: 100%; object-fit: cover; }
/* Slow drift while a slide is showing — stills that refuse to sit still. */
.slideshow figure.on img { animation: kenburns 9s ease-out both; }
@keyframes kenburns {
  from { transform: scale(1.02) translate3d(0, 0, 0); }
  to   { transform: scale(1.14) translate3d(-1.5%, -1.5%, 0); }
}

.slide-bar {
  position: absolute; left: 0; bottom: 0;
  height: 4px;
  background: var(--sun);
  box-shadow: 0 0 12px var(--sun);
}

.slide-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  display: grid; place-items: center;
  width: 46px; height: 46px;
  font-size: 20px; font-weight: 900;
  color: var(--ink);
  background: rgb(255 255 255 / 0.86);
  border: 0; border-radius: 50%;
  box-shadow: var(--lift);
  cursor: pointer;
  transition: transform .3s var(--spring), background .16s;
}
.slide-nav:hover { background: #fff; transform: translateY(-50%) scale(1.12); }
.slide-nav.prev { left: 12px; }
.slide-nav.next { right: 12px; }

.slide-count {
  position: absolute; top: 12px; right: 14px;
  padding: 5px 12px;
  font-size: 12px; font-weight: 850;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  background: rgb(255 255 255 / 0.86);
  border-radius: 999px;
}

.slide-play {
  position: absolute; top: 12px; left: 14px;
  padding: 5px 13px;
  font: inherit; font-size: 12px; font-weight: 850;
  color: var(--ink);
  background: rgb(255 255 255 / 0.86);
  border: 0; border-radius: 999px;
  cursor: pointer;
}

.filmstrip { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 10px; scrollbar-width: none; }
.filmstrip::-webkit-scrollbar { display: none; }
.frame {
  flex: 0 0 auto;
  width: 78px; height: 58px;
  padding: 0;
  border: 3px solid #fff;
  border-radius: 11px;
  box-shadow: var(--lift);
  overflow: hidden;
  cursor: pointer;
  opacity: .62;
  transition: transform .3s var(--spring), opacity .2s, border-color .2s;
}
.frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.frame:hover { transform: translateY(-4px) rotate(-2deg); opacity: 1; }
.frame.on { opacity: 1; border-color: var(--sun); transform: translateY(-3px); }

/* ------------------------------------------------------------------- teams */

.team {
  padding: 15px;
  border-radius: var(--r);
  border: 2px solid var(--line);
  background: var(--card);
  box-shadow: var(--lift);
  animation: deal .55s var(--spring) both;
}
.team:nth-child(2) { animation-delay: .1s; }
.team:nth-child(3) { animation-delay: .2s; }
.team:nth-child(4) { animation-delay: .3s; }
@keyframes deal {
  from { opacity: 0; transform: translateY(28px) rotate(-5deg) scale(.9); }
  to   { opacity: 1; transform: none; }
}
.team h3 { margin-bottom: 9px; color: var(--deep); }
.team ol { margin: 0; padding-left: 21px; display: grid; gap: 5px; font-weight: 700; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 13px;
  font-size: 13px; font-weight: 800;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 2px 0 #cfeaf5;
  cursor: pointer;
  transition: transform .3s var(--spring), background .16s, color .16s;
}
/* Two people with the same name is almost always one person twice. */
.chip.dupe { border-color: var(--sun); border-style: dashed; }
.chip-x {
  display: grid; place-items: center;
  width: 19px; height: 19px; margin: -3px -5px -3px 1px; padding: 0;
  font-size: 11px; font-weight: 900; line-height: 1;
  color: #fff;
  background: var(--coral);
  border: 0; border-radius: 50%;
  cursor: pointer;
  transition: transform .2s var(--spring);
}
.chip-x:hover { transform: scale(1.18); }
.chip:hover  { transform: translateY(-3px) rotate(-2deg); }
.chip:active { transform: scale(.92); }
.chip.picked { color: #fff; background: linear-gradient(140deg, var(--mint), #04b98c); border-color: #04b98c; box-shadow: 0 3px 0 #039a74; }
.chip .x { opacity: .7; font-weight: 900; }

/* ----------------------------------------------------------------- bracket */

.bracket { display: flex; gap: 15px; overflow-x: auto; padding: 4px 2px 12px; }
.round { flex: 0 0 195px; display: flex; flex-direction: column; justify-content: space-around; gap: 11px; }
.round > .round-name {
  font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: .12em;
  color: var(--ink-dim); text-align: center;
}
.match {
  display: grid; gap: 4px;
  padding: 8px;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: var(--r-sm);
  box-shadow: 0 2px 0 #cfeaf5;
}
.slot-btn {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%;
  padding: 9px 11px;
  font-size: 13px; font-weight: 800;
  text-align: left;
  color: var(--ink);
  background: #f2fafe;
  border: 2px solid transparent;
  border-radius: 9px;
  cursor: pointer;
  transition: transform .28s var(--spring), background .16s, border-color .16s;
}
.slot-btn:hover:not(:disabled) { border-color: var(--pool); transform: translateX(3px); }
.slot-btn:disabled { opacity: .4; cursor: default; }
.slot-btn.won {
  color: #fff;
  background: linear-gradient(140deg, var(--mint), #04b98c);
  animation: stamp .5s var(--spring) both;
}
.slot-btn.lost { opacity: .38; text-decoration: line-through; }

.champ {
  display: grid; place-items: center; gap: 5px;
  padding: 24px;
  text-align: center;
  background: linear-gradient(150deg, #fff4d2, #ffe3dc);
  border: 3px solid var(--sun);
  border-radius: var(--r-lg);
  box-shadow: var(--lift2);
  animation: pop .6s var(--spring) both;
}
.champ .name {
  font-size: clamp(22px, 5.5vw, 34px);
  font-weight: 900; letter-spacing: -0.04em;
  color: var(--ink);
}

/* -------------------------------------------------------------- list items */

.item {
  display: flex; align-items: flex-start; gap: 13px;
  padding: 14px;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--lift);
  transition: transform .3s var(--spring);
}
.item:hover { transform: translateY(-3px); }
.item .body { flex: 1; min-width: 0; }
.item .body b { display: block; font-weight: 850; }

.vote {
  display: grid; place-items: center;
  flex: 0 0 auto;
  width: 54px; padding: 7px 0;
  background: #f2fafe;
  border: 2px solid var(--line);
  border-radius: 14px;
  cursor: pointer;
  line-height: 1.1;
  transition: transform .3s var(--spring), background .16s;
}
.vote:hover  { transform: translateY(-3px); border-color: var(--pool); }
.vote:active { transform: scale(.9); }
.vote.on { color: #fff; background: linear-gradient(140deg, var(--mint), #04b98c); border-color: #04b98c; }
.vote .n { font-size: 19px; font-weight: 900; font-variant-numeric: tabular-nums; }
.vote .cap { font-size: 9.5px; font-weight: 850; text-transform: uppercase; letter-spacing: .08em; opacity: .78; }

.played { opacity: .55; }
.played .body b { text-decoration: line-through; }

/* -------------------------------------------------------------------- bets */

.bet {
  display: grid; gap: 11px;
  padding: var(--pad);
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--lift);
}
.bet .prompt { font-size: 16.5px; font-weight: 900; line-height: 1.25; letter-spacing: -0.02em; }

.opt {
  position: relative;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%;
  padding: 11px 14px;
  font-size: 14px; font-weight: 750;
  text-align: left;
  color: var(--ink);
  background: #f2fafe;
  border: 2px solid var(--line);
  border-radius: var(--r-sm);
  cursor: pointer;
  overflow: hidden;
  transition: transform .28s var(--spring), border-color .16s;
}
.opt:hover:not(:disabled) { transform: translateX(4px); border-color: var(--pool-lt); }
.opt .bar {
  position: absolute; inset: 0 auto 0 0;
  background: linear-gradient(90deg, #cdf1fb, #a9e8f7);
  transition: width .6s var(--ease);
}
/* Lifts the label and price above the .bar price-fill. Must exclude .ripple:
   anim.js injects one on pointerdown, and stacking it above the bar this way
   would also drop it out of position:absolute and into the flex flow, where
   its 2.2x-of-button size blows the row up to full screen for 620ms. */
.opt > *:not(.ripple) { position: relative; }
.opt.mine { border-color: var(--pool); }
.opt.won  { border-color: var(--sun); }
.opt.won .bar { background: linear-gradient(90deg, #ffeec0, #ffe09a); }
.opt .n { font-variant-numeric: tabular-nums; font-size: 12.5px; font-weight: 850; color: var(--ink-dim); }

/* ------------------------------------------------------------------ market */

.wallet {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 16px;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--lift);
}
.wallet > div { display: grid; gap: 2px; }
.wallet b { font-size: clamp(20px, 5vw, 26px); font-weight: 900; letter-spacing: -0.04em; color: var(--deep); font-variant-numeric: tabular-nums; }
.wallet-label { font-size: 10.5px; font-weight: 850; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-dim); }

.pnl { font-size: 12px; font-weight: 850; font-variant-numeric: tabular-nums; }
.pnl.up   { color: #06a37a; }
.pnl.down { color: var(--coral); }

.spark {
  width: 100%; height: 46px;
  background: #f4fbfe;
  border: 2px solid var(--line);
  border-radius: var(--r-sm);
}

.opt-main   { display: grid; gap: 1px; text-align: left; min-width: 0; }
.opt-label  { font-weight: 800; }
.opt-pos    { font-size: 11.5px; font-weight: 700; color: var(--deep); }
.opt-price  { font-size: 17px; font-weight: 900; font-variant-numeric: tabular-nums; letter-spacing: -0.03em; }

.close-line {
  margin: -2px 0 2px;
  font-size: 11.5px; font-weight: 800;
  color: var(--ink-dim);
}
.close-line.shut { color: var(--coral); }

.quote {
  display: grid; gap: 4px;
  padding: 13px 15px;
  background: #f2fafe;
  border: 2px solid var(--line);
  border-radius: var(--r-sm);
}
.quote-row { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; font-weight: 700; }
.quote-row span { color: var(--ink-dim); }
.quote-row b { font-variant-numeric: tabular-nums; }
.quote-row.win b { color: #06a37a; font-size: 15px; }

input[type=range] {
  width: 100%;
  accent-color: var(--pool);
  height: 28px;
}

/* ------------------------------------------------------------------ awards */

.award {
  display: flex; align-items: center; gap: 15px;
  padding: 16px;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--lift);
  transition: transform .32s var(--spring), box-shadow .2s;
}
.award:hover { transform: translateY(-4px) rotate(-.7deg); box-shadow: var(--lift2); }
.award .medal {
  display: grid; place-items: center;
  flex: 0 0 auto;
  width: 56px; height: 56px;
  font-size: 28px;
  background: linear-gradient(150deg, #fff4d2, #ffe6b8);
  border: 2px solid var(--sun);
  border-radius: 18px;
  animation: bob 3.6s ease-in-out infinite;
}
.award .who { font-size: 19px; font-weight: 900; letter-spacing: -0.03em; }
.award .cat { font-size: 11.5px; font-weight: 900; text-transform: uppercase; letter-spacing: .11em; color: var(--coral); }
.award.empty { opacity: .55; }
.award.empty .medal { background: #eef8fc; border-color: var(--line); animation: none; }

/* ------------------------------------------------------------ modal, toast */

.modal {
  position: fixed; inset: 0; z-index: 60;
  display: grid; place-items: center;
  padding: 18px;
  background: rgb(7 59 82 / 0.44);
  backdrop-filter: blur(7px);
  animation: fade .22s var(--ease) both;
}
.modal[hidden] { display: none; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.sheet {
  width: min(470px, 100%);
  max-height: 88dvh;
  overflow-y: auto;
  padding: 24px;
  background: var(--paper);
  border: 3px solid #fff;
  border-radius: var(--r-lg);
  box-shadow: 0 30px 70px -25px rgb(7 59 82 / .6);
  animation: sheet-in .5s var(--spring) both;
}
@keyframes sheet-in {
  from { opacity: 0; transform: translateY(40px) scale(.9); }
  to   { opacity: 1; transform: none; }
}
.sheet h2 { margin-bottom: 6px; }

.lightbox { display: grid; place-items: center; }
.lightbox img {
  max-width: min(560px, 92vw); max-height: 84dvh;
  border: 4px solid #fff;
  border-radius: var(--r);
  box-shadow: 0 30px 70px -25px rgb(7 59 82 / .7);
  animation: sheet-in .5s var(--spring) both;
}

.emoji-pick { display: flex; flex-wrap: wrap; gap: 7px; }
.emoji-pick button {
  width: 46px; height: 46px;
  font-size: 23px;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 14px;
  cursor: pointer;
  transition: transform .3s var(--spring), border-color .16s;
}
.emoji-pick button:hover { transform: translateY(-3px) scale(1.06); }
.emoji-pick button[aria-pressed="true"] { border-color: var(--mint); background: #d4fff2; transform: scale(1.06); }

.toast {
  position: fixed;
  left: 50%; bottom: 24px;
  z-index: 80;
  transform: translate(-50%, 26px) scale(.9);
  max-width: min(420px, 90vw);
  padding: 13px 22px;
  font-size: 14.5px; font-weight: 850;
  color: #fff;
  background: linear-gradient(140deg, var(--mint), #04b98c);
  border-radius: 999px;
  box-shadow: 0 10px 26px -10px rgb(7 59 82 / .55);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .45s var(--spring);
}
.toast.show { opacity: 1; transform: translate(-50%, 0) scale(1); }
.toast.bad  { background: linear-gradient(140deg, #ff8a5b, var(--coral)); }

.empty-state {
  padding: 36px 20px;
  text-align: center;
  font-weight: 700;
  color: var(--ink-dim);
  background: rgb(255 255 255 / .6);
  border: 3px dashed var(--line);
  border-radius: var(--r);
}
.empty-state .big-emo {
  font-size: 40px; display: block; margin-bottom: 10px;
  animation: bob 3s ease-in-out infinite;
}

.spinner {
  width: 19px; height: 19px;
  border: 3px solid #d7eef7;
  border-top-color: var(--pool);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Fired by anim.js when a challenge is claimed or a champion is crowned. */
.confetti {
  position: fixed; top: 0; left: 0;
  width: 10px; height: 14px;
  z-index: 90;
  pointer-events: none;
  will-change: transform;
  animation: fall linear forwards;
}
@keyframes fall {
  from { transform: translate3d(0, 0, 0) rotate(0deg); opacity: 1; }
  to   { transform: translate3d(var(--dx), 105dvh, 0) rotate(var(--spin)); opacity: 0; }
}

.host-only[hidden] { display: none; }
