/* Grand HiM Casino — Art Deco felt, brass and bad advice. */
:root {
  --felt-0: #17654d;
  --felt-1: #0b3d2e;
  --felt-2: #061f18;
  --gold: #d4af37;
  --gold-soft: #f0d27a;
  --gold-deep: #8a6d24;
  --cream: #f4e9d0;
  --cream-dim: #c9b98f;
  --ink: #14100b;
  --ok: #9fe6b0;
  --bad: #ffb3a3;
}

* { box-sizing: border-box; }

html { min-height: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--cream);
  font-family: Georgia, "Times New Roman", serif;
  text-align: center;
  background:
    radial-gradient(1100px 650px at 50% -8%, var(--felt-0) 0%, var(--felt-1) 48%, var(--felt-2) 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

/* A whisper of woven felt, not a texture download. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .14;
  background-image: repeating-linear-gradient(45deg, rgba(255, 255, 255, .09) 0 1px, transparent 1px 5px);
  mix-blend-mode: soft-light;
}

header, main, .house-note, .foot, .noscript { position: relative; z-index: 1; }

/* --- masthead ------------------------------------------------------------- */
.masthead { padding: clamp(26px, 5vw, 54px) 20px 4px; }

.eyebrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 0 0 12px;
  font-size: 10px;
  letter-spacing: .32em;
  text-transform: uppercase;
  color: var(--gold);
}

.rule {
  width: clamp(24px, 7vw, 90px);
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212, 175, 55, .75));
}
.rule:last-child { background: linear-gradient(90deg, rgba(212, 175, 55, .75), transparent); }

h1 {
  margin: 0;
  font-size: clamp(38px, 6vw, 68px);
  font-weight: 400;
  font-variant: small-caps;
  letter-spacing: .06em;
  color: var(--cream);
  text-shadow: 0 3px 0 rgba(0, 0, 0, .45);
}

.tagline {
  margin: 10px 0 0;
  font-size: clamp(12px, 1.6vw, 15px);
  font-style: italic;
  letter-spacing: .08em;
  color: var(--cream-dim);
}

.sep { color: var(--gold); padding: 0 .35em; }

/* --- table + wheel -------------------------------------------------------- */
.layout {
  display: grid;
  grid-template-columns: minmax(320px, 560px) minmax(300px, 360px);
  gap: clamp(26px, 4.5vw, 64px);
  align-items: center;
  justify-content: center;
  max-width: 1080px;
  margin: 0 auto;
  padding: clamp(18px, 3vw, 36px) 22px 0;
}

.wheel-wrap {
  position: relative;
  width: min(560px, 88vw);
  margin: 0 auto;
  filter: drop-shadow(0 30px 45px rgba(0, 0, 0, .5));
  container-type: inline-size;
}

#wheel {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 3.4s cubic-bezier(.12, .7, .12, 1);
  will-change: transform;
}

.pointer {
  position: absolute;
  top: -14px;
  left: 50%;
  z-index: 3;
  width: 20px;
  height: 30px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, var(--gold-soft), var(--gold-deep));
  clip-path: polygon(50% 100%, 0 0, 100% 0);
  filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .55));
}

.hub-cap {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1%;
  width: 38%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border: 2px solid var(--gold-deep);
  border-radius: 50%;
  background: radial-gradient(circle at 50% 35%, #17251d 0%, #0a1712 65%, #050d0a 100%);
  box-shadow: 0 12px 24px rgba(0, 0, 0, .6), inset 0 0 0 1px rgba(240, 210, 122, .35);
  pointer-events: none;
}
.hub-cap::before {
  content: "";
  position: absolute;
  inset: 7%;
  border: 1px solid rgba(212, 175, 55, .35);
  border-radius: 50%;
}

.hub-top {
  font-size: 16px;
  font-size: clamp(9px, 4.2cqw, 22px);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--gold-soft);
}
.hub-suit { font-size: 22px; font-size: clamp(14px, 6cqw, 34px); line-height: 1; color: var(--cream); }
.hub-bottom {
  font-size: 10px;
  font-size: clamp(7px, 2.6cqw, 14px);
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--gold);
}

.table-caption {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px 10px;
  margin: 14px 0 0;
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: rgba(201, 185, 143, .75);
}
.table-caption span { white-space: nowrap; }

/* --- wheel segments ------------------------------------------------------- */
#rotor use[data-pocket] {
  stroke: rgba(4, 16, 12, .55);
  stroke-width: 1.2;
  cursor: pointer;
  transition: filter .18s ease, stroke .18s ease;
}
#rotor use[data-pocket]:hover { filter: brightness(1.2); }
#rotor use[data-pocket]:focus { outline: none; stroke: var(--cream); stroke-width: 3; }
#rotor use[data-pocket].bet { stroke: var(--gold-soft); stroke-width: 3; filter: brightness(1.15); }
#rotor use[data-pocket].hit {
  stroke: #fff3c9;
  stroke-width: 3.5;
  filter: brightness(1.5);
  animation: pocketPulse 1.15s ease-in-out infinite;
}

@keyframes pocketPulse {
  0%, 100% { filter: brightness(1.35); }
  50% { filter: brightness(1.75); }
}

#rotor text {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 14px;
  font-weight: 700;
  fill: #fff7e6;
  paint-order: stroke;
  stroke: rgba(0, 0, 0, .6);
  stroke-width: 3px;
  text-anchor: middle;
  dominant-baseline: middle;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
  /* Counter-rotated by the script so the numbers stay upright while the
     wheel (and their pockets) turns underneath them. */
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 3.4s cubic-bezier(.12, .7, .12, 1);
  will-change: transform;
}

.pockets-large #rotor text { font-size: 22px; }
.pockets-medium #rotor text { font-size: 18px; }
.pockets-small #rotor text { font-size: 14px; }

.ball {
  opacity: 0;
  transition: opacity .25s ease;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .6));
}
.ball.show { opacity: 1; }

/* --- betting console ------------------------------------------------------ */
.console {
  position: relative;
  padding: 24px 24px 20px;
  text-align: left;
  border: 1px solid rgba(212, 175, 55, .5);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(10, 32, 24, .94), rgba(5, 20, 15, .97));
  box-shadow: 0 24px 55px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .06);
}
.console::after {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(212, 175, 55, .16);
  border-radius: 9px;
  pointer-events: none;
}

.console-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(212, 175, 55, .18);
}

.console-kicker {
  margin: 0 0 4px;
  font-size: 9px;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--gold);
}

.console h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 400;
  font-variant: small-caps;
  letter-spacing: .04em;
}

.gold { color: var(--gold-soft); }

.credit-line {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  font-size: 13px;
  color: var(--cream-dim);
  white-space: nowrap;
}
.credit-line strong { font-size: 20px; color: var(--cream); }

.coin {
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff4c4, var(--gold) 55%, #7c5e1c);
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .18), 0 1px 2px rgba(0, 0, 0, .4);
}

.bet-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 16px 0 12px;
  font-size: 12px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--cream-dim);
}

.pocket-select {
  appearance: none;
  -webkit-appearance: none;
  min-width: 64px;
  height: 38px;
  padding: 0 32px 0 14px;
  border: 1px solid rgba(212, 175, 55, .45);
  border-radius: 9px;
  background: rgba(212, 175, 55, .1);
  color: var(--gold-soft);
  font: 700 20px Georgia, "Times New Roman", serif;
  text-align: center;
  text-align-last: center;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.pocket-select:hover { border-color: var(--gold-soft); background: rgba(212, 175, 55, .16); }
.pocket-select:focus-visible { outline: 2px solid var(--gold-soft); outline-offset: 3px; }
.pocket-select:disabled { opacity: .55; cursor: wait; }
.pocket-select option { background: #0a1712; color: var(--cream); }

.select-wrap { position: relative; display: inline-flex; align-items: center; }
.select-chevron {
  position: absolute;
  right: 10px;
  color: var(--gold-soft);
  font-size: 11px;
  line-height: 1;
  pointer-events: none;
}

.chip-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 18px;
}

.chip-btn {
  --chip-bg: #efe6d0;
  --chip-fg: #17120d;
  width: 50px;
  height: 50px;
  border: 2px dashed rgba(0, 0, 0, .38);
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 255, 255, .55), transparent 42%),
    var(--chip-bg);
  color: var(--chip-fg);
  font: 700 15px Georgia, "Times New Roman", serif;
  cursor: pointer;
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, .16), 0 5px 12px rgba(0, 0, 0, .35);
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.chip-btn[data-bet="5"] { --chip-bg: #a91d22; --chip-fg: #fff4e0; border-color: rgba(255, 255, 255, .35); }
.chip-btn[data-bet="10"] { --chip-bg: #1f3a5f; --chip-fg: #eaf2ff; border-color: rgba(255, 255, 255, .3); }
.chip-btn[data-bet="25"] { --chip-bg: #0e6b3d; --chip-fg: #eafff1; border-color: rgba(255, 255, 255, .3); }
.chip-btn:hover { transform: translateY(-3px); }
.chip-btn:focus-visible { outline: 2px solid var(--gold-soft); outline-offset: 3px; }
.chip-btn:disabled { opacity: .55; cursor: wait; transform: none; }
.chip-btn.is-active {
  border-style: solid;
  border-color: var(--gold-soft);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, .24), inset 0 0 0 4px rgba(255, 255, 255, .16), 0 6px 14px rgba(0, 0, 0, .4);
  transform: translateY(-2px);
}

.spin-btn {
  display: block;
  width: 100%;
  padding: 12px 16px 13px;
  border: 1px solid #7a5e1e;
  border-radius: 10px;
  background: linear-gradient(180deg, #f2d782 0%, var(--gold) 52%, #a9822a 100%);
  color: var(--ink);
  font: 700 19px Georgia, "Times New Roman", serif;
  letter-spacing: .32em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 5px 0 #6b5118, 0 12px 24px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .55);
  transition: transform .08s ease, box-shadow .08s ease, filter .15s ease;
}
.spin-btn small {
  display: block;
  margin-top: 2px;
  font: 400 8px Georgia, "Times New Roman", serif;
  letter-spacing: .38em;
  opacity: .7;
}
.spin-btn:hover:not(:disabled) { filter: brightness(1.06); }
.spin-btn:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 #6b5118, 0 6px 12px rgba(0, 0, 0, .3); }
.spin-btn:disabled { filter: grayscale(.55) brightness(.85); cursor: wait; }
.spin-btn:focus-visible { outline: 2px solid var(--cream); outline-offset: 3px; }

.msg {
  min-height: 44px;
  margin: 16px 0 10px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--cream-dim);
}
.msg.good { color: var(--ok); }
.msg.bad { color: var(--bad); }

.history-wrap {
  padding-top: 12px;
  border-top: 1px solid rgba(212, 175, 55, .18);
}
.history-wrap h3 {
  margin: 0 0 8px;
  font-size: 9px;
  font-weight: 400;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--gold);
}

.history {
  display: grid;
  gap: 6px;
  max-height: 132px;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
}
.history:empty::after {
  content: "No spins yet.";
  font-size: 12px;
  color: rgba(201, 185, 143, .55);
}
.history li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--cream-dim);
}
.history .chip {
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 50%;
}
.history .amount { margin-left: auto; font-variant-numeric: tabular-nums; }
.history .amount.plus { color: var(--ok); }
.history .amount.minus { color: var(--bad); }

/* --- house note + footer -------------------------------------------------- */
.house-note {
  max-width: 760px;
  margin: clamp(26px, 4vw, 44px) auto 0;
  padding: 18px 24px 16px;
  border-top: 1px solid rgba(212, 175, 55, .28);
  border-bottom: 1px solid rgba(212, 175, 55, .28);
  background: linear-gradient(90deg, transparent, rgba(212, 175, 55, .045), transparent);
}
.house-note p {
  max-width: 620px;
  margin: 0 auto;
  font-size: 14px;
  font-style: italic;
  line-height: 1.65;
  color: var(--cream-dim);
}
.ornament { padding: 0 .5em; color: var(--gold); font-style: normal; }
.house-note .fineprint {
  margin-top: 8px;
  font-size: 11px;
  font-style: normal;
  letter-spacing: .04em;
  color: rgba(201, 185, 143, .65);
}

.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 10px;
  padding: 26px 16px 34px;
  font-size: 10px;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: rgba(201, 185, 143, .55);
}
.foot .sep { color: rgba(212, 175, 55, .6); }

.noscript { margin: 20px auto 0; color: var(--bad); }

/* --- responsive / motion -------------------------------------------------- */
@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
    gap: 30px;
    max-width: 600px;
  }
  .console { width: 100%; max-width: 560px; margin: 0 auto; }
  .wheel-wrap { width: min(520px, 88vw); }
}

@media (max-width: 480px) {
  .masthead { padding-top: 24px; }
  .console { padding: 20px 18px 18px; }
  .chip-btn { width: 44px; height: 44px; }
  .credit-line strong { font-size: 18px; }
  .house-note { padding: 16px 14px; }
  .table-caption .sep, .foot .sep { display: none; }
  .foot { gap: 6px 16px; }
}

@media (prefers-reduced-motion: reduce) {
  #wheel { transition-duration: .01s; }
  #rotor text { transition-duration: .01s; }
  #rotor use[data-pocket], .chip-btn, .spin-btn, .ball { transition: none; }
  #rotor use[data-pocket].hit { animation: none; }
}
