@font-face {
  font-family: "Sunset Display";
  src: url("/frontend/assets/font1.woff") format("woff");
  font-display: swap;
}

:root {
  color-scheme: dark;
  --felt: #0d4d37;
  --felt-dark: #06271c;
  --gold: #ddb358;
  --cream: #f8e9c5;
  --muted: #c3b593;
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  min-height: 100svh;
  margin: 0;
  color: var(--cream);
  background:
    radial-gradient(circle at 50% 0, rgba(35, 126, 87, .48), transparent 40%),
    linear-gradient(145deg, #061b14, #020b08 72%);
  font-family: Arial, sans-serif;
}

button,
a { font: inherit; }

button:focus-visible,
a:focus-visible {
  outline: 3px solid #fff1b4;
  outline-offset: 3px;
}

.roulette-loading {
  display: grid;
  min-height: 100svh;
  place-items: center;
  color: var(--muted);
}

.roulette-shell {
  width: min(1320px, calc(100% - 28px));
  margin: 0 auto;
  padding: 18px 0 34px;
}

.roulette-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 0 15px;
  border-bottom: 1px solid rgba(221, 179, 88, .32);
}

.roulette-brand {
  display: flex;
  align-items: center;
  gap: 13px;
  color: var(--cream);
  text-decoration: none;
}

.roulette-back {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid rgba(221, 179, 88, .5);
  border-radius: 50%;
  background: rgba(0, 0, 0, .22);
  font-size: 20px;
}

.roulette-brand-copy { display: grid; gap: 3px; }

.roulette-brand-copy strong {
  font-family: "Sunset Display", Georgia, serif;
  font-size: 20px;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.roulette-brand-copy span,
.mode-pill {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.mode-pill {
  padding: 8px 12px;
  color: #fff1c4;
  border: 1px solid rgba(221, 179, 88, .48);
  border-radius: 999px;
  background: rgba(0, 0, 0, .22);
}

.roulette-stage {
  display: grid;
  grid-template-columns: minmax(310px, .72fr) minmax(600px, 1.45fr);
  align-items: center;
  gap: clamp(24px, 4vw, 58px);
  padding: 28px 0 18px;
}

.wheel-panel {
  display: grid;
  justify-items: center;
  gap: 16px;
}

.wheel-panel .roulette-wheel-container {
  width: 374px;
  max-width: none;
}

.result-panel {
  min-height: 56px;
  text-align: center;
}

.result-panel strong {
  display: block;
  color: #fff1bf;
  font-family: "Sunset Display", Georgia, serif;
  font-size: 25px;
  text-transform: uppercase;
}

.result-panel span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.table-panel {
  min-width: 0;
  padding: clamp(16px, 2vw, 24px);
  overflow-x: auto;
  border: 1px solid rgba(221, 179, 88, .35);
  border-radius: 12px;
  background:
    linear-gradient(rgba(7, 63, 43, .92), rgba(5, 43, 30, .96)),
    var(--felt);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .38), inset 0 0 60px rgba(0, 0, 0, .2);
}

.table-panel .roulette-table-container {
  min-width: 590px;
  margin: 0 auto;
}

.controls {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 18px 20px;
  border: 1px solid rgba(221, 179, 88, .3);
  border-radius: 10px;
  background: rgba(2, 16, 11, .8);
}

.chip-area {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  min-width: 0;
  align-items: center;
  gap: 20px;
}

.chip-area .roulette-chips-list {
  gap: 14px;
  margin: 0;
}

.chip-area .roulette-chips-list li { margin-right: 0; }

.chip-area .roulette-chips-list li p {
  color: #24180d;
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 1px rgba(255, 255, 255, .55);
}

.table-panel .roulette-table-container .chip {
  width: 35px;
  height: 35px;
  color: #24180d;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 1px rgba(255, 255, 255, .7);
}

.balance-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(110px, auto));
  align-items: center;
  gap: 22px;
  white-space: nowrap;
}

.balance-item { display: grid; gap: 4px; }

.balance-item span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.balance-item strong {
  color: #fff0bd;
  font-size: 18px;
}

.balance-item small {
  color: #8c8067;
  font-size: 8px;
  line-height: 1;
}

.balance-item--payout {
  padding-left: 20px;
  border-left: 1px solid rgba(117, 214, 154, .28);
}

.balance-item--payout strong {
  color: #75d69a;
  text-shadow: 0 0 18px rgba(117, 214, 154, .14);
}

.control-actions {
  display: flex;
  gap: 10px;
}

.clear-button,
.spin-button {
  min-height: 48px;
  padding: 0 20px;
  cursor: pointer;
  border-radius: 6px;
  font-weight: 900;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.clear-button {
  color: #ddcfaa;
  border: 1px solid rgba(221, 179, 88, .35);
  background: transparent;
}

.spin-button {
  min-width: 138px;
  color: #201302;
  border: 1px solid #ffe398;
  background: linear-gradient(#f7d271, #bd8323);
  box-shadow: 0 6px 22px rgba(221, 179, 88, .18);
}

.clear-button:disabled,
.spin-button:disabled {
  cursor: not-allowed;
  opacity: .45;
}

.roulette-error {
  margin: 12px 0 0;
  color: #ffb3a6;
  font-size: 12px;
  text-align: right;
}

.upstream-note {
  margin: 14px 0 0;
  color: #897e67;
  font-size: 10px;
  text-align: center;
}

.roulette-player-header {
  width: min(1320px, calc(100% - 28px));
  margin: 18px auto 0;
}

@media (max-width: 980px) {
  .roulette-stage { grid-template-columns: 1fr; }
  .controls { grid-template-columns: 1fr; }
  .control-actions { justify-content: flex-end; }
}

@media (max-width: 620px) {
  .roulette-shell { width: min(100% - 16px, 1320px); padding-top: 8px; }
  .roulette-header { gap: 10px; }
  .roulette-brand-copy strong { font-size: 16px; }
  .roulette-brand-copy span { display: none; }
  .roulette-stage { padding-top: 18px; }
  .wheel-panel .roulette-wheel-container {
    width: 374px;
    zoom: .9;
  }
  .table-panel { padding: 10px; }
  .controls { padding: 14px; }
  .chip-area {
    grid-template-columns: 1fr;
    align-items: start;
  }
  .balance-strip {
    width: 100%;
    grid-row: 1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    white-space: normal;
  }
  .balance-item strong { font-size: 14px; }
  .balance-item--payout { padding-left: 10px; }
  .control-actions { display: grid; grid-template-columns: 1fr 1.4fr; }
  .clear-button,
  .spin-button { padding: 0 12px; }
  .roulette-player-header { width: min(100% - 16px, 1320px); margin-top: 8px; }
}

@media (max-width: 380px) {
  .wheel-panel .roulette-wheel-container { zoom: .82; }
}

@media (max-width: 340px) {
  .wheel-panel .roulette-wheel-container { zoom: .75; }
  .balance-item strong { font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
}
