/* Perchanceably — The Council of Maybe */

:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: #000;
  font-family: var(--font-sans);
  color: #e8e0d0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.pr {
  position: relative;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  background: radial-gradient(ellipse at 50% 30%, #1a1a1a 0%, #050505 70%, #000 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px 40px;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

/* Mute button */
.pm {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #888;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: color 0.2s, border-color 0.2s;
}
.pm:hover { color: #ffb84d; border-color: rgba(255, 184, 77, 0.3); }

/* Title and subtitle */
.pt {
  color: #f5f0e8;
  font-size: clamp(28px, 7vw, 44px);
  font-weight: 500;
  letter-spacing: -0.02em;
  margin: 8px 0 4px;
  text-align: center;
  text-shadow: 0 0 20px rgba(255, 200, 100, 0.15);
}
.ps {
  color: #888;
  font-size: clamp(11px, 2.8vw, 13px);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  margin: 0 0 24px;
  text-align: center;
}

/* Question input */
.pq {
  margin: 0 0 18px;
  width: min(92vw, 480px);
}
.pqi {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #e8e0d0;
  padding: 12px 18px;
  border-radius: 12px;
  font-size: 14px;
  font-family: var(--font-sans);
  text-align: center;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.pqi::placeholder { color: #555; font-style: italic; }
.pqi:focus {
  outline: none;
  border-color: rgba(255, 180, 80, 0.4);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 20px rgba(255, 180, 80, 0.1);
}

/* Cabinet — body + lever as one unified unit */
.pc {
  position: relative;
  width: min(96vw, 560px);
  margin: 0 auto;
  display: flex;
  align-items: stretch;
  background: linear-gradient(180deg, #1a1a1a 0%, #0a0a0a 100%);
  border-radius: 28px;
  border: 1px solid #2a2a2a;
  box-shadow:
    0 30px 60px rgba(0, 0, 0, 0.9),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 1px 0 rgba(255, 255, 255, 0.08) inset;
}
.pc::before {
  content: '';
  position: absolute;
  top: 8px; left: 12px; right: 12px;
  height: 30%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, transparent 100%);
  border-radius: 20px;
  pointer-events: none;
}
.pc-body {
  flex: 1;
  padding: 22px 22px 28px;
  position: relative;
  border-right: 1px solid #1a1a1a;
}

/* Decorative screws */
.pscr {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #555, #1a1a1a 70%);
  box-shadow: inset 0 0 2px rgba(0, 0, 0, 0.8);
}

/* Display housing */
.pd {
  position: relative;
  background: #000;
  border-radius: 18px;
  padding: 14px;
  box-shadow:
    0 0 0 2px #1a1a1a,
    0 8px 20px rgba(0, 0, 0, 0.6) inset;
  overflow: hidden;
}

/* Reel viewport — default gold, tints by tier on landing */
.pv {
  position: relative;
  height: 180px;
  overflow: hidden;
  border-radius: 10px;
  background: #000;
  border: 1px solid #2a2218;
  transition: border-color 0.3s;
}
.pv.cm { border-color: #1a3018; }
.pv.rr { border-color: #5a1a3a; }
.pv.lg { border-color: #3a1a5a; }

.prl {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  will-change: transform;
}

/* Reel items: default gold */
.pi {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #f5d68a;
  font-size: clamp(17px, 4.3vw, 24px);
  font-weight: 500;
  text-shadow: 0 0 12px rgba(245, 200, 100, 0.4);
  padding: 0 12px;
  text-align: center;
  white-space: nowrap;
}

/* Tier glow states for landed answer */
.pi.glcm {
  color: #c8f090;
  text-shadow:
    0 0 8px rgba(180, 240, 100, 0.9),
    0 0 20px rgba(140, 220, 80, 0.6),
    0 0 40px rgba(100, 200, 40, 0.3);
  animation: pg 1.6s ease-in-out infinite;
}
.pi.glrr {
  color: #ffb0d8;
  font-size: clamp(14px, 3.6vw, 20px);
  text-shadow:
    0 0 10px rgba(255, 150, 200, 1),
    0 0 24px rgba(240, 100, 180, 0.8),
    0 0 48px rgba(220, 60, 150, 0.4);
  animation: pp 0.85s ease-in-out infinite;
}
.pi.gllg {
  color: #e0b0ff;
  font-size: clamp(13px, 3.4vw, 19px);
  text-shadow:
    0 0 10px rgba(220, 150, 255, 1),
    0 0 24px rgba(180, 100, 255, 0.9),
    0 0 48px rgba(140, 60, 255, 0.5);
  animation: plg 0.8s ease-in-out infinite;
}

@keyframes pg {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.25); }
}
@keyframes pp {
  0%, 100% { filter: brightness(1); transform: scale(1); }
  50% { filter: brightness(1.35); transform: scale(1.04); }
}
@keyframes plg {
  0%, 100% { filter: brightness(1); transform: scale(1); }
  50% { filter: brightness(1.5); transform: scale(1.06); }
}

/* Top/bottom fade gradients on viewport */
.pv::before, .pv::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  height: 60px;
  pointer-events: none;
  z-index: 2;
}
.pv::before {
  top: 0;
  background: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.8) 50%, transparent 100%);
}
.pv::after {
  bottom: 0;
  background: linear-gradient(0deg, #000 0%, rgba(0, 0, 0, 0.8) 50%, transparent 100%);
}

/* Center indicator band — default gold, tints by tier */
.pin {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 100%;
  height: 60px;
  pointer-events: none;
  z-index: 3;
  border-top: 1px solid rgba(255, 200, 80, 0.3);
  border-bottom: 1px solid rgba(255, 200, 80, 0.3);
  transition: border-color 0.3s;
}
.pin.cm { border-color: rgba(160, 220, 100, 0.5); }
.pin.rr { border-color: rgba(255, 150, 200, 0.5); }
.pin.lg { border-color: rgba(200, 120, 255, 0.5); }

.pin::before, .pin::after {
  content: '';
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  transition: border-color 0.3s;
}
.pin::before { left: -2px; border-left: 12px solid #ffb84d; }
.pin::after { right: -2px; border-right: 12px solid #ffb84d; }
.pin.cm::before { border-left-color: #8cdc5c; }
.pin.cm::after  { border-right-color: #8cdc5c; }
.pin.rr::before { border-left-color: #ff80b8; }
.pin.rr::after  { border-right-color: #ff80b8; }
.pin.lg::before { border-left-color: #d080ff; }
.pin.lg::after  { border-right-color: #d080ff; }

/* Tier badge ribbon at top of viewport */
.pb {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  padding: 3px 12px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  z-index: 4;
  opacity: 0;
  transition: opacity 0.25s;
}
.pb.cm {
  background: linear-gradient(180deg, #7ed040, #3a8810);
  box-shadow: 0 0 12px rgba(140, 220, 80, 0.6);
}
.pb.rr {
  background: linear-gradient(180deg, #ff80b8, #c03070);
  box-shadow: 0 0 16px rgba(255, 120, 180, 0.8);
}
.pb.lg {
  background: linear-gradient(180deg, #d080ff, #8030d0);
  box-shadow: 0 0 20px rgba(200, 100, 255, 0.9);
}
.pb.sh { opacity: 1; }

/* Controls row */
.pco {
  margin-top: 22px;
  display: flex;
  justify-content: center;
}
.pla {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
}
.pbs { display: flex; gap: 8px; }

/* Bulbs — default amber/gold */
.pbl {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #2a1a0a;
  border: 1px solid #1a1208;
  transition: background 0.2s, box-shadow 0.2s;
}
.pbl.on {
  background: radial-gradient(circle at 30% 30%, #fff5c0, #ff9500 60%, #cc5500 100%);
  box-shadow: 0 0 8px rgba(255, 180, 60, 0.9);
}
.pbl.oncm {
  background: radial-gradient(circle at 30% 30%, #e8ffc0, #8cdc40 60%, #3a8a10 100%);
  box-shadow: 0 0 8px rgba(140, 220, 80, 0.9);
}
.pbl.onrr {
  background: radial-gradient(circle at 30% 30%, #ffd0e8, #ff60a8 60%, #a02060 100%);
  box-shadow: 0 0 10px rgba(255, 140, 200, 1);
}
.pbl.onlg {
  background: radial-gradient(circle at 30% 30%, #ffc0ff, #d040ff 60%, #6010a0 100%);
  box-shadow: 0 0 12px rgba(220, 120, 255, 1);
}

/* Consult button */
.psb {
  position: relative;
  flex: 1;
  max-width: 200px;
  height: 56px;
  background: linear-gradient(180deg, #b8000a 0%, #6b0006 100%);
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  box-shadow:
    0 6px 0 #3a0003,
    0 8px 16px rgba(0, 0, 0, 0.7);
  font-family: var(--font-sans);
  touch-action: manipulation;
}
.psb:active:not(:disabled) {
  transform: translateY(4px);
  box-shadow:
    0 2px 0 #3a0003,
    0 4px 8px rgba(0, 0, 0, 0.7);
}
.psb:disabled { opacity: 0.5; cursor: not-allowed; }
.psb.fl { animation: bff 0.4s ease-in-out infinite; }

@keyframes bff {
  0%, 100% {
    box-shadow:
      0 6px 0 #3a0003,
      0 0 20px rgba(255, 40, 40, 0.6);
  }
  50% {
    background: linear-gradient(180deg, #ff3030 0%, #b8000a 100%);
    box-shadow:
      0 6px 0 #3a0003,
      0 0 40px rgba(255, 80, 80, 0.9);
  }
}

/* Lever section — integrated right-side panel.
   touch-action: none on the whole section prevents mobile scroll from hijacking the drag. */
.pl-section {
  position: relative;
  width: 64px;
  flex: 0 0 64px;
  padding: 22px 0 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: linear-gradient(180deg, #161616 0%, #080808 100%);
  border-radius: 0 28px 28px 0;
  border-left: 1px solid #000;
  box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.03);
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}
.pll {
  color: #555;
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 10px;
  pointer-events: none;
}
.plt {
  position: relative;
  width: 14px;
  flex: 1;
  background: #050505;
  border-radius: 7px;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.8);
  max-height: 240px;
  min-height: 200px;
  touch-action: none;
}
.plsh {
  position: absolute;
  left: 50%;
  top: 4px;
  transform: translateX(-50%);
  width: 6px;
  background: linear-gradient(90deg, #888 0%, #ccc 50%, #555 100%);
  border-radius: 3px;
  height: 12px;
  pointer-events: none;
}
/* Knob: visual 38px, invisible hit-area expanded to ~64px for finger-friendly mobile use */
.plk {
  position: absolute;
  left: 50%;
  bottom: -19px;
  transform: translateX(-50%);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 25%, #ff8080 0%, #c00010 40%, #600005 100%);
  border: 2px solid #2a0003;
  box-shadow:
    0 4px 8px rgba(0, 0, 0, 0.7),
    0 0 14px rgba(255, 60, 60, 0.3);
  cursor: grab;
  touch-action: none;
  -webkit-touch-callout: none;
  z-index: 5;
}
.plk::after {
  content: '';
  position: absolute;
  top: -13px;
  left: -13px;
  right: -13px;
  bottom: -13px;
  border-radius: 50%;
}
.plk:active { cursor: grabbing; }

/* Side rails — default gold, tints by tier */
.psl {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 60%;
  background: linear-gradient(180deg, transparent, #ffb84d 50%, transparent);
  opacity: 0.3;
  z-index: 1;
  transition: background 0.3s;
}
.psl.l { left: -2px; }
.psl.r { right: -2px; }
.psl.fl { animation: slp 0.3s ease-in-out infinite; }
.psl.cm { background: linear-gradient(180deg, transparent, #8cdc5c 50%, transparent); }
.psl.rr { background: linear-gradient(180deg, transparent, #ff80b8 50%, transparent); }
.psl.lg { background: linear-gradient(180deg, transparent, #d080ff 50%, transparent); }

@keyframes slp {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

/* Footer — stamp centered on its own line, achievements appear below as unlocked */
.pf {
  margin-top: 32px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.pf .stamp {
  color: #444;
  text-align: center;
}
.pf .tks {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}
.pf .tk {
  display: none;
  align-items: center;
  gap: 4px;
}
.pf .tk.sh { display: inline-flex; }
.pf .tk .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 2px;
}
.pf .tk.cm .dot { background: #8cdc5c; }
.pf .tk.rr .dot { background: #ff80b8; }
.pf .tk.lg .dot { background: #d080ff; }
.pf .tk.cm { color: #5a8a40; }
.pf .tk.rr { color: #a86080; }
.pf .tk.lg { color: #8a5aa8; }

@media (max-width: 480px) {
  .pl-section { width: 54px; flex-basis: 54px; }
  .plt { max-height: 200px; min-height: 170px; }
}

@media (max-width: 360px) {
  .pc-body { padding: 18px 14px 22px; }
  .pd { padding: 10px; }
}
