:root { --bg-top: var(--sea-0); --bg-bottom: var(--sea-2); }

.player {
  display: flex;
  flex-direction: column;
}
.player--game {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100dvh;
  padding: max(12px, env(safe-area-inset-top)) 14px max(16px, env(safe-area-inset-bottom));
}

/* ---------- hero / join ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  padding: 70px 18px 40px;
  text-align: center;
}
.hero .foam { position: absolute; top: 0; left: 0; right: 0; }
.hero__top { position: absolute; top: 44px; left: 0; right: 0; display: flex; justify-content: flex-end; padding: 0 16px; }
.hero__logo { width: 100%; max-width: 440px; }
.hero__tag { margin: 0; font: 600 clamp(1.1rem, 4.5vw, 1.4rem) var(--display); text-shadow: 2px 2px 0 var(--ink); }
/* the join card: hatch a fish on the left, name and PIN on the right */
.join-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 0 1.2rem;
  width: 100%;
  max-width: 620px;
  margin-top: 0.6rem;
  padding: 1.2rem;
  text-align: left;
}
@media (max-width: 560px) { .join-card { grid-template-columns: 1fr; gap: 0.8rem; } }
.join-card__tank {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 0.4rem;
  padding: 0.6rem 0.4rem;
  background: linear-gradient(var(--sea-0), var(--sea-2));
  border: var(--border);
  border-radius: 14px;
  min-height: 180px;
}
.join-card__fish { display: grid; place-items: center; animation: float 5s ease-in-out infinite; }
.join-card__fish .av { filter: drop-shadow(4px 4px 0 rgba(0, 0, 0, 0.25)); transition: opacity 0.3s, filter 0.3s; }
.join-card__fish.is-egg .av { opacity: 0.45; filter: grayscale(0.6) drop-shadow(4px 4px 0 rgba(0, 0, 0, 0.2)); }
.join-card__hint { margin: 0; font: 700 0.7rem var(--mono); letter-spacing: 0.04em; text-transform: uppercase; color: var(--paper); text-align: center; }
.join-card__fields { display: grid; gap: 0.7rem; align-content: center; }
.join-card__fields .input--pin { font-size: 1.5rem; }
.join-card__game { margin: -0.3rem 0 0; font-size: 0.85rem; font-weight: 800; color: #555; }
.join-card__game.is-found { color: #178f72; }
.join-card__game.is-missing { color: #d8512f; }
.join-card__legal { margin: 0; font-size: 0.78rem; font-weight: 500; color: #555; text-align: center; }
.join-card__legal a { color: inherit; }

/* ---------- landing sections under the join hero ---------- */
.landing { max-width: 100%; }
/* the sections sit in open water: the scene behind them darkens and the seabed rises as you scroll */
.land { position: relative; padding: 28px 16px 44px; text-align: center; }
.land__head { position: relative; display: inline-flex; align-items: center; }
.land__head .tag { position: absolute; left: -14px; top: -14px; z-index: 1; }
.land__sub { margin: 12px 0 0; font: 700 0.7rem var(--mono); letter-spacing: 0.08em; text-transform: uppercase; }
.land__cards, .land__steps {
  position: relative;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 14px;
  max-width: 1040px;
  margin: 24px auto 0;
  text-align: left;
}
.feat { padding: 16px 14px; display: grid; gap: 6px; justify-items: start; }
.feat__ico {
  position: relative;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--c);
  border: var(--border);
}
.feat__ico::after { content: ''; position: absolute; width: 12px; height: 6px; border-radius: 50%; background: #fff; top: 9px; left: 10px; transform: rotate(-35deg); opacity: 0.9; }
.feat__ico svg { width: 28px; height: 28px; }
.feat h3, .step h3 { margin: 4px 0 0; font: 600 1.1rem var(--display); }
.feat p, .step p { margin: 0; font-size: 0.9rem; color: #444; line-height: 1.4; }
.land__pills { position: relative; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 7px; margin-top: 22px; }
.land__pills b { font: 600 0.85rem var(--display); color: var(--ink); background: var(--paper); border: 2.5px solid var(--ink); border-radius: 999px; padding: 4px 12px; box-shadow: 2px 2px 0 var(--ink); }
.step { padding: 18px 14px; display: grid; gap: 6px; justify-items: center; text-align: center; }
.step__n {
  position: relative;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--c);
  border: var(--border);
  font: 700 1.4rem var(--display);
}
.step__n::after { content: ''; position: absolute; width: 10px; height: 5px; border-radius: 50%; background: #fff; top: 8px; left: 9px; transform: rotate(-35deg); }

.seabed { position: relative; display: grid; gap: 1.4rem; justify-items: center; padding: 24px 18px calc(18px + clamp(34px, 4vw, 52px)); color: var(--paper); text-shadow: 1px 1px 0 var(--ink); }
.seabed .powered { text-shadow: none; }
.seabed__row { width: 100%; }
.seabed__row { position: relative; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.seabed__links { display: flex; gap: 1rem; flex-wrap: wrap; }

/* ---------- in-game top bar ---------- */
.pbar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0.4rem 0.4rem 1rem;
  background: var(--paper);
  color: var(--ink);
  border: var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1rem;
}
.pbar { padding-left: 0.5rem; }
.pbar__av { display: grid; place-items: center; flex: none; }
.pbar__av .av { transition: width 0.6s cubic-bezier(0.2, 1.4, 0.4, 1); }
.pbar__name { font: 600 1rem var(--display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pbar__streak { font-size: 0.85rem; color: #d8512f; }
.pbar__score { margin-left: auto; font: 700 0.85rem var(--mono); background: var(--sun); border: 2.5px solid var(--ink); padding: 0.25em 0.8em; border-radius: 999px; white-space: nowrap; }
.pbar__score b { font-size: 1.05rem; }

.screen { flex: 1; display: flex; flex-direction: column; gap: 1rem; }
.screen--center { justify-content: center; text-align: center; align-items: center; }
/* the reaction bar sits at the bottom; matching auto margins keep the content centred above it */
.screen--center > :first-child { margin-top: auto; }

.hello { width: 100%; padding: 1.6rem 1.2rem; display: grid; gap: 0.5rem; justify-items: center; }
.hello .mono-label { color: var(--sea-2); }
.hello__fish { display: grid; place-items: center; margin: 0.2rem 0; animation: float 5s ease-in-out infinite; }
.hello__fish .av { filter: drop-shadow(4px 4px 0 rgba(0, 0, 0, 0.2)); }
.hello__name { margin: 0; font: 700 clamp(1.8rem, 9vw, 2.6rem) var(--display); line-height: 1; word-break: break-word; }
.hello .lead { font-size: 0.95rem; color: #444; font-weight: 500; }

.qcard { width: 100%; padding: 1rem 1.1rem; display: grid; gap: 0.5rem; justify-items: center; text-align: center; }
.q-text { margin: 0; font: 600 1.2rem var(--display); line-height: 1.3; }
.secs { font: 700 1.1rem var(--mono); background: var(--paper); color: var(--ink); border: 2.5px solid var(--ink); border-radius: 999px; padding: 0.15em 0.7em; min-width: 3em; text-align: center; }

.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; flex: 1; align-content: stretch; }
.tiles--2 { grid-template-columns: 1fr; }
.tiles .tile { min-height: 104px; }
@media (max-height: 640px) { .tiles .tile { min-height: 76px; } }

/* power-ups */
.powers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
.power {
  display: grid;
  gap: 0.1rem;
  justify-items: center;
  padding: 0.6rem 0.3rem 0.5rem;
  background: var(--paper);
  color: var(--ink);
  border: var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  font: 600 0.85rem var(--display);
}
.power__icon { display: grid; place-items: center; height: 1.6rem; font: 700 1.4rem var(--display); line-height: 1; }
.power__hint { font: 500 0.7rem var(--body); color: #666; }
.power:disabled { opacity: 0.45; cursor: not-allowed; }
.power.is-active { background: var(--sun); }
.power:active:not(:disabled) { transform: translate(3px, 3px); box-shadow: none; }

/* result */
.result { width: 100%; padding: 1.8rem 1.2rem; display: grid; gap: 0.5rem; justify-items: center; text-align: center; }
.result__title { margin: 0; font: 700 clamp(1.8rem, 9vw, 2.6rem) var(--display); line-height: 1; }
.result--good { background: var(--kelp); }
.result--bad { background: var(--coral); }
.result--none { background: var(--sand); }
.result__points { font: 700 1.9rem var(--mono); }
.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; justify-content: center; }
.answer-was { margin: 0; font-weight: 800; }

.reactions { display: flex; justify-content: center; gap: 0.35rem; flex-wrap: wrap; margin-top: auto; padding-top: 1rem; }
.reactions button {
  width: 52px;
  height: 52px;
  padding: 7px;
  background: var(--paper);
  border: 2.5px solid var(--ink);
  border-radius: 50%;
  box-shadow: 2px 2px 0 var(--ink);
  cursor: pointer;
}
.reactions button:active { transform: translate(2px, 2px); box-shadow: none; }

.podium-fish { display: grid; place-items: center; animation: float 5s ease-in-out infinite; }
.podium-fish .av { filter: drop-shadow(4px 4px 0 rgba(0, 0, 0, 0.25)); }
.place {
  position: relative;
  display: grid;
  place-items: center;
  width: min(40vw, 150px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--paper);
  color: var(--ink);
  border: 4px solid var(--ink);
  box-shadow: var(--shadow);
  font: 700 clamp(2.4rem, 14vw, 3.8rem) var(--display);
  line-height: 1;
}
.place::after { content: ''; position: absolute; width: 22%; height: 11%; border-radius: 50%; background: var(--water); top: 14%; left: 16%; transform: rotate(-35deg); }
.place small { font-size: 0.4em; margin-left: 0.04em; }
.place > span { display: inline-flex; align-items: baseline; }

.type-form { display: grid; gap: 0.7rem; }
.waiting { width: 100%; display: grid; gap: 0.6rem; justify-items: center; text-align: center; padding: 1.6rem 1rem; }
.waiting__title { margin: 0; font: 700 1.5rem var(--display); }
.bubbles-loader { display: flex; gap: 8px; align-items: flex-end; height: 24px; }
.bubbles-loader i { width: 14px; height: 14px; border-radius: 50%; background: var(--water); border: 2.5px solid var(--ink); animation: bob 1.1s ease-in-out infinite; }
.bubbles-loader i:nth-child(2) { width: 10px; height: 10px; animation-delay: 0.2s; }
.bubbles-loader i:nth-child(3) { width: 18px; height: 18px; animation-delay: 0.4s; }
@keyframes bob { 50% { transform: translateY(-8px); } }
.leave { align-self: center; background: none; border: 0; color: var(--paper); text-decoration: underline; text-underline-offset: 3px; opacity: 0.8; cursor: pointer; padding: 0.5rem; font-weight: 800; }

.pbar__team { padding: 0.25em 0.7em; }

/* the wager round */
.wagers { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.4rem; width: 100%; }
.wager { display: grid; gap: 0.1rem; padding: 0.5rem 0.2rem; background: var(--paper); color: var(--ink); border: var(--border); border-radius: 12px; box-shadow: var(--shadow-sm); font: 600 0.85rem var(--display); cursor: pointer; }
.wager small { font: 600 0.72rem var(--mono); color: #555; }
.wager.is-on { background: var(--sun); }
