:root {
  --ink: #050d22;
  --paper: #e8eefb;
  --gold: #e8c547;
  --blue: #1a4cff;
  --blue-deep: #1236b8;
  --yellow: #f5c400;
  --red: #e02424;
  --font-display: "Bebas Neue", "Arial Narrow", Impact, sans-serif;
  --font-body: "Manrope", "Segoe UI", sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; }
body {
  color: var(--paper);
  font-family: var(--font-body);
  background: var(--ink);
}
.atmosphere {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 70% 45% at 50% 0%, rgba(26, 76, 255, 0.28), transparent 55%),
    linear-gradient(180deg, #040814, #0c1730);
}
.hidden { display: none !important; }

.screen {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.2rem 3rem;
  text-align: center;
}
.eyebrow {
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: 0.75rem;
  color: rgba(232, 238, 251, 0.5);
  margin-bottom: 0.4rem;
}
h1 {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 9vw, 4.4rem);
  letter-spacing: 0.06em;
  font-weight: 400;
  line-height: 0.95;
}
.lead {
  margin: 0.7rem 0 1.4rem;
  color: rgba(232, 238, 251, 0.68);
  max-width: 28ch;
}
.modes {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  width: min(22rem, 100%);
}
.cta {
  appearance: none;
  border: 1px solid var(--blue);
  background: var(--blue);
  color: #fff;
  font: inherit;
  font-weight: 600;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  cursor: pointer;
}
.cta:hover { filter: brightness(1.08); }
.cta.alt { background: transparent; }
.net-box {
  width: min(22rem, 100%);
  margin-top: 1rem;
}
.net-join {
  display: flex;
  gap: 0.45rem;
  margin-top: 0.55rem;
}
.net-join input {
  flex: 1;
  min-width: 0;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font: inherit;
  font-weight: 700;
  text-align: center;
  border: 1px solid var(--blue);
  background: #0c1730;
  color: #fff;
  border-radius: 10px;
  padding: 0.85rem 0.6rem;
}
.net-join .cta { width: auto; }
.net-status {
  margin-top: 0.5rem;
  min-height: 1.2em;
  font-size: 0.88rem;
  color: var(--gold);
  word-break: break-all;
}

.back {
  color: rgba(232, 238, 251, 0.55);
  text-decoration: none;
  font-size: 0.9rem;
}
.back:hover { color: var(--gold); }
.screen .back { margin-bottom: 1.4rem; }

.play { padding: 0 1rem 2rem; }
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
}
.play h1 {
  font-size: clamp(1.7rem, 5vw, 2.4rem);
}
.play h1 small {
  display: inline-block;
  margin-left: 0.35rem;
  font-family: var(--font-body);
  font-size: 0.85rem;
  letter-spacing: 0.14em;
  color: var(--gold);
  vertical-align: middle;
}
.ghost {
  appearance: none;
  border: 1px solid rgba(232, 238, 251, 0.25);
  background: transparent;
  color: var(--paper);
  font: inherit;
  padding: 0.5rem 0.9rem;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
}
.ghost:hover { border-color: var(--gold); color: var(--gold); }

.score {
  text-align: center;
  font-size: 0.85rem;
  color: rgba(232, 238, 251, 0.5);
}
.status {
  text-align: center;
  margin: 0.25rem 0 0.85rem;
  color: var(--gold);
  min-height: 1.4em;
  font-weight: 600;
}
.status.win { color: #7dffb0; }
.status.draw { color: rgba(232, 238, 251, 0.7); }
.hint {
  text-align: center;
  margin-top: 0.85rem;
  font-size: 0.82rem;
  color: rgba(232, 238, 251, 0.45);
}
.play-actions {
  display: flex;
  justify-content: center;
  margin-top: 0.9rem;
}

.board-wrap {
  width: min(92vw, 78vh, 560px);
  margin: 0 auto;
}
.board {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.35rem;
  padding: 0.7rem 0.7rem 0.85rem;
  background:
    linear-gradient(180deg, #2a5dff, var(--blue) 40%, var(--blue-deep));
  border-radius: 18px;
  box-shadow:
    0 18px 50px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
.col {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  display: grid;
  grid-template-rows: repeat(6, minmax(0, 1fr));
  gap: 0.35rem;
  cursor: pointer;
  border-radius: 10px;
}
.col:hover:not(:disabled) { background: rgba(255, 255, 255, 0.08); }
.col:disabled { cursor: default; }
.cell {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #050d22;
  box-shadow: inset 0 4px 8px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}
.disc {
  position: absolute;
  inset: 7%;
  border-radius: 50%;
  transform: translateY(calc(-110% * var(--fall, 1)));
}
.disc.in {
  transform: none;
  animation: drop 0.38s cubic-bezier(0.2, 0.85, 0.3, 1);
}
.disc.y {
  background: radial-gradient(circle at 32% 28%, #ffe27a, var(--yellow) 46%, #b88600);
  box-shadow: 0 3px 0 #8a6500, inset 0 3px 6px rgba(255, 255, 255, 0.35);
}
.disc.r {
  background: radial-gradient(circle at 32% 28%, #ff7a7a, var(--red) 46%, #8d1010);
  box-shadow: 0 3px 0 #6d0d0d, inset 0 3px 6px rgba(255, 255, 255, 0.3);
}
.cell.win .disc {
  box-shadow: 0 0 0 3px #fff, 0 0 18px rgba(232, 197, 71, 0.9);
}

@keyframes drop {
  from { transform: translateY(calc(-110% * var(--fall, 6))); }
  to { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .disc.in { animation: none; }
}

@media (max-width: 520px) {
  .board { padding: 0.5rem; gap: 0.28rem; border-radius: 14px; }
  .col { gap: 0.28rem; }
}
:root {
  --ink: #050d22;
  --paper: #e8eefb;
  --gold: #e8c547;
  --blue: #1a4cff;
  --blue-deep: #1236b8;
  --yellow: #f5c400;
  --red: #e02424;
  --font-display: "Bebas Neue", "Arial Narrow", Impact, sans-serif;
  --font-body: "Manrope", "Segoe UI", sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; }
body {
  color: var(--paper);
  font-family: var(--font-body);
  background: var(--ink);
}
.atmosphere {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 70% 45% at 50% 0%, rgba(26, 76, 255, 0.28), transparent 55%),
    linear-gradient(180deg, #040814, #0c1730);
}
.hidden { display: none !important; }

.screen {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.2rem 3rem;
  text-align: center;
}
.eyebrow {
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: 0.75rem;
  color: rgba(232, 238, 251, 0.5);
  margin-bottom: 0.4rem;
}
h1 {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 9vw, 4.4rem);
  letter-spacing: 0.06em;
  font-weight: 400;
  line-height: 0.95;
}
.lead {
  margin: 0.7rem 0 1.4rem;
  color: rgba(232, 238, 251, 0.68);
  max-width: 28ch;
}
.modes {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  width: min(22rem, 100%);
}
.cta {
  appearance: none;
  border: 1px solid var(--blue);
  background: var(--blue);
  color: #fff;
  font: inherit;
  font-weight: 600;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  cursor: pointer;
}
.cta:hover { filter: brightness(1.08); }
.cta.alt { background: transparent; }
.net-box {
  width: min(22rem, 100%);
  margin-top: 1rem;
}
.net-join {
  display: flex;
  gap: 0.45rem;
  margin-top: 0.55rem;
}
.net-join input {
  flex: 1;
  min-width: 0;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font: inherit;
  font-weight: 700;
  text-align: center;
  border: 1px solid var(--blue);
  background: #0c1730;
  color: #fff;
  border-radius: 10px;
  padding: 0.85rem 0.6rem;
}
.net-join .cta { width: auto; }
.net-status {
  margin-top: 0.5rem;
  min-height: 1.2em;
  font-size: 0.88rem;
  color: var(--gold);
  word-break: break-all;
}

.back {
  color: rgba(232, 238, 251, 0.55);
  text-decoration: none;
  font-size: 0.9rem;
}
.back:hover { color: var(--gold); }
.screen .back { margin-bottom: 1.4rem; }

.play { padding: 0 1rem 2rem; }
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
}
.play h1 {
  font-size: clamp(1.7rem, 5vw, 2.4rem);
}
.play h1 small {
  display: inline-block;
  margin-left: 0.35rem;
  font-family: var(--font-body);
  font-size: 0.85rem;
  letter-spacing: 0.14em;
  color: var(--gold);
  vertical-align: middle;
}
.ghost {
  appearance: none;
  border: 1px solid rgba(232, 238, 251, 0.25);
  background: transparent;
  color: var(--paper);
  font: inherit;
  padding: 0.5rem 0.9rem;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
}
.ghost:hover { border-color: var(--gold); color: var(--gold); }

.score {
  text-align: center;
  font-size: 0.85rem;
  color: rgba(232, 238, 251, 0.5);
}
.status {
  text-align: center;
  margin: 0.25rem 0 0.85rem;
  color: var(--gold);
  min-height: 1.4em;
  font-weight: 600;
}
.status.win { color: #7dffb0; }
.status.draw { color: rgba(232, 238, 251, 0.7); }
.hint {
  text-align: center;
  margin-top: 0.85rem;
  font-size: 0.82rem;
  color: rgba(232, 238, 251, 0.45);
}
.play-actions {
  display: flex;
  justify-content: center;
  margin-top: 0.9rem;
}

.board-wrap {
  width: min(92vw, 78vh, 560px);
  margin: 0 auto;
}
.board {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.35rem;
  padding: 0.7rem 0.7rem 0.85rem;
  background:
    linear-gradient(180deg, #2a5dff, var(--blue) 40%, var(--blue-deep));
  border-radius: 18px;
  box-shadow:
    0 18px 50px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
.col {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  display: grid;
  grid-template-rows: repeat(6, minmax(0, 1fr));
  gap: 0.35rem;
  cursor: pointer;
  border-radius: 10px;
}
.col:hover:not(:disabled) { background: rgba(255, 255, 255, 0.08); }
.col:disabled { cursor: default; }
.cell {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #050d22;
  box-shadow: inset 0 4px 8px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}
.disc {
  position: absolute;
  inset: 7%;
  border-radius: 50%;
  transform: translateY(calc(-110% * var(--fall, 1)));
}
.disc.in {
  transform: none;
  animation: drop 0.38s cubic-bezier(0.2, 0.85, 0.3, 1);
}
.disc.y {
  background: radial-gradient(circle at 32% 28%, #ffe27a, var(--yellow) 46%, #b88600);
  box-shadow: 0 3px 0 #8a6500, inset 0 3px 6px rgba(255, 255, 255, 0.35);
}
.disc.r {
  background: radial-gradient(circle at 32% 28%, #ff7a7a, var(--red) 46%, #8d1010);
  box-shadow: 0 3px 0 #6d0d0d, inset 0 3px 6px rgba(255, 255, 255, 0.3);
}
.cell.win .disc {
  box-shadow: 0 0 0 3px #fff, 0 0 18px rgba(232, 197, 71, 0.9);
}

@keyframes drop {
  from { transform: translateY(calc(-110% * var(--fall, 6))); }
  to { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .disc.in { animation: none; }
}

@media (max-width: 520px) {
  .board { padding: 0.5rem; gap: 0.28rem; border-radius: 14px; }
  .col { gap: 0.28rem; }
}
