:root {
  --bg: #0e1016;
  --s1: #161922;
  --s2: #1d212c;
  --line: #2a2f3c;
  --t1: #eef0f5;
  --t2: #b4b9c6;
  --t3: #7c8394;
  --red: #e5484d;
  --black: #2b2f3a;
  --white: #f1f1f4;
  --accent: #7c5cff;
  --up: #30a46c;
  --down: #e5484d;
  --tile: 64px;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--t1);
  font: 14px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

button,
input {
  font: inherit;
  color: inherit;
}

.muted {
  color: var(--t3);
}

/* ---------- topo ---------- */

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--s1);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--t1);
  font-weight: 700;
  font-size: 18px;
  text-decoration: none;
}

.brand-mark {
  display: flex;
  gap: 2px;
}
.brand-mark i {
  width: 8px;
  height: 20px;
  border-radius: 3px;
}
.brand-mark .r {
  background: var(--red);
}
.brand-mark .w {
  background: var(--white);
}
.brand-mark .b {
  background: #3a3f4d;
}

.tag {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--t2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.account {
  display: flex;
  align-items: center;
  gap: 10px;
}

.balance {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.balance small {
  color: var(--t3);
  font-weight: 500;
  margin-right: 4px;
}

.btn {
  height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.btn.ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--t2);
}
.btn:hover {
  filter: brightness(1.1);
}

.link {
  background: none;
  border: 0;
  color: var(--t3);
  cursor: pointer;
  font-size: 12px;
}
.link:hover {
  color: var(--t1);
}

/* ---------- layout ---------- */

.wrap {
  max-width: 980px;
  margin: 0 auto;
  padding: 20px 16px 40px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

.alert {
  margin: 0;
  padding: 10px 14px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--down) 15%, transparent);
  border: 1px solid color-mix(in srgb, var(--down) 40%, transparent);
}

section {
  background: var(--s1);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
}

/* ---------- roleta ---------- */

.status {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 8px;
  font-weight: 600;
}

.tick {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-weight: 500;
  color: var(--t2);
  font-size: 13px;
}
.tick b {
  color: var(--t1);
  background: var(--s2);
  border-radius: 4px;
  padding: 0 3px;
}

.bar {
  height: 4px;
  background: var(--s2);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 16px;
}
.bar-fill {
  height: 100%;
  width: 0;
  background: var(--accent);
}

.reel {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  background: var(--s2);
  padding: 12px 0;
}

.reel-marker {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 3px;
  margin-left: -1.5px;
  background: var(--accent);
  z-index: 2;
  box-shadow: 0 0 12px var(--accent);
}

.reel-strip {
  display: flex;
  width: max-content;
  gap: 6px;
  will-change: transform;
}

.tile {
  flex: 0 0 var(--tile);
  height: var(--tile);
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 22px;
}
.tile.red {
  background: var(--red);
  color: #fff;
}
.tile.black {
  background: var(--black);
  color: #fff;
  border: 1px solid #3a3f4d;
}
.tile.white {
  background: var(--white);
  color: var(--red);
}
.tile.win {
  outline: 3px solid #ffd166;
  outline-offset: -3px;
}

.history {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  font-size: 12px;
}
.history ol {
  display: flex;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
}
.dot {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
}
.dot.red {
  background: var(--red);
}
.dot.black {
  background: var(--black);
  border: 1px solid #3a3f4d;
}
.dot.white {
  background: var(--white);
  color: var(--red);
}

/* ---------- apostas ---------- */

.play {
  display: grid;
  gap: 16px;
}

.stake label {
  display: block;
  font-size: 12px;
  color: var(--t2);
  margin-bottom: 6px;
}
.stake-row {
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 340px;
}
.prefix {
  color: var(--t3);
}
.stake input {
  flex: 1;
  min-width: 0;
  height: 38px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--s2);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  outline: none;
}
.stake input:focus {
  border-color: var(--accent);
}
.stake-row button {
  height: 38px;
  min-width: 42px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--s2);
  cursor: pointer;
}

.colors {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.pick {
  display: grid;
  gap: 2px;
  padding: 14px 10px;
  border-radius: 10px;
  border: 0;
  cursor: pointer;
  text-align: center;
  transition: transform 0.08s, filter 0.15s;
}
.pick:hover:not(:disabled) {
  filter: brightness(1.1);
}
.pick:active:not(:disabled) {
  transform: scale(0.98);
}
.pick:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.pick b {
  font-size: 16px;
}
.pick small {
  opacity: 0.8;
  font-size: 11.5px;
}
.pick em {
  font-style: normal;
  font-weight: 700;
  font-size: 13px;
}
.pick.red {
  background: var(--red);
  color: #fff;
}
.pick.black {
  background: var(--black);
  color: #fff;
  border: 1px solid #3a3f4d;
}
.pick.white {
  background: var(--white);
  color: #1b1d24;
}

.mine-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
#bets {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
}
#bets li,
.result li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-variant-numeric: tabular-nums;
}
.chip {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-right: 6px;
}
.chip.red {
  background: var(--red);
}
.chip.black {
  background: #3a3f4d;
}
.chip.white {
  background: var(--white);
}

.result {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.result ul {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  display: grid;
  gap: 4px;
}
.won {
  color: var(--up);
  font-weight: 600;
}
.lost {
  color: var(--t3);
}
.err {
  color: var(--down);
}

.rules h2 {
  margin: 0 0 6px;
  font-size: 15px;
}
.rules p {
  margin: 6px 0;
  color: var(--t2);
}

.foot {
  text-align: center;
  font-size: 12px;
  padding: 0 16px 24px;
}

@media (max-width: 560px) {
  :root {
    --tile: 52px;
  }
  .colors {
    gap: 6px;
  }
  .pick small {
    display: none;
  }
  .top {
    padding: 10px 12px;
  }
  .brand {
    font-size: 16px;
  }
  .balance small {
    display: none;
  }
}
