:root {
  --wood: #111522;
  --wood-light: #20283a;
  --charcoal: #07131f;
  --neon-cyan: #20c9ff;
  --neon-magenta: #ff2bad;
  --glow: var(--neon-cyan);
}

#app {
  position: relative;
  grid-template-rows: 92px 396px 24px 66px;
  background:
    radial-gradient(circle at 18% 14%, rgb(0 119 255 / 18%), transparent 28%),
    radial-gradient(circle at 82% 18%, rgb(255 0 166 / 15%), transparent 30%),
    #020307;
}

.hud {
  grid-row: 1;
}

.match-score {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  font-size: 12px;
}

.match-score i {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--ivory);
  color: #10131a;
  font-style: normal;
  font-weight: 900;
}

.match-score i.blue { background: var(--blue); color: white; }
.match-score b { color: #8794a8; }

.decision-overlay {
  position: absolute;
  z-index: 35;
  inset: 205px auto auto 50%;
  transform: translateX(-50%);
  min-width: 150px;
  padding: 14px 16px;
  display: grid;
  justify-items: center;
  gap: 10px;
  border: 2px solid var(--neon-cyan);
  border-radius: 16px;
  background: rgb(2 5 12 / 96%);
  box-shadow: 0 0 22px rgb(32 201 255 / 60%), inset 0 0 18px rgb(32 201 255 / 12%);
}

.decision-overlay > div { display: flex; gap: 9px; }
.decision-overlay strong { font-size: 20px; }
.choice {
  min-width: 58px;
  height: 38px;
  padding: 0 12px;
  border: 2px solid #3a4658;
  border-radius: 10px;
  background: #090d15;
  font-size: 16px;
  font-weight: 800;
}
.choice.focused,.choice:focus-visible { outline: none; border-color: white; box-shadow: 0 0 13px var(--neon-cyan); }
.icon-choice { width: 58px; height: 50px; padding: 0; font-size: 21px; }
.roll-icon { font-size: 30px; line-height: 1; }
.cube-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 2px solid white;
  border-radius: 8px;
  color: #111522;
  background: var(--ivory);
  box-shadow: 0 0 14px white;
  font-size: 18px;
  font-weight: 950;
}
.cube-status {
  position: absolute;
  z-index: 9;
  left: 50%;
  top: 50%;
  width: 24px;
  height: 24px;
  transform: translate(-50%,-50%);
  display: grid;
  place-items: center;
  border: 1px solid #667284;
  border-radius: 5px;
  background: rgb(8 13 22 / 82%);
  color: #b9c2cf;
  box-shadow: 0 0 5px #0008;
  font-size: 11px;
  font-weight: 950;
  pointer-events: none;
}
.cube-status.white { top: auto; bottom: 12px; transform: translateX(-50%); color:#e7dfd2; border-color:#8f887d; }
.cube-status.blue { top: 12px; transform: translateX(-50%); color:#69baff; border-color:#236ca8; box-shadow:0 0 5px #168cff66; }
.pass-notice { min-width: 170px; }
.board.paused { filter: brightness(.48); }

.board {
  grid-row: 2;
}

.actions {
  grid-row: 4;
}

.move-analysis {
  position: relative;
  z-index: 25;
  grid-row: 3;
  align-self: center;
  justify-self: center;
  display: flex;
  align-items: baseline;
  gap: 7px;
  color: #fff;
  font-size: 18px;
  line-height: 24px;
  padding: 0 9px;
  border-radius: 10px;
  background: rgb(2 3 7 / 92%);
  text-shadow: 0 0 8px currentColor;
}

.move-analysis strong {
  text-transform: uppercase;
  letter-spacing: .08em;
}

.move-analysis small {
  color: #bdc8d8;
  font-size: 13px;
  text-shadow: none;
}

.move-analysis.best { color: var(--neon-cyan); }
.move-analysis.good { color: #72f5a5; }
.move-analysis.bad { color: #ffc857; }
.move-analysis.blunder { color: #ff4f9a; }

.rolling {
  align-self: center;
  color: var(--ivory);
  font-size: 28px;
  letter-spacing: .02em;
  text-shadow: 0 0 16px #fff8;
}

.die:not(.blue) {
  background: linear-gradient(145deg, #fffef9, #dfdfdf 74%);
  border: 2px solid white;
  box-shadow:
    inset 3px 3px 6px rgb(255 255 255 / 85%),
    inset -4px -5px 8px rgb(90 105 125 / 28%),
    0 5px 0 #8d98a8,
    0 0 20px rgb(218 245 255 / 68%);
}

.hud.blue .rolling {
  color: var(--blue);
  text-shadow: 0 0 18px #168cffaa;
}

.die.blue {
  background: linear-gradient(145deg, #35b9ff, #075ed9 72%);
  border: 2px solid #82e7ff;
  box-shadow:
    inset 3px 3px 6px rgb(255 255 255 / 35%),
    inset -4px -5px 8px rgb(0 20 90 / 48%),
    0 5px 0 #043680,
    0 0 22px rgb(32 201 255 / 82%);
}

.die.blue .pip {
  background: white;
  box-shadow: 0 0 6px white;
}

.board {
  transform: perspective(680px) rotateX(4deg);
  border-color: #182337;
  border-top-color: #293b57;
  border-bottom-color: #070a12;
  background:
    linear-gradient(rgb(255 255 255 / 2%), rgb(0 0 0 / 18%)),
    repeating-linear-gradient(90deg, transparent 0 18px, rgb(55 149 255 / 3%) 19px),
    #050810;
  box-shadow:
    inset 0 0 0 2px rgb(32 201 255 / 55%),
    inset 0 0 18px rgb(255 43 173 / 18%),
    0 0 8px var(--neon-cyan),
    0 8px 0 #080b14,
    0 12px 0 rgb(255 43 173 / 40%),
    0 20px 26px #000;
}

.board::after {
  background:
    linear-gradient(90deg, transparent 47%, rgb(32 201 255 / 16%) 50%, transparent 53%),
    linear-gradient(115deg, transparent 24%, rgb(255 255 255 / 5%) 38%, transparent 48%);
  opacity: .65;
}

.point::before {
  background:
    linear-gradient(90deg, rgb(255 255 255 / 5%), transparent 25% 75%, rgb(0 0 0 / 28%)),
    linear-gradient(#07527c, #05243b 62%, #20c9ff);
  filter: drop-shadow(0 0 3px rgb(32 201 255 / 55%));
}

.point.alt::before {
  background:
    linear-gradient(90deg, rgb(255 255 255 / 8%), transparent 25% 75%, rgb(0 0 0 / 25%)),
    linear-gradient(#8d155f, #3b102e 62%, #ff2bad);
  filter: drop-shadow(0 0 4px rgb(255 43 173 / 60%));
}

.point .number {
  color: rgb(224 245 255 / 78%);
  font-weight: 800;
  text-shadow: 0 0 6px #000;
}

.checker {
  background: linear-gradient(145deg, #fffdf7, #e9ddcd 72%);
  border-color: white;
  box-shadow:
    0 4px 0 #a99b87,
    0 6px 8px #000c,
    inset 3px 3px 5px rgb(255 255 255 / 80%),
    inset -4px -5px 6px rgb(120 101 80 / 22%);
}

.checker.blue {
  background: linear-gradient(145deg, #32b6ff, #0665e8 72%);
  border-color: #6fd7ff;
  box-shadow:
    0 4px 0 #033a91,
    0 6px 8px #000d,
    0 0 8px rgb(32 201 255 / 48%),
    inset 3px 3px 5px rgb(255 255 255 / 30%),
    inset -4px -5px 7px rgb(0 20 90 / 45%);
}

.bar {
  background:
    linear-gradient(90deg, #070a12, #18243a 46%, #27344a 50%, #18243a 54%, #070a12);
  border-color: #02040a;
  box-shadow:
    inset 3px 0 0 rgb(255 43 173 / 28%),
    inset -3px 0 0 rgb(32 201 255 / 24%);
}

.bearoff-stack {
  position: absolute;
  z-index: 7;
  display: flex;
  flex-direction: column;
  pointer-events: none;
}

.bearoff-stack.blue {
  top: 8px;
  left: 1px;
}

.bearoff-stack.white {
  right: 1px;
  bottom: 8px;
  flex-direction: column-reverse;
}

.bearoff-stack .checker {
  width: 14px;
  height: 25px;
  min-height: 0;
  margin: -17px 0 0;
  border-width: 1px;
  border-radius: 7px;
}

.bearoff-stack.blue .checker:first-child,
.bearoff-stack.white .checker:first-child {
  margin-top: 0;
}

.borne-count {
  position: absolute;
  z-index: 12;
  top: 294px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 2px solid white;
  border-radius: 50%;
  background: #050810;
  color: var(--ivory);
  box-shadow: 0 0 9px white;
  font-size: 11px;
  font-weight: 900;
  pointer-events: none;
}
.borne-count.blue { left: 1px; color: #7cddff; border-color: var(--neon-cyan); box-shadow: 0 0 10px var(--neon-cyan); }
.borne-count.white { right: 1px; }

.win-screen {
  position: absolute;
  z-index: 30;
  inset: 188px 68px auto;
  height: 122px;
  display: grid;
  place-items: center;
  border: 3px solid white;
  border-radius: 20px;
  background: rgb(2 5 12 / 92%);
  box-shadow: 0 0 28px white, inset 0 0 24px rgb(255 255 255 / 16%);
  font-size: 42px;
  letter-spacing: .02em;
  grid-template-rows: auto auto auto;
}
.win-screen small { font-size: 17px; text-transform: capitalize; }
.win-screen em { position:absolute;top:8px;right:12px;font-size:12px;text-transform:uppercase;color:#aeb9cb; }
.final-analysis { font-size: 13px; letter-spacing:.04em; }
.final-analysis.best { color:var(--neon-cyan); }
.final-analysis.good { color:#72f5a5; }
.final-analysis.bad { color:#ffc857; }
.final-analysis.blunder { color:#ff4f9a; }

.win-screen.blue {
  color: #66d6ff;
  border-color: var(--neon-cyan);
  box-shadow: 0 0 30px var(--neon-cyan), inset 0 0 26px rgb(32 201 255 / 24%);
}

/* A full-point focus box remains legible on the glasses display even when
   checker glow and point colors lose detail at the edge of the viewport. */
.point.focused,
.point.selected {
  z-index: 4;
  background: rgb(72 199 255 / 10%);
  box-shadow:
    inset 0 0 0 4px var(--glow),
    inset 0 0 18px rgb(72 199 255 / 42%),
    0 0 14px rgb(72 199 255 / 70%);
}

.point.focused::before {
  filter: brightness(1.35) drop-shadow(0 0 7px var(--glow));
}

.point.selected:not(.focused) {
  background: rgb(72 199 255 / 6%);
  box-shadow:
    inset 0 0 0 3px var(--glow),
    inset 0 0 12px rgb(72 199 255 / 30%);
}

.point.target .target-ring,
.off-target .target-ring {
  background: rgb(3 8 18 / 70%);
  border-color: var(--neon-cyan);
  box-shadow:
    0 0 9px var(--neon-cyan),
    0 0 20px rgb(32 201 255 / 65%),
    inset 0 0 9px var(--neon-cyan);
}

.point.target.focused .target-ring,
.off-target.focused .target-ring {
  border-color: white;
  box-shadow:
    0 0 7px white,
    0 0 24px var(--neon-cyan),
    inset 0 0 12px var(--neon-cyan);
}

.player-mark {
  box-shadow: 0 0 0 3px #0d2035, 0 0 15px white;
}

.player-mark.blue {
  box-shadow: 0 0 0 3px #07355f, 0 0 20px var(--neon-cyan);
}

.action {
  flex: 0 0 44px;
  min-width: 44px;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  font-size: 27px;
  line-height: 1;
  background: #070a11;
  border-color: #33455e;
}

.action.focused,
.action:focus-visible {
  border-color: var(--neon-cyan);
  box-shadow: 0 0 8px var(--neon-cyan), inset 0 0 10px rgb(32 201 255 / 25%);
}

.action[data-action="new"] {
  flex-basis: 30px;
  min-width: 30px;
  width: 30px;
  height: 30px;
  border-color: #574b40;
  font-size: 20px;
  opacity: .66;
  order: 10;
}

.action[data-action="new"].focused {
  opacity: 1;
}

.action[data-action="keep"],
.action[data-action="reset"] {
  flex-basis: auto;
  width: auto;
  min-width: 78px;
  padding: 0 14px;
  border-radius: 20px;
  font-size: 14px;
}

.move-flight {
  animation-duration: 650ms;
  animation-timing-function: cubic-bezier(.22,.7,.18,1);
  will-change: transform, filter, opacity;
}
