/* THE RATTING CELLAR — every rule scoped under #screen-cellar (ROOMS-API). */

#screen-cellar {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  padding: 0.8rem 0.8rem 2.2rem;
  min-height: 100dvh;
}

/* ---------- top bar ---------- */
#screen-cellar .cel-top {
  width: 100%;
  max-width: 440px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}
#screen-cellar .cel-leave {
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  padding: 0.55rem 0.7rem;
  min-height: 44px;
  font-style: italic;
}
#screen-cellar .cel-name { text-align: center; }
#screen-cellar .cel-title {
  display: block;
  color: var(--gold);
  letter-spacing: 0.22em;
  font-size: 0.88rem;
  text-shadow: 0 0 12px rgba(216, 180, 90, 0.3);
}
#screen-cellar .cel-rules-link {
  display: inline-block;
  color: var(--gold-dim);
  font-size: 0.68rem;
  font-style: italic;
  letter-spacing: 0.14em;
  text-decoration: underline dotted;
  padding: 0.3rem 0.5rem; /* generous tap area */
}
#screen-cellar .cel-hud {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.1rem;
  min-width: 5.4rem;
}
#screen-cellar .cel-coins {
  color: var(--gold);
  font-variant-numeric: tabular-nums;
  font-size: 1.05rem;
  text-shadow: 0 0 10px rgba(216, 180, 90, 0.35);
}
#screen-cellar .cel-drop {
  color: #8c8775;
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  font-style: italic;
}

/* ---------- the pit ---------- */
#screen-cellar .cel-stage {
  position: relative;
  width: 100%;
  max-width: 440px;
}
#screen-cellar .cel-canvas {
  display: block;
  width: 100%;
  border: 1px solid var(--gold-dim);
  box-shadow:
    inset 0 0 0 3px rgba(6, 9, 6, 0.9),
    inset 0 0 60px rgba(0, 0, 0, 0.8),
    0 12px 40px rgba(0, 0, 0, 0.6);
  background: #241b10;
  touch-action: manipulation;
  cursor: crosshair;
}
#screen-cellar .cel-mult {
  position: absolute;
  top: 0.5rem;
  right: 0.6rem;
  color: var(--gold);
  font-size: 1.5rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  text-shadow: 0 0 16px rgba(216, 180, 90, 0.55), 0 2px 6px rgba(0, 0, 0, 0.9);
  pointer-events: none;
}
#screen-cellar .cel-banner {
  position: absolute;
  left: 50%;
  top: 0.6rem;
  transform: translateX(-50%);
  white-space: nowrap;
  color: var(--bone);
  background: rgba(6, 9, 6, 0.82);
  border: 1px solid var(--gold-dim);
  padding: 0.3rem 0.8rem;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  pointer-events: none;
  animation: cel-banner-in 0.3s ease-out;
}
@keyframes cel-banner-in {
  from { opacity: 0; transform: translateX(-50%) translateY(-6px); }
  to { opacity: 1; transform: translateX(-50%); }
}
#screen-cellar .cel-scored {
  position: absolute;
  left: 0.6rem;
  bottom: 0.5rem;
  color: var(--gold-dim);
  font-size: 0.6rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  pointer-events: none;
}

/* ---------- house voice ---------- */
#screen-cellar .cel-house {
  min-height: 1.2rem;
  margin: 0;
  max-width: 26rem;
  text-align: center;
  color: #8c8775;
  font-style: italic;
  font-size: 0.82rem;
  line-height: 1.45;
}

/* ---------- controls ---------- */
#screen-cellar .cel-controls {
  width: 100%;
  max-width: 440px;
  min-height: 6.4rem;
}
#screen-cellar .cel-wager { text-align: center; }
#screen-cellar .cel-wager-label {
  display: block;
  color: var(--gold-dim);
  font-size: 0.62rem;
  letter-spacing: 0.28em;
  margin-bottom: 0.5rem;
}
#screen-cellar .cel-chiprow {
  display: flex;
  gap: 0.7rem;
  justify-content: center;
}
#screen-cellar .cel-chip {
  min-width: 84px;
  min-height: 52px;
  font-family: inherit;
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
  color: var(--gold);
  background: radial-gradient(circle at 50% 30%, var(--felt-deep), var(--felt));
  border: 1px solid var(--gold-dim);
  border-radius: 50% / 42%;
  box-shadow:
    inset 0 0 0 2px rgba(6, 9, 6, 0.9),
    inset 0 0 0 3px rgba(216, 180, 90, 0.25),
    0 4px 14px rgba(0, 0, 0, 0.55);
  cursor: pointer;
}
#screen-cellar .cel-chip:hover:not(:disabled),
#screen-cellar .cel-chip:focus-visible {
  box-shadow:
    inset 0 0 0 2px rgba(6, 9, 6, 0.9),
    inset 0 0 18px rgba(216, 180, 90, 0.3),
    0 4px 14px rgba(0, 0, 0, 0.55);
}
#screen-cellar .cel-chip:disabled { opacity: 0.35; cursor: default; }

#screen-cellar .cel-result { text-align: center; }
#screen-cellar .cel-result-line {
  font-size: 1.05rem;
  letter-spacing: 0.14em;
  color: var(--bone);
}
#screen-cellar .cel-result-line.cel-win {
  color: var(--gold);
  text-shadow: 0 0 14px rgba(216, 180, 90, 0.5);
}
#screen-cellar .cel-result-line.cel-loss {
  color: var(--red);
  text-shadow: 0 0 14px rgba(168, 54, 46, 0.5);
}
#screen-cellar .cel-result-sub {
  color: #8c8775;
  font-style: italic;
  font-size: 0.78rem;
  margin: 0.35rem 0 0.7rem;
}
#screen-cellar .cel-result-btns {
  display: flex;
  gap: 0.7rem;
  justify-content: center;
}
#screen-cellar .cel-result-btns button { min-height: 48px; min-width: 11rem; }

/* ---------- explainer overlay ---------- */
#screen-cellar .cel-explainer {
  position: absolute;
  inset: 0;
  z-index: 30;
  background: rgba(4, 6, 4, 0.96);
  overflow-y: auto;
  display: flex;
  justify-content: center;
}
#screen-cellar .cel-explainer-inner {
  padding: 1.6rem 1rem 2.4rem;
  text-align: center;
  max-width: 48rem;
}
#screen-cellar .cel-ex-title {
  color: var(--gold);
  letter-spacing: 0.3em;
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0 0 0.4rem;
  text-shadow: 0 0 18px rgba(216, 180, 90, 0.4);
}
#screen-cellar .cel-rules-row { margin-top: 1.2rem; }
#screen-cellar .cel-ex-houseline {
  color: #8c8775;
  font-style: italic;
  font-size: 0.85rem;
  margin: 1.4rem 0 1.1rem;
}
#screen-cellar .cel-ex-btn {
  min-height: 50px;
  min-width: 13rem;
  letter-spacing: 0.2em;
}

/* ---------- placard demos ---------- */
#screen-cellar .cel-demo {
  position: relative;
  height: 3.65rem;
  overflow: hidden;
  background: linear-gradient(180deg, #241b10, #1c150c);
  border: 1px solid #4a3d22;
}
#screen-cellar .cel-demo-rat {
  position: absolute;
  width: 26px;
  height: 12px;
  border-radius: 50% / 60%;
  background: #2c241a;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}
#screen-cellar .cel-demo-rat::before { /* head */
  content: '';
  position: absolute;
  right: -7px;
  top: 2px;
  width: 10px;
  height: 8px;
  border-radius: 50%;
  background: #2c241a;
}
#screen-cellar .cel-demo-tail {
  position: absolute;
  left: -12px;
  top: 5px;
  width: 14px;
  height: 2px;
  background: #2c241a;
  transform-origin: right center;
  transform: rotate(14deg);
}

/* demo I — the ring, then the hood */
#screen-cellar .cel-demo-ring .cel-demo-rat {
  left: calc(50% - 13px);
  top: calc(50% - 6px);
  animation: cel-pace 3.2s ease-in-out infinite;
}
#screen-cellar .cel-demo-ring .cel-demo-rat.ringed::after {
  content: '';
  position: absolute;
  left: 8px;
  top: -4px;
  width: 16px;
  height: 16px;
  border: 2px solid var(--gold);
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(216, 180, 90, 0.8);
  animation: cel-glint 3.2s ease-in-out infinite;
}
@keyframes cel-pace {
  0%, 100% { transform: translateX(-14px); }
  45%, 55% { transform: translateX(14px) scaleX(-1); }
}
@keyframes cel-glint {
  0%, 8% { opacity: 0; }
  14%, 60% { opacity: 1; }
  70%, 100% { opacity: 0; }
}
#screen-cellar .cel-demo-hood {
  position: absolute;
  inset: 0;
  background: #030303;
  transform: translateY(-103%);
  animation: cel-hood 3.2s ease-in infinite;
}
@keyframes cel-hood {
  0%, 62% { transform: translateY(-103%); }
  74%, 92% { transform: translateY(0); }
  100% { transform: translateY(-103%); }
}

/* demo II — the multiplier ride */
#screen-cellar .cel-demo-ride {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.3rem;
  padding: 0 0.55rem;
}
#screen-cellar .cel-demo-bar {
  height: 8px;
  border: 1px solid var(--gold-dim);
  background: rgba(6, 9, 6, 0.8);
}
#screen-cellar .cel-demo-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--gold-dim), var(--gold));
  box-shadow: 0 0 10px rgba(216, 180, 90, 0.5);
  animation: cel-ride 3s ease-in infinite;
}
@keyframes cel-ride {
  0% { width: 4%; }
  78% { width: 96%; }
  88% { width: 96%; }
  100% { width: 4%; }
}
#screen-cellar .cel-demo-marks {
  display: flex;
  justify-content: space-between;
  color: var(--gold-dim);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  font-variant-numeric: tabular-nums;
}
#screen-cellar .cel-demo-marks .hot { color: var(--red); letter-spacing: 0.18em; }

/* demo III — the slap call among lookalikes */
#screen-cellar .cel-demo-slap .cel-demo-rat.r1 {
  left: 12%;
  top: 30%;
  animation: cel-wander1 4s ease-in-out infinite;
}
#screen-cellar .cel-demo-slap .cel-demo-rat.r2 {
  left: 46%;
  top: 56%;
  animation: cel-wander2 4s ease-in-out infinite;
}
#screen-cellar .cel-demo-slap .cel-demo-rat.r3 {
  left: 72%;
  top: 22%;
  animation: cel-wander3 4s ease-in-out infinite;
}
@keyframes cel-wander1 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(26px, 10px); }
}
@keyframes cel-wander2 {
  0%, 100% { transform: translate(0, 0); }
  40% { transform: translate(-14px, -12px); }
  75% { transform: translate(10px, -4px); }
}
@keyframes cel-wander3 {
  0%, 100% { transform: translate(0, 0); }
  55% { transform: translate(-22px, 14px) scaleX(-1); }
}
#screen-cellar .cel-demo-cross {
  position: absolute;
  left: 46%;
  top: 46%;
  width: 22px;
  height: 22px;
  pointer-events: none;
  animation: cel-cross 4s ease-in-out infinite;
}
#screen-cellar .cel-demo-cross::before,
#screen-cellar .cel-demo-cross::after {
  content: '';
  position: absolute;
  background: var(--gold);
  box-shadow: 0 0 6px rgba(216, 180, 90, 0.8);
}
#screen-cellar .cel-demo-cross::before {
  left: 10px;
  top: 0;
  width: 2px;
  height: 22px;
}
#screen-cellar .cel-demo-cross::after {
  left: 0;
  top: 10px;
  width: 22px;
  height: 2px;
}
@keyframes cel-cross {
  0%, 30% { opacity: 0.4; transform: scale(1); }
  44% { opacity: 1; transform: scale(0.7); }
  52% { opacity: 1; transform: scale(1.25); }
  60%, 100% { opacity: 0.4; transform: scale(1); }
}

/* ---------- mobile: thumb-fair at ≤600px ---------- */
@media (max-width: 600px) {
  #screen-cellar { padding: 0.5rem 0.5rem 1.6rem; gap: 0.45rem; }
  #screen-cellar .cel-top { flex-wrap: wrap; justify-content: center; row-gap: 0.2rem; }
  #screen-cellar .cel-name { order: -1; width: 100%; }
  #screen-cellar .cel-hud { flex-direction: row; align-items: baseline; gap: 0.6rem; min-width: 0; }
  #screen-cellar .cel-mult { font-size: 1.25rem; }
  #screen-cellar .cel-banner { font-size: 0.62rem; letter-spacing: 0.16em; max-width: 92%; white-space: normal; text-align: center; }
  #screen-cellar .cel-chip { flex: 1 1 0; min-width: 0; min-height: 56px; }
  #screen-cellar .cel-chiprow { width: 100%; gap: 0.5rem; }
  #screen-cellar .cel-result-btns { flex-direction: column; align-items: stretch; }
  #screen-cellar .cel-result-btns button { min-width: 0; width: 100%; }
  #screen-cellar .cel-rules-row { gap: 0.7rem; }
  #screen-cellar .cel-explainer-inner { padding: 1rem 0.6rem 2rem; }
}
