:root {
  --tmw-cyan: #00cccc;
  --tmw-bright: #88ffff;
  --tmw-ink: #02090a;
  --tmw-panel: #071a1c;
  --tmw-bone: #e9dfc9;
  --tmw-gold: #e5b45b;
  --tmw-red: #8f2932;
}

[hidden] { display: none !important; }

.tmw-shell { max-width: 1240px; }
.tmw-muted { margin: .3rem 0 0; color: #9ab7b7; font-size: .83rem; }
.tmw-kicker { margin: 0; color: var(--tmw-gold) !important; font-size: .62rem !important; letter-spacing: .2em; text-transform: uppercase; }
.tmw-primary { background: #0b5555 !important; }

.tmw-account {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: center;
  gap: .65rem;
  margin: 1rem auto;
  padding: .8rem;
  border: 1px solid #17666b;
  background: linear-gradient(180deg, rgba(8, 34, 37, .95), rgba(2, 13, 15, .95));
  box-shadow: inset 0 0 25px rgba(0, 204, 204, .08);
}
.tmw-field { flex: 1 1 240px; max-width: 350px; }
.tmw-field label { display: block; margin-bottom: .25rem; color: #9adfe0; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; }
.tmw-account input,
.tmw-account button,
.tmw-builder input,
.tmw-builder select,
.tmw-controls button,
.tmw-slip button,
.tmw-outside-grid button,
.tmw-number-grid button,
.tmw-modal button {
  min-height: 40px;
  border: 1px solid #188b91;
  color: #dffefe;
  background: #07191c;
  font-family: Cinzel, serif;
}
.tmw-account input, .tmw-builder input, .tmw-builder select { box-sizing: border-box; width: 100%; padding: .55rem .65rem; }
.tmw-account button,
.tmw-builder button,
.tmw-controls button,
.tmw-slip button,
.tmw-outside-grid button,
.tmw-number-grid button,
.tmw-chip,
.tmw-modal button {
  cursor: url('/images/cursors/hover.cur') 11 0, url('/images/cursors/hover.png') 11 0, pointer;
}
.tmw-account button:hover, .tmw-builder button:hover, .tmw-controls button:hover,
.tmw-slip button:hover, .tmw-outside-grid button:hover, .tmw-number-grid button:hover,
.tmw-modal button:hover { border-color: var(--tmw-bright); color: #fff; box-shadow: 0 0 14px rgba(0, 255, 255, .25); }
.tmw-account button:disabled, .tmw-controls button:disabled, .tmw-slip button:disabled { cursor: not-allowed; opacity: .46; }
.tmw-balance { display: flex; min-width: 130px; align-items: center; justify-content: center; gap: .4rem; padding: .2rem .55rem; border: 1px solid rgba(229, 180, 91, .55); background: #0d0c08; }
.tmw-balance img { width: 34px; height: 34px; object-fit: contain; }
.tmw-balance strong { display: block; color: #ffe08a; font-size: 1.2rem; line-height: 1; }
.tmw-balance small { display: block; color: #96886c; font-size: .62rem; text-transform: uppercase; }
.tmw-restore { display: grid; flex: 1 1 270px; grid-template-columns: minmax(160px, 1fr) auto; max-width: 370px; gap: .4rem; }

.tmw-play { display: grid; grid-template-columns: minmax(220px, .78fr) minmax(0, 1.6fr); gap: 1rem; margin-top: 1.15rem; padding: 1rem; border: 1px solid #245c60; background: radial-gradient(circle at 25% 20%, rgba(38, 100, 90, .21), transparent 48%), linear-gradient(145deg, #091e1c, #030b0d 70%); box-shadow: inset 0 0 50px rgba(0, 0, 0, .35), 0 16px 40px rgba(0, 0, 0, .32); }
.tmw-wheel-column { display: flex; min-width: 0; flex-direction: column; align-items: center; gap: .7rem; }
.tmw-wheel-stage {
  position: relative;
  width: min(100%, 400px);
  aspect-ratio: 1;
  box-sizing: border-box;
  padding: 3.2%;
  border: 2px solid #9a8654;
  border-radius: 50%;
  background: radial-gradient(circle, #11191a 0 60%, #665533 61% 65%, #090d0e 66% 100%);
  box-shadow: 0 0 28px rgba(0, 224, 224, .21), inset 0 0 22px #000;
  overflow: visible;
  isolation: isolate;
}
.tmw-wheel {
  position: relative;
  width: 100%;
  height: 100%;
  border: 2px solid #c39b54;
  border-radius: 50%;
  background: #080d0e;
  box-shadow: inset 0 0 0 5px #24190f, inset 0 0 22px #000, 0 0 0 2px #17100a;
  overflow: hidden;
  transform: rotate(var(--wheel-rotation, 0deg));
  transform-origin: 50% 50%;
  transition: transform 3.15s cubic-bezier(.1, .72, .18, 1);
  will-change: transform;
}
.tmw-pocket-overlay {
  position: absolute;
  z-index: 1;
  inset: 0;
  overflow: visible;
  pointer-events: none;
}
.tmw-pocket-ring {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.tmw-pocket {
  stroke: #1a120d;
  stroke-width: .45;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.tmw-pocket.is-red { fill: #8f2932; }
.tmw-pocket.is-black { fill: #11191a; }
.tmw-pocket.is-green { fill: #17613e; }
.tmw-pocket-label {
  fill: #fff8e4;
  font-family: Georgia, serif;
  font-size: 3.25px;
  font-weight: 700;
  letter-spacing: -.12px;
  paint-order: stroke;
  stroke: #050707;
  stroke-width: .7px;
  stroke-linejoin: round;
}
.tmw-pocket-label.is-green { fill: #d5ffe6; }
.tmw-pocket-inner {
  fill: none;
  stroke: #c39b54;
  stroke-width: .8;
  vector-effect: non-scaling-stroke;
}
.tmw-wheel-crown {
  position: absolute;
  z-index: 2;
  inset: 28%;
  display: grid;
  place-items: center;
  border: 3px solid #8e6d36;
  border-radius: 50%;
  background:
    repeating-conic-gradient(from 22.5deg, rgba(230, 180, 85, .9) 0 2deg, transparent 2deg 88deg),
    radial-gradient(circle, #e5bd70 0 8%, #4a2d16 9% 17%, #c59347 18% 21%, #15100b 22% 55%, #68451f 56% 62%, #0a1112 63%);
  box-shadow: 0 0 0 5px #19100a, 0 0 0 7px #b38948, inset 0 0 18px #000;
}
.tmw-wheel-crown span {
  width: 22%;
  aspect-ratio: 1;
  border: 2px solid #f0d28d;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff2c3, #b0792d 45%, #25150a 72%);
  box-shadow: 0 0 9px rgba(255, 222, 145, .4);
}
.tmw-ball-track { position: absolute; z-index: 5; inset: 7.2%; border-radius: 50%; pointer-events: none; transform: rotate(0deg); }
.tmw-ball {
  position: absolute;
  top: 0;
  left: 50%;
  width: 11px;
  height: 11px;
  border: 1px solid #9b927f;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, #f0e6cc 55%, #8d846f 100%);
  box-shadow: 0 0 7px 2px rgba(255, 255, 255, .8);
  opacity: 0;
  transform: translate(-50%, -45%);
  transition: opacity .18s;
}
.tmw-wheel-stage.is-spinning .tmw-ball-track { animation: tmw-ball-orbit .72s linear infinite; }
.tmw-wheel-stage.is-spinning .tmw-ball,
.tmw-wheel-stage.has-result .tmw-ball { opacity: 1; }
@keyframes tmw-ball-orbit { to { transform: rotate(360deg); } }
.tmw-pointer { position: absolute; z-index: 6; top: -6px; left: calc(50% - 11px); width: 0; height: 0; border-right: 11px solid transparent; border-left: 11px solid transparent; border-top: 23px solid var(--tmw-gold); filter: drop-shadow(0 2px 2px #000); }
.tmw-result { display: grid; min-width: 180px; grid-template-columns: auto 1fr; grid-template-rows: auto auto; align-items: center; gap: 0 .7rem; padding: .5rem .9rem; border: 1px solid #655737; background: rgba(2, 10, 11, .9); }
.tmw-result-label { grid-column: 1 / -1; color: #a9beb5; font-size: .62rem; letter-spacing: .15em; text-transform: uppercase; }
.tmw-result strong { color: var(--tmw-bone); font-family: Georgia, serif; font-size: 2rem; line-height: 1; }
.tmw-result strong.is-red { color: #ff929a; }.tmw-result strong.is-black { color: #fff; }.tmw-result strong.is-green { color: #9effc6; }
.tmw-result span:last-child { color: #a8c8c8; font-size: .78rem; }

.tmw-layout { display: grid; min-width: 0; grid-template-rows: auto 1fr; gap: .75rem; }
.tmw-table-wrap { min-width: 0; padding: .55rem; border: 1px solid #635535; background: rgba(1, 10, 11, .76); }
.tmw-number-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; }
.tmw-number-grid button { min-width: 0; min-height: 38px; border-color: #396867; color: #e8ffff; background: #071c1d; font-family: Georgia, serif; font-size: 1rem; font-weight: 700; }
.tmw-number-grid button.is-red { background: linear-gradient(145deg, #7f2934, #341217); }.tmw-number-grid button.is-black { background: linear-gradient(145deg, #253335, #090e0f); }
.tmw-number-grid button.is-zero { grid-column: 1 / -1; border-color: #4e8b62; color: #b9ffdb; background: linear-gradient(145deg, #17452f, #081711); }
.tmw-number-grid button.is-selected { box-shadow: inset 0 0 0 2px #ffe08a, 0 0 10px rgba(255, 224, 138, .32); }
.tmw-outside-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 3px; margin-top: .45rem; }
.tmw-outside-grid button { min-width: 0; padding: .35rem .15rem; border-color: #496866; font-size: .65rem; }
.tmw-outside-grid button.is-red { border-color: #9c3b48; color: #ffb8bf; }.tmw-outside-grid button.is-black { border-color: #788f90; color: #e8ffff; }

.tmw-slip { min-height: 180px; padding: .65rem; border: 1px solid #245c60; background: #041011; }
.tmw-slip-head { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; border-bottom: 1px solid #1d4a4c; }
.tmw-slip h2 { margin: 0 0 .35rem; color: var(--tmw-bone); font-size: 1rem; }
.tmw-slip-head span { color: #88b8b8; font-size: .68rem; }
.tmw-slip-list { display: grid; max-height: 225px; gap: .25rem; overflow: auto; margin: .5rem 0; padding: 0 0 0 1.45rem; }
.tmw-slip-list li { padding: .25rem .3rem; color: #d9eeee; font-size: .72rem; }
.tmw-slip-list li:not(.empty-cell) { border-bottom: 1px solid rgba(27, 92, 94, .45); }
.tmw-slip-list button { float: right; min-height: 24px; padding: .1rem .35rem; font-size: .65rem; }
.tmw-slip-actions { display: flex; flex-wrap: wrap; gap: .35rem; }.tmw-slip-actions button { flex: 1 1 70px; min-height: 34px; padding: .2rem; font-size: .67rem; }

.tmw-controls { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .75rem; margin-top: .9rem; padding: .75rem; border: 1px solid #635535; background: linear-gradient(#1b1a14, #080907); }
.tmw-chip-picker { min-width: 0; }.tmw-control-label { display: block; margin-bottom: .25rem; color: #a99e82; font-size: .62rem; letter-spacing: .15em; text-transform: uppercase; }
.tmw-chip-row { display: flex; flex-wrap: wrap; align-items: end; gap: .25rem; }
.tmw-chip { display: grid; width: 49px; height: 49px; place-items: center; padding: 2px; border: 1px solid transparent; border-radius: 50%; background: transparent; }
.tmw-chip img { width: 100%; height: 100%; object-fit: contain; }.tmw-chip.is-selected { border-color: #fff0a9; box-shadow: 0 0 11px rgba(255, 224, 138, .55); }
.tmw-spin-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .4rem; }.tmw-spin-actions button { min-height: 44px; padding: .5rem .8rem; }
.tmw-spin { border-color: #d2a452 !important; color: #fff4cf !important; background: radial-gradient(circle at 50% 20%, #277879, #0a3839 62%, #061717) !important; box-shadow: inset 0 0 0 2px #0d1110, inset 0 0 0 3px #9b7a3b; font-weight: 700; }
.tmw-message { grid-column: 1 / -1; min-height: 1.2rem; margin: 0; color: #cce6e3; font-size: .78rem; text-align: center; }.tmw-message[data-tone="win"] { color: #ffe496; }.tmw-message[data-tone="lose"] { color: #ff9da5; }

.tmw-builder { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(290px, 1.5fr); gap: .7rem 1rem; align-items: end; margin-top: 1rem; padding: .9rem; border: 1px solid #245c60; background: linear-gradient(145deg, rgba(8, 27, 30, .95), rgba(2, 11, 13, .95)); }
.tmw-builder h2 { margin: .15rem 0 0; color: #baffff; font-size: 1.1rem; }.tmw-builder-form { display: grid; grid-template-columns: auto minmax(115px, 1fr) auto minmax(130px, 1.2fr) auto; gap: .35rem; align-items: center; }.tmw-builder-form label { color: #9dbcbc; font-size: .7rem; }.tmw-builder-form select, .tmw-builder-form input { min-height: 38px; padding: .35rem; font-size: .76rem; }.tmw-builder-form button { min-height: 38px; padding: .35rem .65rem; font-size: .72rem; }.tmw-builder-help { grid-column: 1 / -1; margin: 0; color: #759494; font-size: .7rem; }

.tmw-history { margin-top: 1rem; padding: .8rem; border: 1px solid #245c60; background: #041011; }.tmw-history h2 { margin: 0; color: #baffff; font-size: 1rem; }.tmw-history-list { display: flex; flex-wrap: wrap; gap: .35rem; margin: .65rem 0 0; padding: 0; list-style: none; }.tmw-history-list li { min-width: 35px; padding: .35rem .5rem; border: 1px solid #315b5b; color: #e8f7e9; background: #112727; font-family: Georgia, serif; text-align: center; }.tmw-history-list li.is-red { border-color: #8c3541; color: #ffb9c0; background: #35151b; }.tmw-history-list li.is-green { border-color: #4f8966; color: #a8ffca; background: #122b1d; }.tmw-history-list li small { display: block; color: #8da8a4; font-family: Cinzel, serif; font-size: .5rem; }
.tmw-divider { max-width: 1080px; margin: 2rem auto 1rem; border: 0; border-top: 1px solid rgba(0, 204, 204, .35); }.leaderboard { max-width: 1080px; margin: 0 auto; }.leaderboard h2 { color: #aefefe; }#lbTable { width: 100%; border-collapse: collapse; border: 1px solid #008b8b; }#lbTable th, #lbTable td { padding: .55rem; border: 1px solid #008b8b; text-align: left; }#lbTable th { color: #aefefe; background: rgba(0, 204, 204, .14); }#lbTable td:last-child, #lbTable th:last-child { text-align: right; }.empty-cell { color: #71898a; font-style: italic; text-align: center !important; }

.tmw-modal { position: fixed; z-index: 10000; inset: 0; place-items: center; padding: 1rem; background: rgba(0, 0, 0, .86); }.tmw-modal:not([hidden]) { display: grid !important; }.tmw-modal > div { max-width: 560px; padding: 1.4rem; border: 1px solid #00aeb5; background: #061416; box-shadow: 0 0 35px rgba(0, 204, 204, .25); }.tmw-modal h2 { margin-top: 0; color: #baffff; }.tmw-modal code { display: block; overflow-wrap: anywhere; padding: .8rem; border: 1px solid #6c6044; color: #ffe294; background: #020606; }.tmw-modal-actions { display: flex; justify-content: flex-end; gap: .6rem; margin-top: 1rem; }.tmw-modal button { min-height: 40px; padding: .4rem .7rem; }
.sr-only { position: absolute; overflow: hidden; width: 1px; height: 1px; clip: rect(0, 0, 0, 0); white-space: nowrap; }

@media (max-width: 980px) {
  .tmw-play { grid-template-columns: minmax(180px, .62fr) minmax(0, 1.8fr); padding: .65rem; }
  .tmw-outside-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tmw-builder { grid-template-columns: 1fr; }.tmw-builder-form { grid-template-columns: auto minmax(110px, 1fr) auto minmax(130px, 1fr) auto; }
}
@media (max-width: 720px) {
  .tmw-account { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: stretch; }
  .tmw-field { grid-column: 1 / -1; max-width: none; }
  .tmw-balance { min-width: 0; }
  .tmw-restore { grid-column: 1 / -1; width: 100%; max-width: none; }
  .tmw-play { grid-template-columns: 1fr; padding: .65rem; }
  .tmw-wheel-stage { width: min(78vw, 330px); }
  .tmw-wheel-column { order: 0; }
  .tmw-layout { order: 1; }
  .tmw-slip { min-height: 0; }
  .tmw-slip-list { max-height: 130px; }
  .tmw-controls { grid-template-columns: 1fr; }
  .tmw-chip-row { flex-wrap: nowrap; overflow-x: auto; padding: .15rem 0 .35rem; scrollbar-width: thin; }
  .tmw-chip { flex: 0 0 46px; width: 46px; height: 46px; }
  .tmw-spin-actions { justify-content: stretch; }
  .tmw-spin-actions button { flex: 1 1 45%; }
}
@media (max-width: 500px) {
  .tmw-shell { min-width: 0; overflow: clip; }
  .tmw-account { gap: .45rem; margin: .75rem auto; padding: .6rem; }
  .tmw-account input, .tmw-builder input, .tmw-builder select { font-size: 16px; }
  .tmw-account button { padding-inline: .45rem; font-size: .72rem; }
  .tmw-balance { padding-inline: .4rem; }
  .tmw-balance img { width: 30px; height: 30px; }
  .tmw-balance strong { font-size: 1.05rem; }
  .tmw-play { width: 100%; margin-inline: 0; padding: .45rem; box-sizing: border-box; }
  .tmw-wheel-stage { width: min(80vw, 312px); }
  .tmw-result { min-width: 150px; padding: .42rem .72rem; }
  .tmw-number-grid { gap: 2px; }
  .tmw-number-grid button { min-height: 38px; font-size: .88rem; }
  .tmw-outside-grid button { min-height: 40px; font-size: .58rem; }
  .tmw-chip { flex-basis: 42px; width: 42px; height: 42px; }
  .tmw-controls { margin-top: .65rem; padding: .6rem; }
  .tmw-spin-actions button { min-height: 46px; padding-inline: .45rem; font-size: .72rem; }
  .tmw-builder-form { grid-template-columns: 1fr 1fr; }.tmw-builder-form label { align-self: end; }.tmw-builder-form button { grid-column: 1 / -1; }.tmw-builder-help { line-height: 1.45; }
}
@media (prefers-reduced-motion: reduce) {
  .tmw-wheel { transition: none; }
  .tmw-wheel-stage.is-spinning .tmw-ball-track { animation: none; }
  .tmw-ball { transition: none; }
}
