/* ------------------------------ HUD ------------------------------ */
.hud {
  position: absolute;
  inset: 0;
}
.hud-top {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: calc(8px + var(--sat)) calc(8px + var(--sar)) 0 calc(8px + var(--sal));
  transition: opacity 0.3s;
}
.hud-top.dim,
.hud-info.dim {
  opacity: 0;
}
.hud-info {
  transition: opacity 0.3s;
}
.hud-btn {
  pointer-events: auto;
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(15, 9, 8, 0.62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  font-size: 18px;
  box-shadow: inset 0 0 0 1.5px var(--line);
}
.sb-wrap {
  pointer-events: auto;
  flex: 1;
  min-width: 0;
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
}
.sb {
  background: rgba(250, 240, 220, 0.94);
  color: #2a1a12;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}
.sb.cur {
  box-shadow:
    0 0 0 2.5px var(--pc),
    0 4px 14px rgba(0, 0, 0, 0.35);
}
.sb-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  background: #2a1a12;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}
.sb-logo {
  height: 14px;
  width: auto;
  max-width: 70px;
  object-fit: contain;
  margin-right: 2px;
}
.sb-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--pc);
  flex: none;
}
.sb-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sb-max {
  color: var(--muted);
  font-weight: 500;
  font-size: 11px;
}
.sb-total {
  font-family: var(--f-display);
  font-size: 15px;
  color: var(--pc);
  min-width: 30px;
  text-align: right;
}
.sb-frames {
  display: grid;
  grid-template-columns: repeat(9, 1fr) 1.45fr;
}
.sb-f {
  border-right: 1px solid rgba(42, 26, 18, 0.18);
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.sb-f:last-child {
  border-right: 0;
}
.sb-n {
  font-size: 9px;
  text-align: center;
  background: rgba(42, 26, 18, 0.08);
  color: rgba(42, 26, 18, 0.6);
  font-weight: 700;
  line-height: 13px;
}
.sb-b {
  display: flex;
  justify-content: flex-end;
  height: 17px;
}
.sb-b i {
  font-style: normal;
  width: 50%;
  max-width: 17px;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  border-left: 1px solid rgba(42, 26, 18, 0.14);
  border-bottom: 1px solid rgba(42, 26, 18, 0.14);
}
.ten .sb-b i {
  width: 33.33%;
  max-width: none;
}
.sb-b i.mx {
  background: var(--secondary);
  color: #fff;
}
.sb-b i.ms {
  background: var(--accent);
  color: #fff;
  clip-path: polygon(100% 0, 100% 100%, 0 100%);
}
.sb-s {
  font-family: var(--f-display);
  font-size: 13px;
  text-align: center;
  line-height: 20px;
  height: 20px;
}
.sb-s.pend {
  color: rgba(42, 26, 18, 0.35);
  font-family: var(--f-ui);
  font-size: 10px;
  letter-spacing: 1px;
  animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse {
  50% {
    opacity: 0.35;
  }
}
.sb-f.now {
  background: rgba(242, 181, 58, 0.32);
}
.sb-f.now .sb-n {
  background: var(--primary);
  color: #2a1606;
}
.sb-others {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.sb-chip {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  padding: 2px 9px;
  border-radius: 10px;
  background: rgba(15, 9, 8, 0.7);
  font-size: 11px;
  box-shadow: inset 3px 0 0 var(--pc);
}
.pinmap {
  flex: none;
  width: 58px;
  padding: 6px 5px;
  border-radius: 12px;
  background: rgba(15, 9, 8, 0.62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: center;
  box-shadow: inset 0 0 0 1.5px var(--line);
}
.no-pinmap .pinmap {
  display: none;
}
.pm-row {
  display: flex;
  gap: 3px;
}
.pm-row i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #fff6e4;
  box-shadow: 0 0 6px rgba(255, 240, 200, 0.6);
  transition: all 0.3s;
}
.pm-row i.down {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.25);
}
.hud-info {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(var(--sat) + 96px);
  display: flex;
  justify-content: center;
  gap: 6px;
}
.ch-card {
  position: absolute;
  left: 50%;
  top: calc(8px + var(--sat));
  transform: translateX(-50%);
  width: min(calc(100% - 140px), 420px);
  padding: 10px 14px;
  border-radius: 16px;
  background: rgba(15, 9, 8, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: inset 0 0 0 1.5px var(--line);
  text-align: center;
}
.ch-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--f-display);
  text-transform: uppercase;
  font-size: 15px;
  color: var(--primary);
}
.ch-desc {
  font-size: 13px;
  color: var(--muted);
  margin: 4px 0 6px;
}
.ch-meta {
  display: flex;
  justify-content: center;
  gap: 6px;
}

/* Banner */
.banner {
  position: absolute;
  left: 0;
  right: 0;
  top: 30%;
  text-align: center;
  opacity: 0;
  pointer-events: none;
}
.banner.show {
  opacity: 1;
}
.banner.out {
  opacity: 0;
  transition:
    opacity 0.35s ease,
    transform 0.35s ease;
  transform: translateY(-14px) scale(0.96);
}
.b-title {
  font-family: var(--f-display);
  font-size: clamp(40px, 13vw, 96px);
  line-height: 1;
  letter-spacing: 0.01em;
  white-space: nowrap;
  transform: skew(-6deg);
}
.b-title span {
  display: inline-block;
  animation: letter 0.55s cubic-bezier(0.2, 1.7, 0.35, 1) both;
  color: #fff;
  -webkit-text-stroke: 2px rgba(0, 0, 0, 0.25);
  paint-order: stroke fill;
  text-shadow:
    0 5px 0 rgba(0, 0, 0, 0.35),
    0 0 40px rgba(255, 255, 255, 0.25);
}
@keyframes letter {
  from {
    transform: translateY(40px) scale(0.2) rotate(-12deg);
    opacity: 0;
  }
  60% {
    opacity: 1;
  }
  to {
    transform: none;
  }
}
.banner.strike .b-title span {
  color: #ffe29a;
  text-shadow:
    0 5px 0 #b3261e,
    0 0 50px rgba(255, 190, 80, 0.7);
  -webkit-text-stroke: 2px #6b120d;
}
.banner.big .b-title {
  font-size: clamp(46px, 15vw, 116px);
}
.banner.big .b-title span {
  color: #fff2c4;
  text-shadow:
    0 6px 0 #b3261e,
    0 0 70px rgba(255, 120, 60, 0.9);
  animation:
    letter 0.55s cubic-bezier(0.2, 1.7, 0.35, 1) both,
    wobble 1.2s ease-in-out infinite 0.6s;
}
@keyframes wobble {
  50% {
    transform: translateY(-6px) rotate(2deg);
  }
}
.banner.spare .b-title span {
  color: #c9fff8;
  text-shadow:
    0 5px 0 #0f6b64,
    0 0 40px rgba(60, 220, 200, 0.6);
  -webkit-text-stroke: 2px #0b4945;
}
.banner.split .b-title span {
  color: #ffd0c8;
  text-shadow: 0 5px 0 #7a1a12;
}
.banner.gutter .b-title span {
  color: #cfc7bd;
  text-shadow: 0 5px 0 #3b3430;
}
.banner.pins .b-title {
  font-size: clamp(30px, 9vw, 58px);
}
.b-sub {
  margin-top: 10px;
  display: inline-block;
  padding: 6px 14px;
  border-radius: 14px;
  background: rgba(15, 9, 8, 0.7);
  font-weight: 700;
  font-size: 14px;
  animation: scrIn 0.4s both 0.25s;
}

/* Hint */
.hint {
  position: absolute;
  left: 50%;
  bottom: calc(26px + var(--sab));
  transform: translateX(-50%) translateY(20px);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border-radius: 22px;
  background: rgba(15, 9, 8, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  font-weight: 700;
  font-size: 14px;
  opacity: 0;
  transition: all 0.35s ease;
  white-space: nowrap;
  max-width: 94vw;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hint.show {
  opacity: 1;
  transform: translateX(-50%);
}
.hint-swipe {
  width: 16px;
  height: 22px;
  border-radius: 8px;
  border: 2px solid var(--primary);
  position: relative;
  flex: none;
}
.hint-swipe::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 3px;
  width: 5px;
  height: 5px;
  margin-left: -2.5px;
  border-radius: 50%;
  background: var(--primary);
  animation: swipeDot 1.4s ease-in-out infinite;
}
@keyframes swipeDot {
  0% {
    transform: translateY(0);
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  80% {
    transform: translateY(-11px);
    opacity: 1;
  }
  100% {
    transform: translateY(-11px);
    opacity: 0;
  }
}

/* Meters */
.meter {
  position: absolute;
  right: calc(16px + var(--sar));
  bottom: calc(22% + var(--sab));
  width: 22px;
  height: 34vh;
  max-height: 260px;
  border-radius: 12px;
  background: rgba(15, 9, 8, 0.65);
  box-shadow: inset 0 0 0 2px var(--line);
  overflow: hidden;
}
.meter-fill {
  position: absolute;
  inset: 3px;
  border-radius: 9px;
  transform-origin: bottom;
  transform: scaleY(0);
  transition: transform 0.05s linear;
}
.meter-label {
  position: absolute;
  left: 50%;
  top: -24px;
  transform: translateX(-50%);
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}
.meter {
  overflow: visible;
}
.spin-ind {
  position: absolute;
  left: calc(16px + var(--sal));
  bottom: calc(22% + var(--sab));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px;
  border-radius: 16px;
  background: rgba(15, 9, 8, 0.65);
  min-width: 82px;
}
.spin-arrow {
  width: 54px;
  height: 54px;
  position: relative;
}
.spin-arrow::before {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 2px;
  width: 4px;
  height: 46px;
  margin-left: -2px;
  border-radius: 3px;
  background: var(--primary);
  transform-origin: bottom center;
  transform: rotate(calc(var(--spin, 0) * 40deg));
  box-shadow: 0 0 10px rgba(242, 181, 58, 0.6);
}
.spin-arrow::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  width: 46px;
  height: 46px;
  margin-left: -23px;
  border-radius: 50%;
  border: 2px dashed rgba(255, 255, 255, 0.18);
  clip-path: inset(0 0 50% 0);
}
.spin-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}

/* Precision controls */
.precision {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 10px calc(10px + var(--sar)) calc(10px + var(--sab)) calc(10px + var(--sal));
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  background: linear-gradient(180deg, transparent, rgba(12, 7, 6, 0.85) 30%);
  pointer-events: auto;
}
.pc-row {
  display: flex;
  gap: 8px;
  width: 100%;
  max-width: 620px;
  justify-content: center;
}
.pc-group {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  padding: 4px;
  min-width: 0;
}
.pc-btn {
  pointer-events: auto;
  width: 38px;
  height: 40px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  display: grid;
  place-items: center;
  flex: none;
  touch-action: none;
}
.pc-btn:active {
  background: var(--primary);
  color: #2a1606;
}
.pc-val {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
}
.pc-val small {
  font-size: 10px;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.pc-val b {
  font-size: 13px;
  white-space: nowrap;
}
.pc-bowl {
  pointer-events: auto;
  position: relative;
  width: 100%;
  max-width: 620px;
  height: 56px;
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(180deg, #ffd06a, var(--primary));
  color: #2a1606;
  box-shadow: 0 4px 0 #a86f12;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  touch-action: none;
}
.pc-bowl span {
  position: relative;
  font-family: var(--f-display);
  font-size: 20px;
  letter-spacing: 0.06em;
}
.pc-bowl small {
  position: relative;
  font-size: 12px;
  opacity: 0.7;
  font-weight: 700;
}
.pc-fill {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #2bb3a8, #f2b53a 60%, #ff4d3a);
  transform-origin: left;
  transform: scaleX(0);
}
.pc-bowl.on {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #a86f12;
}

/* Turn hand-over */
.turn {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  pointer-events: none;
}
.turn-band {
  width: 100%;
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: linear-gradient(90deg, transparent, var(--pc) 15%, var(--pc) 85%, transparent);
  color: #1d120c;
}
.turn-band small {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.75;
}
.turn-band b {
  font-family: var(--f-display);
  font-size: clamp(34px, 10vw, 64px);
  line-height: 1;
  text-transform: uppercase;
}
.turn-band span {
  font-weight: 700;
}
.turn.anim .turn-band {
  animation: band 1.15s cubic-bezier(0.3, 0.9, 0.3, 1) both;
}
@keyframes band {
  0% {
    transform: translateX(-100%) skew(-12deg);
  }
  22% {
    transform: translateX(0) skew(-6deg);
  }
  78% {
    transform: translateX(0) skew(-6deg);
    opacity: 1;
  }
  100% {
    transform: translateX(100%) skew(-12deg);
    opacity: 0;
  }
}

/* Replay */
.replay .lb {
  position: absolute;
  left: 0;
  right: 0;
  height: 9vh;
  background: #000;
  animation: lbIn 0.35s ease both;
}
.replay .lb.top {
  top: 0;
}
.replay .lb.bottom {
  bottom: 0;
}
@keyframes lbIn {
  from {
    transform: scaleY(0);
  }
}
.replay-badge {
  position: absolute;
  left: calc(16px + var(--sal));
  top: calc(9vh + 12px);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 10px;
  background: var(--secondary);
  font-family: var(--f-display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 14px;
  animation: blink 1.2s steps(2) infinite;
}
@keyframes blink {
  50% {
    opacity: 0.55;
  }
}
.replay-skip {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(9vh + 14px);
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.8);
}

/* Tutorial */
.tut {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.tut-hand {
  position: absolute;
  left: var(--bx);
  top: var(--by);
  width: 0;
  height: 0;
}
.tut-finger {
  position: absolute;
  left: -16px;
  top: -4px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  box-shadow:
    0 0 0 6px rgba(255, 255, 255, 0.25),
    0 0 26px rgba(255, 255, 255, 0.6);
}
.k1 .tut-finger {
  animation: tutSide 1.8s ease-in-out infinite;
}
.k2 .tut-finger {
  animation: tutUp 1.4s cubic-bezier(0.5, 0, 0.3, 1) infinite;
}
.k3 .tut-finger {
  animation: tutCurve 1.6s ease-in-out infinite;
  offset-path: path('M0,0 C 30,-60 40,-120 0,-190');
}
.k9 .tut-finger {
  display: none;
}
@keyframes tutSide {
  0%,
  100% {
    transform: translateX(-60px);
  }
  50% {
    transform: translateX(60px);
  }
}
@keyframes tutUp {
  0% {
    transform: translateY(10px);
    opacity: 0;
  }
  15% {
    opacity: 1;
  }
  70% {
    transform: translateY(-200px);
    opacity: 1;
  }
  100% {
    transform: translateY(-220px);
    opacity: 0;
  }
}
@keyframes tutCurve {
  0% {
    offset-distance: 0%;
    opacity: 0;
  }
  15% {
    opacity: 1;
  }
  80% {
    offset-distance: 100%;
    opacity: 1;
  }
  100% {
    offset-distance: 100%;
    opacity: 0;
  }
}
.tut-bubble {
  position: absolute;
  left: 50%;
  top: calc(var(--sat) + 132px);
  transform: translateX(-50%);
  width: min(88vw, 380px);
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(250, 240, 220, 0.96);
  color: #2a1606;
  font-weight: 700;
  font-size: 16px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  pointer-events: auto;
  animation: pop 0.4s both;
}
.tut-btns {
  margin-top: 10px;
  display: flex;
  justify-content: center;
}
.tut-btns .btn {
  background: rgba(42, 22, 6, 0.1);
  color: #2a1606;
  box-shadow: none;
}

/* Results */
.results {
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 50% 40%, rgba(40, 24, 18, 0.5), rgba(12, 7, 6, 0.92));
}
.res-card {
  width: min(100%, 440px);
  max-height: 100%;
  overflow-y: auto;
  background: var(--panel);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: 28px;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  box-shadow:
    0 24px 70px rgba(0, 0, 0, 0.6),
    inset 0 0 0 1.5px var(--line);
  animation: pop 0.45s cubic-bezier(0.2, 1.3, 0.4, 1) both;
}
.res-kicker {
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 12px;
}
.res-win {
  margin: 0;
  font-family: var(--f-display);
  font-weight: 400;
  font-size: 24px;
  text-transform: uppercase;
  color: var(--primary);
}
.big-score {
  font-family: var(--f-display);
  font-size: clamp(72px, 24vw, 120px);
  line-height: 1;
  color: #fff3d6;
  text-shadow:
    0 6px 0 #6b1a14,
    0 0 50px rgba(242, 181, 58, 0.35);
  -webkit-text-stroke: 3px var(--secondary);
  paint-order: stroke fill;
}
.big-score.bump {
  animation: bump 0.5s cubic-bezier(0.2, 1.8, 0.4, 1);
}
@keyframes bump {
  40% {
    transform: scale(1.18);
  }
}
.new-best {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 16px;
  background: var(--primary);
  color: #2a1606;
  font-weight: 700;
  animation:
    pop 0.5s both 1.2s,
    glow 1.6s ease-in-out infinite 1.7s;
}
@keyframes glow {
  50% {
    box-shadow: 0 0 30px rgba(242, 181, 58, 0.7);
  }
}
.res-tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  width: 100%;
}
.res-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.res-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  box-shadow: inset 4px 0 0 var(--pc);
  animation: scrIn 0.4s both;
}
.res-row.first {
  background: rgba(242, 181, 58, 0.12);
}
.res-place {
  width: 28px;
  color: var(--primary);
  font-weight: 700;
  display: grid;
  place-items: center;
}
.res-name {
  flex: 1;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.res-mini {
  font-size: 11px;
  color: var(--muted);
}
.res-total {
  font-family: var(--f-display);
  font-size: 22px;
  font-weight: 400;
  min-width: 46px;
  text-align: right;
}
.res-tickets {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--primary);
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 16px;
  background: rgba(242, 181, 58, 0.1);
}
.res-tickets b {
  font-family: var(--f-display);
  font-weight: 400;
  font-size: 20px;
}
.res-ach {
  width: 100%;
  text-align: center;
}
.res-ach > small {
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 11px;
  display: block;
  margin-bottom: 6px;
}

/* Help/settings over a paused game */
#pf-ui.over-game .screen {
  background: rgba(18, 11, 9, 0.94);
}
/* End of css/hud.css (complete file). */
