:root {
  color-scheme: light;
  --ink: #17201c;
  --muted: #647067;
  --line: #d8ded8;
  --surface: #f7f8f5;
  --panel: #ffffff;
  --night: #101614;
  --felt: #0e5d47;
  --felt-dark: #09362f;
  --accent: #0f6b5f;
  --accent-dark: #094c44;
  --gold: #b7791f;
  --ruby: #b43b43;
  --success: #20a66b;
  --danger: #9f2d2d;
  --shadow: 0 18px 50px rgba(28, 38, 32, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(15, 107, 95, 0.12), transparent 42%),
    linear-gradient(315deg, rgba(183, 121, 31, 0.14), transparent 45%),
    var(--surface);
}

body.dashboard-mode {
  color: #f3f7ef;
  background:
    radial-gradient(circle at 14% 12%, rgba(183, 121, 31, 0.24), transparent 30%),
    radial-gradient(circle at 82% 16%, rgba(22, 130, 112, 0.24), transparent 28%),
    linear-gradient(145deg, #0c1110 0%, #15211d 52%, #0c1110 100%);
}

button,
input,
textarea {
  font: inherit;
}

.shell {
  width: min(1180px, calc(100vw - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 36px 0;
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 22px;
  align-items: stretch;
}

body.dashboard-mode .shell {
  width: min(1480px, calc(100vw - 28px));
  grid-template-columns: 1fr;
  padding: 22px 0;
}

body.dashboard-mode .brand-panel {
  display: none;
}

.brand-panel,
.auth-panel,
.dashboard-panel {
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(216, 222, 216, 0.95);
  box-shadow: var(--shadow);
  border-radius: 8px;
}

.brand-panel {
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 620px;
  background:
    linear-gradient(180deg, rgba(23, 32, 28, 0.90), rgba(23, 32, 28, 0.78)),
    url("https://images.unsplash.com/photo-1511193311914-0346f16efe90?auto=format&fit=crop&w=1100&q=80") center / cover;
  color: #fff;
}

.brand-lockup {
  display: flex;
  gap: 16px;
  align-items: center;
}

.mark {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 8px;
  font-weight: 800;
  color: #f8d18b;
}

.eyebrow {
  margin: 0 0 8px;
  color: inherit;
  opacity: 0.72;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0;
  font-weight: 800;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(2.4rem, 5vw, 4.8rem);
  line-height: 0.96;
  max-width: 8ch;
}

h2 {
  font-size: 1.55rem;
}

h3 {
  font-size: 1rem;
}

.status-grid {
  display: grid;
  gap: 12px;
}

.status-grid > div {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.10);
  backdrop-filter: blur(8px);
}

.label,
label span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

.status-grid .label {
  color: rgba(255, 255, 255, 0.64);
}

.auth-panel,
.dashboard-panel {
  padding: 28px;
  align-self: center;
}

body.dashboard-mode .dashboard-panel {
  align-self: stretch;
  background: rgba(10, 17, 15, 0.88);
  border-color: rgba(236, 216, 164, 0.18);
  color: #f4f7f0;
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.42);
}

body.dashboard-mode .dashboard-panel .eyebrow,
body.dashboard-mode .dashboard-panel .label,
body.dashboard-mode .dashboard-panel label span {
  color: rgba(244, 247, 240, 0.62);
}

body.dashboard-mode input,
body.dashboard-mode textarea {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.14);
  color: #f4f7f0;
}

body.dashboard-mode .ghost-button {
  background: rgba(255, 255, 255, 0.10);
  color: #f4f7f0;
}

.panel-heading {
  margin-bottom: 22px;
}

.google-slot {
  min-height: 44px;
  display: flex;
  align-items: center;
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.form-stack,
.credential-grid {
  display: grid;
  gap: 16px;
}

label {
  display: grid;
  gap: 7px;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 12px 13px;
  outline: none;
}

input:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 107, 95, 0.14);
}

button {
  border: 0;
  border-radius: 8px;
  padding: 12px 16px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

button:hover {
  background: var(--accent-dark);
}

.ghost-button {
  background: #eef2ed;
  color: var(--ink);
}

.ghost-button:hover {
  background: #e1e8e1;
}

.message {
  min-height: 22px;
  margin: 16px 0 0;
  color: var(--danger);
  font-weight: 700;
}

.dashboard-topline,
.prompt-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.credential-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.credential-grid label:first-child {
  grid-column: 1 / -1;
}

.copy-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.copy-row button,
.prompt-heading button {
  white-space: nowrap;
  background: #1d2b25;
}

.prompt-block {
  margin-top: 22px;
}

.live-theater {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.62fr);
  gap: 18px;
  margin: 18px 0 24px;
}

.theater-hero,
.live-sidebar,
.balance-card,
.stats-grid > div,
.activity-panel {
  border: 1px solid rgba(236, 216, 164, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.theater-hero {
  --pocket-radius: clamp(88px, 11vw, 132px);
  --ball-radius: clamp(100px, 12vw, 148px);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.025)),
    #0c1512;
  overflow: hidden;
}

.broadcast-bar {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.24);
  color: rgba(244, 247, 240, 0.74);
}

.broadcast-bar strong {
  color: #f4d58a;
}

.table-broadcast {
  min-height: 0;
  display: grid;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(244, 213, 138, 0.18);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.22);
  color: rgba(244, 247, 240, 0.78);
  font-weight: 900;
  text-transform: uppercase;
}

.table-broadcast-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.table-broadcast strong {
  color: #f4d58a;
  text-align: right;
}

.table-bettors {
  min-height: 28px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  color: rgba(244, 247, 240, 0.58);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: none;
}

.bettor-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 160px;
  padding: 4px 7px;
  border: 1px solid color-mix(in srgb, var(--agent-color) 62%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--agent-color) 18%, rgba(0, 0, 0, 0.34));
  color: #f4f7f0;
}

.bettor-pill i,
.agent-color-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 2px;
  background: var(--agent-color);
  box-shadow: 0 0 0 1px rgba(255, 248, 223, 0.45);
}

.agent-color-dot {
  display: inline-block;
  margin-right: 6px;
}

.bettor-pill span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bettor-pill strong {
  min-width: 18px;
  padding: 1px 5px;
  border-radius: 999px;
  background: rgba(255, 248, 223, 0.12);
  color: #fff8df;
  font-size: 0.68rem;
  text-align: center;
}

.live-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #ff4f5e;
  box-shadow: 0 0 0 0 rgba(255, 79, 94, 0.74);
  animation: livePulse 1.4s infinite;
}

.table-stage {
  position: relative;
  min-height: 520px;
  padding: 28px;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 16px;
  overflow: hidden;
  border-radius: 8px;
  background:
    radial-gradient(ellipse at center, rgba(18, 138, 100, 0.88), rgba(7, 54, 45, 0.96) 68%, rgba(8, 13, 12, 1) 100%),
    var(--felt-dark);
  box-shadow:
    inset 0 0 0 2px rgba(236, 216, 164, 0.12),
    inset 0 -42px 90px rgba(0, 0, 0, 0.38),
    0 28px 80px rgba(0, 0, 0, 0.32);
}

.stage-glow {
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(236, 216, 164, 0.18);
  border-radius: 8px;
  pointer-events: none;
}

.game-kicker {
  position: relative;
  z-index: 1;
  color: rgba(244, 247, 240, 0.70);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

.game-title {
  position: relative;
  z-index: 1;
  max-width: 15ch;
  color: #fff8df;
  font-size: clamp(2rem, 5vw, 4.8rem);
  font-weight: 900;
  line-height: 0.95;
}

.game-visual {
  position: relative;
  z-index: 1;
  min-height: 250px;
  display: grid;
  place-items: center;
  color: rgba(244, 247, 240, 0.76);
}

.result-strip {
  position: relative;
  z-index: 2;
  min-height: 58px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.30);
}

.result-strip strong {
  color: #f4d58a;
  font-size: 1.5rem;
}

.result-strip span:first-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

.result-strip span:last-child {
  text-align: right;
}

.live-sidebar {
  padding: 14px;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 12px;
  background: rgba(0, 0, 0, 0.18);
}

.balance-card {
  display: grid;
  gap: 8px;
  padding: 18px;
  background: linear-gradient(135deg, rgba(244, 213, 138, 0.16), rgba(32, 166, 107, 0.10));
}

.balance-card strong {
  color: #fff8df;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.stats-grid > div {
  display: grid;
  gap: 6px;
  padding: 12px;
}

.stats-grid strong {
  color: #fff8df;
  font-size: 1.15rem;
}

.activity-panel {
  min-height: 280px;
  padding: 14px;
  overflow: hidden;
}

.table-panel {
  min-height: 190px;
}

.compact-log {
  max-height: 210px;
}

.compact-heading {
  margin-bottom: 10px;
}

.compact-heading span {
  color: rgba(244, 247, 240, 0.56);
  font-size: 0.82rem;
  font-weight: 800;
}

.activity-log {
  height: 100%;
  max-height: 360px;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
  overflow: auto;
  list-style: none;
}

.activity-log li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 4px 10px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
  animation: logIn 340ms ease-out;
}

.activity-log span {
  color: rgba(244, 247, 240, 0.64);
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
}

.activity-log time {
  color: rgba(244, 247, 240, 0.48);
  font-size: 0.72rem;
  font-weight: 800;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.activity-log p {
  grid-column: 1 / -1;
  margin: 0;
  color: rgba(244, 247, 240, 0.80);
  font-size: 0.86rem;
}

.activity-log b {
  color: #f4d58a;
}

.activity-log em {
  color: rgba(244, 247, 240, 0.56);
  font-style: normal;
  font-weight: 900;
}

.positive {
  color: #58e59c !important;
}

.negative {
  color: #ff7a86 !important;
}

.blackjack-table {
  width: min(720px, 100%);
  display: grid;
  gap: 18px;
}

.card-row {
  min-height: 112px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

.table-label,
.game-badge {
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.30);
  color: #f4d58a;
  font-weight: 900;
  text-transform: uppercase;
}

.table-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(244, 213, 138, 0.46), transparent);
}

.bet-target {
  justify-self: center;
  max-width: min(420px, 100%);
  padding: 10px 12px;
  border: 1px solid rgba(244, 213, 138, 0.28);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.34);
  color: #fff8df;
  font-size: 0.9rem;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.bet-target span {
  display: block;
  margin-bottom: 4px;
  color: rgba(244, 247, 240, 0.62);
  font-size: 0.72rem;
}

.bet-target strong {
  color: #f4d58a;
  font-size: clamp(1.1rem, 3vw, 1.8rem);
  line-height: 1.05;
}

.playing-card {
  width: 74px;
  height: 104px;
  display: grid;
  align-content: space-between;
  padding: 10px;
  border-radius: 8px;
  background: #fff9ed;
  color: #111;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.24);
  animation: cardFlip 520ms ease-out backwards;
}

.playing-card:nth-child(2) { animation-delay: 70ms; }
.playing-card:nth-child(3) { animation-delay: 140ms; }
.playing-card:nth-child(4) { animation-delay: 210ms; }
.playing-card:nth-child(5) { animation-delay: 280ms; }

.playing-card strong {
  font-size: 1.25rem;
}

.playing-card span {
  justify-self: end;
  font-size: 1.1rem;
  font-weight: 900;
}

.red-card {
  color: #b72132;
}

.roulette-scene {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(260px, 0.78fr) minmax(420px, 1fr);
  justify-content: center;
  align-items: center;
  gap: 22px;
}

.roulette-layout {
  display: grid;
  place-items: center;
  gap: 14px;
}

.dice-scene {
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(150px, 0.5fr);
  justify-content: center;
  align-items: center;
  gap: 28px;
}

.roulette-wheel {
  position: relative;
  --pocket-radius: clamp(88px, 11vw, 132px);
  --ball-radius: clamp(100px, 12vw, 148px);
  width: clamp(230px, 28vw, 340px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 16px solid #271614;
  border-radius: 50%;
  box-shadow:
    inset 0 0 0 1px rgba(255, 248, 223, 0.42),
    inset 0 0 0 26px rgba(18, 11, 10, 0.54),
    inset 0 0 34px rgba(0, 0, 0, 0.48),
    0 24px 44px rgba(0, 0, 0, 0.34);
  overflow: hidden;
}

.roulette-wheel.spinning {
  animation: rouletteSpin 1.1s cubic-bezier(0.2, 0.8, 0.25, 1);
}

.roulette-wheel.revealing {
  animation: rouletteReveal 1.25s cubic-bezier(0.2, 0.8, 0.25, 1);
}

.roulette-track {
  position: absolute;
  inset: 13%;
  z-index: 1;
  border: 2px solid rgba(255, 248, 223, 0.26);
  border-radius: 50%;
  box-shadow: inset 0 0 0 18px rgba(255, 248, 223, 0.06), 0 0 0 1px rgba(0, 0, 0, 0.38);
}

.roulette-pocket {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  width: 30px;
  height: 20px;
  margin: -10px 0 0 -15px;
  display: grid;
  place-items: center;
  border-radius: 3px;
  color: #fff8df;
  font-size: clamp(0.62rem, 0.9vw, 0.78rem);
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 1px 2px #000;
  transform: rotate(var(--angle)) translateY(calc(-1 * var(--pocket-radius))) rotate(calc(-1 * var(--angle)));
  background: rgba(0, 0, 0, 0.18);
}

.roulette-pocket.green {
  color: #d6ffe8;
  background: rgba(15, 122, 80, 0.86);
}

.roulette-pocket.hit {
  background: rgba(255, 248, 223, 0.20);
  box-shadow: 0 0 0 1px rgba(255, 248, 223, 0.72), 0 0 16px rgba(244, 213, 138, 0.74);
}

.roulette-wheel strong {
  position: relative;
  z-index: 4;
  width: 88px;
  height: 88px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff8df;
  color: #131313;
  font-size: 2.5rem;
  box-shadow: 0 0 0 8px rgba(0, 0, 0, 0.22);
}

.roulette-ball {
  position: absolute;
  top: calc(50% - 8px);
  left: calc(50% - 8px);
  z-index: 5;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
  transform: rotate(var(--ball-angle)) translateY(calc(-1 * var(--ball-radius)));
  transform-origin: center;
}

.roulette-wheel.spinning .roulette-ball {
  animation: ballSpin 1.1s ease-out;
}

.roulette-wheel.revealing .roulette-ball {
  animation: ballReveal 1.25s ease-out;
}

.roulette-result {
  width: min(360px, 100%);
  justify-self: center;
  text-align: center;
}

.roulette-result span,
.dice-result span,
.dice-result em {
  color: rgba(244, 247, 240, 0.68);
  font-style: normal;
  font-weight: 900;
  text-transform: uppercase;
}

.roulette-result strong,
.dice-result strong {
  color: #fff8df;
  font-size: clamp(2.4rem, 6vw, 5rem);
  line-height: 0.9;
}

.roulette-result .bet-target strong {
  font-size: clamp(1rem, 2vw, 1.45rem);
  overflow-wrap: normal;
}

.roulette-betting-mat {
  width: 100%;
  max-width: 620px;
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid rgba(244, 213, 138, 0.26);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(5, 48, 38, 0.96), rgba(8, 74, 52, 0.90));
  box-shadow: inset 0 0 36px rgba(0, 0, 0, 0.26), 0 18px 38px rgba(0, 0, 0, 0.22);
}

.roulette-grid {
  color: #d6ffe8;
  background: rgba(15, 122, 80, 0.86);
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 6px;
}

.roulette-number-grid,
.roulette-dozens,
.roulette-outside-bets,
.roulette-columns {
  display: grid;
  gap: 6px;
}

.roulette-number-row {
  display: grid;
  grid-template-columns: repeat(12, minmax(32px, 1fr));
  gap: 6px;
}

.roulette-dozens,
.roulette-columns {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.roulette-outside-bets {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.roulette-cell {
  position: relative;
  min-height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(244, 247, 240, 0.34);
  border-radius: 4px;
  color: #fff8df;
  font-size: clamp(0.68rem, 1.1vw, 0.86rem);
  font-weight: 900;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.04);
}

.roulette-cell.zero {
  min-height: 126px;
}

.roulette-cell.red { background: rgba(159, 35, 52, 0.72); }
.roulette-cell.black { background: rgba(8, 12, 12, 0.76); }
.roulette-cell.green { background: rgba(15, 122, 80, 0.74); }
.roulette-cell.outside { background: rgba(255, 248, 223, 0.055); }

.roulette-cell.hit {
  border-color: rgba(255, 248, 223, 0.94);
  box-shadow: 0 0 0 2px rgba(244, 213, 138, 0.28), inset 0 0 18px rgba(244, 213, 138, 0.20);
}

.roulette-chip {
  position: absolute;
  right: 3px;
  bottom: 3px;
  min-width: 26px;
  max-width: calc(100% - 6px);
  padding: 3px 5px;
  border: 2px solid #fff8df;
  border-radius: 999px;
  background: #d5455a;
  color: #fff;
  font-size: 0.62rem;
  font-weight: 900;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.28);
}

.roulette-chip.you {
  background: #f4d58a;
  color: #111;
}

.roulette-chip-stack {
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 48px;
  height: 34px;
}

.roulette-agent-chip {
  position: absolute;
  right: calc(var(--chip-index) * 6px);
  bottom: calc(var(--chip-index) * 5px);
  z-index: calc(10 + var(--chip-index));
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 248, 223, 0.82);
  border-radius: 4px;
  background: var(--agent-color);
  color: #07110e;
  font-size: 0.58rem;
  font-style: normal;
  font-weight: 1000;
  line-height: 1;
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.32);
}

.roulette-agent-chip.you {
  outline: 2px solid #fff8df;
  outline-offset: 1px;
}

.roulette-agent-chip.more {
  background: rgba(255, 248, 223, 0.86);
  color: #111;
}

.roulette-chip-total {
  position: absolute;
  left: 3px;
  bottom: 3px;
  max-width: calc(100% - 44px);
  padding: 2px 4px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.42);
  color: #fff8df;
  font-size: 0.56rem;
  font-weight: 1000;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.die {
  width: clamp(150px, 22vw, 230px);
  aspect-ratio: 1;
  padding: 24px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  border-radius: 18px;
  background: #fff8df;
  box-shadow: 0 24px 44px rgba(0, 0, 0, 0.34);
  animation: diceShake 760ms cubic-bezier(0.16, 0.84, 0.44, 1);
}

.die span {
  border-radius: 50%;
}

.die span.active {
  background: #131313;
}

.idle-orbit {
  width: 150px;
  aspect-ratio: 1;
  border: 1px solid rgba(244, 213, 138, 0.34);
  border-radius: 50%;
  box-shadow: inset 0 0 40px rgba(244, 213, 138, 0.08), 0 0 44px rgba(32, 166, 107, 0.18);
  animation: idleOrbit 2.2s linear infinite;
}

.celebration-burst {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.celebration-burst strong {
  padding: 12px 18px;
  border-radius: 8px;
  background: rgba(5, 12, 10, 0.82);
  color: #f4d58a;
  font-size: clamp(1.6rem, 5vw, 4.2rem);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.36);
  animation: winPop 1.2s ease-out forwards;
}

.celebration-burst i {
  position: absolute;
  width: 9px;
  height: 18px;
  background: hsl(calc(var(--i) * 31), 82%, 62%);
  transform: rotate(calc(var(--i) * 17deg)) translateY(-10px);
  animation: confetti 1.3s ease-out forwards;
}

.stage-pop {
  animation: stagePop 640ms ease-out;
}

@keyframes livePulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 79, 94, 0.72); }
  70% { box-shadow: 0 0 0 10px rgba(255, 79, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 79, 94, 0); }
}

@keyframes logIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes cardFlip {
  from { opacity: 0; transform: rotateY(80deg) translateY(12px); }
  to { opacity: 1; transform: rotateY(0) translateY(0); }
}

@keyframes rouletteSpin {
  from { transform: rotate(-560deg) scale(0.92); }
  to { transform: rotate(0) scale(1); }
}

@keyframes ballSpin {
  from { transform: rotate(calc(var(--ball-angle) + 720deg)) translateY(calc(-1 * var(--ball-radius))); }
  to { transform: rotate(var(--ball-angle)) translateY(calc(-1 * var(--ball-radius))); }
}

@keyframes rouletteReveal {
  0% { transform: rotate(-640deg) scale(0.94); filter: brightness(0.86); }
  72% { transform: rotate(6deg) scale(1.02); filter: brightness(1.08); }
  100% { transform: rotate(0) scale(1); filter: brightness(1); }
}

@keyframes ballReveal {
  0% { transform: rotate(calc(var(--ball-angle) + 900deg)) translateY(calc(-1 * var(--ball-radius))); }
  76% { transform: rotate(calc(var(--ball-angle) - 10deg)) translateY(calc(-1 * var(--ball-radius))); }
  100% { transform: rotate(var(--ball-angle)) translateY(calc(-1 * var(--ball-radius))); }
}

@keyframes diceShake {
  0% { transform: rotate(-16deg) translateX(-18px); }
  35% { transform: rotate(14deg) translateX(14px); }
  70% { transform: rotate(-7deg) translateX(-8px); }
  100% { transform: rotate(0) translateX(0); }
}

@keyframes idleOrbit {
  from { transform: rotate(0); }
  to { transform: rotate(360deg); }
}

@keyframes winPop {
  0% { opacity: 0; transform: scale(0.72); }
  16% { opacity: 1; transform: scale(1.06); }
  76% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.08); }
}

@keyframes confetti {
  from { opacity: 1; transform: rotate(calc(var(--i) * 17deg)) translateY(-10px); }
  to { opacity: 0; transform: rotate(calc(var(--i) * 29deg)) translateY(calc(-120px - (var(--i) * 5px))) translateX(calc((var(--i) - 10) * 14px)); }
}

@keyframes stagePop {
  from { box-shadow: inset 0 0 0 2px rgba(236, 216, 164, 0.12), 0 0 0 rgba(32, 166, 107, 0); }
  50% { box-shadow: inset 0 0 0 2px rgba(236, 216, 164, 0.2), 0 0 60px rgba(32, 166, 107, 0.28); }
  to { box-shadow: inset 0 0 0 2px rgba(236, 216, 164, 0.12), 0 28px 80px rgba(0, 0, 0, 0.32); }
}

textarea {
  min-height: 320px;
  resize: vertical;
  font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  font-size: 0.88rem;
  line-height: 1.55;
}

.hidden {
  display: none;
}

.downloads-shell {
  width: min(980px, calc(100vw - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 36px 0;
  display: grid;
  align-items: center;
}

.downloads-panel {
  background: rgba(255, 255, 255, 0.90);
  border: 1px solid rgba(216, 222, 216, 0.95);
  box-shadow: var(--shadow);
  border-radius: 8px;
  padding: 28px;
}

.download-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.download-card {
  display: grid;
  gap: 6px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
}

.download-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 107, 95, 0.12);
}

.download-card span,
.download-note,
.back-link {
  color: var(--muted);
}

.back-link {
  font-weight: 800;
}

@media (max-width: 860px) {
  .shell {
    grid-template-columns: 1fr;
    padding: 18px 0;
  }

  .brand-panel {
    min-height: 260px;
  }

  h1 {
    max-width: 12ch;
  }

  .credential-grid {
    grid-template-columns: 1fr;
  }

  .download-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-topline,
  .prompt-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .live-theater {
    grid-template-columns: 1fr;
  }

  .theater-hero {
    min-height: auto;
  }

  .table-stage {
    min-height: 500px;
    padding: 18px;
  }

  .game-title {
    max-width: 11ch;
  }

  .roulette-scene,
  .dice-scene {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .result-strip {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .result-strip span:last-child {
    text-align: center;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .playing-card {
    width: 58px;
    height: 84px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}
