/* PinBell Machine — arcade navy cabinet page, Prodigies buttons. */

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body { margin: 0; padding: 0; height: 100%; }

body.pinbell-page {
  font-family: "Nunito", "Avenir Next Rounded", "Trebuchet MS", "Verdana", sans-serif;
  background: linear-gradient(180deg, #232b58 0%, #1b2245 55%, #121732 100%);
  color: #fff;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.app {
  position: relative;
  z-index: 1;
  height: 100vh;
  height: 100dvh;
  display: flex;
  align-items: stretch;
  justify-content: center;
}






/* ---- note select ---- */

.select-screen {
  width: min(560px, 100%);
  display: flex;
  flex-direction: column;
  padding: calc(58px + env(safe-area-inset-top)) 16px 18px;
  gap: 14px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.select-head { text-align: center; }

.app-title {
  margin: 0;
  font-size: clamp(28px, 6vw, 38px);
  font-weight: 900;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.3);
}

.select-sub {
  margin: 6px 0 0;
  font-size: clamp(16px, 3.5vw, 20px);
  font-weight: 800;
  color: #9fb0f0;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.ball-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 10px;
}

.ball-card {
  appearance: none;
  border: 3px solid transparent;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  padding: 12px 6px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.ball-card:hover { transform: translateY(-3px); }
.ball-card:active { transform: translateY(0) scale(0.97); }

.ball-card.is-selected {
  border-color: var(--bell-color);
  background: rgba(255, 255, 255, 0.16);
  animation: ballBounce 0.45s ease;
}

@keyframes ballBounce {
  0% { transform: scale(1); }
  35% { transform: scale(1.09); }
  65% { transform: scale(0.97); }
  100% { transform: scale(1); }
}

.ball-chip {
  position: relative;
  width: 54px; height: 54px;
  border-radius: 50%;
  background: var(--bell-color);
  box-shadow: inset -4px -6px 0 rgba(0, 0, 0, 0.18), 0 4px 8px rgba(0, 0, 0, 0.35);
}

.ball-shine {
  position: absolute;
  top: 9px; left: 11px;
  width: 15px; height: 11px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.8);
  transform: rotate(-25deg);
}

.ball-note {
  font-size: 15px;
  font-weight: 900;
  padding: 2px 12px;
  border-radius: 999px;
  background: var(--bell-color);
  color: #fff;
  min-width: 42px;
  text-align: center;
}

.ball-card[style*="#f1e606"] .ball-note,
.ball-card[style*="#ffd25b"] .ball-note {
  color: #512d1b;
}

.select-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding-bottom: env(safe-area-inset-bottom);
}

.controls-hint {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: #9fb0f0;
}

.controls-hint kbd {
  font-family: inherit;
  background: rgba(255, 255, 255, 0.16);
  border-radius: 6px;
  padding: 1px 7px;
}

.action-btn {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 14px 34px;
  font-family: inherit;
  font-size: 19px;
  font-weight: 900;
  letter-spacing: 1px;
  cursor: pointer;
  color: #1b233e;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.3);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  min-height: 52px;
}

.action-btn:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.3);
}

.action-btn.primary { background: #6ab845; color: #fff; }

/* ---- machine stage ---- */

.game-screen {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
}

.stage {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.55);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

#gameCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* ---- game over panel ---- */

.panel {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 20;
  width: min(350px, 90%);
  max-height: 94%;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: rgba(18, 23, 50, 0.96);
  border: 2px solid rgba(255, 255, 255, 0.16);
  border-radius: 24px;
  padding: 20px 18px;
  text-align: center;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: panelIn 0.35s cubic-bezier(0.2, 1.4, 0.4, 1);
}

@keyframes panelIn {
  from { transform: translate(-50%, -44%) scale(0.85); opacity: 0; }
  to { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

.panel h2 {
  margin: 0 0 10px;
  font-size: 28px;
  font-weight: 900;
}

.new-best {
  display: inline-block;
  margin: 0 0 10px;
  padding: 5px 16px;
  border-radius: 999px;
  background: #f39422;
  color: #fff;
  font-weight: 900;
  font-size: 15px;
  animation: ballBounce 0.6s ease infinite alternate;
}

.led-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #0c1024;
  border-radius: 12px;
  padding: 9px 14px;
  margin-bottom: 8px;
}

.led-label {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 2px;
  color: #8fa0e0;
}

.led-text {
  font-family: "Courier New", monospace;
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 3px;
  color: #ffd25b;
}

.over-bell {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 12px 0 16px;
}

.over-ball {
  width: 34px; height: 34px;
  border-radius: 50%;
  box-shadow: inset -3px -4px 0 rgba(0, 0, 0, 0.18);
  flex: none;
}

.over-note { font-weight: 900; font-size: 16px; }

.panel-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.panel-actions .action-btn { width: 100%; }

#classScoreSlot .pk5s-block {
  margin: 0 0 16px;
  text-align: left;
}

/* ---- reduced motion ---- */

@media (prefers-reduced-motion: reduce) {
  .ball-card, .ball-card.is-selected, .new-best, .panel {
    animation: none;
    transition: none;
  }
}

/* Control hints: a pre-reader on an iPad should never be told about Space and
   arrow keys. The keyboard line shows on fine pointers, the touch line on
   coarse ones — same trick the games use to reveal #touchControls. */
.hint-touch { display: none; }
@media (pointer: coarse) {
  .hint-keys { display: none; }
  .hint-touch { display: inline; }
}
