:root {
  color-scheme: light;
  --bg: #f3f5f8;
  --surface: #ffffff;
  --surface-2: #f7f8fa;
  --ink: #151b27;
  --muted: #667085;
  --line: #d9dee8;
  --line-strong: #bec7d5;
  --gold: #f2bd35;
  --gold-soft: #fff3c4;
  --green: #0e714f;
  --green-2: #07543e;
  --mint: #32c88a;
  --blue: #2674d9;
  --red: #d83b54;
  --black: #202733;
  --shadow: 0 18px 48px rgba(21, 27, 39, 0.1);
  --shadow-soft: 0 6px 18px rgba(21, 27, 39, 0.08);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: linear-gradient(180deg, #ffffff 0, var(--bg) 340px, var(--bg) 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.46;
}

a {
  color: inherit;
  text-decoration: none;
}

b,
strong {
  font-weight: 900;
}

.hidden {
  display: none !important;
}

.student-auth-gate {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  overflow-y: auto;
  padding: 24px 18px 92px;
  background:
    linear-gradient(90deg, var(--gold) 0 7px, transparent 7px),
    #f5f7fa;
}

.student-auth-shell {
  display: grid;
  gap: 16px;
  width: min(470px, 100%);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.student-auth-brand,
.auth-view-head,
.account-profile {
  display: flex;
  align-items: center;
  gap: 12px;
}

.student-auth-brand strong,
.student-auth-brand small,
.auth-view-head strong,
.auth-view-head small,
.account-profile strong,
.account-profile small {
  display: block;
}

.student-auth-brand small,
.auth-view-head small,
.account-profile small {
  color: var(--muted);
}

.auth-tab-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.auth-tab {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
}

.auth-tab.active {
  background: #fff;
  color: var(--ink);
  box-shadow: var(--shadow-soft);
}

.student-auth-form {
  display: none;
  gap: 13px;
}

.student-auth-form.active {
  display: grid;
}

.student-auth-form label,
.modal-dialog label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.student-auth-form label small {
  color: var(--muted);
  font-size: 11px;
}

.student-auth-form input,
.modal-dialog input,
.modal-dialog textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
}

.modal-dialog textarea {
  min-height: 120px;
  padding: 11px 12px;
  resize: vertical;
}

.student-auth-form input:focus,
.modal-dialog input:focus,
.modal-dialog textarea:focus {
  outline: 3px solid rgba(242, 189, 53, 0.25);
  border-color: #c99920;
}

.password-field {
  position: relative;
  display: block;
  width: 100%;
}

.password-field > input {
  padding-right: 48px;
}

.password-visibility {
  position: absolute;
  top: 50%;
  right: 2px;
  display: grid;
  width: 42px;
  height: 42px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #697383;
  transform: translateY(-50%);
  cursor: pointer;
}

.password-visibility:hover {
  background: #f1f3f2;
  color: var(--ink);
}

.password-visibility:focus-visible {
  outline: 3px solid rgba(242, 189, 53, 0.34);
}

.password-eye {
  position: relative;
  display: block;
  width: 19px;
  height: 13px;
  border: 2px solid currentColor;
  border-radius: 60% 40% / 60% 40%;
  transform: rotate(45deg);
}

.password-eye::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  content: "";
  transform: translate(-50%, -50%);
}

.password-visibility[aria-pressed="true"] .password-eye::before {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: -4px;
  width: 25px;
  height: 2px;
  background: currentColor;
  box-shadow: 0 0 0 2px #fff;
  content: "";
  transform: translateY(-50%);
}

.name-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
}

.auth-sub-actions {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.auth-back {
  flex: 0 0 auto;
}

.small-mark {
  width: 42px;
  height: 42px;
}

.auth-message,
.modal-message {
  min-height: 20px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.auth-message.error,
.modal-message.error {
  color: var(--red);
}

.auth-message.success,
.modal-message.success {
  color: var(--green);
}

.auth-result {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.auth-result p,
.auth-result strong {
  margin: 0;
}

.auth-result p {
  color: var(--muted);
  line-height: 1.6;
}

.secret-admin-trigger {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 330;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border: 1px solid #c99614;
  border-radius: var(--radius);
  background: var(--gold);
  color: #332400;
  font-size: 17px;
  font-weight: 950;
  box-shadow: var(--shadow);
}

.secret-admin-trigger:active {
  transform: scale(0.95);
}

.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 360;
  display: grid;
  place-items: center;
  overflow-y: auto;
  padding: 18px;
  background: rgba(21, 27, 39, 0.36);
  backdrop-filter: blur(6px);
}

.modal-dialog {
  display: grid;
  gap: 14px;
  width: min(560px, 100%);
  max-height: calc(100vh - 36px);
  overflow-y: auto;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.modal-head h2,
.modal-head p {
  margin: 0;
}

.audio-settings-dialog {
  width: min(500px, 100%);
}

.audio-power-row {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.audio-power-row span,
.audio-power-row strong,
.audio-power-row small {
  display: block;
}

.audio-power-row small {
  margin-top: 2px;
  font-size: 10px;
}

.audio-power-row input {
  appearance: none;
  position: relative;
  width: 48px;
  min-height: 28px;
  flex: 0 0 48px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #cfd4dc;
  transition: background 140ms ease, border-color 140ms ease;
}

.audio-power-row input::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(18, 24, 35, 0.28);
  transition: transform 140ms ease;
}

.audio-power-row input:checked {
  border-color: #bd8c0e;
  background: var(--gold);
}

.audio-power-row input:checked::after {
  transform: translateX(20px);
}

.audio-level-list {
  display: grid;
  gap: 2px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
}

.audio-level-row {
  display: grid;
  gap: 10px;
  padding: 12px 14px;
  background: #fff;
}

.audio-level-row > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.audio-level-row output {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.audio-level-row input {
  appearance: none;
  width: 100%;
  min-height: 18px;
  padding: 0;
  border: 0;
  background: transparent;
  accent-color: #c99614;
}

.audio-level-row input::-webkit-slider-runnable-track {
  height: 5px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    var(--gold) 0 var(--audio-level, 50%),
    #d7dce4 var(--audio-level, 50%) 100%
  );
}

.audio-level-row input::-webkit-slider-thumb {
  appearance: none;
  width: 18px;
  height: 18px;
  margin-top: -6px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #202938;
  box-shadow: 0 1px 4px rgba(18, 24, 35, 0.26);
}

.audio-level-row input::-moz-range-track {
  height: 5px;
  border: 0;
  border-radius: 999px;
  background: #d7dce4;
}

.audio-level-row input::-moz-range-progress {
  height: 5px;
  border-radius: 999px;
  background: var(--gold);
}

.audio-level-row input::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #202938;
  box-shadow: 0 1px 4px rgba(18, 24, 35, 0.26);
}

.audio-dynamics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  margin: 0;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.audio-dynamics legend {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.audio-dynamics label {
  display: block;
  cursor: pointer;
}

.audio-dynamics input {
  position: absolute;
  width: 1px;
  min-height: 1px;
  opacity: 0;
}

.audio-dynamics span {
  display: grid;
  place-items: center;
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.audio-dynamics input:checked + span {
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
  box-shadow: var(--shadow-soft);
}

.audio-preview-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.audio-preview-row button {
  min-width: 0;
}

.account-profile {
  padding: 4px 0;
}

.account-balance-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.account-balance-grid > div {
  display: grid;
  gap: 5px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.account-balance-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.account-balance-grid strong {
  font-size: 20px;
}

.modal-actions {
  display: grid;
  gap: 8px;
}

.app {
  min-height: 100vh;
  padding-bottom: 56px;
}

.maintenance-screen {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  padding: 24px;
  background: rgba(247, 248, 250, 0.98);
  text-align: center;
}

.maintenance-screen h1,
.maintenance-screen p {
  margin: 0;
}

.maintenance-screen h1 {
  font-size: 34px;
}

.maintenance-screen p:last-child {
  color: var(--muted);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 70px;
  padding: 10px max(18px, calc((100vw - 1320px) / 2));
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
}

.header-left,
.top-actions,
.brand,
.top-balance,
.connection-pill {
  display: flex;
  align-items: center;
}

.header-left {
  gap: 12px;
  min-width: 0;
}

.top-actions {
  gap: 8px;
}

.brand {
  gap: 10px;
  min-width: 0;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: var(--muted);
  font-size: 11px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border: 1px solid #d29d18;
  border-radius: var(--radius);
  background: var(--gold);
  color: #332400;
  font-weight: 950;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
}

.icon-button:hover,
.ghost:hover,
.primary:hover,
.danger:hover,
.text-button:hover,
.game-chip:hover,
.filter-tab:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-soft);
  transform: translateY(-1px);
}

.menu-button {
  gap: 4px;
  align-content: center;
}

.menu-button span {
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: var(--ink);
}

.sound-button[aria-pressed="false"] {
  color: var(--muted);
  background: var(--surface-2);
  text-decoration: line-through;
}

.ghost,
.primary,
.danger,
.text-button,
.game-chip,
.filter-tab,
.tab {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font-weight: 850;
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.ghost,
.primary,
.danger,
.text-button {
  padding: 0 16px;
}

.compact {
  min-height: 38px;
  padding: 0 12px;
}

.primary {
  border-color: #d6a31d;
  background: var(--gold);
  color: #352600;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.danger {
  border-color: #ba3148;
  background: var(--red);
  color: #fff;
}

.text-button {
  min-height: 34px;
  padding: 0 9px;
  border-color: transparent;
  background: transparent;
  color: var(--blue);
}

.wide {
  width: 100%;
}

.connection-pill {
  gap: 7px;
  min-height: 32px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 11px;
}

.connection-pill span {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #98a2b3;
}

.connection-pill[data-mode="sync"] {
  border-color: #9edec4;
  color: #136342;
}

.connection-pill[data-mode="sync"] span {
  background: var(--mint);
}

.connection-pill[data-mode="offline"] {
  border-color: #efb4bf;
  color: #9b2b40;
}

.connection-pill[data-mode="offline"] span {
  background: var(--red);
}

.top-balance {
  gap: 4px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid #e3bd54;
  border-radius: var(--radius);
  background: var(--gold-soft);
}

.top-balance span {
  font-size: 18px;
  font-weight: 950;
}

.top-balance small {
  color: #684d00;
  font-weight: 900;
}

.drawer,
.history-panel {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 110;
  width: min(370px, calc(100vw - 30px));
  padding: 16px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 24px 0 64px rgba(21, 27, 39, 0.16);
  transform: translateX(-105%);
  transition: transform 180ms ease;
}

.drawer.open {
  transform: translateX(0);
}

.history-panel {
  inset: 0 0 0 auto;
  display: flex;
  flex-direction: column;
  width: min(430px, calc(100vw - 24px));
  border-right: 0;
  border-left: 1px solid var(--line);
  transform: translateX(105%);
}

.history-panel.open {
  transform: translateX(0);
}

.drawer-backdrop,
.history-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  background: rgba(21, 27, 39, 0.28);
  backdrop-filter: blur(2px);
}

.drawer-backdrop.show,
.history-backdrop.show {
  display: block;
}

.drawer-head,
.history-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.history-head {
  grid-template-columns: minmax(0, 1fr) auto;
}

.drawer-head strong,
.drawer-head small,
.account-panel strong,
.account-panel small {
  display: block;
}

.drawer-head small,
.account-panel small {
  color: var(--muted);
  line-height: 1.45;
}

.account-panel {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 0;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.avatar {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--black);
  color: #fff;
  font-weight: 950;
}

.drawer-nav {
  display: grid;
  gap: 8px;
}

.drawer-nav button,
.drawer-nav a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font-weight: 800;
}

.drawer-nav a:last-child {
  border-color: #e2bd58;
  background: var(--gold-soft);
}

.drawer-stats {
  display: grid;
  gap: 8px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.drawer-stats div,
.session-summary div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.drawer-stats span,
.session-summary span {
  color: var(--muted);
}

.history-head h2,
.history-head p {
  margin: 0;
}

.session-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.session-summary div {
  display: grid;
  gap: 4px;
}

.session-summary strong {
  font-size: 22px;
}

.history-list {
  display: grid;
  align-content: start;
  gap: 0;
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  margin-bottom: 14px;
}

.history-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.history-item strong,
.history-item small {
  overflow-wrap: anywhere;
}

.history-item small {
  color: var(--muted);
}

.history-delta {
  grid-row: span 2;
  align-self: center;
  color: var(--muted);
  font-weight: 950;
}

.history-delta.win {
  color: var(--green);
}

.history-delta.loss {
  color: var(--red);
}

.empty-state {
  margin: 30px 0;
  color: var(--muted);
  text-align: center;
}

main {
  width: min(1320px, calc(100% - 30px));
  margin: 0 auto;
}

.floor-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px;
  padding: 34px 0 20px;
}

.floor-head h1,
.floor-head p {
  margin: 0;
}

.floor-head h1 {
  font-size: 36px;
  line-height: 1.1;
  letter-spacing: 0;
}

.eyebrow {
  margin: 0 0 7px;
  color: #8a6200;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0;
}

.balance-strip {
  display: grid;
  grid-template-columns: minmax(190px, 1.25fr) repeat(3, minmax(112px, 0.72fr));
  min-width: min(720px, 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.balance-strip > div {
  display: grid;
  align-content: center;
  min-height: 72px;
  padding: 12px 16px;
  border-left: 1px solid var(--line);
}

.balance-strip > div:first-child {
  border-left: 0;
}

.balance-strip span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.balance-strip strong {
  margin-top: 4px;
  white-space: nowrap;
}

.balance-main strong {
  font-size: 26px;
}

.balance-main small {
  margin-left: 4px;
  font-size: 13px;
}

.game-toolbar {
  position: sticky;
  top: 70px;
  z-index: 40;
  display: grid;
  gap: 8px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(243, 245, 248, 0.96);
  backdrop-filter: blur(12px);
}

.filter-tabs,
.game-picker,
.action-row,
.outside-bets,
.top-actions {
  display: flex;
  align-items: center;
}

.filter-tabs,
.game-picker {
  gap: 7px;
  overflow-x: auto;
  scrollbar-width: none;
}

.filter-tabs::-webkit-scrollbar,
.game-picker::-webkit-scrollbar {
  display: none;
}

.filter-tab {
  min-height: 32px;
  flex: 0 0 auto;
  padding: 0 11px;
  color: var(--muted);
  font-size: 12px;
}

.filter-tab.active {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.game-chip {
  min-height: 40px;
  flex: 0 0 auto;
  padding: 0 14px;
}

.game-chip.active {
  border-color: #d6a31d;
  background: var(--gold-soft);
  color: #4f3900;
}

.game-chip.filtered-out {
  display: none;
}

.game-view {
  display: none;
}

.game-view.active {
  display: block;
}

.game-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(270px, 330px);
  gap: 18px;
  padding: 18px 0 48px;
}

.game-layout-wide {
  grid-template-columns: minmax(0, 1fr) 280px;
}

.machine,
.side-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.machine {
  position: relative;
  min-width: 0;
  overflow: hidden;
  padding: 22px;
}

.machine::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--gold), var(--green), var(--blue), var(--red));
}

.side-panel {
  align-self: start;
  padding: 20px;
}

.machine-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.machine-head h2,
.machine-head p,
.side-panel h3 {
  margin-top: 0;
}

.machine-head h2 {
  margin-bottom: 0;
  font-size: 30px;
  line-height: 1.15;
  letter-spacing: 0;
}

.side-panel h3 {
  margin-bottom: 14px;
  font-size: 18px;
}

.inline-field {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.inline-field input,
.select,
.total-bet-row select {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  padding: 0 10px;
}

.inline-field input {
  width: 86px;
}

.inline-field input:focus,
.select:focus,
.total-bet-row select:focus {
  outline: 3px solid rgba(242, 189, 53, 0.24);
  border-color: #d6a31d;
}

.action-row {
  flex-wrap: wrap;
  gap: 8px;
}

.panel-heading,
.roulette-selection {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.panel-heading h3 {
  margin: 0;
}

.live-dot {
  padding: 4px 7px;
  border-radius: 999px;
  background: #dff8ec;
  color: #0f6d49;
  font-size: 10px;
  font-weight: 950;
}

.mini-stats,
.paytable {
  display: grid;
  gap: 0;
}

.mini-stats div,
.paytable div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  border-bottom: 1px solid var(--line);
}

.mini-stats div:last-child,
.paytable div:last-child {
  border-bottom: 0;
}

.mini-stats span,
.paytable span {
  color: var(--muted);
  font-size: 13px;
}

.rule-panel details {
  margin-top: 16px;
  border-top: 1px solid var(--line);
}

.rule-panel summary {
  padding: 14px 0;
  color: var(--ink);
  font-weight: 900;
  cursor: pointer;
}

.rule-panel details p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.configured-rule-lines {
  display: grid;
  gap: 6px;
}

.configured-live-settings {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.configured-live-settings > strong {
  color: var(--muted);
  font-size: 9px;
  text-transform: uppercase;
}

.configured-live-settings > div {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 12px;
}

.configured-live-settings span {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}

.configured-live-settings small {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 8px;
}

.configured-live-settings b {
  flex: 0 0 auto;
  font-size: 9px;
}

.scratch-live-odds {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 12px;
}

.scratch-live-odds span {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
}

.scratch-live-odds em {
  grid-column: 1 / -1;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 8px;
  font-style: normal;
}

.scratch-live-odds b {
  font-size: 10px;
}

.scratch-live-odds small {
  color: var(--muted);
  font-size: 8px;
  white-space: nowrap;
}

.result-box,
.result-display,
.poker-status,
.slot-status {
  min-height: 62px;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  font-weight: 850;
  line-height: 1.55;
}

.result-display {
  display: grid;
  align-content: center;
  gap: 3px;
}

.result-display span {
  color: var(--muted);
  font-size: 12px;
}

.result-display strong {
  font-size: 24px;
}

.cost-badge {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 12px;
  border-radius: var(--radius);
  background: var(--gold-soft);
  color: #5b4100;
  font-weight: 950;
}

/* Scratch */
.scratch-board {
  position: relative;
  width: min(100%, 560px);
  aspect-ratio: 420 / 260;
  margin: 4px auto 18px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: linear-gradient(135deg, #fff5ce, #def6e9);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.8), var(--shadow-soft);
}

.prize-layer,
#scratchCanvas {
  position: absolute;
  inset: 0;
}

#scratchCanvas {
  width: 100%;
  height: 100%;
  touch-action: none;
}

.prize-layer {
  display: grid;
  place-items: center;
  align-content: center;
  text-align: center;
}

.prize-layer span {
  font-size: 72px;
  font-weight: 950;
}

.prize-layer small {
  color: var(--muted);
  font-weight: 900;
}

/* Roulette */
.roulette-pro-layout {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 24px;
  align-items: center;
}

.european-wheel-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 340px;
}

.european-wheel {
  position: relative;
  width: 300px;
  max-width: 100%;
  aspect-ratio: 1;
  border: 12px solid #d2a647;
  border-radius: 999px;
  background: #131820;
  box-shadow: inset 0 0 0 7px #f4d47d, inset 0 0 0 20px #111720, 0 22px 44px rgba(21, 27, 39, 0.2);
  transition: transform 5.1s cubic-bezier(0.08, 0.72, 0.12, 1);
}

.wheel-ring {
  position: absolute;
  inset: 15px;
  border-radius: 999px;
}

.wheel-pocket {
  position: absolute;
  left: calc(50% - 11px);
  top: 6px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 46%;
  color: #fff;
  font-size: 9px;
  font-weight: 950;
  transform-origin: 11px 100%;
}

.wheel-pocket span {
  display: grid;
  place-items: center;
  width: 20px;
  height: 25px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 4px;
  background: var(--black);
}

.wheel-pocket.red span {
  background: #c9364d;
}

.wheel-pocket.green span {
  background: #078055;
}

.wheel-hub {
  position: absolute;
  inset: 32%;
  display: grid;
  place-items: center;
  border: 8px solid #e0b957;
  border-radius: 999px;
  background: #f6d77d;
  color: #493300;
  font-size: 28px;
  font-weight: 950;
  box-shadow: inset 0 0 0 6px #fff0b8;
}

.wheel-pointer {
  position: absolute;
  top: 4px;
  z-index: 4;
  width: 0;
  height: 0;
  border-left: 13px solid transparent;
  border-right: 13px solid transparent;
  border-top: 28px solid var(--gold);
  filter: drop-shadow(0 4px 3px rgba(21, 27, 39, 0.28));
}

.roulette-ball {
  position: absolute;
  left: calc(50% - 6px);
  top: 22px;
  z-index: 5;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
  transform-origin: 6px 126px;
}

.roulette-ball.spinning {
  animation: ballOrbit 900ms linear infinite;
}

@keyframes ballOrbit {
  to { transform: rotate(-360deg); }
}

.roulette-selection {
  min-height: 42px;
  margin-bottom: 9px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.roulette-selection span {
  color: var(--muted);
  font-size: 12px;
}

.roulette-selection strong {
  margin-right: auto;
}

.roulette-pro-layout > div:last-child {
  min-width: 0;
  overflow-x: auto;
}

.roulette-board {
  display: grid;
  grid-template-columns: 46px repeat(12, minmax(38px, 1fr));
  grid-template-rows: repeat(3, 42px);
  min-width: 540px;
  overflow: hidden;
  border: 2px solid #fff;
  border-radius: var(--radius);
  background: var(--green-2);
}

.roulette-number {
  display: grid;
  place-items: center;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.52);
  border-radius: 0;
  background: var(--black);
  color: #fff;
  font-size: 13px;
  font-weight: 950;
}

.roulette-number.red {
  background: #c9364d;
}

.roulette-number.zero {
  grid-column: 1;
  grid-row: 1 / 4;
  background: #078055;
}

.roulette-number.selected,
.outside-bets button.selected {
  outline: 3px solid var(--gold);
  outline-offset: -4px;
  box-shadow: inset 0 0 0 2px #fff;
}

.outside-bets {
  display: grid;
  grid-template-columns: repeat(6, minmax(72px, 1fr));
  min-width: 540px;
  margin: 8px 0 10px;
}

.outside-bets button {
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 0;
  background: var(--green-2);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
}

.outside-bets button:nth-last-child(-n+3) {
  grid-column: span 2;
}

.outside-bets .red-bet {
  background: #c9364d;
}

.outside-bets .black-bet {
  background: var(--black);
}

/* Cards and felt tables */
.felt-machine,
.baccarat-machine {
  border-color: #185f49;
  background: var(--green);
  color: #fff;
}

.felt-machine::before,
.baccarat-machine::before {
  background: var(--gold);
}

.felt-machine .eyebrow,
.baccarat-machine .eyebrow {
  color: #fbe39e;
}

.light-field {
  color: rgba(255, 255, 255, 0.78);
}

.blackjack-table {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 12px;
  min-height: 410px;
  padding: 20px;
  border: 2px solid rgba(255, 255, 255, 0.23);
  border-radius: 180px 180px var(--radius) var(--radius);
  background: var(--green-2);
  box-shadow: inset 0 0 0 7px rgba(255, 255, 255, 0.05);
}

.table-score {
  display: flex;
  align-items: center;
  gap: 9px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 900;
}

.table-score strong {
  display: grid;
  place-items: center;
  min-width: 32px;
  min-height: 28px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: var(--radius);
  color: #fff;
  font-size: 16px;
}

.table-rule {
  color: rgba(255, 255, 255, 0.72);
  font-size: 10px;
  font-weight: 900;
  text-align: center;
}

.casino-hand {
  display: flex;
  justify-content: center;
  min-height: 112px;
  padding-left: 20px;
}

.casino-card {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  width: 72px;
  aspect-ratio: 2.5 / 3.5;
  flex: 0 0 auto;
  margin-left: -20px;
  padding: 7px;
  border: 1px solid #c8cfd9;
  border-radius: var(--radius);
  background: #fff;
  color: #161d2b;
  box-shadow: 0 8px 18px rgba(7, 30, 23, 0.22);
  animation: dealCard 260ms ease-out both;
}

.casino-card.red {
  color: #cb334c;
}

.casino-card.hidden-card {
  place-items: center;
  border: 4px solid #fff;
  background:
    repeating-linear-gradient(45deg, #263851 0 6px, #f2bd35 6px 9px);
  color: #fff;
  font-weight: 950;
}

.casino-card .card-rank {
  font-size: 19px;
  font-weight: 950;
  line-height: 1;
}

.casino-card .card-suit {
  place-self: center;
  font-size: 28px;
}

.casino-card .card-corner {
  justify-self: end;
  align-self: end;
  font-size: 16px;
}

@keyframes dealCard {
  from { transform: translate(-60px, -24px) rotate(-7deg); opacity: 0; }
  to { transform: translate(0, 0) rotate(0); opacity: 1; }
}

/* Baccarat */
.baccarat-table {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  min-height: 320px;
  padding: 24px 12px;
  border: 2px solid rgba(255, 255, 255, 0.23);
  border-radius: 100px 100px var(--radius) var(--radius);
  background: var(--green-2);
}

.baccarat-side {
  display: grid;
  justify-items: center;
  gap: 14px;
  min-width: 0;
}

.baccarat-center {
  display: grid;
  place-items: center;
  width: 92px;
  min-height: 92px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  color: #fbe39e;
  font-size: 11px;
  font-weight: 950;
  text-align: center;
}

.compact-hand .casino-card {
  width: 64px;
}

.bet-choice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.bet-choice-grid button {
  display: grid;
  place-items: center;
  gap: 3px;
  min-height: 64px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
  font-weight: 900;
}

.bet-choice-grid button span {
  font-size: 12px;
}

.bet-choice-grid button strong {
  color: #fbe39e;
}

.bet-choice-grid button.selected {
  border-color: var(--gold);
  background: rgba(242, 189, 53, 0.24);
  box-shadow: inset 0 0 0 2px var(--gold);
}

/* Sic Bo */
.dice-dome {
  display: flex;
  justify-content: center;
  gap: 20px;
  min-height: 190px;
  margin-bottom: 14px;
  padding: 46px 20px;
  border: 1px solid var(--line);
  border-radius: 90px 90px var(--radius) var(--radius);
  background: #eef2f7;
  box-shadow: inset 0 12px 32px rgba(21, 27, 39, 0.08);
}

.die {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  width: 84px;
  height: 84px;
  padding: 12px;
  border: 1px solid #c9d0dc;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 12px 20px rgba(21, 27, 39, 0.16);
}

.die.rolling {
  animation: diceRoll 520ms ease-in-out;
}

.pip {
  place-self: center;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--black);
}

@keyframes diceRoll {
  0% { transform: rotate(0) translateY(0); }
  30% { transform: rotate(70deg) translateY(-28px); }
  65% { transform: rotate(160deg) translateY(3px); }
  100% { transform: rotate(180deg) translateY(0); }
}

.sicbo-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  margin-bottom: 8px;
}

.sicbo-board button,
.total-bet-row button {
  display: grid;
  gap: 3px;
  place-items: center;
  min-height: 62px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font-weight: 900;
}

.sicbo-board button strong {
  color: var(--muted);
  font-size: 11px;
}

.sicbo-board .wide-bet {
  grid-column: span 2;
}

.sicbo-board button.selected,
.total-bet-row button.selected {
  border-color: #d6a31d;
  background: var(--gold-soft);
  box-shadow: inset 0 0 0 2px var(--gold);
}

.total-bet-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 0.7fr);
  gap: 8px;
  margin-bottom: 10px;
}

.total-bet-row label {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.total-bet-row button {
  min-height: 42px;
}

/* Video poker */
.video-poker-machine {
  background: #172236;
  color: #fff;
}

.video-poker-machine::before {
  background: var(--gold);
}

.video-poker-machine .eyebrow {
  color: #fbe39e;
}

.poker-status,
.slot-status {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  text-align: center;
}

.poker-hand {
  display: grid;
  grid-template-columns: repeat(5, minmax(90px, 1fr));
  gap: 10px;
  margin: 18px 0;
}

.poker-card {
  position: relative;
  display: grid;
  place-items: stretch;
  min-width: 0;
  padding: 0;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius);
  background: transparent;
}

.poker-card .casino-card {
  width: 100%;
  margin: 0;
}

.poker-card .hold-label {
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 6px;
  display: none;
  padding: 4px;
  border-radius: 4px;
  background: var(--gold);
  color: #352600;
  font-size: 10px;
  font-weight: 950;
}

.poker-card.held {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px var(--gold);
}

.poker-card.held .hold-label {
  display: block;
}

.video-poker-machine .ghost {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

/* Slots */
.slot-machine {
  background: #76283a;
  color: #fff;
}

.slot-machine::before {
  background: var(--gold);
}

.slot-machine .eyebrow {
  color: #fbe39e;
}

.slot-window {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  max-width: 650px;
  margin: 0 auto 14px;
  padding: 14px;
  border: 5px solid #e0b957;
  border-radius: var(--radius);
  background: #fff4c6;
  box-shadow: inset 0 0 0 3px #8c5d00, 0 16px 30px rgba(46, 7, 16, 0.28);
}

.slot-reel {
  display: grid;
  grid-template-rows: repeat(3, 82px);
  overflow: hidden;
  border: 1px solid #ccb967;
  border-radius: var(--radius);
  background: #fff;
}

.slot-cell {
  display: grid;
  place-items: center;
  border-bottom: 1px solid #e4dfc5;
  color: var(--ink);
  font-size: 34px;
  font-weight: 950;
}

.slot-cell:last-child {
  border-bottom: 0;
}

.slot-reel.spinning .slot-cell {
  animation: reelBlur 170ms linear infinite;
}

@keyframes reelBlur {
  50% { transform: translateY(12px); filter: blur(2px); }
}

.payline {
  position: absolute;
  left: 12px;
  right: 12px;
  z-index: 3;
  height: 2px;
  opacity: 0;
  background: var(--red);
  pointer-events: none;
}

.payline.line-1 { top: 18%; }
.payline.line-2 { top: 50%; }
.payline.line-3 { top: 82%; }
.payline.line-4 { top: 50%; transform: rotate(21deg); }
.payline.line-5 { top: 50%; transform: rotate(-21deg); }
.slot-window.win .payline { opacity: 0.8; }

.slot-machine .ghost {
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

/* Coin */
.coin-stage {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 0.7fr);
  gap: 24px;
  align-items: center;
  min-height: 330px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #eef2f7;
}

.coin {
  display: grid;
  place-items: center;
  width: 190px;
  max-width: 100%;
  aspect-ratio: 1;
  justify-self: center;
  border: 14px solid #dcaa29;
  border-radius: 999px;
  background: var(--gold);
  color: #493300;
  font-size: 54px;
  font-weight: 950;
  box-shadow: inset 0 0 0 5px #ffe391, 0 18px 28px rgba(21, 27, 39, 0.18);
  transform-style: preserve-3d;
}

.coin.flip {
  animation: coinFlip 620ms ease-out;
}

@keyframes coinFlip {
  0% { transform: rotateY(0) translateY(0); }
  45% { transform: rotateY(720deg) translateY(-44px); }
  100% { transform: rotateY(1080deg) translateY(0); }
}

.coin-status {
  display: grid;
  gap: 5px;
}

.coin-status span,
.coin-status small {
  color: var(--muted);
  font-weight: 850;
}

.coin-status strong {
  font-size: 50px;
}

#coinMachine.all-in {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(216, 59, 84, 0.18), var(--shadow);
}

/* High low */
.highlow-table {
  display: grid;
  grid-template-columns: 120px auto 170px;
  gap: 24px;
  place-content: center;
  align-items: center;
  min-height: 360px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #edf2f7;
}

.deck {
  display: grid;
  place-items: center;
  width: 112px;
  aspect-ratio: 2.5 / 3.5;
  border: 5px solid #fff;
  border-radius: var(--radius);
  background:
    repeating-linear-gradient(45deg, #263851 0 7px, #f2bd35 7px 10px);
  color: #fff;
  font-size: 26px;
  font-weight: 950;
  box-shadow: 0 10px 24px rgba(21, 27, 39, 0.2);
}

.highlow-table .casino-card {
  width: 140px;
  margin: 0;
  padding: 12px;
}

.highlow-table .card-rank {
  font-size: 34px;
}

.highlow-table .card-suit {
  font-size: 54px;
}

.highlow-arrow {
  color: var(--muted);
  font-size: 28px;
}

/* Lotto */
.lotto-machine {
  overflow: visible;
}

.lotto-round-badge {
  display: grid;
  min-width: 92px;
  padding: 8px 12px;
  border: 1px solid #d8b13d;
  border-radius: 6px;
  background: #fff8dd;
  text-align: right;
}

.lotto-round-badge span,
.lotto-round-strip span,
.lotto-ticket > span,
.lotto-picker-head span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
}

.lotto-round-badge strong {
  color: #523a00;
  font-size: 20px;
}

.lotto-round-strip {
  display: grid;
  grid-template-columns: 1.15fr 1.3fr 1.3fr 0.8fr;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.lotto-round-strip > div {
  display: grid;
  align-content: center;
  min-width: 0;
  min-height: 60px;
  padding: 10px 13px;
  border-right: 1px solid var(--line);
}

.lotto-round-strip > div:last-child {
  border-right: 0;
}

.lotto-round-strip strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lotto-round-strip > div:first-child strong {
  color: #a66d00;
  font-size: 20px;
}

.lotto-draw {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(9px, 2vw, 18px);
  min-height: 126px;
  margin-bottom: 14px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #182333;
  box-shadow: inset 0 8px 22px rgba(0, 0, 0, 0.28);
}

.draw-ball {
  position: relative;
  display: grid;
  place-items: center;
  width: clamp(58px, 8vw, 76px);
  height: clamp(58px, 8vw, 76px);
  border: 4px solid #d5a11b;
  border-radius: 999px;
  background: #f5c53d;
  color: #3d2b00;
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 950;
  box-shadow:
    inset 8px 10px 0 rgba(255, 246, 193, 0.62),
    inset -8px -10px 0 rgba(158, 100, 0, 0.18),
    0 9px 16px rgba(0, 0, 0, 0.32);
}

.draw-ball.operator-fixed,
.lotto-result-balls span.operator-fixed {
  border-color: #3f83d1;
  box-shadow:
    inset 0 0 0 3px #d8eaff,
    0 0 0 3px rgba(63, 131, 209, 0.25);
}

.draw-ball.operator-fixed::after {
  content: "指定";
  position: absolute;
  right: -6px;
  bottom: -8px;
  padding: 2px 5px;
  border-radius: 4px;
  background: #245f9f;
  color: #fff;
  font-size: 9px;
  line-height: 1.2;
}

.draw-ball.drawing {
  animation: drawBall 260ms ease-in-out infinite alternate;
}

@keyframes drawBall {
  to { transform: translateY(-9px) rotate(9deg) scale(1.04); }
}

.lotto-picker {
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f7f9fb;
}

.lotto-picker-head,
.lotto-subhead,
.lotto-side-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.lotto-picker-head {
  margin-bottom: 12px;
}

.lotto-picker-head > div:first-child {
  display: grid;
}

.lotto-picker-head strong {
  font-size: 17px;
}

.lotto-picker-actions {
  display: flex;
  gap: 6px;
}

.lotto-picker-actions button {
  min-height: 32px;
  padding: 0 9px;
}

.lotto-purchase-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 230px);
  gap: 10px;
  margin-bottom: 14px;
}

.number-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 7px;
}

.lotto-picker .number-grid {
  width: min(100%, 620px);
  margin-inline: auto;
}

.number-grid button {
  min-width: 0;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-weight: 900;
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
}

.number-grid button:not(:disabled):hover {
  transform: translateY(-2px);
  border-color: #c18a00;
}

.number-grid button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.number-grid button.selected {
  border-color: #d3a021;
  background: var(--gold);
  color: #3d2b00;
  box-shadow: inset 0 0 0 2px #fff2bd;
}

.number-grid button.drawn {
  border-color: var(--green);
  box-shadow: inset 0 0 0 2px var(--green);
}

.lotto-ticket {
  display: grid;
  align-content: center;
  min-height: 64px;
  padding: 10px 16px;
  border: 1px solid #d8b13d;
  border-radius: var(--radius);
  background: var(--gold-soft);
  color: #513a00;
}

.lotto-ticket strong {
  overflow: hidden;
  font-size: clamp(16px, 2.4vw, 24px);
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lotto-purchase-row #buyLotto {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 64px;
  padding-inline: 16px;
}

.lotto-purchase-row #buyLotto span {
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lotto-purchase-row #buyLotto strong {
  font-size: 18px;
}

.lotto-owned {
  padding-top: 4px;
}

.lotto-subhead {
  margin-bottom: 9px;
}

.lotto-subhead h3 {
  margin: 0;
  font-size: 14px;
}

.lotto-subhead > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.lotto-ticket-list,
.lotto-ticket-results {
  display: grid;
  gap: 6px;
}

.lotto-ticket-list {
  max-height: 218px;
  overflow: auto;
}

.lotto-ticket-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
}

.lotto-ticket-numbers {
  display: flex;
  gap: 4px;
}

.lotto-ticket-numbers span,
.lotto-result-balls span {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  border: 2px solid #d5a11b;
  border-radius: 999px;
  background: #f5c53d;
  color: #3d2b00;
  font-size: 12px;
  font-weight: 950;
}

.lotto-ticket-detail {
  display: grid;
  min-width: 0;
}

.lotto-ticket-detail strong,
.lotto-ticket-detail small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lotto-ticket-detail strong {
  font-size: 13px;
}

.lotto-ticket-detail small,
.lotto-latest small {
  color: var(--muted);
  font-size: 10px;
}

.lotto-empty {
  margin: 0;
  padding: 15px 10px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.lotto-side-status {
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.lotto-side-status span {
  padding: 4px 7px;
  border-radius: 4px;
  background: #dff8ec;
  color: #0f6d49;
  font-size: 10px;
  font-weight: 950;
}

.lotto-side-status strong {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.lotto-carry-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 50px;
  margin-top: 8px;
  padding: 0 10px;
  border: 1px solid #dfc168;
  border-radius: 5px;
  background: #fff8dd;
}

.lotto-carry-line span {
  color: #755300;
  font-size: 12px;
  font-weight: 850;
}

.lotto-carry-line strong {
  color: #6b4b00;
}

.lotto-latest {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.lotto-result-balls {
  display: flex;
  gap: 6px;
  margin: 10px 0;
}

.lotto-result-copy {
  display: block;
  margin-bottom: 2px;
  font-size: 13px;
}

.lotto-ticket-results {
  margin-top: 12px;
}

.lotto-ticket-results .lotto-ticket-row {
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
}

.lotto-ticket-results .lotto-ticket-numbers span {
  width: 27px;
  height: 27px;
  font-size: 10px;
}

/* Feedback */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 3600;
  max-width: min(500px, calc(100% - 28px));
  padding: 13px 16px;
  border: 1px solid #2d3747;
  border-radius: var(--radius);
  background: #151b27;
  color: #fff;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 16px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.celebration {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 5px;
  background: rgba(21, 27, 39, 0.78);
  color: #fff;
  opacity: 0;
  pointer-events: none;
  transform: scale(1.04);
}

.celebration.show {
  animation: celebrateFlash 1050ms ease both;
}

.celebration strong {
  color: var(--gold);
  font-size: 54px;
}

.celebration span {
  font-size: 34px;
  font-weight: 950;
}

.spark {
  position: fixed;
  z-index: 151;
  width: 8px;
  height: 16px;
  pointer-events: none;
  animation: sparkFall 900ms ease-out forwards;
}

@keyframes celebrateFlash {
  0% { opacity: 0; transform: scale(1.04); }
  16%, 74% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(0.98); }
}

@keyframes sparkFall {
  to { transform: translate(var(--dx), var(--dy)) rotate(540deg); opacity: 0; }
}

.mobile-tabs {
  display: none;
}

@media (max-width: 1120px) {
  .roulette-pro-layout {
    grid-template-columns: 320px minmax(0, 1fr);
  }

  .european-wheel-stage {
    min-height: 340px;
  }

  .european-wheel {
    width: 300px;
  }

  .roulette-ball {
    top: 22px;
    transform-origin: 6px 126px;
  }

  .poker-hand {
    grid-template-columns: repeat(5, minmax(70px, 1fr));
    gap: 6px;
  }
}

@media (max-width: 900px) {
  .floor-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    width: 100%;
  }

  .balance-strip {
    min-width: 0;
    width: 100%;
    justify-self: stretch;
  }

  .game-layout,
  .game-layout-wide {
    grid-template-columns: minmax(0, 1fr);
  }

  .side-panel {
    align-self: stretch;
  }

  .roulette-pro-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .european-wheel-stage {
    min-height: 330px;
  }
}

@media (max-width: 700px) {
  .student-auth-gate {
    place-items: start center;
    padding: 14px 12px 90px;
  }

  .student-auth-shell {
    padding: 18px;
  }

  .secret-admin-trigger {
    right: 10px;
    bottom: 10px;
    z-index: 81;
    width: 52px;
    height: 52px;
  }

  .app {
    padding-bottom: 88px;
  }

  .topbar {
    min-height: 64px;
    padding: 9px 12px;
  }

  .brand small,
  .connection-pill,
  .desktop-admin {
    display: none;
  }

  .brand-mark {
    width: 40px;
    height: 40px;
  }

  .top-actions {
    gap: 5px;
  }

  .top-balance {
    min-height: 38px;
    padding: 0 9px;
  }

  .top-balance span {
    font-size: 16px;
  }

  .top-actions #historyButton {
    display: none;
  }

  main {
    width: min(100% - 20px, 1320px);
  }

  .floor-head {
    padding: 22px 0 14px;
  }

  .floor-head h1 {
    font-size: 28px;
  }

  .balance-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .balance-strip > div {
    min-height: 64px;
    padding: 10px;
  }

  .balance-strip span {
    font-size: 10px;
  }

  .balance-strip strong {
    font-size: 12px;
  }

  .balance-main strong {
    font-size: 20px;
  }

  .game-toolbar {
    top: 64px;
    margin: 0 -10px;
    padding: 8px 10px;
  }

  .game-layout {
    padding: 12px 0 28px;
  }

  .machine,
  .side-panel {
    padding: 15px;
  }

  .machine-head {
    align-items: center;
  }

  .machine-head h2 {
    font-size: 24px;
  }

  .inline-field {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 3px 5px;
  }

  .inline-field input {
    grid-row: 2;
    width: 72px;
  }

  .inline-field > span {
    grid-row: 2;
  }

  .prize-layer span {
    font-size: 52px;
  }

  .european-wheel-stage {
    min-height: 280px;
  }

  .european-wheel {
    width: 260px;
    border-width: 9px;
  }

  .roulette-ball {
    top: 18px;
    transform-origin: 6px 109px;
  }

  .wheel-pocket {
    left: calc(50% - 9px);
    width: 18px;
    transform-origin: 9px 100%;
  }

  .wheel-pocket span {
    width: 17px;
    height: 21px;
    font-size: 7px;
  }

  .wheel-hub {
    font-size: 22px;
  }

  .blackjack-table {
    min-height: 360px;
    padding: 16px 8px;
  }

  .casino-card {
    width: 60px;
    margin-left: -16px;
  }

  .baccarat-table {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    min-height: 370px;
    border-radius: 70px 70px var(--radius) var(--radius);
  }

  .baccarat-center {
    grid-column: 1 / 3;
    grid-row: 1;
    width: auto;
    min-height: 36px;
    border-radius: var(--radius);
  }

  .baccarat-side {
    grid-row: 2;
  }

  .compact-hand .casino-card {
    width: 50px;
  }

  .dice-dome {
    gap: 10px;
    min-height: 150px;
    padding: 34px 12px;
  }

  .die {
    width: 66px;
    height: 66px;
    padding: 9px;
  }

  .pip {
    width: 9px;
    height: 9px;
  }

  .sicbo-board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .total-bet-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .poker-hand {
    grid-template-columns: repeat(5, minmax(54px, 1fr));
    gap: 4px;
    margin: 12px -5px;
  }

  .poker-card .casino-card {
    padding: 4px;
  }

  .poker-card .card-rank {
    font-size: 15px;
  }

  .poker-card .card-suit {
    font-size: 22px;
  }

  .slot-window {
    gap: 5px;
    padding: 9px;
  }

  .slot-reel {
    grid-template-rows: repeat(3, 66px);
  }

  .slot-cell {
    font-size: 26px;
  }

  .coin-stage {
    grid-template-columns: minmax(0, 1fr);
    min-height: 390px;
  }

  .coin {
    width: 150px;
    font-size: 42px;
  }

  .coin-status {
    text-align: center;
  }

  .coin-status strong {
    font-size: 40px;
  }

  .highlow-table {
    grid-template-columns: 84px auto 110px;
    gap: 12px;
    min-height: 290px;
    padding: 16px 10px;
  }

  .deck {
    width: 80px;
  }

  .highlow-table .casino-card {
    width: 100px;
  }

  .highlow-table .card-suit {
    font-size: 38px;
  }

  .lotto-panel {
    grid-template-columns: minmax(0, 1fr);
  }

  .lotto-ticket {
    min-height: 90px;
  }

  .number-grid {
    gap: 5px;
  }

  .draw-ball {
    width: 52px;
    height: 52px;
  }

  .mobile-tabs {
    position: static;
    left: auto;
    right: auto;
    bottom: auto;
    z-index: 80;
    display: grid;
    width: calc(100% - 20px);
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin: 0 10px 10px;
    padding: 7px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
  }

  .mobile-tabs .tab {
    display: grid;
    place-items: center;
    padding: 0 8px;
  }

  .toast {
    bottom: 84px;
  }

  .celebration strong {
    font-size: 38px;
  }

  .celebration span {
    font-size: 28px;
  }
}

@media (max-width: 430px) {
  .name-field-grid,
  .account-balance-grid {
    grid-template-columns: 1fr;
  }

  .auth-sub-actions {
    display: grid;
    justify-items: start;
  }

  .brand > span:last-child {
    display: none;
  }

  .balance-strip {
    grid-template-columns: 1fr 1fr;
  }

  .balance-main {
    grid-column: 1 / 4;
    border-bottom: 1px solid var(--line);
  }

  .balance-strip > div:nth-child(2) {
    border-left: 0;
  }

  .action-row > button {
    flex: 1 1 calc(50% - 8px);
  }

  .bet-choice-grid {
    gap: 5px;
  }

  .bet-choice-grid button {
    min-height: 58px;
  }

  .dice-dome {
    gap: 7px;
  }

  .die {
    width: 58px;
    height: 58px;
  }
}

/* Immersive game floor */
main {
  width: min(1760px, calc(100% - 32px));
}

.floor-head {
  padding: 20px 0 14px;
}

.floor-head h1 {
  font-size: 28px;
}

.balance-strip > div {
  min-height: 62px;
}

.casino-shell {
  display: grid;
  grid-template-columns: 164px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.game-toolbar {
  position: sticky;
  top: 82px;
  z-index: 35;
  display: block;
  max-height: calc(100dvh - 96px);
  overflow-y: auto;
  padding: 0 8px 24px 0;
  border: 0;
  background: transparent;
  backdrop-filter: none;
  scrollbar-width: thin;
}

.game-picker {
  display: grid;
  gap: 5px;
  overflow: visible;
}

.game-chip {
  position: relative;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  width: 100%;
  min-height: 58px;
  padding: 8px 9px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  box-shadow: none;
  color: var(--muted);
  text-align: left;
}

.game-chip:hover {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
}

.game-chip.active {
  border-color: var(--line-strong);
  background: #fff;
  color: var(--ink);
  box-shadow: var(--shadow-soft);
}

.game-chip.active::before {
  content: "";
  position: absolute;
  inset: 8px auto 8px -1px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--gold);
}

.game-code {
  color: #9aa1ad;
  font-size: 10px;
  font-weight: 950;
}

.game-chip.active .game-code {
  color: #8a6200;
}

.game-label {
  display: grid;
  min-width: 0;
}

.game-label strong {
  overflow: hidden;
  font-size: 12px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-label small {
  margin-top: 2px;
  color: #9aa1ad;
  font-size: 8px;
  font-weight: 900;
}

.game-stage {
  min-width: 0;
}

.game-stage .game-layout {
  min-height: calc(100dvh - 190px);
  align-items: stretch;
  padding: 0 0 36px;
}

.game-stage .machine {
  min-height: 540px;
}

.game-stage .side-panel {
  align-self: stretch;
}

.machine-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Full-table roulette */
.roulette-experience {
  --wheel-size: clamp(340px, 30vw, 500px);
}

.roulette-experience .game-layout {
  grid-template-columns: minmax(0, 1fr) 250px;
  gap: 0;
  min-height: calc(100dvh - 190px);
  overflow: hidden;
  border: 1px solid #0a513f;
  border-radius: 8px;
  background: #0d654f;
  box-shadow: 0 18px 48px rgba(23, 35, 30, 0.18);
}

.roulette-experience .roulette-machine {
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: #0d654f;
  box-shadow: none;
  color: #fff;
}

.roulette-experience .roulette-machine::before {
  height: 3px;
  background: var(--gold);
}

.roulette-experience .machine-head {
  align-items: center;
  margin-bottom: 4px;
}

.roulette-experience .machine-head .eyebrow {
  color: #f2d483;
}

.roulette-experience .machine-head h2 {
  color: #fff;
}

.roulette-experience .inline-field {
  color: rgba(255, 255, 255, 0.74);
}

.roulette-experience .inline-field input {
  border-color: rgba(255, 255, 255, 0.45);
  background: #fff;
}

.roulette-fullscreen {
  border-color: rgba(255, 255, 255, 0.38);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 21px;
}

.roulette-fullscreen:hover {
  background: rgba(255, 255, 255, 0.2);
}

.roulette-pro-layout {
  grid-template-columns: minmax(330px, 0.8fr) minmax(560px, 1.35fr);
  gap: clamp(20px, 2.5vw, 42px);
  min-height: 100%;
}

.european-wheel-stage {
  min-height: calc(var(--wheel-size) + 34px);
}

.european-wheel {
  width: var(--wheel-size);
  max-width: none;
}

.roulette-ball {
  top: calc(var(--wheel-size) * 0.073);
  transform-origin: 6px calc(var(--wheel-size) * 0.42);
}

.roulette-pro-layout > div:last-child {
  overflow: visible;
}

.roulette-betting-area {
  min-width: 0;
}

.roulette-status-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  gap: 8px;
  margin-bottom: 10px;
}

.roulette-experience .roulette-selection,
.roulette-experience .result-display {
  min-height: 50px;
  margin: 0;
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.roulette-experience .roulette-selection span,
.roulette-experience .result-display span {
  color: rgba(255, 255, 255, 0.68);
}

.roulette-experience .roulette-selection .text-button {
  color: #f3d77f;
}

.roulette-experience .result-display {
  padding: 7px 11px;
}

.roulette-experience .result-display strong {
  color: #fff;
}

.roulette-bet-scroll {
  width: 100%;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-color: rgba(255, 255, 255, 0.45) transparent;
}

.roulette-experience .roulette-board {
  width: 100%;
  min-width: 620px;
  grid-template-columns: 48px repeat(12, minmax(44px, 1fr));
  grid-template-rows: repeat(3, 50px);
  border-color: rgba(255, 255, 255, 0.75);
  background: #084f3d;
}

.roulette-experience .roulette-number {
  font-size: 14px;
}

.roulette-experience .outside-bets {
  width: 100%;
  min-width: 620px;
  margin-bottom: 12px;
}

.roulette-experience .outside-bets button {
  min-height: 44px;
  background: #084f3d;
}

.roulette-experience #spinRoulette {
  min-height: 52px;
  border-color: #e8bc45;
  background: #f2bd35;
  color: #322400;
  font-size: 15px;
}

.roulette-round-panel {
  border: 0;
  border-left: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 0;
  background: #fff;
  box-shadow: none;
}

#game-roulette:fullscreen,
#game-roulette.focus-mode {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: block;
  overflow: auto;
  padding: 16px;
  background: #f3f5f8;
}

#game-roulette:fullscreen .game-layout,
#game-roulette.focus-mode .game-layout {
  min-height: calc(100dvh - 32px);
  padding: 0;
}

body.roulette-focus {
  overflow: hidden;
}

body.student-authenticated .secret-admin-trigger {
  display: none;
}

@media (min-width: 901px) and (max-width: 1500px) {
  .roulette-experience {
    --wheel-size: clamp(310px, 26vw, 370px);
  }

  .roulette-experience .game-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .roulette-pro-layout {
    grid-template-columns: minmax(300px, 0.72fr) minmax(560px, 1.28fr);
    gap: 24px;
  }

  .roulette-experience .roulette-board,
  .roulette-experience .outside-bets {
    min-width: 560px;
  }

  .roulette-round-panel {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) 150px;
    align-items: center;
    gap: 18px;
    padding: 14px 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    border-left: 0;
  }

  .roulette-round-panel h3 {
    margin: 0;
  }

  .roulette-round-panel .mini-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
  }

  .roulette-round-panel .mini-stats div {
    border-bottom: 0;
  }

  .roulette-round-panel details {
    margin: 0;
    border-top: 0;
  }
}

@media (max-width: 1180px) {
  .casino-shell {
    grid-template-columns: 132px minmax(0, 1fr);
  }

  .game-chip {
    grid-template-columns: 24px minmax(0, 1fr);
    padding-inline: 7px;
  }

  .roulette-experience {
    --wheel-size: clamp(310px, 42vw, 430px);
  }

  .roulette-pro-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }

  .roulette-betting-area {
    width: 100%;
  }
}

@media (max-width: 900px) {
  main {
    width: min(100% - 20px, 900px);
  }

  .floor-head {
    display: block;
    padding: 8px 0;
  }

  .floor-head > div:first-child {
    display: none;
  }

  .balance-strip {
    display: flex;
    width: 100%;
    min-width: 0;
    overflow-x: auto;
    border-radius: 6px;
    scrollbar-width: none;
  }

  .balance-strip::-webkit-scrollbar {
    display: none;
  }

  .balance-strip > div,
  .balance-strip .balance-main {
    grid-column: auto;
    flex: 0 0 auto;
    min-width: 112px;
    min-height: 52px;
    padding: 8px 11px;
    border-bottom: 0;
    border-left: 1px solid var(--line);
  }

  .balance-strip > div:first-child {
    min-width: 154px;
    border-left: 0;
  }

  .balance-main strong {
    font-size: 20px;
  }

  .casino-shell {
    display: block;
  }

  .game-toolbar {
    top: 64px;
    max-height: none;
    margin: 0 -10px;
    overflow: hidden;
    padding: 7px 10px;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    background: rgba(243, 245, 248, 0.96);
    backdrop-filter: blur(12px);
  }

  .game-picker {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scroll-padding-inline: 10px;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }

  .game-picker::-webkit-scrollbar {
    display: none;
  }

  .game-chip {
    flex: 0 0 126px;
    grid-template-columns: 24px minmax(0, 1fr);
    min-height: 54px;
    scroll-snap-align: start;
    border-color: var(--line);
    background: #fff;
  }

  .game-chip.active {
    border-color: #c99718;
    box-shadow: inset 0 -3px 0 var(--gold);
  }

  .game-chip.active::before {
    display: none;
  }

  .game-stage .game-layout {
    min-height: 0;
    padding: 10px 0 28px;
  }

  .game-stage .machine {
    min-height: 0;
  }

  .roulette-experience {
    --wheel-size: min(78vw, 360px);
    margin-inline: -10px;
  }

  .roulette-experience .game-layout {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .roulette-experience .roulette-machine {
    padding: 16px 10px 12px;
  }

  .roulette-experience .machine-head {
    padding-inline: 4px;
  }

  .roulette-experience .machine-head h2 {
    font-size: 23px;
  }

  .roulette-pro-layout {
    display: block;
  }

  .european-wheel-stage {
    min-height: calc(var(--wheel-size) + 20px);
  }

  .roulette-status-line {
    grid-template-columns: minmax(0, 1fr) 126px;
    padding-inline: 4px;
  }

  .roulette-bet-scroll {
    padding: 0 4px 5px;
  }

  .roulette-experience .roulette-board,
  .roulette-experience .outside-bets {
    min-width: 560px;
  }

  .roulette-experience .roulette-board {
    grid-template-columns: 44px repeat(12, 43px);
    grid-template-rows: repeat(3, 46px);
  }

  .roulette-experience #spinRoulette {
    width: calc(100% - 8px);
    margin-inline: 4px;
  }

  .roulette-round-panel {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0 18px;
    padding: 16px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    border-left: 0;
  }

  .roulette-round-panel h3 {
    grid-column: 1 / -1;
  }
}

@media (max-width: 520px) {
  .game-chip {
    flex-basis: 112px;
  }

  .game-label strong {
    font-size: 11px;
  }

  .roulette-experience {
    --wheel-size: min(84vw, 340px);
  }

  .roulette-experience .machine-head {
    align-items: flex-start;
  }

  .roulette-experience .machine-tools {
    align-items: flex-start;
  }

  .roulette-experience .roulette-fullscreen {
    width: 38px;
    height: 38px;
  }

  .roulette-status-line {
    grid-template-columns: minmax(0, 1fr);
  }

  .roulette-experience .result-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .roulette-round-panel {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}

/* Immersive 3D roulette */
.roulette-experience {
  --roulette-stage-height: clamp(500px, calc(100dvh - 285px), 680px);
  --roulette-gap: clamp(18px, 2vw, 34px);
}

.roulette-experience .game-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
  border: 1px solid #174e42;
  border-radius: 6px;
  background: #075b47;
}

.roulette-experience .roulette-machine {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  padding: 18px 22px 22px;
  overflow: hidden;
  background: #075b47;
}

.roulette-experience .machine-head {
  min-height: 66px;
  margin: 0;
  padding: 0 2px 12px;
}

.roulette-experience .machine-head h2 {
  font-size: clamp(25px, 2.1vw, 34px);
  line-height: 1.05;
}

.roulette-experience .machine-head .eyebrow {
  margin-bottom: 5px;
  font-size: 11px;
}

.roulette-experience .roulette-pro-layout {
  display: grid;
  grid-template-columns: minmax(390px, 42fr) minmax(550px, 58fr);
  gap: var(--roulette-gap);
  min-height: var(--roulette-stage-height);
  align-items: stretch;
}

.roulette-experience .european-wheel-stage {
  display: block;
  min-width: 0;
  min-height: 0;
  height: var(--roulette-stage-height);
}

.roulette-3d-viewport {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 420px;
  overflow: hidden;
  border: 1px solid rgba(245, 211, 123, 0.28);
  border-radius: 6px;
  background: #063d33;
  box-shadow: inset 0 0 80px rgba(0, 0, 0, 0.34), 0 14px 32px rgba(0, 34, 26, 0.22);
  isolation: isolate;
}

#roulette3DCanvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 240ms ease;
}

.roulette-3d-viewport.three-ready #roulette3DCanvas {
  opacity: 1;
}

.roulette-table-light {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04), inset 0 -90px 100px rgba(0, 19, 15, 0.2);
}

.roulette-pocket-lens {
  --lens-cell: 42px;
  --lens-gap: 4px;
  position: absolute;
  top: 12px;
  left: 50%;
  z-index: 5;
  box-sizing: border-box;
  width: 238px;
  height: 54px;
  padding: 5px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 5px;
  background: rgba(8, 22, 20, 0.86);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.24);
  transform: translateX(-50%);
  backdrop-filter: blur(10px);
}

.roulette-lens-track {
  position: absolute;
  top: 9px;
  left: 50%;
  display: flex;
  gap: var(--lens-gap);
  width: max-content;
  will-change: transform;
}

.roulette-lens-cell {
  display: grid;
  flex: 0 0 var(--lens-cell);
  place-items: center;
  width: var(--lens-cell);
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 3px;
  background: #151d25;
  color: #fff;
  font-size: 16px;
  font-weight: 950;
}

.roulette-lens-cell.red {
  background: #ba253a;
}

.roulette-lens-cell.green {
  background: #087149;
}

.roulette-lens-pin {
  position: absolute;
  top: 9px;
  left: 50%;
  z-index: 2;
  width: var(--lens-cell);
  height: 36px;
  border: 2px solid #ffd457;
  border-radius: 4px;
  box-shadow: 0 0 0 2px rgba(255, 212, 87, 0.18);
  pointer-events: none;
  transform: translateX(-50%);
}

.roulette-lens-pin::after {
  position: absolute;
  top: -8px;
  left: 50%;
  width: 0;
  height: 0;
  border-right: 5px solid transparent;
  border-bottom: 7px solid #ffd457;
  border-left: 5px solid transparent;
  content: "";
  transform: translateX(-50%);
}

.roulette-3d-viewport.is-spinning .roulette-lens-pin {
  box-shadow: 0 0 16px rgba(255, 212, 87, 0.52);
}

.roulette-render-fallback {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
}

.roulette-3d-viewport.three-ready .roulette-render-fallback {
  display: none;
}

.roulette-render-fallback .european-wheel {
  width: min(86%, 490px);
}

.roulette-live-result {
  position: absolute;
  left: 16px;
  bottom: 16px;
  z-index: 4;
  display: grid;
  grid-template-columns: auto auto;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 10px;
  min-width: 154px;
  padding: 10px 13px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 6px;
  background: rgba(8, 22, 20, 0.86);
  color: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(10px);
}

.roulette-live-result span {
  grid-column: 1 / -1;
  color: #e7ca78;
  font-size: 9px;
  font-weight: 950;
  letter-spacing: 0;
}

.roulette-live-result strong {
  grid-row: 2;
  min-width: 43px;
  font-size: 34px;
  line-height: 1;
}

.roulette-live-result small {
  grid-row: 2;
  max-width: 90px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 9px;
  font-weight: 900;
}

.roulette-live-result.red {
  border-color: #ff6b78;
}

.roulette-live-result.black {
  border-color: #a9b4c2;
}

.roulette-live-result.green {
  border-color: #58d8a6;
}

.roulette-live-result.spinning strong {
  animation: rouletteLivePulse 560ms ease-in-out infinite alternate;
}

.roulette-live-result.landed {
  animation: rouletteResultLand 480ms cubic-bezier(0.2, 1.5, 0.35, 1);
}

@keyframes rouletteLivePulse {
  to {
    opacity: 0.42;
    transform: translateY(-2px);
  }
}

@keyframes rouletteResultLand {
  0% {
    opacity: 0;
    transform: translateY(10px) scale(0.86);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.roulette-experience .roulette-betting-area {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  align-content: center;
  min-width: 0;
  height: var(--roulette-stage-height);
  padding: clamp(10px, 1.3vw, 20px) 0;
}

.roulette-experience .roulette-status-line {
  grid-template-columns: minmax(0, 1fr) minmax(128px, 0.34fr);
  gap: 10px;
  margin-bottom: 14px;
}

.roulette-experience .roulette-selection,
.roulette-experience .result-display {
  min-height: 58px;
  border-radius: 5px;
}

.roulette-experience .roulette-selection {
  display: flex;
  align-items: center;
  gap: 12px;
}

.roulette-experience .roulette-selection strong {
  font-size: 18px;
}

.roulette-experience .roulette-bet-scroll {
  display: grid;
  align-content: center;
  width: 100%;
  min-width: 0;
  overflow: visible;
}

.roulette-experience .roulette-board {
  width: 100%;
  min-width: 0;
  grid-template-columns: minmax(46px, 0.72fr) repeat(12, minmax(38px, 1fr));
  grid-template-rows: repeat(3, clamp(48px, 5.1vh, 58px));
  border-width: 1px;
  border-radius: 4px 4px 0 0;
}

.roulette-experience .roulette-number {
  min-height: 0;
  padding: 0;
  font-size: clamp(13px, 1vw, 17px);
}

.roulette-experience .outside-bets {
  width: 100%;
  min-width: 0;
  margin: 8px 0 16px;
}

.roulette-experience .outside-bets button {
  min-width: 0;
  min-height: 48px;
  padding: 4px;
  font-size: clamp(10px, 0.78vw, 13px);
}

.roulette-experience #spinRoulette {
  min-height: 60px;
  border-radius: 5px;
  font-size: 17px;
  box-shadow: 0 7px 0 #b98208, 0 14px 24px rgba(0, 0, 0, 0.2);
  transition: transform 140ms ease, box-shadow 140ms ease, filter 140ms ease;
}

.roulette-experience #spinRoulette:not(:disabled):active {
  transform: translateY(5px);
  box-shadow: 0 2px 0 #b98208, 0 7px 14px rgba(0, 0, 0, 0.2);
}

.roulette-experience #spinRoulette:disabled {
  filter: saturate(0.6);
}

.roulette-round-panel {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(180px, 0.32fr);
  align-items: center;
  gap: 20px;
  padding: 13px 20px;
  border-top: 1px solid rgba(0, 0, 0, 0.12);
  border-left: 0;
}

.roulette-round-panel h3 {
  margin: 0;
}

.roulette-round-panel .mini-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.roulette-round-panel .mini-stats div {
  padding: 0;
  border: 0;
}

.roulette-round-panel details {
  margin: 0;
  border: 0;
}

#game-roulette.focus-mode {
  padding: 12px;
}

#game-roulette.focus-mode .game-layout {
  min-height: calc(100dvh - 24px);
}

#game-roulette.focus-mode .roulette-experience,
#game-roulette.focus-mode .roulette-machine {
  min-height: 0;
}

#game-roulette.focus-mode .roulette-pro-layout,
#game-roulette.focus-mode .european-wheel-stage,
#game-roulette.focus-mode .roulette-betting-area {
  --roulette-stage-height: calc(100dvh - 190px);
}

@media (max-width: 1280px) and (min-width: 901px) {
  .roulette-experience {
    --roulette-stage-height: clamp(460px, calc(100dvh - 300px), 590px);
  }

  .roulette-experience .roulette-pro-layout {
    grid-template-columns: minmax(330px, 40fr) minmax(500px, 60fr);
  }

  .roulette-experience .roulette-machine {
    padding-inline: 16px;
  }

  .roulette-experience .roulette-board {
    grid-template-columns: 42px repeat(12, minmax(34px, 1fr));
  }
}

@media (max-width: 900px) {
  .roulette-experience {
    --roulette-stage-height: auto;
    margin-inline: -10px;
  }

  .roulette-experience .game-layout {
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .roulette-experience .roulette-machine {
    display: block;
    padding: 12px 10px 18px;
  }

  .roulette-experience .machine-head {
    min-height: 54px;
    padding: 0 4px 9px;
  }

  .roulette-experience .machine-head h2 {
    font-size: 21px;
  }

  .roulette-experience .machine-head .eyebrow {
    font-size: 9px;
  }

  .roulette-experience .inline-field input {
    width: 58px;
    height: 38px;
  }

  .roulette-experience .roulette-pro-layout {
    display: block;
    min-height: 0;
  }

  .roulette-experience .european-wheel-stage {
    height: clamp(350px, 103vw, 440px);
  }

  .roulette-3d-viewport {
    min-height: 0;
    border-radius: 5px;
  }

  .roulette-live-result {
    left: 10px;
    bottom: 10px;
    min-width: 138px;
    padding: 8px 10px;
  }

  .roulette-pocket-lens {
    --lens-cell: 36px;
    --lens-gap: 3px;
    top: 8px;
    width: 204px;
    height: 49px;
  }

  .roulette-lens-track {
    top: 8px;
  }

  .roulette-lens-cell {
    height: 32px;
    font-size: 14px;
  }

  .roulette-lens-pin {
    top: 8px;
    height: 32px;
  }

  .roulette-live-result strong {
    font-size: 30px;
  }

  .roulette-experience .roulette-betting-area {
    display: block;
    height: auto;
    padding: 12px 0 0;
  }

  .roulette-experience .roulette-status-line {
    grid-template-columns: minmax(0, 1fr) 122px;
    padding: 0;
    margin-bottom: 10px;
  }

  .roulette-experience .roulette-selection,
  .roulette-experience .result-display {
    min-height: 52px;
  }

  .roulette-experience .roulette-selection {
    gap: 8px;
    padding-inline: 9px;
  }

  .roulette-experience .roulette-selection strong {
    font-size: 15px;
  }

  .roulette-experience .roulette-bet-scroll {
    display: block;
    padding: 0;
    overflow: visible;
  }

  .roulette-experience .roulette-board {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    grid-template-rows: none;
    gap: 3px;
    min-width: 0;
    padding: 3px;
    overflow: visible;
    border: 1px solid rgba(255, 255, 255, 0.48);
    border-radius: 5px;
    background: rgba(0, 40, 31, 0.52);
  }

  .roulette-experience .roulette-number {
    grid-column: auto !important;
    grid-row: auto !important;
    min-height: 43px;
    border: 0;
    border-radius: 3px;
    font-size: 15px;
  }

  .roulette-experience .roulette-number.zero {
    grid-column: 1 / -1 !important;
    min-height: 40px;
  }

  .roulette-experience .outside-bets {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 3px;
    min-width: 0;
    margin: 6px 0 12px;
  }

  .roulette-experience .outside-bets button,
  .roulette-experience .outside-bets button:nth-last-child(-n+3) {
    grid-column: auto;
    min-height: 43px;
    border-radius: 3px;
    font-size: 11px;
  }

  .roulette-experience #spinRoulette {
    position: static;
    width: 100%;
    min-height: 58px;
    margin: 10px 0 0;
  }

  .roulette-round-panel {
    display: block;
    padding: 14px;
  }

  .roulette-round-panel .mini-stats {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    margin-top: 10px;
  }

  .roulette-round-panel .mini-stats div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    text-align: left;
    border-bottom: 1px solid var(--line);
  }

  .roulette-round-panel .mini-stats span {
    min-width: 0;
    font-size: 12px;
    white-space: nowrap;
  }

  .roulette-round-panel .mini-stats strong {
    font-size: 16px;
  }

  .roulette-round-panel details {
    margin-top: 10px;
  }

  #game-roulette.focus-mode {
    padding: 0;
  }

  #game-roulette.focus-mode .game-layout {
    min-height: 100dvh;
  }
}

@media (max-width: 430px) {
  .roulette-experience .machine-head {
    align-items: center;
  }

  .roulette-experience .machine-head h2 {
    font-size: 18px;
  }

  .roulette-experience .machine-tools {
    gap: 5px;
  }

  .roulette-experience .inline-field {
    gap: 4px;
    font-size: 10px;
  }

  .roulette-experience .inline-field input {
    width: 52px;
  }

  .roulette-experience .european-wheel-stage {
    height: clamp(330px, 99vw, 410px);
  }

  .roulette-experience .roulette-status-line {
    grid-template-columns: minmax(0, 1fr) 106px;
    gap: 5px;
  }

  .roulette-experience .roulette-selection .text-button {
    font-size: 10px;
  }

  .roulette-experience .result-display {
    display: grid;
  }
}

/* Unambiguous roulette payouts */
.roulette-round-panel .roulette-paytable {
  display: grid;
  grid-template-columns: repeat(5, minmax(112px, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #f7f9fb;
}

.roulette-round-panel .roulette-paytable > div {
  display: grid;
  align-content: center;
  min-width: 0;
  min-height: 56px;
  padding: 8px 12px;
  border-right: 1px solid var(--line);
}

.roulette-round-panel .roulette-paytable > div:last-child {
  border-right: 0;
}

.roulette-round-panel .roulette-paytable span {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.roulette-round-panel .roulette-paytable strong {
  color: var(--ink);
  font-size: 18px;
}

@media (max-width: 900px) {
  .lotto-round-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lotto-round-strip > div:nth-child(2) {
    border-right: 0;
  }

  .lotto-round-strip > div:nth-child(-n+2) {
    border-bottom: 1px solid var(--line);
  }

  .roulette-round-panel .roulette-paytable {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 10px;
  }

  .roulette-round-panel .roulette-paytable > div {
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
  }

  .roulette-round-panel .roulette-paytable > div:nth-child(2n) {
    border-right: 0;
  }

  .roulette-round-panel .roulette-paytable > div:last-child {
    grid-column: 1 / -1;
    border-right: 0;
    border-bottom: 0;
  }
}

@media (max-width: 620px) {
  .lotto-draw {
    min-height: 104px;
    padding: 14px 8px;
  }

  .lotto-purchase-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .lotto-purchase-row #buyLotto {
    min-height: 58px;
  }

  .lotto-ticket-numbers span {
    width: 27px;
    height: 27px;
    font-size: 10px;
  }
}

@media (max-width: 430px) {
  .lotto-machine {
    padding-inline: 11px;
  }

  .lotto-round-badge {
    min-width: 78px;
    padding-inline: 9px;
  }

  .lotto-round-strip > div {
    min-height: 56px;
    padding: 8px 9px;
  }

  .lotto-round-strip strong {
    font-size: 12px;
  }

  .lotto-round-strip > div:first-child strong {
    font-size: 17px;
  }

  .draw-ball {
    width: 52px;
    height: 52px;
    border-width: 3px;
    font-size: 20px;
  }

  .lotto-picker {
    padding: 10px 8px;
  }

  .number-grid {
    gap: 4px;
  }

  .number-grid button {
    font-size: 11px;
  }

  .lotto-ticket-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 5px;
  }

  .roulette-round-panel .roulette-paytable {
    grid-template-columns: minmax(0, 1fr);
  }

  .roulette-round-panel .roulette-paytable > div,
  .roulette-round-panel .roulette-paytable > div:nth-child(2n),
  .roulette-round-panel .roulette-paytable > div:last-child {
    grid-column: auto;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    min-height: 44px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .roulette-round-panel .roulette-paytable > div:last-child {
    border-bottom: 0;
  }
}
