/* Casino floor - extends shared Pulse tokens */

html.casino-html,
body.casino-body {
  overflow: auto;
  height: auto;
  min-height: 100%;
}

.casino-panel {
  position: relative;
  inset: auto;
  min-height: 100vh;
  overflow: visible;
}

.casino-body-scroll {
  overflow: visible;
  padding: 24px 20px 64px;
  display: flex;
  justify-content: center;
}

.casino-shell {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
}

.casino-hub,
.casino-table {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.casino-floor {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.live-rail {
  position: relative;
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.28);
  height: 118px;
}

.live-fade {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 48px;
  z-index: 2;
  pointer-events: none;
}

.live-fade-l {
  left: 0;
  background: linear-gradient(90deg, rgba(5, 5, 5, 0.95), transparent);
}

.live-fade-r {
  right: 0;
  background: linear-gradient(270deg, rgba(5, 5, 5, 0.95), transparent);
}

.live-track {
  display: flex;
  align-items: stretch;
  gap: 10px;
  width: max-content;
  height: 100%;
  padding: 10px 12px;
  animation: live-scroll 42s linear infinite;
  will-change: transform;
}

.live-rail:hover .live-track {
  animation-play-state: paused;
}

@media (prefers-reduced-motion: reduce) {
  .live-track { animation: none; overflow-x: auto; width: 100%; }
}

@keyframes live-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.live-card {
  flex: 0 0 92px;
  width: 92px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  padding: 8px 6px;
  border: 1px solid var(--line);
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(255, 154, 0, 0.12), transparent 55%),
    rgba(255, 255, 255, 0.03);
  text-align: center;
}

.live-card.is-big {
  border-color: rgba(255, 154, 0, 0.45);
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(255, 154, 0, 0.22), transparent 55%),
    rgba(255, 154, 0, 0.06);
}

.live-card img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--line-strong);
  background: #111;
}

.live-card .live-game {
  font-size: 1.15rem;
  line-height: 1;
}

.live-card .live-name {
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.68rem;
  color: var(--ink-soft);
}

.live-card .live-amt {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ok);
}

.floor-main {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
  width: 100%;
  min-height: 0;
}

.side-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.top-board {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  padding: 10px 10px 8px;
  flex: 1 1 auto;
  min-height: 180px;
  max-height: 320px;
  display: flex;
  flex-direction: column;
  text-align: left;
}

.top-board h3 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.top-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.top-row {
  display: grid;
  grid-template-columns: 22px 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 6px 6px;
  border: 1px solid transparent;
}

.top-row:hover {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.top-rank {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--muted);
  text-align: center;
}

.top-row img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--line);
  background: #111;
}

.top-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.82rem;
  color: var(--ink-soft);
}

.top-amt {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ok);
  white-space: nowrap;
}

.top-empty {
  color: var(--muted);
  font-size: 0.8rem;
  padding: 12px 4px;
}

.mode-rail {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mode-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 10px 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  color: var(--ink-soft);
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.mode-btn span {
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--hev);
  letter-spacing: 0.08em;
}

.mode-btn:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}

.mode-btn.is-on {
  border-color: var(--hev-dim);
  background: rgba(255, 154, 0, 0.08);
  color: var(--ink);
}

.mode-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.casino-table {
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.22);
  padding: 16px 14px 18px;
  min-height: 380px;
  justify-content: flex-start;
}

.table-empty {
  margin: auto;
  padding: 36px 16px;
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.table-play {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.casino-status {
  margin: 0 0 20px;
  color: var(--ink-soft);
  font-size: 0.95rem;
  text-align: center;
  width: 100%;
}

.casino-status.is-bad { color: var(--danger); }
.casino-status.is-ok { color: var(--ok); }

.casino-title {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  text-transform: uppercase;
}

.casino-lead {
  margin: 0 auto 28px;
  color: var(--muted);
  max-width: 36rem;
}

.game-rail {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  text-align: left;
}

.casino-head {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.stat-inline {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 72px;
}

.stat-inline .stat-label {
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.stat-inline .stat-value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.03em;
}

.srv-btn.compact {
  padding: 10px 16px;
  font-size: 0.78rem;
}

.game-enter {
  display: grid;
  grid-template-columns: 48px 1fr;
  grid-template-rows: auto auto;
  column-gap: 18px;
  row-gap: 4px;
  text-align: left;
  padding: 22px 24px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  color: inherit;
  cursor: pointer;
  font: inherit;
  transition: border-color 0.25s ease, background 0.25s ease, transform 0.25s ease;
  animation: rise 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.game-enter:nth-child(2) { animation-delay: 0.05s; }
.game-enter:nth-child(3) { animation-delay: 0.1s; }
.game-enter:nth-child(4) { animation-delay: 0.15s; }
.game-enter:nth-child(5) { animation-delay: 0.2s; }

.game-enter:hover {
  border-color: var(--hev-dim);
  background: rgba(255, 154, 0, 0.05);
  transform: translateX(4px);
}

.game-enter-kicker {
  grid-row: 1 / span 2;
  align-self: center;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--hev);
  letter-spacing: 0.08em;
}

.game-enter-name {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  text-transform: uppercase;
}

.game-enter-desc {
  color: var(--muted);
  font-size: 0.9rem;
}

.back-link {
  background: none;
  border: 0;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
  padding: 0;
  margin-bottom: 18px;
}

.back-link:hover { color: var(--ink); }

.bet-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: center;
  gap: 14px;
  width: 100%;
  max-width: 640px;
  margin: 0 auto 28px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.game-root {
  width: 100%;
  min-height: 280px;
}

.result-line {
  min-height: 1.4em;
  margin-top: 22px;
  font-size: 1.05rem;
  color: var(--ink-soft);
  text-align: center;
  width: 100%;
}

.bet-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.bet-field input {
  width: 110px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  background: rgba(0, 0, 0, 0.35);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 1rem;
}

.bet-presets {
  display: flex;
  gap: 6px;
}

.bet-presets button {
  min-width: 48px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-soft);
  font-family: var(--mono);
  cursor: pointer;
}

.bet-presets button:hover,
.bet-presets button.is-on {
  border-color: var(--hev);
  color: var(--hev);
}

.bet-hint {
  color: var(--muted);
  font-size: 0.75rem;
  margin-left: auto;
}

.result-line.is-win { color: var(--ok); }
.result-line.is-lose { color: var(--danger); }

/* -- Roulette board -- */
.roulette-board {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
}

.roulette-center-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  width: 100%;
}

.feed-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  width: 100%;
  text-align: left;
}

.feed-panel {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  padding: 14px 12px;
  min-height: 0;
  max-height: 220px;
  overflow: auto;
}

.feed-panel h3 {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.feed-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.feed-list li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: baseline;
  font-size: 0.82rem;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.feed-rank {
  font-family: var(--mono);
  color: var(--hev);
  width: 1.2em;
}

.feed-player {
  font-family: var(--mono);
  color: var(--ink-soft);
}

.feed-game {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.feed-amt {
  font-family: var(--mono);
  color: var(--ok);
  font-weight: 600;
}

.feed-empty {
  color: var(--muted);
  border: 0 !important;
}

.spin-hist {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  min-height: 28px;
  max-width: 420px;
}

.spin-chip {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  padding: 0 6px;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid var(--line);
}

.spin-chip.is-red { background: rgba(168, 24, 40, 0.55); color: #ffd0d4; }
.spin-chip.is-black { background: rgba(255, 255, 255, 0.06); color: #eee; }
.spin-chip.is-green { background: rgba(31, 122, 58, 0.55); color: #c8f5d4; }

.roulette-arena {
  position: relative;
  width: min(360px, 86vw);
  height: min(360px, 86vw);
  margin: 0 auto;
}

.roulette-pointer {
  position: absolute;
  top: -2px;
  left: 50%;
  z-index: 5;
  width: 0;
  height: 0;
  margin-left: -10px;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 18px solid var(--hev);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.roulette-rim {
  position: absolute;
  inset: 12px;
  border-radius: 50%;
  border: 3px solid rgba(255, 154, 0, 0.35);
  box-shadow:
    0 0 0 8px rgba(0, 0, 0, 0.45),
    inset 0 0 40px rgba(0, 0, 0, 0.55),
    0 20px 50px rgba(0, 0, 0, 0.45);
  background: #0a0a0a;
}

.roulette-wheel {
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  overflow: hidden;
  transition: transform 3.2s cubic-bezier(0.12, 0.82, 0.08, 1);
  will-change: transform;
  background: #111;
}

.roulette-svg {
  display: block;
  width: 100%;
  height: 100%;
}

.roulette-orbit {
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  pointer-events: none;
  transition: transform 3.2s cubic-bezier(0.08, 0.7, 0.1, 1);
  will-change: transform;
  z-index: 3;
}

.roulette-ball {
  position: absolute;
  left: 50%;
  top: 6px;
  width: 14px;
  height: 14px;
  margin-left: -7px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, #c8c8c8 55%, #888);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.55);
  z-index: 4;
}

.roulette-ball.is-flying {
  animation: ball-pulse 0.35s ease infinite alternate;
}

@keyframes ball-pulse {
  from { transform: scale(1); }
  to { transform: scale(1.15); }
}

.roulette-hub {
  position: absolute;
  inset: 32%;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #1a1a1a, #050505 70%);
  border: 1px solid var(--line-strong);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 6vw, 2.4rem);
  font-weight: 800;
  z-index: 2;
  color: var(--ink);
  transition: color 0.25s ease, box-shadow 0.25s ease;
}

.roulette-hub.is-spinning { color: var(--muted); }
.roulette-hub.is-red { color: #ff6b6b; box-shadow: 0 0 24px rgba(255, 107, 107, 0.25); }
.roulette-hub.is-black { color: #eee; }
.roulette-hub.is-green { color: #7dffb3; box-shadow: 0 0 24px rgba(125, 255, 179, 0.2); }

.roulette-center-col .choice-row,
.roulette-center-col .play-btn {
  width: 100%;
  max-width: 360px;
}

@media (max-width: 900px) {
  .panel-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    padding: 18px 18px 14px;
  }
  .casino-head {
    width: 100%;
    justify-content: flex-start;
  }
  .floor-main {
    grid-template-columns: 1fr;
  }
  .side-col {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .top-board {
    max-height: 220px;
    order: 2;
  }
  .mode-rail {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    order: 1;
  }
  .mode-btn {
    flex: 1 1 calc(50% - 8px);
    min-width: 140px;
  }
  .live-rail { height: 108px; }
  .live-card { flex-basis: 84px; width: 84px; }
}

@media (max-width: 720px) {
  .casino-body-scroll { padding: 16px 14px 48px; }
  .bet-bar { justify-content: flex-start; }
  .bet-hint { margin-left: 0; width: 100%; text-align: left; }
  .bet-presets { width: 100%; }
  .bet-presets button { flex: 1; }
  .slot-reel { width: 68px; height: 84px; font-size: 2rem; }
  .roulette-arena {
    width: min(300px, 92vw);
    height: min(300px, 92vw);
  }
  .feed-row { grid-template-columns: 1fr; }
  .feed-panel { max-height: 180px; }
  .mode-btn { flex: 1 1 100%; }
  .choice-row button { min-width: 0; font-size: 0.78rem; padding: 12px 8px; }
  .game-enter { padding: 16px 14px; column-gap: 12px; }
  .game-enter-name { font-size: 1.15rem; }
}

.choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.choice-row button {
  flex: 1;
  min-width: 100px;
  padding: 14px 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s, filter 0.2s;
}

.choice-row button:hover { border-color: var(--line-strong); filter: brightness(1.08); }
.choice-row button.is-on {
  transform: translateY(-1px);
  box-shadow: 0 0 0 2px var(--hev);
}

.choice-row button.color-red {
  background: linear-gradient(180deg, #e23a48, #9e1522);
  border-color: #ff5a66;
  color: #fff;
}
.choice-row button.color-black {
  background: linear-gradient(180deg, #2a2a2a, #101010);
  border-color: #666;
  color: #f2f2f2;
}
.choice-row button.color-green {
  background: linear-gradient(180deg, #1db954, #0d7a36);
  border-color: #3dff8a;
  color: #fff;
}

.choice-row button.color-red.is-on { box-shadow: 0 0 0 2px #ff8a90; }
.choice-row button.color-black.is-on { box-shadow: 0 0 0 2px #ddd; }
.choice-row button.color-green.is-on { box-shadow: 0 0 0 2px #7dffb3; }

.play-btn {
  margin-top: 8px;
  width: 100%;
  max-width: 280px;
}

/* -- Slots -- */
.slots-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.slots-reels {
  display: flex;
  gap: 10px;
  padding: 20px;
  border: 1px solid var(--line-strong);
  background: rgba(0, 0, 0, 0.4);
}

.slot-reel {
  width: 88px;
  height: 100px;
  display: grid;
  place-items: center;
  font-size: 2.6rem;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #121212, #080808);
  overflow: hidden;
}

.slot-reel.is-spinning {
  animation: reel-shake 0.12s linear infinite;
}

.slot-reel.is-land {
  animation: land-pop 0.35s ease;
}

@keyframes reel-shake {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes land-pop {
  0% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

/* -- Dice -- */
.dice-stage {
  display: flex;
  flex-direction: column;
  gap: 22px;
  max-width: 420px;
}

.dice-faces {
  display: flex;
  gap: 16px;
  align-items: center;
}

.die {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  border: 1px solid var(--line-strong);
  background: #0c0c0c;
}

.die.is-roll {
  animation: die-roll 0.5s ease;
}

@keyframes die-roll {
  0% { transform: rotate(0) scale(1); }
  40% { transform: rotate(18deg) scale(1.08); }
  100% { transform: rotate(0) scale(1); }
}

.dice-total {
  font-family: var(--mono);
  font-size: 1.2rem;
  color: var(--hev);
}

/* -- RPS -- */
.rps-stage {
  display: flex;
  flex-direction: column;
  gap: 28px;
  max-width: 480px;
}

.rps-arena {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
  align-items: center;
  text-align: center;
}

.rps-hand {
  font-size: 3.2rem;
  min-height: 1.2em;
  transition: transform 0.35s ease, opacity 0.35s ease;
}

.rps-hand.is-reveal {
  animation: land-pop 0.4s ease;
}

.rps-vs {
  font-family: var(--mono);
  color: var(--muted);
  letter-spacing: 0.2em;
}

/* -- Crash -- */
.crash-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  max-width: 420px;
}

.crash-mult {
  font-family: var(--font-display);
  font-size: clamp(3.5rem, 12vw, 5.5rem);
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 1;
  color: var(--hev);
  transition: color 0.15s ease;
}

.crash-mult.is-crash {
  color: var(--danger);
  animation: crash-shake 0.45s ease;
}

.crash-mult.is-cash {
  color: var(--ok);
}

@keyframes crash-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}

.crash-track {
  width: 100%;
  height: 4px;
  background: var(--line);
  overflow: hidden;
}

.crash-track > span {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--hev);
  transition: width 0.25s linear;
}

.crash-actions {
  display: flex;
  gap: 10px;
  width: 100%;
}

.crash-actions .srv-btn {
  flex: 1;
}

@media (max-width: 720px) {
  .crash-actions { flex-direction: column; }
}
