* {
  box-sizing: border-box;
}
html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}
body {
  height: 100dvh;
  font-family: "DM Sans", sans-serif;
  color: #fff1d8;
  background: #193d4a;
}
button, input {
  font-family: inherit;
}
a {
  color: inherit;
}
:focus-visible {
  outline: 2px solid #f1d294;
  outline-offset: 3px;
}
main, .curling-dialog, .curl-shell {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  overflow: hidden;
  box-shadow: none;
  background: transparent;
}
.curl-stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  overflow: hidden;
}
.curl-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(to bottom, #0b263bd1 0%, #0b263b75 10%, #0b263b24 22%, transparent 36%, transparent 69%, #0b263ba8 100%);
}
#curl-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
}
#curl-canvas.dragging {
  cursor: grabbing;
}
.game-page-nav {
  position: absolute;
  z-index: 20;
  top: max(14px, env(safe-area-inset-top));
  left: max(18px, env(safe-area-inset-left));
  right: max(18px, env(safe-area-inset-right));
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
}
.game-page-nav > a, .game-actions {
  pointer-events: auto;
}
.game-page-nav img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  display: block;
}
.game-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.game-actions a {
  font-size: 11px;
  text-decoration: none;
  text-shadow: 0 1px 8px #102536;
}
:is(#game-fullscreen, #game-sound, #game-leaderboard) {
  border: 1px solid #ffffff55;
  border-radius: 30px;
  padding: 10px 15px;
  color: #fff2d6;
  background: #163443bb;
  backdrop-filter: blur(14px);
  cursor: pointer;
  font-size: 11px;
  min-height: 40px;
}
.curl-header {
  position: absolute;
  z-index: 8;
  left: 78px;
  top: max(23px, calc(env(safe-area-inset-top) + 9px));
  pointer-events: none;
}
.curl-header h2 {
  margin: 0;
  font: 400 27px/1 "Instrument Serif", serif;
  text-shadow: 0 2px 10px #193d4a;
}
.game-kicker {
  display: none;
}
.curl-score {
  position: absolute;
  z-index: 8;
  left: 50%;
  top: max(16px, env(safe-area-inset-top));
  transform: translateX(-50%);
  width: min(350px, 42%);
  min-height: 57px;
  border: 1px solid #fff2;
  border-radius: 18px;
  background: #173747df;
  backdrop-filter: blur(16px);
  padding: 8px 18px 13px;
  gap: 12px;
}
.curl-score > div {
  position: relative;
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 47px;
  padding-bottom: 5px;
}
.curl-score strong {
  font-size: 24px;
}
.curl-score span {
  font-size: 10px;
  white-space: nowrap;
}
.curl-score p {
  font-size: 10px;
  line-height: 1.4;
}
.shot-track {
  display: flex;
  gap: 4px;
  position: absolute;
  bottom: -4px;
  left: 0;
}
.shot-track i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #a6d5ed;
}
.shot-track.opponent i {
  background: #f79499;
}
.shot-track i.spent {
  opacity: .2;
}
.curl-score > div:last-child .shot-track {
  left: auto;
  right: 0;
}
.curl-packages {
  position: absolute;
  z-index: 9;
  bottom: max(14px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  width: min(480px, calc(100% - 24px));
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 7px;
  border: 1px solid #ffffff38;
  border-radius: 23px;
  background: #173747dc;
  backdrop-filter: blur(18px);
  box-shadow: 0 10px 40px #12283566;
}
.curl-package {
  min-width: 0;
  min-height: 82px;
  padding: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  text-align: center;
  background: #ffffff08;
  border: 1px solid #fff2;
  border-radius: 16px;
  transition: background .15s, transform .15s;
}
.curl-package.selected {
  background: #a6d5ed25;
  border-color: #d9eef0;
}
.curl-package:not(:disabled):hover {
  transform: translateY(-3px);
  background: #a6d5ed38;
}
.curl-package strong {
  font-size: 11px;
  line-height: 1.2;
}
.curl-package small {
  font-size: 9px;
  color: #c4d8df;
}
img.critter-icon {
  width: 30.72px;
  height: 28.16px;
  object-fit: contain;
  display: block;
}
.curl-footer {
  display: none;
}
.curl-ability {
  z-index: 9;
  right: 50%;
  transform: translateX(50%);
  bottom: calc(max(14px, env(safe-area-inset-bottom)) + 100px);
  min-height: 45px;
  padding: 12px 26px;
  font-size: 13px;
  box-shadow: 0 5px 30px #102a4b66;
  animation: ability-glow 1.6s ease-in-out infinite;
}
@keyframes ability-glow {
  50% {
    box-shadow: 0 0 0 6px #f0dab022, 0 5px 30px #102a4b66;
  }
}
.curl-banner {
  z-index: 21;
  top: max(90px, calc(env(safe-area-inset-top) + 80px));
  max-width: calc(100% - 32px);
  white-space: normal;
  background: #163747ed;
}
.curl-overlay {
  z-index: 12;
  background: #0e293b66;
  backdrop-filter: blur(8px);
  padding: 85px 22px 150px;
}
.curl-overlay > div {
  max-width: 395px;
  padding: 24px 24px 28px;
  border: 1px solid #fff3;
  border-radius: 28px;
  background: #153748ef;
  box-shadow: 0 20px 90px #0a192c77;
}
.curl-overlay h3 {
  font-size: 42px;
}
.curl-overlay p {
  font-size: 13px;
}
.curl-pull {
  position: absolute;
  z-index: 4;
  pointer-events: none;
  left: var(--pull-x);
  top: var(--pull-y);
  width: 0;
  height: 0;
}
.curl-pull::before {
  content: "";
  position: absolute;
  height: 3px;
  width: var(--pull-length);
  transform-origin: left center;
  transform: rotate(var(--pull-angle));
  background: linear-gradient(90deg, #fff2cb55, #fff2cb);
  border-radius: 4px;
  box-shadow: 0 1px 8px #25384b55;
}
.curl-pull::after {
  content: "";
  position: absolute;
  width: 28px;
  height: 28px;
  left: -14px;
  top: -14px;
  border: 2px solid #fff2cb;
  border-radius: 50%;
  box-shadow: 0 0 0 6px #fff2cb22;
}
.game-confetti {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 13;
}
.game-confetti i {
  position: absolute;
  top: -15px;
  width: 8px;
  height: 13px;
  background: var(--confetti-color);
  animation: confetti-fall 2.7s ease-in forwards;
}
@keyframes confetti-fall {
  to {
    transform: translate(var(--confetti-drift), 110vh) rotate(600deg);
    opacity: .15;
  }
}
@media (max-width: 700px) {
  .game-page-nav {
    left: 12px;
    right: 12px;
    top: max(8px, env(safe-area-inset-top));
  }
  .game-page-nav img {
    width: 39px;
    height: 39px;
  }
  .curl-header {
    left: 57px;
    top: max(19px, calc(env(safe-area-inset-top) + 10px));
  }
  .curl-header h2 {
    font-size: 23px;
  }
  .game-actions {
    gap: 8px;
  }
  .game-actions a {
    font-size: 10px;
  }
  :is(#game-fullscreen, #game-sound, #game-leaderboard) {
    padding: 8px 11px;
    font-size: 10px;
    min-height: 36px;
  }
  .curl-score {
    top: max(57px, calc(env(safe-area-inset-top) + 48px));
    width: min(330px, calc(100% - 28px));
    min-height: 48px;
    padding: 5px 14px 11px;
  }
  .curl-score strong {
    font-size: 21px;
  }
  .curl-banner {
    top: max(118px, calc(env(safe-area-inset-top) + 110px));
    font-size: 11px;
  }
  .curl-package strong {
    font-size: 10px;
  }
  .curl-package small {
    font-size: 8px;
  }
  .curl-packages {
    gap: 5px;
    padding: 5px;
    border-radius: 20px;
  }
  .curl-package {
    min-height: 78px;
    border-radius: 14px;
  }
  .curl-ability {
    bottom: calc(max(14px, env(safe-area-inset-bottom)) + 98px);
  }
  .curl-overlay {
    padding: 115px 18px 125px;
  }
  .curl-overlay > div {
    padding: 18px;
  }
  .curl-overlay h3 {
    font-size: 33px;
  }
  .curl-overlay p {
    font-size: 11px;
    line-height: 1.6;
  }
}
@media (max-width: 390px) {
  .game-actions a {
    display: none;
  }
  .curl-header h2 {
    font-size: 21px;
  }
}
@media (max-height: 540px) and (min-width: 600px) {
  .curl-header {
    display: none;
  }
  .curl-score {
    top: 12px;
    width: 300px;
    min-height: 45px;
    padding: 4px 12px 10px;
  }
  .curl-score strong {
    font-size: 20px;
  }
  .curl-packages {
    width: 300px;
    left: auto;
    right: 12px;
    transform: none;
    bottom: 12px;
  }
  .curl-package {
    min-height: 53px;
  }
  img.critter-icon {
    width: 27px;
    height: 23px;
  }
  .curl-ability {
    right: 162px;
    bottom: 86px;
  }
  .curl-banner {
    top: 68px;
  }
  .curl-overlay {
    padding: 65px 20px 15px;
  }
  .curl-overlay > div {
    max-width: 390px;
    padding: 10px 20px 15px;
  }
  .curl-symbol {
    display: none;
  }
  .curl-overlay h3 {
    font-size: 29px;
    margin: 5px 0;
  }
  .curl-overlay p {
    margin: 8px 0;
    font-size: 11px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .curl-ability, .game-confetti i {
    animation: none;
  }
}


/* Snow-framed score panels and character tokens. */ .game-actions {
  gap: 8px;
}
.game-actions a, :is(#game-fullscreen, #game-sound, #game-leaderboard) {
  display: grid;
  place-items: center;
  width: 39px;
  height: 39px;
  min-height: 39px;
  padding: 0;
  border: 3px solid #c7e9f5;
  border-radius: 50%;
  color: #ecf9ff;
  background: linear-gradient(#4a91b0,#1b4b71);
  box-shadow: 0 4px 0 #112c4e, inset 0 2px 0 #ffffff66;
  font-size: 22px;
  text-decoration: none;
}
.curl-header h2 {
  font-family: "Archivo Black",sans-serif;
  font-size: 17px;
  text-transform: uppercase;
  color: #f7fcff;
  text-shadow: 0 3px 0 #18354f;
}
.curl-score {
  display: grid;
  grid-template-columns: 100px 116px 100px;
  align-items: start;
  justify-content: center;
  width: 360px;
  min-height: 130px;
  padding: 0;
  gap: 12px;
  top: 15px;
  border: 0;
  border-radius: 0;
  background: none;
  backdrop-filter: none;
  box-shadow: none;
}
.curl-score .team-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 0;
  border: 3px solid #9de2ff;
  border-top: 6px solid #f3fcff;
  border-radius: 20px 20px 27px 27px;
  padding: 4px 6px 16px;
  margin-top: 23px;
  background: linear-gradient(#387fab,#19486f);
  box-shadow: 0 5px 0 #0b274c, inset 0 2px 0 #b7f0ff77;
}
.curl-score .opponent-panel {
  border-color: #ffc0c5;
  border-top-color: #fff4ef;
  background: linear-gradient(#cf636f,#883d56);
  box-shadow: 0 5px 0 #542b42, inset 0 2px 0 #ffe1d577;
}
.curl-score .team-avatar {
  position: relative;
  display: block;
  width: 60px;
  min-width: 0;
  height: 52px;
  padding: 0;
  margin-top: -31px;
}
.team-avatar img {
  display: block;
  width: 60px;
  height: 60px;
  object-fit: contain;
  filter: drop-shadow(0 3px 0 #0b253a66);
}
.curl-score .team-avatar span {
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  min-width: 72px;
  padding: 3px 5px;
  border: 1px solid #ffffff77;
  border-radius: 5px;
  background: #122e50;
  color: white;
  font: 9px "Archivo Black",sans-serif;
  white-space: nowrap;
}
.opponent-panel .team-avatar span {
  background: #792e49;
}
.curl-score .team-panel > strong {
  font: 34px/1.25 "Archivo Black",sans-serif;
  color: white;
  text-shadow: 0 3px 0 #102c4b88;
  margin-top: 5px;
}
.curl-score .shot-track {
  position: absolute;
  bottom: 6px;
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  gap: 4px;
}
.shot-track i {
  width: 10px;
  height: 5px;
  border-radius: 2px;
  background: #c5efff;
  box-shadow: 0 1px 0 #0e3150;
}
.shot-track.opponent i {
  background: #ffd9cf;
}
.shot-track i.spent {
  opacity: .22;
}
.curl-score .match-panel {
  display: block;
  min-width: 0;
  text-align: center;
  padding: 7px 0;
}
.round-title {
  display: block;
  font: 10px "Archivo Black",sans-serif;
  letter-spacing: 2px;
  color: #a8cedd;
}
.curl-score #round-display {
  font: 27px/1.4 "Archivo Black",sans-serif;
  color: #fff7de;
  text-shadow: 0 3px 0 #172c49;
  white-space: nowrap;
}
.curl-score p {
  background: #f4d18a;
  color: #513c29;
  border: 2px solid #fff1c5;
  border-radius: 20px;
  font: 9px/1.3 "Archivo Black",sans-serif;
  padding: 5px 7px;
  margin-top: 3px;
  box-shadow: 0 3px 0 #7e6343;
  text-transform: uppercase;
}
.team-panel.active-turn {
  filter: drop-shadow(0 0 8px #ffe79377);
}
.curl-packages {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 21px;
  width: min(430px,calc(100% - 24px));
  height: 105px;
  padding: 0 8px 28px;
  background: none;
  border: none;
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none;
}
.curl-package {
  position: relative;
  display: block;
  flex: 1;
  max-width: 76px;
  min-width: 0;
  min-height: 0;
  height: 76px;
  margin: 0;
  padding: 0;
  border: 4px solid #b4e4ee;
  border-top-color: #ffffff;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 30%,#85bbca,#335976 78%);
  box-shadow: 0 5px 0 #17344f, inset 0 0 0 3px #42708d;
  transition: transform .16s;
}
.curl-package img.critter-icon {
  position: absolute;
  width: 48px;
  height: 48px;
  left: 50%;
  top: 1px;
  transform: translateX(-50%);
  object-fit: contain;
  filter: drop-shadow(0 3px 0 #16385344);
}
.curl-package strong {
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  min-width: 83px;
  padding: 5px 3px;
  border: 2px solid #badce8;
  border-radius: 5px;
  background: #1b3b5b;
  color: #fff;
  font: 10px "Archivo Black",sans-serif;
  white-space: nowrap;
}
.curl-package small {
  position: absolute;
  bottom: -23px;
  left: 0;
  width: 100%;
  font: 8px "Archivo Black",sans-serif;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: #d2e9f1;
  text-shadow: 0 2px 0 #122943;
}
.curl-package.selected {
  transform: translateY(-9px);
  padding: 0;
  border: 4px solid #ffdf8c;
  border-top-color: #fff5cb;
  background: radial-gradient(circle at 50% 30%,#ffe9a0,#b9894b 90%);
  box-shadow: 0 6px 0 #765438,0 0 22px #ffd66d44;
}
.curl-package.selected strong {
  background: #835d37;
  border-color: #ffe39e;
}
.curl-package.selected::after {
  content: "";
  position: absolute;
  top: -17px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 9px solid #ffe39e;
}
.curl-package:disabled {
  opacity: .45;
  filter: grayscale(.6);
}
.curl-package:not(:disabled):hover {
  transform: translateY(-9px) scale(1.05);
}
.curl-ability {
  border: 3px solid #fff1bd;
  border-radius: 16px;
  background: linear-gradient(#ffe4a2,#e7ae50);
  color: #624321;
  font: 13px "Archivo Black",sans-serif;
  letter-spacing: .2px;
  box-shadow: 0 5px 0 #875a29,0 8px 25px #07183377;
  bottom: calc(max(14px,env(safe-area-inset-bottom)) + 124px);
}
.curl-banner {
  top: 162px;
  border: 2px solid #d8f1f8;
  border-radius: 18px;
  background: #214662f5;
  font: 11px "Archivo Black",sans-serif;
  box-shadow: 0 4px 0 #122d49;
}
.curl-overlay > div {
  border: 4px solid #d0f0f8;
  border-top: 8px solid white;
  border-radius: 30px;
  background: linear-gradient(#326581f5,#17354ff5);
  box-shadow: 0 9px 0 #10283b,0 25px 70px #06142788;
}
.curl-overlay h3 {
  font: 31px/1.1 "Archivo Black",sans-serif;
  color: #fff4d4;
  text-shadow: 0 4px 0 #15334c;
}
.game-start {
  border: 3px solid #fff1c2;
  border-radius: 16px;
  background: linear-gradient(#ffe9a7,#e6ae51);
  font: 12px "Archivo Black",sans-serif;
  text-transform: uppercase;
  color: #69452b;
  box-shadow: 0 6px 0 #94602d,0 10px 20px #071c3655;
}
.game-start:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #94602d;
}
.shot-charge {
  position: absolute;
  z-index: 11;
  bottom: calc(max(14px,env(safe-area-inset-bottom)) + 127px);
  left: 50%;
  transform: translateX(-50%);
  width: 165px;
  padding: 8px 12px;
  background: #15344ded;
  border: 2px solid #e1f5ff;
  border-radius: 15px;
  pointer-events: none;
  box-shadow: 0 4px 0 #0b2239;
}
.shot-charge[hidden] {
  display: none;
}
.shot-charge > span {
  display: block;
  font: 9px "Archivo Black",sans-serif;
  letter-spacing: 1px;
  margin-bottom: 5px;
}
.shot-charge > div {
  height: 9px;
  border-radius: 5px;
  overflow: hidden;
  background: #071b2b;
}
.shot-charge i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg,#8cf0ff,#ffe396);
  width: 0;
  border-radius: 4px;
}
.shot-charge.full-power {
  border-color: #ffdc8c;
}
@media (max-width:700px) {
  .curl-header {
    display: none;
  }
  .game-page-nav img {
    width: 34px;
    height: 34px;
  }
  .game-actions a, :is(#game-fullscreen, #game-sound, #game-leaderboard) {
    width: 34px;
    height: 34px;
    min-height: 34px;
    font-size: 19px;
  }
  .curl-score {
    width: calc(100% - 28px);
    grid-template-columns: 84px 104px 84px;
    gap: 8px;
    top: max(44px,calc(env(safe-area-inset-top) + 36px));
  }
  .curl-score .team-panel {
    padding: 4px 4px 15px;
  }
  .curl-score .team-panel > strong {
    font-size: 30px;
  }
  .curl-score #round-display {
    font-size: 23px;
  }
  .curl-score .team-avatar {
    width: 54px;
  }
  .team-avatar img {
    width: 54px;
    height: 54px;
  }
  .curl-packages {
    gap: 14px;
    padding-left: 5px;
    padding-right: 5px;
  }
  .curl-package {
    max-width: 64px;
    height: 64px;
  }
  .curl-package img.critter-icon {
    width: 43px;
    height: 43px;
    top: -1px;
  }
  .curl-package strong {
    min-width: 70px;
    font-size: 8px;
  }
  .curl-package small {
    font-size: 7px;
  }
  .curl-banner {
    top: 174px;
  }
}
@media (max-height:540px) and (min-width:600px) {
  .curl-score {
    top: 10px;
    grid-template-columns: 74px 95px 74px;
    min-height: 95px;
    gap: 8px;
  }
  .curl-score .team-panel {
    margin-top: 17px;
    padding-bottom: 12px;
  }
  .curl-score .team-avatar {
    margin-top: -26px;
    height: 34px;
  }
  .team-avatar img {
    width: 46px;
    height: 46px;
    margin: 0 auto;
  }
  .curl-score .team-panel > strong {
    font-size: 23px;
  }
  .curl-score #round-display {
    font-size: 22px;
  }
  .curl-score p {
    font-size: 7px;
  }
  .curl-packages {
    width: 320px;
    height: 86px;
    bottom: 6px;
    gap: 14px;
  }
  .curl-package {
    height: 57px;
  }
  .curl-package img.critter-icon {
    width: 36px;
    height: 36px;
  }
  .curl-package strong {
    font-size: 8px;
    min-width: 65px;
    padding: 3px;
  }
  .curl-package small {
    bottom: -18px;
    font-size: 7px;
  }
  .curl-ability {
    bottom: 102px;
  }
  .shot-charge {
    right: 162px;
    left: auto;
    transform: translateX(50%);
    bottom: 106px;
  }
  .curl-banner {
    top: 122px;
  }
}
/* Final spacing and hierarchy. */ .curl-score .team-avatar span {
  z-index: 1;
  letter-spacing: .2px;
}
.curl-score p {
  letter-spacing: .1px;
}
.team-panel.active-turn {
  filter: drop-shadow(0 0 5px #ffe79355);
}
.curl-package.selected {
  box-shadow: 0 5px 0 #765438,0 0 16px #ffd66d2a;
}
.curl-package.selected::after {
  top: -14px;
  border-top-width: 8px;
}
@media (max-width:700px) {
  .curl-packages {
    width: calc(100% - 32px);
    gap: 12px;
  }
  .curl-package strong {
    font-size: 9px;
  }
  .curl-score .team-avatar span {
    font-size: 8px;
  }
}

/* Keep every remaining-shot marker inside its team panel. */
.curl-score #player-shots,
.curl-score #opponent-shots {
  display: flex;
  width: max-content;
  left: 50%;
  right: auto;
  bottom: 7px;
  transform: translateX(-50%);
  margin: 0;
  padding: 0;
  gap: 4px;
}
.curl-score .player-panel {
  background: linear-gradient(#72b4d0, #326e9b);
  border-color: #bdefff;
  border-top-color: #ffffff;
}
.curl-score .opponent-panel {
  background: linear-gradient(#e7a3ad, #b76482);
  border-color: #ffe0e3;
  border-top-color: #fff6f3;
}
.curl-score .team-avatar span {
  border-radius: 8px;
  background: #2d6287;
}
.curl-score .opponent-panel .team-avatar span {
  background: #a25673;
}
.curl-score p {
  background: #ffe2a5;
  border-color: #fff5da;
  color: #79522d;
}
.curl-package {
  background: radial-gradient(circle at 50% 30%, #a0d2da, #4b7d9e 85%);
  border-color: #d5f4fa;
}
.curl-package.selected {
  background: radial-gradient(circle at 50% 30%, #fff0bc, #d2a661 90%);
  border-color: #ffeab1;
}
.curl-package strong {
  border-radius: 8px;
  background: #2e5b7b;
}
.curl-package.selected strong {
  background: #a87a48;
}

.best-score {
  display: block;
  margin-top: 8px;
  font: 7px "Archivo Black",sans-serif;
  color: #c5dce7;
  letter-spacing: .5px;
}
.best-score b {
  color: #ffe5a7;
}
.curl-score .team-panel > strong.small-score {
  font-size: 22px;
  line-height: 1.7;
}
.score-rules[hidden] {
  display: none;
}
.score-zones {
  display: flex;
  justify-content: center;
  gap: 9px;
  margin: 14px 0 7px;
}
.score-zones span {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 3px solid #f8ecd7;
  border-radius: 50%;
  background: #f8ecd7;
  color: #4d3a31;
  font: 10px "Archivo Black",sans-serif;
}
.score-zones span:nth-child(2) {
  background: #b95058;
  color: white;
}
.score-zones span:nth-child(3) {
  background: #e7f0ec;
  color: #2a485b;
}
.score-zones span:nth-child(4) {
  background: #4b839f;
  color: white;
}
.score-rules p {
  font-size: 10px;
}
@media (max-height:540px) and (min-width:600px) {
  .score-zones {
    margin: 5px 0;
  }
  .score-zones span {
    width: 32px;
    height: 32px;
    font-size: 8px;
  }
  .score-rules p {
    margin: 5px 0;
    font-size: 9px;
  }
  .best-score {
    margin-top: 5px;
  }
}

/* Keep the scene attached to the visual viewport, including mobile browser chrome changes. */
body, main { position: fixed; inset: 0; width: 100%; height: 100dvh; max-width: none; }

.magic-banner {
  position: absolute;
  z-index: 14;
  top: 28%;
  left: 50%;
  transform: translateX(-50%) rotate(-5deg);
  text-align: center;
  pointer-events: none;
  filter: drop-shadow(0 7px 0 #694e7e) drop-shadow(0 0 30px #ffe49d);
  animation: magic-arrival .5s cubic-bezier(.2,1.8,.4,1) both;
}
.magic-banner[hidden] { display: none; }
.magic-banner strong { display: block; font: clamp(30px,6vw,72px)/1 "Archivo Black",sans-serif; color: #fff1b7; -webkit-text-stroke: 1px #99659d; white-space: nowrap; }
.magic-banner span { display: inline-block; padding: 5px 12px; margin-top: 10px; border-radius: 12px; background: #6f478e; color: #fff5dc; font: 12px "Archivo Black",sans-serif; }
@keyframes magic-arrival { from { opacity: 0; transform: translateX(-50%) scale(.25) rotate(-18deg); } to { opacity: 1; transform: translateX(-50%) scale(1) rotate(-5deg); } }
@media (prefers-reduced-motion: reduce) { .magic-banner { animation: none; } }

.julefest::after {
  content: ""; position: fixed; inset: 0; z-index: 8; pointer-events: none;
  box-shadow: inset 0 0 55px 10px #b0ffdf88;
  animation: party-glow 1.2s ease-in-out infinite alternate;
}
@keyframes party-glow { to { box-shadow: inset 0 0 70px 16px #edb1ff99; } }
#player-shots, #opponent-shots { gap: 3px; }
#player-shots i, #opponent-shots i { width: 9px; }

/* Reserve separate vertical space for the face, label and score. */
.curl-score .team-avatar {
  height: 52px;
  flex: 0 0 52px;
  margin-top: -28px;
}
.curl-score .team-avatar img {
  position: absolute;
  top: -9px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 60px;
  margin: 0;
  clip-path: inset(0 0 36% 0);
}
.curl-score .team-avatar span { bottom: 0; }
.curl-score .team-panel > strong { position: relative; margin-top: 7px; }
@media (max-height:540px) and (min-width:600px) {
  .curl-score .team-avatar { height: 42px; flex-basis: 42px; margin-top: -24px; }
  .curl-score .team-avatar img { width: 50px; height: 50px; top: -9px; }
}

.audio-credit { margin: 8px auto; max-width: 320px; color: #bfd6df; font: 10px/1.4 "DM Sans",sans-serif; }
.audio-credit summary { cursor: pointer; }
.audio-credit p { font: inherit; margin: 6px 0; }
.audio-credit a { color: #fff0bd; }
#game-sound { font-size: 20px; white-space: nowrap; }

.gift-pop {
  position: absolute;
  z-index: 13;
  pointer-events: none;
  transform: translate(-50%, -50%);
  color: #fff3b0;
  font: 30px/1 "Archivo Black", sans-serif;
  -webkit-text-stroke: 1px #7d4522;
  text-shadow: 0 3px 0 #a75c29, 0 0 18px #ffdc6d;
  animation: gift-pop-in .25s cubic-bezier(.2,1.8,.4,1);
}
@keyframes gift-pop-in { from { transform: translate(-50%, -50%) scale(.25) rotate(-15deg); } to { transform: translate(-50%, -50%) scale(1) rotate(0); } }

.score-form[hidden] { display: none; }
.score-form { margin: 16px 0 8px; text-align: left; }
.score-form label { display: block; margin-bottom: 7px; font: 700 12px "DM Sans",sans-serif; color: #e9f5f8; }
.score-entry { display: flex; gap: 6px; }
.score-entry input { width: 100%; min-width: 0; border: 2px solid #9fc4d6; border-radius: 11px; padding: 10px; background: #f5fbff; color: #18394d; font: 16px "DM Sans",sans-serif; }
.score-entry button, .leaderboard-dialog > button { border: 2px solid #ffefbd; border-radius: 11px; background: #f2d18f; color: #573e25; padding: 9px 13px; font: 700 12px "DM Sans",sans-serif; cursor: pointer; white-space: nowrap; }
.score-entry button:disabled { opacity: .65; cursor: default; }
.score-form #score-save-status { margin: 8px 0; font: 12px/1.4 "DM Sans",sans-serif; color: #e7f5ed; }
.score-view-list { padding: 3px 0; color: #f7dfab; border: 0; background: none; font: 12px "DM Sans",sans-serif; text-decoration: underline; cursor: pointer; }
.leaderboard-dialog { width: min(440px,calc(100% - 28px)); max-height: 86dvh; overflow: auto; border: 3px solid #bce8f5; border-radius: 24px; padding: 22px; background: linear-gradient(145deg,#285a76,#132e49); color: #f9f4de; box-shadow: 0 10px 0 #0d223d,0 20px 70px #0008; }
.leaderboard-dialog::backdrop { background: #071a30b8; backdrop-filter: blur(7px); }
.leaderboard-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.leaderboard-heading h2 { margin: 0; font: 25px "Archivo Black",sans-serif; }
.leaderboard-heading button { border: 1px solid #c5e7f7; border-radius: 50%; width: 38px; height: 38px; background: #386e8a; color: white; font: 25px/1 sans-serif; cursor: pointer; }
.leaderboard-intro { margin: 8px 0 20px; color: #bfd4e4; font: 12px "DM Sans",sans-serif; }
.leaderboard-list { list-style: none; padding: 0; margin: 0 0 16px; }
.leaderboard-list li { display: grid; grid-template-columns: 26px minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid #ffffff24; font: 14px "DM Sans",sans-serif; }
.leaderboard-list li strong { overflow-wrap: anywhere; }
.leaderboard-rank { color: #a7c5d5; }
.leaderboard-list li:first-child { color: #ffe6a3; }
.leaderboard-score { font-weight: 800; font-variant-numeric: tabular-nums; }
#leaderboard-status { font: 13px/1.5 "DM Sans",sans-serif; }
.curl-overlay > div { max-height: calc(100dvh - 120px); overflow-y: auto; }
@media(max-height:600px) { .curl-overlay > div { max-height: calc(100dvh - 65px); } }

#result-summary[hidden], #score-view-list[hidden] { display: none; }
.curl-overlay.is-result > div { display: flex; flex-direction: column; width: min(370px,100%); padding: 25px 22px 20px; border: 2px solid #a8cfdd; border-radius: 24px; background: linear-gradient(145deg,#244b62,#142f46); box-shadow: 0 5px 0 #0b2136,0 20px 60px #04182777; }
.is-result .curl-symbol { display: none; }
.curl-overlay.is-result h3 { order: 0; margin: 0; font: 27px/1.15 "Archivo Black",sans-serif; text-shadow: none; }
.curl-overlay.is-result #curl-panel-copy { order: 1; margin: 9px 0 18px; font: 13px/1.5 "DM Sans",sans-serif; color: #bdd5e1; }
#result-summary { order: 2; }
.result-totals { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; padding: 16px 10px; border-radius: 15px; background: #0b233680; border: 1px solid #b9dfef22; }
.result-totals div { display: flex; flex-direction: column; gap: 6px; }
.result-totals div > span { font: 12px "DM Sans",sans-serif; color: #a9c9d9; }
.result-totals strong { font: 30px/1.2 "Archivo Black",sans-serif; color: #f3e4b7; }
.result-totals div:last-child strong { color: #f2bac4; }
.result-vs { font: 11px "DM Sans",sans-serif; color: #a8bfca; }
.is-result .score-form { order: 3; margin: 14px 0 0; padding: 13px; border-radius: 15px; background: #0b233650; border: 1px solid #b9dfef22; }
.is-result .score-form label { font-size: 12px; color: #f3e4b7; }
.is-result .score-entry { gap: 7px; }
.is-result .score-entry input { padding: 10px; border-width: 1px; border-radius: 9px; }
.is-result .score-entry button { border-width: 1px; border-radius: 9px; padding: 10px; font-size: 12px; }
.is-result .game-start { order: 4; margin: 17px 0 0; width: 100%; padding: 13px; min-height: 46px; border-width: 1px; border-radius: 12px; box-shadow: 0 3px 0 #80643d; font: 700 14px "DM Sans",sans-serif; text-transform: none; }
.is-result #score-view-list { order: 5; align-self: center; padding: 12px 8px 5px; text-decoration: none; color: #d0e3ee; }
.is-result .audio-credit { order: 6; margin: 12px 0 0; opacity: .7; font-size: 9px; }
