:root {
  --ink: #171629;
  --cream: #f6f0e4;
  --paper: #fffaf0;
  --blue: #5d5be7;
  --blue-dark: #3f3cae;
  --red: #f05a4f;
  --yellow: #f7c843;
  --muted: #6f6a7d;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 10%, rgba(247,200,67,.35), transparent 24rem),
    radial-gradient(circle at 90% 85%, rgba(93,91,231,.22), transparent 26rem),
    var(--cream);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .22;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.16'/%3E%3C/svg%3E");
}

main { width: min(940px, calc(100% - 32px)); margin: 0 auto; padding: 26px 0 50px; position: relative; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 900; letter-spacing: .16em; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; color: white; background: var(--ink); border-radius: 50%; font-family: Georgia, serif; font-style: italic; font-size: 21px; }
.card { margin-top: clamp(60px, 12vh, 120px); max-width: 650px; }
.eyebrow { color: var(--blue-dark); font-size: 12px; font-weight: 900; letter-spacing: .18em; }
h1 { margin: 18px 0; font-size: clamp(52px, 10vw, 94px); line-height: .88; letter-spacing: -.065em; }
h1 em { color: var(--blue); font-family: Georgia, serif; font-weight: 400; }
.home p { max-width: 490px; color: var(--muted); font-size: clamp(17px, 2vw, 20px); line-height: 1.55; }
button { border: 0; font: inherit; cursor: pointer; }
.primary { margin-top: 20px; padding: 17px 21px; display: inline-flex; gap: 36px; align-items: center; justify-content: space-between; background: var(--ink); color: white; border-radius: 14px; font-weight: 800; box-shadow: 0 8px 0 rgba(23,22,41,.15); transition: transform .15s, box-shadow .15s; }
.primary:hover { transform: translateY(-2px); box-shadow: 0 10px 0 rgba(23,22,41,.15); }
.primary:active { transform: translateY(4px); box-shadow: 0 3px 0 rgba(23,22,41,.15); }
.primary:disabled { opacity: .55; cursor: wait; }
.hidden { display: none !important; }

.game { margin-top: 44px; }
.game-top { display: flex; justify-content: space-between; align-items: end; gap: 20px; }
h2 { margin: 5px 0 0; font-family: Georgia, serif; font-size: clamp(30px, 6vw, 48px); font-weight: 500; }
h2 span { color: var(--blue); letter-spacing: .06em; }
.secondary { padding: 12px 16px; border: 2px solid var(--ink); background: transparent; border-radius: 12px; font-weight: 800; }
.notice { margin: 26px 0 14px; padding: 13px 16px; text-align: center; color: white; background: var(--ink); border-radius: 12px; font-weight: 750; }
.players { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; margin: 20px 0; }
.player { display: flex; gap: 12px; align-items: center; padding: 12px 15px; border: 2px solid transparent; border-radius: 14px; opacity: .6; }
.player:last-child { justify-content: flex-end; text-align: right; }
.player.active { opacity: 1; border-color: var(--ink); background: rgba(255,255,255,.4); }
.player.you strong::after { content: " · YOU"; font-size: 11px; letter-spacing: .08em; color: var(--blue-dark); }
.player small { display: block; color: var(--muted); font-weight: 800; font-size: 9px; letter-spacing: .14em; }
.player strong { display: block; font-size: 15px; }
.disc { flex: 0 0 auto; width: 32px; height: 32px; border-radius: 50%; box-shadow: inset 0 -5px 0 rgba(0,0,0,.13); }
.red .disc { background: var(--red); }
.yellow .disc { background: var(--yellow); }
.versus { font: italic 18px Georgia, serif; color: var(--muted); }

.board-wrap { position: relative; max-width: 700px; margin: 0 auto; }
.columns { position: absolute; inset: 0; z-index: 3; display: grid; grid-template-columns: repeat(7, 1fr); }
.column { background: transparent; border-radius: 20px 20px 0 0; }
.column:hover:not(:disabled) { background: rgba(255,255,255,.13); }
.board { position: relative; display: grid; grid-template-columns: repeat(7, 1fr); gap: clamp(5px, 1.4vw, 12px); padding: clamp(10px, 2vw, 20px); background: var(--blue); border: 3px solid var(--ink); border-radius: 24px; box-shadow: 0 13px 0 var(--blue-dark), 0 17px 0 var(--ink); }
.cell { aspect-ratio: 1; border-radius: 50%; background: var(--paper); border: clamp(2px, .45vw, 4px) solid var(--blue-dark); box-shadow: inset 0 5px 0 rgba(23,22,41,.16); }
.cell.p1, .cell.p2 { animation: drop .3s cubic-bezier(.2,.8,.3,1.2); }
.cell.p1 { background: var(--red); box-shadow: inset 0 -8px 0 rgba(130,30,30,.18); }
.cell.p2 { background: var(--yellow); box-shadow: inset 0 -8px 0 rgba(140,90,10,.16); }
.cell.win { outline: 4px solid white; outline-offset: -7px; animation: pulse .8s ease-in-out infinite alternate; }
@keyframes drop { from { transform: translateY(-65px); opacity: .4; } }
@keyframes pulse { to { transform: scale(.88); } }
.actions { min-height: 82px; margin-top: 28px; text-align: center; }
.compact { margin: 0 15px 0 0; gap: 15px; }
.text-link { color: var(--muted); font-weight: 750; text-decoration: none; }
.toast { position: fixed; left: 50%; bottom: 22px; z-index: 10; transform: translate(-50%, 120px); padding: 12px 17px; border-radius: 12px; background: var(--ink); color: white; font-weight: 700; transition: transform .25s; }
.toast.show { transform: translate(-50%, 0); }

@media (max-width: 560px) {
  main { width: min(100% - 20px, 940px); padding-top: 16px; }
  .game { margin-top: 28px; }
  .game-top { align-items: center; }
  .secondary { padding: 10px 12px; font-size: 12px; }
  .players { gap: 5px; }
  .player { padding: 8px 5px; gap: 6px; }
  .disc { width: 25px; height: 25px; }
  .board { border-radius: 17px; }
  .notice { font-size: 14px; }
}
