:root {
  --deep: #030604;
  --green: #7cff6b;
  --text: #f3f7f2;
  --muted: #8fa596;
  --card: rgba(3, 12, 8, 0.72);
  --line: rgba(124, 255, 107, 0.22);
  --font: "Bricolage Grotesque", ui-rounded, system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--deep);
  min-height: 100vh;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.seabg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: #030604 url("../assets/sea.jpg") center 45% / cover no-repeat;
}
.seabg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 40%, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, 0.45) 100%);
}
.top, .wrap { position: relative; z-index: 1; }

.top { text-align: center; padding: 1rem 1rem 0.2rem; }
.top h1 { margin: 0.2rem 0 0; font-size: clamp(1.8rem, 6vw, 2.6rem); font-weight: 800; letter-spacing: -0.02em; }
.sub { margin: 0.2rem 0 0; color: var(--muted); }
.back { position: absolute; left: 1rem; top: 1rem; color: var(--muted); text-decoration: none; font-weight: 700; }
.back:hover { color: var(--green); }

.wrap {
  width: min(1100px, calc(100% - 24px));
  margin: 0.8rem auto 2rem;
  display: grid;
  grid-template-columns: 1.25fr 0.9fr;
  gap: 1rem;
  align-items: start;
}
@media (max-width: 820px) { .wrap { grid-template-columns: 1fr; } }

.game { display: flex; flex-direction: column; align-items: stretch; gap: 0.7rem; }
.stage {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 0.86;
  max-height: 62vh;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.toast {
  position: absolute;
  left: 50%;
  top: 6%;
  transform: translateX(-50%) scale(0.9);
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  background: rgba(3, 12, 8, 0.8);
  border: 1px solid var(--line);
  font-weight: 800;
  font-size: 1.05rem;
  opacity: 0;
  transition: opacity 0.2s, transform 0.25s;
  pointer-events: none;
  white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateX(-50%) scale(1); }
.toast.good { color: var(--green); }
.toast.bad { color: #ff8a8a; }

/* drukmeter met zones: 0-75 niks, 75-85 = 1, 85-93 = 2, 93-100 = 3 */
.meter {
  position: relative;
  height: 22px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(3, 12, 8, 0.75);
  border: 1px solid var(--line);
}
.zones { position: absolute; inset: 0; display: flex; }
.zones span { display: flex; align-items: center; justify-content: center; font-size: 0.7rem; font-weight: 800; color: rgba(3, 12, 8, 0.75); }
.z0 { width: 75%; }
.z1 { width: 10%; background: rgba(124, 255, 107, 0.28); }
.z2 { width: 8%; background: rgba(124, 255, 107, 0.48); }
.z3 { width: 7%; background: rgba(124, 255, 107, 0.75); }
.fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: linear-gradient(90deg, rgba(243, 247, 242, 0.25), rgba(243, 247, 242, 0.85));
  border-right: 3px solid #fff;
}
.fill.danger { border-right-color: #ff8a8a; }

.stats { display: flex; justify-content: space-around; text-align: center; }
.stats span { display: block; color: var(--muted); font-size: 0.85rem; }
.stats b { font-size: 1.6rem; font-weight: 800; }

.hold {
  align-self: center;
  width: min(360px, 100%);
  padding: 1.05rem 1.4rem;
  border: 0;
  border-radius: 999px;
  background: var(--green);
  color: var(--deep);
  font: 800 1.25rem var(--font);
  cursor: pointer;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  box-shadow: 0 8px 30px rgba(124, 255, 107, 0.25);
  transition: transform 0.08s;
}
.hold.down { transform: scale(0.96); }
.hint { margin: 0; color: var(--muted); font-size: 0.9rem; text-align: center; }

.side { display: flex; flex-direction: column; gap: 0.8rem; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 0.9rem 1rem;
  backdrop-filter: blur(4px);
}
.card h2 { margin: 0 0 0.4rem; font-size: 1.05rem; }
.clock { margin: 0; font-size: 1.7rem; font-weight: 800; }
.muted { color: var(--muted); font-size: 0.88rem; margin: 0.3rem 0; }
.board { list-style: none; margin: 0.5rem 0 0; padding: 0; counter-reset: r; }
.board li {
  display: grid;
  grid-template-columns: 1.6rem 1fr auto;
  gap: 0.5rem;
  padding: 0.38rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.board li::before { counter-increment: r; content: counter(r); color: var(--muted); font-weight: 700; }
.board li.empty::before { content: ""; }
.board li.empty { grid-template-columns: 1fr; color: var(--muted); }
.board li.top5 b { color: var(--green); }
.board li.me { background: rgba(124, 255, 107, 0.08); border-radius: 8px; }
.board .score { font-weight: 800; }

label { display: block; color: var(--muted); font-size: 0.85rem; margin-bottom: 0.6rem; }
label small { color: var(--muted); opacity: 0.8; }
input {
  display: block;
  width: 100%;
  margin-top: 0.3rem;
  padding: 0.6rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(3, 12, 8, 0.85);
  color: var(--text);
  font: 600 0.95rem var(--font);
}
form button, .link {
  font: 800 0.95rem var(--font);
  cursor: pointer;
}
form button {
  border: 0;
  border-radius: 999px;
  padding: 0.6rem 1.1rem;
  background: var(--green);
  color: var(--deep);
}
.link { background: none; border: 0; color: var(--green); padding: 0; }
.err { color: #ff8a8a; font-size: 0.9rem; margin: 0.4rem 0 0; }
.rules ul { margin: 0; padding-left: 1.1rem; color: var(--muted); font-size: 0.88rem; }
.rules li { margin: 0.25rem 0; }

@media (prefers-reduced-motion: reduce) {
  .toast, .hold { transition: none; }
}

/* Telefoon: Squeeze, meter en knop samen in beeld */
@media (max-width: 820px) {
  .top { padding-top: 0.55rem; }
  .top h1 { font-size: 1.6rem; }
  .sub { font-size: 0.85rem; }
  .back { position: static; display: inline-block; font-size: 0.85rem; margin-bottom: 0.1rem; }
  .wrap { margin-top: 0.3rem; }
  .game { gap: 0.45rem; }
  .stage { aspect-ratio: auto; height: min(46vh, 92vw); max-height: none; }
  .stats b { font-size: 1.3rem; }
  .hold { padding: 0.9rem 1.2rem; }
  .hint { font-size: 0.8rem; }
}

.split { list-style: none; margin: 0.4rem 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.35rem; }
.split li { text-align: center; background: rgba(124, 255, 107, 0.08); border: 1px solid var(--line); border-radius: 10px; padding: 0.35rem 0.2rem; }
.split b { display: block; font-size: 0.8rem; color: var(--muted); }
.split span { font-weight: 800; color: var(--green); }
.prize a { color: var(--green); font-weight: 700; text-decoration: none; }
.small { font-size: 0.8rem; }

.pool { display: flex; align-items: baseline; gap: 0.5rem; flex-wrap: wrap; margin: 0.5rem 0 0.2rem; }
.pool span { color: var(--muted); font-size: 0.85rem; }
.pool b { font-size: 1.5rem; font-weight: 800; color: var(--green); }
.pool em { font-style: normal; color: var(--muted); font-weight: 700; }
.split small { display: block; font-size: 0.72rem; color: var(--text); opacity: 0.85; margin-top: 0.1rem; white-space: nowrap; }

/* high score: altijd in beeld bij Squeeze */
.best-badge {
  position: absolute;
  left: 0.6rem;
  top: 0.6rem;
  z-index: 3;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: rgba(3, 12, 8, 0.72);
  border: 1px solid var(--line);
  font-size: 0.85rem;
  color: var(--muted);
  pointer-events: none;
}
.best-badge b { color: var(--text); font-weight: 800; }
.best-badge.pulse { animation: badgePulse 0.9s ease; }
@keyframes badgePulse {
  0% { transform: scale(1); }
  35% { transform: scale(1.18); border-color: var(--green); }
  100% { transform: scale(1); }
}

/* een vriendje komt feliciteren */
.friend {
  position: absolute;
  bottom: 6%;
  z-index: 4;
  width: 30%;
  max-width: 210px;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.friend img { width: 100%; height: auto; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.35)); }
.friend.from-left { left: 2%; animation: friendInL 3.4s ease forwards; }
.friend.from-right { right: 2%; animation: friendInR 3.4s ease forwards; }
.friend.from-right img { transform: scaleX(-1); }
.friend-bubble {
  margin-bottom: 0.3rem;
  padding: 0.4rem 0.7rem;
  border-radius: 14px;
  background: #f4fbf2;
  color: #07140c;
  font-weight: 800;
  font-size: 0.92rem;
  text-align: center;
  white-space: nowrap;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
}
@keyframes friendInL {
  0% { transform: translateX(-130%) translateY(10px); opacity: 0; }
  14% { transform: translateX(0) translateY(0); opacity: 1; }
  20%, 40%, 60%, 80% { transform: translateY(-6px); }
  30%, 50%, 70% { transform: translateY(2px); }
  86% { transform: translateX(0); opacity: 1; }
  100% { transform: translateX(-130%); opacity: 0; }
}
@keyframes friendInR {
  0% { transform: translateX(130%) translateY(10px); opacity: 0; }
  14% { transform: translateX(0) translateY(0); opacity: 1; }
  20%, 40%, 60%, 80% { transform: translateY(-6px); }
  30%, 50%, 70% { transform: translateY(2px); }
  86% { transform: translateX(0); opacity: 1; }
  100% { transform: translateX(130%); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .friend.from-left, .friend.from-right { animation: none; }
  .best-badge.pulse { animation: none; }
}
@media (max-width: 820px) {
  .best-badge { font-size: 0.78rem; }
  .friend { width: 34%; }
  .friend-bubble { font-size: 0.8rem; }
}

.friend[hidden] { display: none; }

/* ---------- Squeeze Says ---------- */
.says-stage { aspect-ratio: 1 / 0.92; }
.tiles { position: absolute; inset: 0; z-index: 2; }
.tile {
  position: absolute;
  width: clamp(54px, 17%, 104px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 2px solid rgba(124, 255, 107, 0.28);
  background: radial-gradient(circle at 50% 40%, rgba(20, 60, 40, 0.75), rgba(3, 12, 8, 0.85));
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.12s, box-shadow 0.12s, border-color 0.12s, filter 0.12s;
}
.tile img { width: 78%; height: 78%; object-fit: contain; pointer-events: none; filter: saturate(0.85) brightness(0.92); }
.tile.lit {
  transform: translate(-50%, -50%) scale(1.2);
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(124, 255, 107, 0.35), 0 0 28px rgba(124, 255, 107, 0.65);
}
.tile.lit img { filter: none brightness(1.15); }
.tile.hint { border-color: #ffd36b; box-shadow: 0 0 0 4px rgba(255, 211, 107, 0.35), 0 0 24px rgba(255, 211, 107, 0.6); }
.tiles.off .tile { cursor: default; }
.says-status { margin: 0; text-align: center; font-weight: 800; font-size: 1.1rem; min-height: 1.5em; }
@media (max-width: 820px) {
  .says-stage { aspect-ratio: auto; width: 100%; height: min(52vh, 92vw); }
}

/* ---------- spelletjeshal ---------- */
.hub { width: min(900px, calc(100% - 24px)); margin: 1rem auto 2rem; display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; position: relative; z-index: 1; }
@media (max-width: 720px) { .hub { grid-template-columns: 1fr; } }
.game-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 1.2rem;
  transition: transform 0.15s, border-color 0.15s;
}
.game-card:hover { transform: translateY(-3px); border-color: var(--green); }
.game-card .art { height: 140px; display: flex; align-items: center; justify-content: center; gap: 0.4rem; }
.game-card .art img { height: 100%; width: auto; object-fit: contain; }
.game-card .art .mini { height: 54%; }
.game-card h2 { margin: 0.2rem 0 0; font-size: 1.5rem; }
.game-card p { margin: 0; color: var(--muted); }
.game-card .win { color: var(--green); font-weight: 800; }
.game-card .go { margin-top: 0.4rem; align-self: flex-start; padding: 0.55rem 1.1rem; border-radius: 999px; background: var(--green); color: var(--deep); font-weight: 800; }
.hub-note { position: relative; z-index: 1; text-align: center; color: var(--muted); margin: 0 1rem 2rem; }
