/* ==========================================================
   Westphal Solutions - SPACEBITS cartridge
   Mounts a canvas + HUD in the cabinet screen and a rotary
   dial in the deck. Geometry sizes off the screen via the
   cabinet's --wscab-s, so it scales with the machine.
   ========================================================== */

.wssb-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }

/* HUD overlay inside the screen */
.wssb-hud {
  position: absolute;
  inset: 0;
  padding: calc(var(--wscab-s, 320px) * 0.03);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  pointer-events: none;
  z-index: 2;
}
.wssb-hud__row { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.wssb-hud__label {
  font-size: calc(var(--wscab-s, 320px) * 0.026);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ws-grey, #A2AAAD);
  margin: 0 0 3px;
}
.wssb-hud__shields { display: flex; gap: 5px; }
.wssb-hud__pip {
  width: calc(var(--wscab-s, 320px) * 0.06);
  height: calc(var(--wscab-s, 320px) * 0.022);
  border-radius: 2px;
  background: var(--ws-lime, #C3DD22);
  box-shadow: 0 0 8px rgba(195,221,34,0.5);
  transition: background 0.2s var(--ws-ease, ease), box-shadow 0.2s var(--ws-ease, ease);
}
.wssb-hud__pip.is-lost { background: #3a3a3e; box-shadow: none; }
.wssb-hud__center { text-align: center; flex: 1; }
.wssb-hud__score {
  font-size: calc(var(--wscab-s, 320px) * 0.11);
  font-weight: 900;
  line-height: 1;
  color: var(--ws-white, #FFFFFF);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 14px rgba(0,0,0,0.7);
}
.wssb-hud__combo {
  margin-top: calc(var(--wscab-s, 320px) * 0.012);
  height: 1.1em;
  font-size: calc(var(--wscab-s, 320px) * 0.034);
  font-weight: 900;
  letter-spacing: 0.06em;
  color: var(--ws-lime, #C3DD22);
  opacity: 0;
  transition: opacity 0.15s var(--ws-ease, ease), transform 0.15s var(--ws-ease, ease);
}
.wssb-hud__combo.is-on { opacity: 1; }
.wssb-hud__combo.is-bump { transform: scale(1.22); }
.wssb-hud__best { text-align: right; }
.wssb-hud__best-val { font-size: calc(var(--wscab-s, 320px) * 0.04); font-weight: 900; color: var(--ws-light-grey, #E5E5EA); font-variant-numeric: tabular-nums; }

/* Overlays inside the screen */
.wssb-screenmsg {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: calc(var(--wscab-s, 320px) * 0.07);
  background: rgba(13,13,15,0.86);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.wssb-screenmsg.is-hidden { display: none; }
.wssb-screenmsg__title {
  font-size: calc(var(--wscab-s, 320px) * 0.16);
  font-weight: 900;
  letter-spacing: 0.12em;
  line-height: 1;
  margin: 0 0 0.1em;
  color: var(--ws-lime, #C3DD22);
  text-shadow: 0 0 34px rgba(195,221,34,0.4);
  padding-left: 0.12em;
}
.wssb-screenmsg__sub {
  font-size: calc(var(--wscab-s, 320px) * 0.034);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ws-grey, #A2AAAD);
  margin: 0 0 1.6em;
}
.wssb-screenmsg__how {
  max-width: 22em;
  font-size: calc(var(--wscab-s, 320px) * 0.04);
  line-height: 1.5;
  color: var(--ws-light-grey, #E5E5EA);
  margin: 0 0 1.6em;
}
.wssb-screenmsg__how b { color: var(--ws-white, #FFFFFF); font-weight: 900; }
.wssb-screenmsg__over {
  font-size: calc(var(--wscab-s, 320px) * 0.034);
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ws-red, #FF6B6B);
  margin: 0 0 0.6em;
}
.wssb-screenmsg__final {
  font-size: calc(var(--wscab-s, 320px) * 0.18);
  font-weight: 900;
  line-height: 1;
  color: var(--ws-white, #FFFFFF);
  font-variant-numeric: tabular-nums;
  margin: 0 0 0.1em;
}
.wssb-screenmsg__best { font-size: calc(var(--wscab-s, 320px) * 0.034); letter-spacing: 0.18em; text-transform: uppercase; color: var(--ws-grey, #A2AAAD); margin: 0 0 1.4em; }
.wssb-screenmsg__best b { color: var(--ws-lime, #C3DD22); font-weight: 900; }
.wssb-btn {
  appearance: none;
  font-family: var(--ws-font, 'Lato', Arial, sans-serif);
  font-size: calc(var(--wscab-s, 320px) * 0.042);
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #111;
  background: var(--ws-lime, #C3DD22);
  border: none;
  border-radius: 3px;
  padding: 0.85em 2.2em;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(195,221,34,0.3);
  transition: transform 0.12s var(--ws-ease, ease), box-shadow 0.2s var(--ws-ease, ease);
}
.wssb-btn:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(195,221,34,0.42); }
.wssb-btn:active { transform: translateY(0); }
.wssb-btn:focus-visible { outline: 2px solid var(--ws-white, #FFFFFF); outline-offset: 3px; }
.wssb-btn--ghost {
  background: transparent;
  color: var(--ws-light-grey, #E5E5EA);
  border: 1px solid rgba(255,255,255,0.25);
  box-shadow: none;
  margin-top: 0.7em;
}
.wssb-btn--ghost:hover { box-shadow: none; border-color: rgba(255,255,255,0.5); }
.wssb-screenmsg__share-note { margin: 1.2em 0 0; font-size: calc(var(--wscab-s, 320px) * 0.03); color: var(--ws-grey, #A2AAAD); max-width: 20em; line-height: 1.5; }
.wssb-toast {
  position: absolute;
  bottom: calc(var(--wscab-s, 320px) * 0.05);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.7);
  color: var(--ws-light-grey, #E5E5EA);
  font-size: calc(var(--wscab-s, 320px) * 0.03);
  letter-spacing: 0.04em;
  padding: 0.5em 1em;
  border-radius: 3px;
  opacity: 0;
  transition: opacity 0.2s var(--ws-ease, ease);
  pointer-events: none;
  z-index: 4;
}
.wssb-toast.is-on { opacity: 1; }

/* Rotary dial in the deck */
.wssb-dial {
  position: relative;
  width: calc(var(--wscab-s, 320px) * 0.3);
  height: calc(var(--wscab-s, 320px) * 0.3);
  border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, #34343a 0%, #1c1c20 70%, #141417 100%);
  box-shadow: inset 0 2px 4px rgba(255,255,255,0.08), inset 0 -4px 10px rgba(0,0,0,0.6), 0 6px 14px rgba(0,0,0,0.5);
  border: 1px solid rgba(0,0,0,0.5);
  pointer-events: none;
  transition: box-shadow 0.15s var(--ws-ease, ease);
}
.wssb-dial__ring { position: absolute; inset: 12%; border-radius: 50%; border: 2px dashed rgba(195,221,34,0.22); }
.wssb-dial__hub {
  position: absolute;
  top: 50%; left: 50%;
  width: 26%; height: 26%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #46464d 0%, #232327 80%);
  box-shadow: inset 0 1px 2px rgba(255,255,255,0.12), 0 1px 3px rgba(0,0,0,0.6);
}
.wssb-dial__needle {
  position: absolute;
  top: 50%; left: 50%;
  width: 100%; height: 100%;
  transform: translate(-50%, -50%) rotate(0deg);
  transform-origin: 50% 50%;
  will-change: transform;
}
.wssb-dial__needle::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 8%;
  width: calc(var(--wscab-s, 320px) * 0.013);
  height: 36%;
  transform: translateX(-50%);
  border-radius: 3px;
  background: linear-gradient(180deg, var(--ws-lime, #C3DD22) 0%, rgba(195,221,34,0.4) 100%);
  box-shadow: 0 0 8px rgba(195,221,34,0.6);
}
.wssb-dial.is-active {
  box-shadow: inset 0 2px 4px rgba(255,255,255,0.1), inset 0 -4px 10px rgba(0,0,0,0.6), 0 0 18px rgba(195,221,34,0.35), 0 6px 14px rgba(0,0,0,0.5);
}
.wssb-dial__label {
  position: absolute;
  bottom: -1.8em;
  left: 50%;
  transform: translateX(-50%);
  font-size: calc(var(--wscab-s, 320px) * 0.026);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ws-grey, #A2AAAD);
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  .wssb-btn, .wssb-hud__combo, .wssb-dial, .wssb-toast { transition: none; }
}
