:root {
  --bg: #f4ecd8;
  --header: #ede5d0;
  --surface: #faf6ed;
  --ink: #2a2520;
  --muted: #7a7060;
  --line: #d4cbba;
  --green: #2d5f3a;
  --red: #8b2020;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--header);
  color: var(--ink);
  font:
    13px Inter,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
  line-height: 1.45;
}
button,
input,
select {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
  background: none;
  border: 0;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
input,
select {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 8px;
  min-width: 0;
}
input:focus,
select:focus,
button:focus-visible {
  outline: 2px solid #779272;
  outline-offset: 2px;
}
header {
  height: 49px;
  display: flex;
  align-items: center;
  padding: 0 20px;
  border-top: 2px solid var(--ink);
  border-bottom: 1px solid var(--line);
  gap: 30px;
  background: var(--bg);
}
.brand {
  display: block;
  width: 147px;
  flex-shrink: 0;
}
.brand img {
  width: 100%;
  display: block;
}
nav {
  display: flex;
  height: 100%;
  gap: 24px;
}
.nav {
  font-size: 12px;
  border-bottom: 2px solid transparent;
  padding: 0 2px;
}
.nav.active {
  border-color: var(--ink);
}
.header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 17px;
  font-size: 12px;
}
.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  color: var(--ink);
  border: 1px solid transparent;
  border-radius: 4px;
  text-decoration: none;
  transition:
    background-color 120ms,
    border-color 120ms;
}
.social-link:hover {
  background: var(--header);
  border-color: var(--line);
}
.social-link:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}
.local-pill {
  display: flex;
  gap: 5px;
  align-items: center;
  font: 9px monospace;
  letter-spacing: 1px;
  color: var(--muted);
}
.local-pill i,
.live-dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green);
}
.account-button {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 6px 10px;
}
.settings-button {
  font-size: 18px;
}
.ticker {
  display: flex;
  gap: 30px;
  height: 31px;
  align-items: center;
  padding: 0 20px;
  font: 10px monospace;
  letter-spacing: 0.3px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}
.ticker b {
  color: var(--ink);
  font-weight: 500;
  margin-left: 7px;
}
.ticker-note {
  margin-left: auto;
  font:
    10px Inter,
    system-ui,
    sans-serif;
  letter-spacing: 0;
}
main {
  padding: 3px;
}
.panel {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 3px;
}
.view {
  display: none;
}
.view.active {
  display: block;
}
.play-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 286px;
  gap: 3px;
}
.stage-top {
  height: 60px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
  gap: 20px;
}
.market-icon {
  background: var(--ink);
  color: var(--bg);
  font: bold 15px monospace;
  border-radius: 50%;
  padding: 5px 9px;
  margin-right: 10px;
}
.stage-stats {
  display: flex;
  gap: 27px;
  font-size: 10px;
  color: var(--muted);
}
.stage-stats b {
  display: block;
  font: 12px monospace;
  margin-top: 3px;
  color: var(--ink);
}
.coin-stage {
  height: 438px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background-image: radial-gradient(var(--line) 0.7px, transparent 0.7px);
  background-size: 31px 31px;
}
.watermark {
  position: absolute;
  font-size: clamp(80px, 14vw, 200px);
  font-weight: 700;
  letter-spacing: -10px;
  opacity: 0.035;
  top: 110px;
  pointer-events: none;
}
.result-heading {
  font-size: 16px;
  letter-spacing: -0.4px;
  margin-bottom: 24px;
  z-index: 1;
}
.coin {
  width: 160px;
  height: 160px;
  border: 1px solid #b4a88d;
  border-radius: 50%;
  background: #e8dec4;
  box-shadow:
    0 5px 0 #c7baa0,
    0 7px 0 #a99d84;
  display: grid;
  place-items: center;
  position: relative;
  transition: transform 0.15s;
}
.coin:hover {
  transform: translateY(-2px);
}
.coin-inner {
  border: 1px solid #c6b99b;
  border-radius: 50%;
  width: 140px;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f5eedc;
}
.coin img {
  width: 72px;
  height: 72px;
}
.coin #coin-face {
  display: none;
  font:
    900 65px Georgia,
    serif;
  color: var(--ink);
}
.coin.has-result img {
  display: none;
}
.coin.has-result #coin-face {
  display: block;
}
.coin.flipping {
  animation: flip 0.24s ease-out;
}
@keyframes flip {
  0% {
    transform: rotateY(0);
  }
  50% {
    transform: rotateY(110deg) translateY(-5px);
  }
  100% {
    transform: rotateY(360deg);
  }
}
.result-subtitle {
  margin-top: 22px;
  font: 11px monospace;
  color: var(--muted);
  z-index: 1;
}
.recent-rolls {
  display: flex;
  gap: 5px;
  height: 25px;
  margin-top: 21px;
  z-index: 1;
}
.roll-pill {
  width: 25px;
  height: 22px;
  border: 1px solid var(--line);
  border-radius: 3px;
  display: grid;
  place-items: center;
  font: 10px monospace;
}
.win {
  color: var(--green);
}
.loss {
  color: var(--red);
}
.roll-pill.win {
  background: #dce4d0;
  border-color: #b7c5a9;
}
.roll-pill.loss {
  background: #edddd0;
  border-color: #d5bbac;
}
.stage-bottom {
  position: absolute;
  bottom: 13px;
  left: 20px;
  right: 20px;
  display: flex;
  justify-content: space-between;
  font: 9px monospace;
  color: var(--muted);
  letter-spacing: 0.3px;
}
.ticket {
  padding: 16px 15px 12px;
}
.ticket-title {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.9px;
  display: flex;
  justify-content: space-between;
}
.ticket-title span {
  font: 10px monospace;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--muted);
}
.balance-label {
  font-size: 11px;
  color: var(--muted);
  margin-top: 20px;
}
.balance-value {
  font: 26px monospace;
  letter-spacing: -1.3px;
  margin: 3px 0 12px;
}
.ticket-small {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--muted);
  margin: 7px 0;
}
.ticket-small b {
  font: 10px monospace;
  color: var(--ink);
}
hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 15px 0;
}
.label {
  display: block;
  font-size: 11px;
  margin: 12px 0 6px;
}
.segmented {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 3px;
  background: #eee5d0;
  gap: 3px;
}
.segmented button {
  flex: 1;
  padding: 7px;
  border-radius: 3px;
  font-size: 12px;
}
.segmented button.selected {
  background: var(--ink);
  color: var(--bg);
}
.amount-input {
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  padding: 0 9px;
  gap: 6px;
}
.amount-input input {
  width: 100%;
  background: none;
  border: 0;
  padding: 9px 0;
  font: 14px monospace;
  outline: none;
}
.amount-input span {
  font-size: 10px;
  color: var(--muted);
}
.amount-tools {
  display: flex;
  justify-content: flex-end;
  gap: 3px;
  margin-top: 4px;
}
.amount-tools button {
  font: 10px monospace;
  background: #e9e0c9;
  padding: 3px 12px;
  border-radius: 3px;
}
.payout-row {
  display: flex;
  justify-content: space-between;
  margin-top: 17px;
  font-size: 11px;
}
.payout-row small {
  display: block;
  font-size: 9px;
  color: var(--muted);
}
.payout-row strong {
  font: 17px monospace;
}
.primary {
  background: var(--green);
  color: #faf6ed;
  border: 1px solid var(--green);
  border-radius: 4px;
  padding: 9px 14px;
  font-size: 12px;
}
.primary:hover {
  background: #234e2e;
}
.flip-button {
  width: 100%;
  display: flex;
  justify-content: space-between;
  margin-top: 15px;
}
.flip-button span {
  font-size: 16px;
  line-height: 16px;
}
.ticket-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 7px;
  font-size: 9px;
  color: var(--muted);
}
kbd {
  font: 8px monospace;
  border: 1px solid var(--line);
  padding: 1px 3px;
  border-radius: 2px;
}
.proof-indicator {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 10px;
  margin-bottom: 8px;
}
.proof-indicator i {
  width: 5px;
  height: 5px;
  background: #b39d60;
  border-radius: 50%;
}
.proof-indicator i.ready {
  background: var(--green);
}
.outline {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 7px 10px;
  font-size: 11px;
}
.outline:hover {
  background: #e9e0c9;
}
.full {
  width: 100%;
}
.tiny {
  font-size: 10px;
  line-height: 1.6;
}
.muted {
  color: var(--muted);
}
.activity {
  margin-top: 3px;
  min-height: 220px;
}
.tabs {
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 0 15px;
  height: 39px;
  gap: 24px;
}
.tab {
  font-size: 11px;
  padding: 12px 0 10px;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.tab.active {
  border-color: var(--ink);
}
.tab span {
  background: #e7ddc5;
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: 4px;
  font: 9px monospace;
}
.table-info {
  margin-left: auto;
  font-size: 10px;
  color: var(--muted);
}
.table-wrap {
  overflow: auto;
  max-height: 320px;
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  white-space: nowrap;
}
th {
  font-weight: 400;
  color: var(--muted);
  font-size: 10px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
}
td {
  font: 11px monospace;
  padding: 10px 18px;
  border-bottom: 1px solid #ded5c2;
}
td button {
  font:
    10px Inter,
    system-ui;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 2px 8px;
}
td a {
  color: var(--green);
}
.empty {
  padding: 60px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 11px;
}
.status-badge {
  font: 9px monospace;
  padding: 3px 5px;
  border: 1px solid var(--line);
  border-radius: 3px;
}
.page-title {
  padding: 24px 20px 20px;
  display: flex;
  justify-content: space-between;
  align-items: end;
}
.eyebrow {
  font: 9px monospace;
  letter-spacing: 1.3px;
  color: var(--muted);
}
h1 {
  font-size: 32px;
  letter-spacing: -1.4px;
  font-weight: 600;
  margin: 7px 0 0;
}
h2 {
  font-size: 12px;
  font-weight: 600;
  margin: 0 0 20px;
}
p {
  font-size: 12px;
  line-height: 1.7;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3px;
  margin-bottom: 3px;
}
.metric {
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 18px;
}
.metric-label {
  font-size: 10px;
  color: var(--muted);
}
.metric-value {
  font: 23px monospace;
  margin-top: 8px;
  letter-spacing: -0.8px;
}
.metric-note {
  font-size: 9px;
  color: var(--muted);
  margin-top: 5px;
}
.house-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 3px;
  margin-bottom: 3px;
}
.padded {
  padding: 22px;
}
.definition-list > div {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
}
.definition-list > div:last-child {
  border: 0;
  margin-bottom: 15px;
}
.definition-list b {
  font: 11px monospace;
  text-align: right;
}
.break b {
  max-width: 62%;
  word-break: break-all;
}
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  margin-bottom: 3px;
}
.notice {
  padding: 12px;
  border-left: 2px solid #aa9157;
  background: #eee3c9;
  font-size: 11px;
  line-height: 1.7;
}
.chart-key {
  font: 10px monospace;
  color: var(--muted);
}
.chart-key i {
  display: inline-block;
  width: 15px;
  border-top: 2px solid var(--ink);
  margin-right: 8px;
}
#equity-chart {
  width: 100%;
  height: 260px;
}
#referral-link {
  width: 100%;
  font: 10px monospace;
  margin-bottom: 10px;
}
footer {
  display: flex;
  justify-content: space-between;
  padding: 12px 20px;
  font: 9px monospace;
  color: var(--muted);
}
footer > span:first-child {
  color: var(--ink);
}
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 4px 15px #2a252018;
  padding: 12px 20px;
  border-radius: 5px;
  font-size: 12px;
  z-index: 50;
  max-width: 90%;
  display: none;
}
.toast.visible {
  display: block;
}
dialog {
  background: var(--bg);
  border: 1px solid #b8ac94;
  border-radius: 7px;
  padding: 28px;
  width: 390px;
  color: var(--ink);
}
dialog::backdrop {
  background: #2a252055;
  backdrop-filter: blur(2px);
}
dialog h2 {
  font-size: 24px;
  letter-spacing: -0.8px;
  margin: 7px 0 10px;
}
.dialog-close {
  position: absolute;
  right: 12px;
  top: 8px;
  font-size: 23px;
  color: var(--muted);
}
dialog .full {
  margin-top: 16px;
}
dialog input {
  width: 100%;
}
.settings-dialog {
  width: 650px;
  max-height: 90vh;
  overflow: auto;
}
.settings-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 20px;
}
.setting-field input,
.setting-field select {
  width: 100%;
}
button.small {
  font-size: 10px;
}
#retired-epochs {
  word-break: break-all;
  font: 10px monospace;
}
#house-queue {
  overflow: auto;
  margin-bottom: 15px;
}
@media (min-height: 950px) {
  .coin-stage {
    height: 530px;
  }
  .activity {
    min-height: 260px;
  }
}
@media (max-width: 850px) {
  header {
    padding: 0 12px;
    gap: 15px;
  }
  nav {
    gap: 14px;
  }
  .header-right {
    gap: 10px;
  }
  .ticker {
    gap: 15px;
    padding: 0 12px;
  }
  .ticker-note {
    display: none;
  }
  .local-pill {
    display: none;
  }
  .brand {
    width: 125px;
  }
  .stage-stats {
    gap: 12px;
  }
  .metrics {
    grid-template-columns: repeat(2, 1fr);
  }
  .table-info {
    display: none;
  }
  .house-grid {
    grid-template-columns: 1fr;
  }
  .page-title > span {
    display: none;
  }
}
@media (max-width: 620px) {
  header {
    height: auto;
    min-height: 49px;
    flex-wrap: wrap;
    padding: 10px 12px;
    gap: 10px;
  }
  nav {
    order: 3;
    height: 32px;
    width: 100%;
    justify-content: space-around;
  }
  .header-right {
    order: 2;
    width: 100%;
    margin-left: 0;
    justify-content: space-between;
    gap: 8px;
  }
  .header-right > button {
    font-size: 10px;
  }
  .ticker {
    font-size: 8px;
    gap: 10px;
  }
  .play-layout {
    grid-template-columns: 1fr;
  }
  .coin-stage {
    height: 340px;
  }
  .stage-top {
    height: 50px;
    padding: 0 12px;
  }
  .stage-stats {
    font-size: 8px;
  }
  .ticket {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 12px;
  }
  .ticket-title,
  .ticket hr,
  .ticket-foot,
  .ticket .proof-indicator,
  .ticket > .outline,
  .ticket > .tiny {
    grid-column: 1/-1;
  }
  .balance-label,
  .balance-value {
    grid-column: 1;
  }
  .ticket > .label,
  .segmented,
  .amount-input,
  .amount-tools,
  .payout-row,
  .flip-button {
    grid-column: 1/-1;
  }
  .balance-label {
    margin-top: 12px;
  }
  .balance-value {
    font-size: 23px;
  }
  .ticket-small {
    margin: 5px 0;
  }
  .tabs {
    gap: 17px;
    padding: 0 10px;
    overflow: auto;
  }
  .tab {
    font-size: 10px;
  }
  .two-col {
    grid-template-columns: 1fr;
  }
  footer {
    font-size: 8px;
    padding: 12px;
    gap: 8px;
  }
  footer > span:nth-child(2) {
    display: none;
  }
  .settings-fields {
    grid-template-columns: 1fr;
  }
  .metrics .metric {
    padding: 12px;
  }
  .metric-value {
    font-size: 19px;
  }
  .page-title {
    padding: 20px 12px;
  }
  .coin {
    width: 135px;
    height: 135px;
  }
  .coin-inner {
    width: 117px;
    height: 117px;
  }
  .coin img {
    width: 60px;
  }
  .result-heading {
    font-size: 14px;
    margin-bottom: 18px;
  }
  .stage-bottom {
    font-size: 8px;
    left: 12px;
    right: 12px;
  }
}

.withdraw-summary {
  margin: 16px 0;
  padding: 12px;
  border: 1px solid var(--line, #d5cdb9);
  background: rgba(255, 255, 255, 0.24);
}
.withdraw-summary[hidden] {
  display: none;
}
.withdraw-summary > div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 6px 0;
  font-size: 13px;
}
.withdraw-summary .net {
  margin-top: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--line, #d5cdb9);
  font-size: 15px;
}
#withdraw-note {
  line-height: 1.6;
  margin: 12px 0 18px;
}
