:root {
  --ink: #102b2f;
  --muted: #4b6970;
  --paper: #fffaf0;
  --panel: #f8fff8;
  --line: #1b6b73;
  --water: #44b7d6;
  --water-dark: #157898;
  --coin: #f4b73d;
  --leaf: #58b66a;
  --coral: #ee6c5d;
  --violet: #7a6be8;
  --shadow: rgba(17, 63, 68, 0.18);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0)),
    linear-gradient(135deg, #c7eff2 0%, #e9f9d0 48%, #ffd7b9 100%);
  font-family: 'Nunito', system-ui, sans-serif;
}

.privacy-page {
  width: min(860px, 94vw);
  margin: 0 auto;
  padding: 30px 0 46px;
}

.privacy-panel {
  border: 3px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--paper) 90%, white);
  padding: 18px;
  box-shadow: 0 7px 0 var(--shadow);
}

.privacy-panel p {
  color: var(--muted);
  font-weight: 800;
}

.privacy-back {
  display: inline-block;
  margin-top: 8px;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.game-shell {
  width: min(1180px, 94vw);
  margin: 0 auto;
  padding: 18px 0 34px;
}

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 4px 0 14px;
}

.masthead .text-button {
  white-space: nowrap;
}

.current-aquarium {
  margin: 6px 0 0;
  color: #35656c;
  font-size: 0.92rem;
  font-weight: 800;
}

.site-summary {
  max-width: 560px;
  margin: 4px 0 0;
  color: #35656c;
  font-size: 0.96rem;
  font-weight: 800;
}

.eyebrow,
.section-kicker {
  margin: 0;
  color: #27626a;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  font-family: 'Baloo 2', system-ui, sans-serif;
  line-height: 0.95;
}

h1 {
  margin: 2px 0 0;
  font-size: clamp(2.25rem, 6vw, 4.7rem);
}

h2 {
  margin: 3px 0 0;
  font-size: clamp(1.55rem, 3vw, 2.1rem);
}

h3 {
  margin: 0 0 5px;
  font-size: 1.35rem;
}

.wallet {
  min-width: 156px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 3px solid #8e6615;
  border-radius: 8px;
  background: #fff1b7;
  padding: 9px 12px;
  box-shadow: 0 5px 0 rgba(142, 102, 21, 0.2);
}

.coin-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 3px solid #ad7816;
  border-radius: 50%;
  background: var(--coin);
  color: #5b3a00;
  font-weight: 900;
}

.wallet span:not(.coin-icon) {
  color: #6d551c;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.wallet strong {
  display: block;
  font-size: 1.35rem;
}

.wallet small {
  display: block;
  color: #5d7425;
  font-size: 0.78rem;
  font-weight: 900;
}

.wallet small.in-debt {
  color: #a7352e;
}

.dashboard,
.market-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.94fr) minmax(0, 1.06fr);
  gap: 14px;
  margin-bottom: 14px;
}

.math-panel,
.aquarium-panel,
.store-panel,
.collection-panel {
  border: 3px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--paper) 88%, white);
  padding: 14px;
  box-shadow: 0 7px 0 var(--shadow);
}

.panel-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.grade-select {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

select,
input {
  border: 2px solid #2e7880;
  border-radius: 8px;
  background: white;
  color: var(--ink);
  font-weight: 900;
}

select {
  min-width: 80px;
  padding: 7px 8px;
}

.question-card {
  min-height: 238px;
  display: grid;
  align-content: center;
  gap: 12px;
  border: 3px solid #2e7880;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.35)),
    linear-gradient(135deg, #e4fbff, #f5ffe2);
  padding: 16px;
}

.question-card p {
  margin: 0;
}

#questionType {
  color: #396870;
  font-weight: 900;
}

#questionText {
  min-height: 64px;
  display: flex;
  align-items: center;
  font-family: 'Baloo 2', system-ui, sans-serif;
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 0.95;
}

.answer-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.answer-form input {
  min-width: 0;
  padding: 10px 12px;
  font-size: 1.25rem;
}

.answer-form button,
.secondary-button,
.supply-card,
#tradeButton,
.coin-vault button,
.coin-room-entrance button {
  border: 0;
  border-radius: 8px;
  background: var(--coral);
  color: white;
  font-weight: 900;
  padding: 10px 13px;
  box-shadow: 0 4px 0 rgba(102, 43, 36, 0.2);
}

.secondary-button {
  background: var(--leaf);
}

.text-button {
  border: 2px solid #2e7880;
  border-radius: 8px;
  background: white;
  color: #255d65;
  font-weight: 900;
  padding: 8px 11px;
}

.feedback {
  min-height: 24px;
  color: var(--muted);
  font-weight: 800;
}

.feedback.good {
  color: #176b37;
}

.feedback.bad {
  color: #a7352e;
}

.streak-row,
.tank-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.streak-row div,
.tank-stats span {
  min-height: 56px;
  border: 2px solid #2e7880;
  border-radius: 8px;
  background: #eefcff;
  padding: 8px;
  font-weight: 900;
}

.streak-row span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
}

.streak-row strong {
  display: block;
  margin-top: 2px;
  font-size: 1.25rem;
}

.tank-scene {
  position: relative;
  min-height: 295px;
  overflow: hidden;
  border: 4px solid #17677a;
  border-radius: 8px;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.8) 0 2px, transparent 3px),
    linear-gradient(180deg, #71d7ed 0%, #29aacb 56%, #167b9e 100%);
}

.tank-scene.low-food {
  border-color: #c04b42;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.8) 0 2px, transparent 3px),
    linear-gradient(180deg, #73c9df 0%, #2a9ebe 56%, #87676b 100%);
}

.tank-scene::before {
  content: '';
  position: absolute;
  inset: auto 0 0;
  height: 46px;
  background:
    radial-gradient(ellipse at 12% 100%, #ffe08b 0 20px, transparent 21px),
    radial-gradient(ellipse at 48% 100%, #f7c766 0 26px, transparent 27px),
    radial-gradient(ellipse at 82% 100%, #ffdc86 0 22px, transparent 23px);
}

.tank-scene::after {
  content: '';
  position: absolute;
  left: 18px;
  bottom: 26px;
  width: 44px;
  height: 88px;
  border-radius: 60% 35% 55% 35%;
  background: #3cae62;
  box-shadow: 24px 12px 0 #2d9153, 380px 18px 0 #3cae62, 408px 3px 0 #2d9153;
  opacity: 0.9;
}

.swim-fish,
.fish-preview {
  --fish-color: #ffbc5b;
  --size-scale: 1;
  --growth-scale: 1;
  position: relative;
  display: inline-block;
  width: 58px;
  height: 28px;
  color: var(--fish-color);
  transform: scale(calc(var(--size-scale) * var(--growth-scale)));
  transform-origin: center;
}

.swim-fish {
  position: absolute;
  top: var(--lane);
  left: -74px;
  z-index: 2;
  animation: swim 8s linear infinite;
  animation-delay: var(--delay);
}

.swim-fish span,
.fish-preview span {
  position: absolute;
  inset: 5px 10px 5px 0;
  border-radius: 60% 50% 50% 60%;
  background: currentColor;
  box-shadow: inset -8px -4px 0 rgba(0, 0, 0, 0.12);
}

.swim-fish span::before,
.fish-preview span::before {
  content: '';
  position: absolute;
  right: -14px;
  top: 2px;
  width: 18px;
  height: 18px;
  clip-path: polygon(0 50%, 100% 0, 100% 100%);
  background: currentColor;
}

.swim-fish span::after,
.fish-preview span::after {
  content: '';
  position: absolute;
  left: 8px;
  top: 5px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #07323a;
}

.fish-tiny {
  --size-scale: 0.74;
}

.fish-small {
  --size-scale: 0.9;
}

.fish-medium {
  --size-scale: 1;
}

.fish-large {
  --size-scale: 1.2;
}

.fish-giant {
  --size-scale: 1.48;
}

.swim-fish.growth-baby {
  --growth-scale: 0.68;
  opacity: 0.78;
}

.swim-fish.growth-growing {
  --growth-scale: 0.84;
  opacity: 0.9;
}

.swim-fish.growth-adult {
  filter: saturate(1.12);
}

.bubble {
  position: absolute;
  bottom: 38px;
  width: 12px;
  height: 12px;
  border: 2px solid rgba(255, 255, 255, 0.72);
  border-radius: 50%;
  animation: bubble 4.8s ease-in infinite;
}

.tank-stats span {
  display: grid;
  place-items: center;
  text-align: center;
}

.tank-emergency {
  margin-top: 10px;
  border: 3px solid #a7352e;
  border-radius: 8px;
  background: #fff2ed;
  padding: 12px;
}

.tank-emergency h3 {
  margin: 0 0 5px;
}

.tank-emergency p {
  margin: 0 0 10px;
  color: #6f3b35;
  font-weight: 800;
}

.emergency-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.emergency-actions button {
  border: 0;
  border-radius: 8px;
  background: #a7352e;
  color: white;
  font-weight: 900;
  padding: 10px 12px;
  box-shadow: 0 4px 0 rgba(102, 43, 36, 0.2);
}

.emergency-actions button:last-child {
  background: #4b6970;
}

.store-list,
.supply-list,
.collection-list {
  display: grid;
  gap: 8px;
}

.fish-card,
.supply-card,
.collection-row {
  width: 100%;
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 2px solid #2e7880;
  border-radius: 8px;
  background: white;
  color: var(--ink);
  padding: 9px;
  text-align: left;
}

.fish-card {
  min-height: 72px;
}

.fish-card strong,
.collection-row strong {
  display: block;
  line-height: 1.05;
}

.fish-card small,
.collection-row span:last-child {
  display: block;
  color: var(--muted);
  font-weight: 800;
}

.price {
  max-width: 132px;
  border-radius: 999px;
  background: #fff0b8;
  color: #614706;
  padding: 5px 8px;
  font-weight: 900;
  text-align: center;
}

.supply-card {
  grid-template-columns: 1fr auto;
  background: #fffefa;
  color: var(--ink);
}

.supply-card.premium {
  border-color: #6a60bd;
  background: #f2f0ff;
}

.collection-panel {
  margin-top: 14px;
}

.coin-room-entrance {
  margin: 14px 0;
}

.coin-room-entrance button {
  width: 100%;
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background:
    linear-gradient(135deg, #6a60bd, #2e7880);
  text-align: left;
}

.coin-room-entrance span {
  font-family: 'Baloo 2', system-ui, sans-serif;
  font-size: clamp(1.4rem, 3vw, 2rem);
  line-height: 1;
}

.coin-room-entrance strong {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  padding: 7px 10px;
}

.coin-room {
  margin: 14px 0;
  border: 3px solid #4e489b;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.55)),
    linear-gradient(135deg, #f2f0ff, #e5fbff);
  padding: 14px;
  box-shadow: 0 7px 0 var(--shadow);
}

.coin-room-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.coin-vault {
  border: 2px solid #6a60bd;
  border-radius: 8px;
  background: white;
  padding: 12px;
}

.koi-card-top {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.koi-card-top .fish-preview {
  justify-self: center;
}

.koi-card-top h3 {
  margin-bottom: 4px;
}

.coin-vault p {
  min-height: 54px;
  margin: 0 0 10px;
  color: var(--muted);
  font-weight: 800;
}

.coin-vault button {
  width: 100%;
  margin-top: 8px;
  background: var(--violet);
}

.collection-list {
  grid-template-columns: repeat(auto-fit, minmax(245px, 1fr));
}

.aquarium-panel-list {
  margin-top: 14px;
}

.aquarium-feedback {
  min-height: 22px;
  margin: 0 0 10px;
  color: #8d2f29;
  font-weight: 900;
}

.aquarium-row {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 2px solid #2e7880;
  border-radius: 8px;
  background: white;
  color: var(--ink);
  padding: 10px;
}

.aquarium-row strong {
  display: block;
  margin-bottom: 4px;
}

.aquarium-row small {
  display: block;
  color: var(--muted);
  font-weight: 800;
}

.aquarium-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.danger-button {
  border: 2px solid #b6473f;
  border-radius: 8px;
  background: #fff2ef;
  color: #8d2f29;
  font-weight: 900;
  padding: 8px 11px;
}

.collection-row {
  grid-template-columns: 72px 78px minmax(0, 1fr);
  row-gap: 2px;
  min-height: 64px;
}

.collection-row .fish-preview {
  --growth-scale: 0.82;
}

.collection-row > span:last-child {
  grid-column: 3;
  justify-self: start;
}

.rank-badge {
  white-space: nowrap;
  border-radius: 999px;
  background: #e2f7ec;
  color: #22623b;
  padding: 5px 8px;
  font-size: 0.78rem;
  font-weight: 900;
}

@keyframes swim {
  0% {
    left: -82px;
  }
  100% {
    left: calc(100% + 82px);
  }
}

@keyframes bubble {
  0% {
    transform: translateY(0);
    opacity: 0;
  }
  20% {
    opacity: 0.8;
  }
  100% {
    transform: translateY(-210px);
    opacity: 0;
  }
}

@media (max-width: 850px) {
  .dashboard,
  .market-grid,
  .coin-room-grid {
    grid-template-columns: 1fr;
  }

  .masthead {
    align-items: stretch;
    flex-direction: column;
  }

  .wallet {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .game-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 12px;
  }

  .panel-top,
  .answer-form {
    grid-template-columns: 1fr;
  }

  .panel-top {
    display: grid;
  }

  .answer-form button,
  .secondary-button,
  .text-button,
  .coin-vault button {
    width: 100%;
  }

  .coin-room-entrance button {
    align-items: flex-start;
    flex-direction: column;
  }

  .streak-row,
  .tank-stats,
  .emergency-actions {
    grid-template-columns: 1fr;
  }

  .fish-card {
    grid-template-columns: 54px minmax(0, 1fr);
  }

  .fish-card .price {
    grid-column: 2;
    justify-self: start;
  }

  .collection-row {
    grid-template-columns: 72px 68px minmax(0, 1fr);
  }

  .collection-row > span:last-child {
    grid-column: 3;
    justify-self: start;
  }

  .aquarium-row {
    grid-template-columns: 1fr;
  }

  .aquarium-actions {
    justify-content: stretch;
  }
}
.swim-fish,
.fish-preview {
  --fish-pattern-a: var(--fish-color, #ffbc5b);
  --fish-pattern-b: var(--fish-color, #ffbc5b);
  --fish-pattern-c: var(--fish-color, #ffbc5b);
}

.swim-fish.koi-pattern span,
.fish-preview.koi-pattern span {
  background:
    radial-gradient(circle at 18% 22%, var(--fish-pattern-b) 0 12%, transparent 13%),
    radial-gradient(circle at 52% 38%, var(--fish-pattern-c) 0 10%, transparent 11%),
    radial-gradient(circle at 76% 60%, var(--fish-pattern-b) 0 13%, transparent 14%),
    radial-gradient(circle at 36% 72%, var(--fish-pattern-c) 0 8%, transparent 9%),
    linear-gradient(135deg, var(--fish-pattern-a) 0%, color-mix(in srgb, var(--fish-pattern-a) 78%, white) 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.swim-fish.koi-pattern span::before,
.fish-preview.koi-pattern span::before {
  background:
    radial-gradient(circle at 30% 50%, color-mix(in srgb, var(--fish-pattern-b) 88%, white) 0 30%, transparent 31%),
    linear-gradient(135deg, var(--fish-pattern-a) 0%, var(--fish-pattern-c) 100%);
}

.cookie-banner {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 20;
  width: min(520px, calc(100vw - 32px));
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  border: 3px solid #2e7880;
  border-radius: 8px;
  background: #fffdf5;
  color: var(--ink);
  padding: 14px;
  box-shadow: 0 8px 24px rgba(17, 63, 68, 0.26);
}

.cookie-banner[hidden] {
  display: none;
}

.cookie-banner strong {
  display: block;
  margin-bottom: 4px;
  font-family: 'Baloo 2', system-ui, sans-serif;
  font-size: 1.2rem;
  line-height: 1;
}

.cookie-banner p {
  margin: 0 0 6px;
  color: var(--muted);
  font-weight: 800;
}

.cookie-banner a {
  color: #1b6b73;
  font-weight: 900;
}

.cookie-actions {
  display: grid;
  gap: 8px;
}

.cookie-actions .text-button,
.cookie-actions .secondary-button {
  white-space: nowrap;
}

@media (max-width: 560px) {
  .cookie-banner {
    grid-template-columns: 1fr;
  }

  .cookie-actions {
    grid-template-columns: 1fr;
  }
}
