:root {
  color-scheme: light;
  --panel: rgba(4, 20, 33, 0.78);
  --text: #f2fbff;
  --muted: rgba(242, 251, 255, 0.72);
  --accent: #ffd166;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.28);
  --headline: Georgia, "Times New Roman", serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Trebuchet MS", Verdana, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top, rgba(141, 224, 255, 0.38), transparent 30%),
    linear-gradient(180deg, #63c0e9 0%, #147bb1 24%, #0d5c8e 58%, #093e67 100%);
}

body {
  min-height: 100vh;
}

.shell {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  min-height: 100vh;
  gap: 18px;
  padding-right: 18px;
}

.panel {
  background: var(--panel);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: var(--shadow);
}

.sidebar {
  position: relative;
  z-index: 2;
  padding: 18px;
  display: grid;
  grid-template-rows: auto auto auto 1fr;
  gap: 12px;
}

.brand {
  font-family: var(--headline);
  line-height: 0.95;
  margin: 0;
  font-size: 2.2rem;
  text-transform: uppercase;
  color: var(--accent);
}

.join-form {
  display: grid;
  gap: 8px;
}

.label,
.section-title {
  color: var(--muted);
}

.join-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 82px;
  gap: 10px;
}

input,
button {
  border: 0;
  border-radius: 999px;
  font: inherit;
}

input {
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.92);
  color: #0a2438;
}

button {
  padding: 12px 18px;
  cursor: pointer;
  transition: transform 120ms ease;
}

button:hover {
  transform: translateY(-1px);
}

button:active {
  transform: translateY(1px);
}

.join-form button,
.ghost-button:hover {
  background: linear-gradient(135deg, #ffe38a, #ffbd59);
  color: #0b2940;
  font-weight: 700;
}

.ghost-button {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.left-stats {
  display: grid;
  gap: 10px;
}

.score-chip {
  padding: 14px 18px;
  border-radius: 18px;
  background: rgba(6, 29, 47, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.label {
  display: block;
  font-size: 0.8rem;
}

.score-chip strong {
  font-size: clamp(1.6rem, 3vw, 2.5rem);
}

.scoreboard {
  padding: 16px;
  border-radius: 24px;
  min-height: 0;
}

.section-title {
  margin-bottom: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  font-size: 0.78rem;
}

.score-list {
  display: grid;
  gap: 10px;
  max-height: calc(100vh - 250px);
  overflow: auto;
}

.score-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 6px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
}

.score-row.is-you {
  outline: 2px solid rgba(255, 209, 102, 0.7);
}

.score-name {
  font-weight: 700;
  color: var(--text);
}

.score-value {
  font-size: 1.2rem;
  color: var(--accent);
}

.game-area {
  padding: 18px 0 18px 0;
  min-width: 0;
}

.pond {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: calc(100vh - 36px);
  border-radius: 36px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: var(--shadow);
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.25), transparent 34%),
    linear-gradient(180deg, rgba(140, 225, 255, 0.55) 0%, rgba(24, 127, 188, 0.65) 24%, rgba(10, 78, 123, 0.86) 65%, rgba(5, 43, 73, 1) 100%);
}

.pond::before,
.pond::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.pond::before {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.2), transparent 16%),
    repeating-linear-gradient(120deg, rgba(255, 255, 255, 0.08) 0 2px, transparent 2px 38px);
  mix-blend-mode: screen;
  opacity: 0.35;
}

.pond::after {
  top: auto;
  height: 18%;
  background:
    radial-gradient(circle at 12% 38%, rgba(145, 225, 255, 0.3), transparent 24%),
    radial-gradient(circle at 72% 58%, rgba(145, 225, 255, 0.22), transparent 26%),
    linear-gradient(180deg, transparent 0%, rgba(4, 20, 34, 0.4) 100%);
}

.fish {
  position: absolute;
  width: 78px;
  height: 38px;
  transform: translate(-50%, -50%);
  background: transparent;
  padding: 0;
  border-radius: 0;
  touch-action: manipulation;
}

.fish-body {
  position: absolute;
  inset: 6px 16px 6px 4px;
  border-radius: 50% 60% 60% 50%;
  background:
    radial-gradient(circle at 30% 35%, rgba(255, 255, 255, 0.9), transparent 26%),
    linear-gradient(135deg, hsl(var(--fish-hue), 70%, 72%), hsl(calc(var(--fish-hue) + 35), 70%, 44%));
  box-shadow: inset -8px -6px 10px rgba(7, 33, 54, 0.2);
}

.fish-tail {
  position: absolute;
  right: 0;
  top: 9px;
  width: 24px;
  height: 20px;
  background: linear-gradient(135deg, hsl(calc(var(--fish-hue) + 30), 70%, 55%), hsl(calc(var(--fish-hue) - 15), 75%, 38%));
  clip-path: polygon(0 50%, 100% 0, 82% 50%, 100% 100%);
}

.fish-fin {
  position: absolute;
  width: 16px;
  height: 12px;
  background: rgba(255, 255, 255, 0.28);
  clip-path: polygon(0 100%, 50% 0, 100% 100%);
}

.fish-fin.top {
  top: 2px;
  left: 30px;
}

.fish-fin.bottom {
  bottom: 2px;
  left: 26px;
  transform: rotate(180deg);
}

.fish-eye {
  position: absolute;
  left: 15px;
  top: 15px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #08263a;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.8);
}

.game-over {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--headline);
  font-size: clamp(3rem, 9vw, 7rem);
  letter-spacing: 0.06em;
  color: white;
  background: rgba(3, 16, 29, 0.35);
  z-index: 5;
}

.game-over[hidden] {
  display: none !important;
}

@media (max-width: 1100px) {
  .shell {
    grid-template-columns: 1fr;
    gap: 0;
    padding-right: 0;
  }

  .game-area {
    padding: 0 18px 18px;
  }

  .pond {
    height: 60vh;
    border-radius: 36px;
  }

  .score-list {
    max-height: 280px;
  }
}

@media (max-width: 800px) {
  .join-row {
    grid-template-columns: 1fr;
  }
}
