/* THE EVEN ODD — room styles. Every rule scoped under #screen-wheel. */

#screen-wheel .wh-room {
  max-width: 30rem;
  margin: 0 auto;
  padding: 0.4rem 0.4rem 2rem;
  transition: filter 1.2s ease;
}
/* each hollow leaves the room a shade further from the lamp */
#screen-wheel .wh-room.wh-dark1 { filter: brightness(0.92) saturate(0.95); }
#screen-wheel .wh-room.wh-dark2 { filter: brightness(0.82) saturate(0.85); }

/* the instant of the hollow: the room itself flinches dark */
#screen-wheel .wh-room.wh-hollowing { animation: wh-hollow-cut 1.4s ease-out; }
@keyframes wh-hollow-cut {
  0% { filter: brightness(1); }
  4% { filter: brightness(0.35); }
  60% { filter: brightness(0.45); }
  100% { filter: brightness(0.86); }
}

/* ---------- head / the Wheelwright ---------- */
#screen-wheel .wh-head { margin-bottom: 0.3rem; }
#screen-wheel .wh-head .label { font-size: 0.8rem; letter-spacing: 0.34em; }
#screen-wheel .wh-keeper {
  min-height: 2.1rem;
  margin: 0.25rem auto 0;
  max-width: 24rem;
  font-size: 0.86rem;
  color: var(--bone);
  transition: opacity 0.3s ease;
}

/* ---------- HUD ---------- */
#screen-wheel .wh-hud {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.3rem 0 0.5rem;
  border-bottom: 1px dashed rgba(216, 180, 90, 0.18);
  margin-bottom: 0.5rem;
}
#screen-wheel .wh-tray { font-size: 1.1rem; }
#screen-wheel .wh-purse { font-size: 1.1rem; color: var(--bone); }
#screen-wheel .wh-flag { color: var(--gold-dim); width: 100%; font-size: 0.7rem; }

/* the lamp: an oil bar that loses a notch per spin */
#screen-wheel .wh-lamp {
  --oil: 100%;
  position: relative;
  width: 4.6rem;
  height: 0.55rem;
  border: 1px solid #4a3d22;
  background: #0d0a05;
  border-radius: 2px;
  overflow: hidden;
}
#screen-wheel .wh-lamp::before {
  content: '';
  position: absolute;
  inset: 1px;
  width: var(--oil);
  background: linear-gradient(90deg, #6e5a28, #d8b45a);
  box-shadow: 0 0 8px rgba(216, 180, 90, 0.5);
  transition: width 0.8s ease;
}
#screen-wheel .wh-lamp.low::before { animation: wh-lamp-gutter 1.3s ease-in-out infinite; }
@keyframes wh-lamp-gutter { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }

/* the hollows: three gaps waiting to open */
#screen-wheel .wh-hollows { display: flex; gap: 0.35rem; }
#screen-wheel .wh-gapdot {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  border: 1px solid #3c3526;
  background: #131009;
  transition: all 0.6s ease;
}
#screen-wheel .wh-gapdot.open {
  background: #000;
  border-color: var(--bone);
  box-shadow:
    inset 0 0 5px #000,
    0 0 0 2px rgba(207, 201, 184, 0.25),
    0 0 12px rgba(0, 0, 0, 0.95);
  animation: wh-gap-open 0.9s ease-out;
}
@keyframes wh-gap-open {
  0% { transform: scale(0.2); }
  60% { transform: scale(1.45); }
  100% { transform: scale(1); }
}

/* ---------- coach ---------- */
#screen-wheel .wh-coach {
  margin: 0.2rem auto 0.5rem;
  max-width: 24rem;
  font-size: 0.78rem;
  font-style: italic;
  color: #9a937e;
}

/* ---------- the wheel ---------- */
#screen-wheel .wh-wheelwrap {
  position: relative;
  width: min(100%, 430px);
  margin: 0 auto;
}
#screen-wheel .wh-canvas {
  display: block;
  width: 100%;
  border: 1px solid #3a2c18;
  border-radius: 4px;
  box-shadow:
    inset 0 0 0 2px rgba(0, 0, 0, 0.6),
    0 14px 44px rgba(0, 0, 0, 0.75),
    0 0 0 4px #160e07,
    0 0 0 5px #34230f;
}

/* the cloth — drawn over the wheel after the third hollow */
#screen-wheel .wh-cloth {
  position: absolute;
  inset: 1px;
  border-radius: 4px;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.03), transparent 40%),
    repeating-linear-gradient(115deg, #14110b 0 7px, #1a1610 7px 14px),
    #14110b;
  transform: translateY(-103%);
  opacity: 0;
  transition: transform 1.6s cubic-bezier(0.3, 0.7, 0.4, 1), opacity 0.3s ease;
  pointer-events: none;
}
#screen-wheel .wh-room.wh-covered .wh-cloth { transform: translateY(0); opacity: 1; }

#screen-wheel .wh-lantern {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 4;
  margin: 0;
  font-size: 0.68rem;
  min-height: 44px;
  border-color: var(--gold-dim);
  color: var(--gold);
  background: rgba(8, 6, 3, 0.82);
}
#screen-wheel .wh-replaycap {
  position: absolute;
  left: 50%;
  bottom: 0.6rem;
  transform: translateX(-50%);
  white-space: nowrap;
  z-index: 4;
  padding: 0.2rem 0.8rem;
  background: rgba(6, 4, 2, 0.8);
  border: 1px solid var(--gold-dim);
  font-style: italic;
}

/* ---------- result toast ---------- */
#screen-wheel .wh-toast {
  position: absolute;
  left: 50%;
  top: 12%;
  transform: translate(-50%, 0) scale(0.92);
  z-index: 5;
  pointer-events: none;
  opacity: 0;
  white-space: nowrap;
  padding: 0.45rem 1.1rem;
  font-size: 0.92rem;
  letter-spacing: 0.08em;
  color: var(--bone);
  background: rgba(8, 5, 3, 0.9);
  border: 1px solid var(--gold-dim);
  transition: opacity 0.35s ease, transform 0.35s ease;
}
#screen-wheel .wh-toast.show { opacity: 1; transform: translate(-50%, 0) scale(1); }
#screen-wheel .wh-toast[data-kind='good'] { color: var(--gold); border-color: var(--gold); }
#screen-wheel .wh-toast[data-kind='bad'] { color: #c98e86; border-color: #5e3a35; }
#screen-wheel .wh-toast[data-kind='true'] { color: var(--bone); border-color: var(--bone); font-style: italic; }
#screen-wheel .wh-toast[data-kind='hollow'] {
  color: #cfc9b8;
  background: #000;
  border-color: #000;
  box-shadow: 0 0 0 1px rgba(207, 201, 184, 0.3), 0 0 30px rgba(0, 0, 0, 0.95);
  letter-spacing: 0.2em;
}

/* ---------- THE CORD ---------- */
#screen-wheel .wh-cordwrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  margin: 0.5rem 0 0.6rem;
}
#screen-wheel .wh-cord {
  --pull: 0;
  position: relative;
  width: 3.4rem;
  height: calc(3.2rem + var(--pull) * 2.6rem);
  cursor: grab;
  touch-action: none;
}
#screen-wheel .wh-cord.held { cursor: grabbing; }
#screen-wheel .wh-rope {
  position: absolute;
  left: 50%;
  top: 0;
  width: 7px;
  height: calc(100% - 1.2rem);
  margin-left: -3.5px;
  background: repeating-linear-gradient(165deg, #6e5a28 0 4px, #4a3d22 4px 8px);
  border-radius: 3px;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.7);
}
#screen-wheel .wh-tassel {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 1.5rem;
  height: 1.3rem;
  transform: translateX(-50%) scaleY(calc(1 + var(--pull) * 0.12));
  background:
    radial-gradient(circle at 50% 8%, #d8b45a 12%, transparent 13%),
    linear-gradient(180deg, #8a7335, #4a3d22 70%, #2c2412);
  border-radius: 0.3rem 0.3rem 0.55rem 0.55rem;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.8);
}
#screen-wheel .wh-cord.held .wh-tassel { box-shadow: 0 1px 4px rgba(0, 0, 0, 0.9); }
#screen-wheel .wh-cordhint { font-size: 0.72rem; }

/* ---------- THE LAY: enamel plates ---------- */
#screen-wheel .wh-laywrap { margin-top: 0.4rem; }
#screen-wheel .wh-chiprow {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}
#screen-wheel .wh-chipword { letter-spacing: 0.2em; }
#screen-wheel .wh-chips { display: flex; gap: 0.4rem; }
#screen-wheel .wh-chip {
  min-width: 3.4rem;
  min-height: 48px;
  font-size: 0.95rem;
  border: 1px solid #4a3d22;
  border-radius: 2rem;
  color: var(--bone);
  background:
    radial-gradient(circle at 50% -40%, rgba(216, 180, 90, 0.12), transparent 60%),
    #141008;
}
#screen-wheel .wh-chip.sel {
  color: var(--gold);
  border-color: var(--gold);
  box-shadow: 0 0 10px rgba(216, 180, 90, 0.35);
}
#screen-wheel .wh-pullmode { margin: 0; min-height: 48px; font-size: 0.7rem; }
#screen-wheel .wh-pullmode.sel { color: var(--red); border-color: var(--red); }
#screen-wheel .wh-bank {
  min-height: 48px;
  padding: 0 1rem;
  font-size: 0.82rem;
  letter-spacing: 0.16em;
  color: var(--gold);
  border: 1px solid var(--gold-dim);
  background:
    radial-gradient(circle at 50% -40%, rgba(216, 180, 90, 0.16), transparent 60%),
    #181106;
}
#screen-wheel .wh-bank:disabled { color: #5a5346; border-color: #3c3526; }

#screen-wheel .wh-lay { display: flex; flex-direction: column; gap: 0.45rem; }
#screen-wheel .wh-letters { display: grid; grid-template-columns: 1fr 1fr; gap: 0.45rem; }
#screen-wheel .wh-rose { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.45rem; }
#screen-wheel .wh-sigils { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.45rem; }
#screen-wheel .wh-blackrow { display: grid; }

#screen-wheel .wh-plate {
  position: relative;
  min-height: 52px;
  padding: 0.5rem 0.4rem 0.45rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.12rem;
  border: 1px solid #43361d;
  border-radius: 4px;
  background:
    radial-gradient(circle at 50% -60%, rgba(216, 180, 90, 0.10), transparent 65%),
    linear-gradient(180deg, #181208, #100b05);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.6), inset 0 0 14px rgba(0, 0, 0, 0.5);
  color: var(--bone);
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
}
#screen-wheel .wh-plate:disabled { opacity: 0.55; }
#screen-wheel .wh-pname { font-size: 0.72rem; letter-spacing: 0.14em; }
#screen-wheel .wh-pays { font-size: 0.62rem; }
#screen-wheel .wh-plate.staked {
  border-color: var(--gold-dim);
  box-shadow: inset 0 0 0 1px rgba(216, 180, 90, 0.25), inset 0 0 14px rgba(0, 0, 0, 0.5);
}
#screen-wheel .wh-plate.standing {
  border-color: var(--gold);
  box-shadow: 0 0 12px rgba(216, 180, 90, 0.3), inset 0 0 0 1px rgba(216, 180, 90, 0.4);
}
#screen-wheel .wh-stakebadge {
  position: absolute;
  top: -0.45rem;
  right: -0.25rem;
  font-size: 0.66rem;
  color: #1a1206;
  background: radial-gradient(circle at 35% 30%, #e2c47c, #8a7335 80%);
  border-radius: 1rem;
  padding: 0.1rem 0.4rem;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.7);
}
#screen-wheel .wh-stakebadge:empty { display: none; }
#screen-wheel .wh-notches {
  position: absolute;
  bottom: 0.1rem;
  right: 0.4rem;
  color: var(--gold);
  font-size: 1rem;
  letter-spacing: 0.12em;
  line-height: 0.5;
}
#screen-wheel .wh-quarter .wh-rosearc {
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  border: 1px solid rgba(207, 201, 184, 0.3);
  background: conic-gradient(from var(--qrot), rgba(216, 180, 90, 0.75) 0 90deg, rgba(216, 180, 90, 0.08) 90deg 360deg);
}
#screen-wheel .wh-sigilglyph { width: 22px; height: 22px; }
#screen-wheel .wh-black {
  background:
    radial-gradient(circle at 50% 20%, rgba(207, 201, 184, 0.05), transparent 60%),
    #050403;
  border-color: #26201a;
}
#screen-wheel .wh-black .wh-pname { letter-spacing: 0.26em; }
#screen-wheel .wh-black.staked {
  border-color: #000;
  box-shadow: 0 0 0 1px rgba(207, 201, 184, 0.28), 0 0 18px rgba(0, 0, 0, 0.95), inset 0 0 20px #000;
}

/* ---------- footer ---------- */
#screen-wheel .wh-footer {
  display: flex;
  justify-content: center;
  gap: 1.4rem;
  margin-top: 1rem;
}
#screen-wheel .wh-footer .dim-btn { margin-top: 0; font-size: 0.74rem; padding: 0.45rem 0.9rem; min-height: 44px; }

/* ---------- explainer ---------- */
#screen-wheel .wh-explainer {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(4, 6, 4, 0.94);
  overflow-y: auto;
  padding: 1.6rem 0.8rem 2.4rem;
  text-align: center;
}
#screen-wheel .wh-explainer-house {
  font-style: italic;
  color: var(--bone);
  max-width: 26rem;
  margin: 1.2rem auto 1rem;
}
#screen-wheel .wh-dismiss { min-height: 48px; letter-spacing: 0.2em; }
#screen-wheel .wh-howto {
  text-align: left;
  margin: 0.4rem 0 0;
  padding-left: 1.2rem;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--bone);
}
#screen-wheel .wh-howto li { margin-bottom: 0.35rem; }

/* placard demos */
#screen-wheel .wh-demo {
  position: relative;
  height: 3.65rem;
  margin: 0 auto;
  max-width: 9rem;
  overflow: hidden;
}
/* II. the lean: a wheel that dips toward its heavy arc as it turns */
#screen-wheel .wh-demo-lean .wh-demo-wheel {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 3rem;
  height: 2.6rem;
  margin: -1.3rem 0 0 -1.5rem;
  border-radius: 50%;
  border: 3px solid #43361d;
  background:
    conic-gradient(#2a1a0c 0 45deg, #1d1208 45deg 90deg, #2a1a0c 90deg 135deg, #1d1208 135deg 180deg, #120b04 180deg 270deg, #1d1208 270deg 360deg);
  animation: wh-demo-list 2.8s ease-in-out infinite;
}
@keyframes wh-demo-list {
  0%, 100% { transform: rotate(-1.4deg); }
  50% { transform: rotate(1.4deg); }
}
#screen-wheel .wh-demo-lean .wh-demo-tilt {
  position: absolute;
  left: 14%;
  bottom: 0.3rem;
  right: 14%;
  height: 2px;
  background: rgba(232, 228, 215, 0.3);
}
/* III. the hollow: an orbiting black gap on a turning ring */
#screen-wheel .wh-demo-hollow .wh-demo-ring {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 3rem;
  height: 2.6rem;
  margin: -1.3rem 0 0 -1.5rem;
  border-radius: 50%;
  border: 5px solid #2a1a0c;
  box-shadow: inset 0 0 0 1px rgba(216, 180, 90, 0.2);
}
#screen-wheel .wh-demo-hollow .wh-demo-gap {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 3.7rem;
  height: 3.3rem;
  margin: -1.65rem 0 0 -1.85rem;
  animation: wh-demo-orbit 3.4s linear infinite;
}
#screen-wheel .wh-demo-hollow .wh-demo-gap::before {
  content: '';
  position: absolute;
  left: 50%;
  top: -1px;
  width: 0.6rem;
  height: 0.65rem;
  margin-left: -0.3rem;
  background: #000;
  box-shadow: 0 0 6px #000;
}
@keyframes wh-demo-orbit { to { transform: rotate(360deg); } }
/* IV. the bank: a coin drops past the gap into the slot, safe */
#screen-wheel .wh-demo-bank .wh-demo-coin {
  position: absolute;
  left: 50%;
  top: 0.3rem;
  width: 1rem;
  height: 1rem;
  margin-left: -0.5rem;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #c9a86a, #6e552f 70%);
  animation: wh-demo-bankdrop 2.4s ease-in infinite;
}
@keyframes wh-demo-bankdrop {
  0%, 18% { transform: translateY(0); opacity: 1; }
  60% { transform: translateY(2rem); opacity: 1; }
  70%, 100% { transform: translateY(2.3rem); opacity: 0; }
}
#screen-wheel .wh-demo-bank .wh-demo-slot {
  position: absolute;
  left: 50%;
  bottom: 0.45rem;
  width: 2.4rem;
  height: 0.5rem;
  margin-left: -1.2rem;
  border: 1px solid var(--gold-dim);
  border-radius: 2px;
  background: #0d0a05;
}

/* ---------- end panel ---------- */
#screen-wheel .wh-end {
  position: fixed;
  inset: 0;
  z-index: 38;
  background: rgba(4, 6, 4, 0.93);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 1rem;
  text-align: center;
}
#screen-wheel .wh-end h3 {
  margin: 0;
  font-size: 1.6rem;
  letter-spacing: 0.26em;
  color: var(--gold);
  text-shadow: 0 0 18px rgba(216, 180, 90, 0.35);
}
#screen-wheel .wh-end h3.wh-down { color: var(--bone); text-shadow: 0 0 18px rgba(0, 0, 0, 0.9); }
#screen-wheel .wh-end-detail { margin: 0.2rem 0; color: var(--bone); letter-spacing: 0.04em; }
#screen-wheel .wh-end-house {
  font-style: italic;
  color: #9a937e;
  max-width: 24rem;
  margin: 0.6rem auto 1rem;
}
#screen-wheel .wh-end-leave { min-height: 48px; letter-spacing: 0.18em; }

/* ---------- mobile: thumb-fair at ≤600px, no horizontal scroll ---------- */
@media (max-width: 600px) {
  #screen-wheel .wh-room { padding: 0.2rem 0.2rem 1.4rem; }
  #screen-wheel .wh-wheelwrap { width: min(100%, 96vw); }
  #screen-wheel .wh-hud { gap: 0.6rem; }
  #screen-wheel .wh-keeper { font-size: 0.8rem; min-height: 1.9rem; }
  #screen-wheel .wh-rose { grid-template-columns: repeat(2, 1fr); }
  #screen-wheel .wh-sigils { grid-template-columns: repeat(4, 1fr); }
  #screen-wheel .wh-sigils .wh-plate { min-height: 56px; padding: 0.35rem 0.15rem; }
  #screen-wheel .wh-pname { font-size: 0.62rem; letter-spacing: 0.08em; }
  #screen-wheel .wh-sigils .wh-pays { display: none; }
  #screen-wheel .wh-plate { min-height: 48px; }
  #screen-wheel .wh-chiprow { gap: 0.35rem; }
  #screen-wheel .wh-bank { flex: 1 1 100%; }
  #screen-wheel .wh-cord { width: 4.4rem; }   /* a fatter rope for thumbs */
  #screen-wheel .wh-toast { white-space: normal; width: 88%; text-align: center; }
  #screen-wheel .wh-lantern { font-size: 0.62rem; }
}
