:root {
  --cobalt: #2347A8;
  --cobalt-hi: #2E56C2;
  --shadow: #13285F;
  --green: #66C424;
  --green-dark: #4A9415;
  --coral: #FF7A59;
  --coral-dark: #D9553A;
  --white: #F4F6FB;
  --display: "Fredoka", "Trebuchet MS", sans-serif;
  --body: "Mukta", system-ui, sans-serif;
  /* speckled moulded plastic */
  --speckle: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='90' height='90'%3E%3Cg fill='%23ffffff'%3E%3Ccircle cx='7' cy='12' r='1' opacity='.18'/%3E%3Ccircle cx='41' cy='5' r='.8' opacity='.14'/%3E%3Ccircle cx='71' cy='22' r='1.2' opacity='.12'/%3E%3Ccircle cx='24' cy='44' r='.7' opacity='.2'/%3E%3Ccircle cx='58' cy='51' r='1' opacity='.15'/%3E%3Ccircle cx='84' cy='66' r='.8' opacity='.18'/%3E%3Ccircle cx='15' cy='77' r='1.1' opacity='.13'/%3E%3Ccircle cx='47' cy='83' r='.7' opacity='.17'/%3E%3C/g%3E%3Cg fill='%23000000'%3E%3Ccircle cx='33' cy='27' r='.9' opacity='.16'/%3E%3Ccircle cx='79' cy='41' r='.7' opacity='.14'/%3E%3Ccircle cx='9' cy='59' r='.8' opacity='.15'/%3E%3Ccircle cx='66' cy='79' r='1' opacity='.12'/%3E%3C/g%3E%3C/svg%3E");
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--cobalt) var(--speckle); color: var(--white); font: 17px/1.55 var(--body); }
a { color: #C8F59F; }
button { font: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.5; }
h1, h2 { font-family: var(--display); font-weight: 700; line-height: 1.05; margin: 0; }

.top { display: flex; justify-content: space-between; align-items: center; padding: 16px clamp(16px, 4vw, 48px); }
.logo { display: flex; align-items: center; gap: 10px; color: var(--white); text-decoration: none; font: 700 26px/1 var(--display); }
.connect { background: var(--white); color: var(--shadow); border: 0; border-radius: 999px; padding: 10px 18px; font: 600 16px var(--display); box-shadow: 0 4px 0 var(--shadow); }

main { max-width: 1180px; margin: 0 auto; padding: 0 clamp(12px, 4vw, 48px) 40px; }

/* ---------- the upright board */
.play { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr); gap: clamp(20px, 4vw, 48px); align-items: start; margin-top: 8px; }
.rack { position: relative; }
.board {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 0;
  background: var(--shadow) var(--speckle); border-radius: 26px; padding: 12px;
  box-shadow: inset 0 -8px 0 rgba(0, 0, 0, 0.25), 0 18px 0 rgba(10, 22, 56, 0.45);
}
.col { position: relative; display: grid; grid-template-rows: repeat(6, 1fr); gap: 0; background: none; border: 0; padding: 0; border-radius: 16px; }
.col:hover:not(:disabled), .col:focus-visible { background: rgba(255, 255, 255, 0.07); outline: none; }
.col:disabled { opacity: 1; cursor: default; }
.hole { aspect-ratio: 1; margin: 7%; border-radius: 50%; background: var(--cobalt); box-shadow: inset 0 6px 0 rgba(0, 0, 0, 0.35); }
.disc {
  position: absolute; left: 7%; width: 86%; aspect-ratio: 1; border-radius: 50%; pointer-events: none;
  box-shadow: inset 0 -6px 0 rgba(0, 0, 0, 0.2), inset 0 0 0 5px rgba(255, 255, 255, 0.18);
}
.disc::after { content: ""; position: absolute; inset: 22%; border-radius: 50%; border: 3px solid rgba(255, 255, 255, 0.25); }
.disc.a { background: var(--green); }
.disc.b { background: var(--coral); }
.ghost-disc { opacity: 0; transition: opacity 0.15s; top: -16%; }
.col:hover:not(:disabled) .ghost-disc, .col:focus-visible .ghost-disc { opacity: 0.55; }
.board.wait .col { cursor: default; }
.strike { position: absolute; inset: 12px; width: calc(100% - 24px); height: calc(100% - 24px); pointer-events: none; overflow: visible; }
.strike line { stroke: var(--white); stroke-width: 14; stroke-linecap: round; stroke-dasharray: 1000; stroke-dashoffset: 1000; opacity: 0.92; }
.strike:not(.on) line { display: none; }
.strike.on line { animation: strike 0.6s 0.35s ease-out forwards; }
@keyframes strike { to { stroke-dashoffset: 0; } }
.feet { display: flex; justify-content: space-between; padding: 0 6%; }
.feet span { width: 22%; height: 26px; background: var(--shadow); border-radius: 0 0 14px 14px; margin-top: 10px; }

/* ---------- panel */
.panel h1 { font-size: clamp(32px, 4.4vw, 54px); }
.lead { font-size: 18px; opacity: 0.92; }
.players { display: grid; gap: 8px; margin: 16px 0 6px; }
.pl { display: flex; align-items: center; gap: 10px; font-weight: 600; background: rgba(19, 40, 95, 0.55); border-radius: 12px; padding: 8px 12px; }
.pl i { width: 22px; height: 22px; border-radius: 50%; flex: none; }
.pl.a i { background: var(--green); }
.pl.b i { background: var(--coral); }
.pl.now { outline: 3px solid var(--white); }
.turn { font: 600 22px/1.2 var(--display); margin: 12px 0; min-height: 1.2em; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.big { background: var(--green); color: var(--shadow); border: 0; border-radius: 14px; padding: 13px 22px; font: 700 19px var(--display); box-shadow: 0 5px 0 var(--green-dark); }
.big:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--green-dark); }
.soft { background: transparent; color: var(--white); border: 2px solid rgba(244, 246, 251, 0.6); border-radius: 12px; padding: 9px 16px; font-weight: 600; }
.note { min-height: 1.5em; font-weight: 600; margin: 12px 0; }
.note.bad { color: #FFC2B2; }
.new { margin-top: 18px; background: rgba(19, 40, 95, 0.5); border-radius: 18px; padding: 20px; display: grid; gap: 12px; }
.new h2 { font-size: 26px; }
.new label { display: grid; gap: 6px; font-weight: 600; }
.new small { font-weight: 400; opacity: 0.8; }
.new input { font: 16px var(--body); padding: 11px 12px; border-radius: 10px; border: 2px solid transparent; background: var(--white); color: var(--shadow); width: 100%; }
.new input:focus { outline: none; border-color: var(--green); }

/* ---------- lists */
.lists { display: grid; grid-template-columns: 1fr 1fr 0.7fr; gap: 20px; margin-top: 52px; }
.list { background: rgba(19, 40, 95, 0.5); border-radius: 18px; padding: 20px; }
.list h2 { font-size: 24px; margin-bottom: 10px; }
.list ul { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid rgba(244, 246, 251, 0.15); }
.list li a { color: var(--white); text-decoration: none; font-weight: 600; }
.list li em { font-style: normal; font-size: 14px; opacity: 0.8; }
.list .empty { display: block; opacity: 0.75; border: 0; }
.list button { background: var(--green); color: var(--shadow); border: 0; border-radius: 10px; padding: 5px 12px; font: 600 15px var(--display); }
.stats p { margin: 6px 0; }
.stats b { font: 700 28px var(--display); color: #C8F59F; margin-right: 6px; }

.how { margin-top: 40px; }
.how h2 { font-size: 32px; }
.how ol { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; padding: 0; list-style: none; counter-reset: s; margin-top: 16px; }
.how li { counter-increment: s; position: relative; padding: 18px 18px 18px 66px; background: rgba(19, 40, 95, 0.5); border-radius: 18px; }
.how li::before { content: counter(s); position: absolute; left: 16px; top: 16px; width: 36px; height: 36px; border-radius: 50%; background: var(--coral); color: var(--shadow); display: grid; place-items: center; font: 700 20px var(--display); }

.foot { margin-top: 48px; padding-top: 18px; border-top: 3px solid var(--shadow); font-size: 14px; }
.foot p { margin: 4px 0; overflow-wrap: anywhere; }
.foot .built { font: 600 20px/1.3 var(--display); }

@media (max-width: 900px) {
  .play { grid-template-columns: 1fr; }
  .lists { grid-template-columns: 1fr; }
  .how ol { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .board { padding: 6px; border-radius: 18px; }
  .disc { box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.2); }
  .disc::after { border-width: 2px; }
}
