/* Craps Simulator — mobile-first, single stylesheet */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: #07341c;
  color: #f3efe4;
  touch-action: manipulation;
  overscroll-behavior: none;
}
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
.hidden { display: none !important; }

.view { min-height: 100dvh; }

/* ================= auth ================= */
#authView { display: flex; align-items: center; justify-content: center; padding: 16px; }
.auth-card {
  width: 100%; max-width: 380px; background: #0b4527; border: 1px solid #1d6b40;
  border-radius: 16px; padding: 24px 20px; box-shadow: 0 12px 40px rgba(0,0,0,.45);
}
.logo { font-size: 26px; text-align: center; }
.tagline { text-align: center; color: #a8cbb4; font-size: 12.5px; margin: 6px 0 18px; }
.tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.tab { flex: 1; padding: 10px; border-radius: 10px; background: #08341e; color: #a8cbb4; font-weight: 600; }
.tab.on { background: #f3c93b; color: #4a3403; }
.pane input {
  width: 100%; margin: 6px 0; padding: 13px 14px; border-radius: 10px; border: 1px solid #1d6b40;
  background: #06281676; color: #f3efe4; font-size: 16px;
}
.pane input:focus { outline: 2px solid #f3c93b; border-color: transparent; }
.code-input { text-align: center; letter-spacing: 10px; font-size: 24px !important; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 48px; }
.eye {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  font-size: 19px; padding: 8px; border-radius: 8px; opacity: .75; line-height: 1;
}
.eye:active, .eye.on { opacity: 1; background: #1d6b40; }
.match-hint { font-size: 12.5px; min-height: 16px; margin: 2px 2px 0; color: #ff9b9b; }
.match-hint.ok { color: #9ff3b1; }
.btn-primary {
  width: 100%; margin-top: 10px; padding: 14px; border-radius: 10px; background: #f3c93b;
  color: #4a3403; font-weight: 800; font-size: 16px;
}
.btn-primary:active { transform: scale(.98); }
.linkish { display: block; margin: 12px auto 0; color: #9fd4ae; text-decoration: underline; font-size: 13.5px; }
.msg { margin-top: 10px; font-size: 13.5px; color: #ffd9a0; text-align: center; min-height: 18px; }
.msg.ok { color: #9ff3b1; }

/* ================= top bar ================= */
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 10px;
  padding: calc(env(safe-area-inset-top) + 8px) 12px 8px; background: #052b16f2; backdrop-filter: blur(6px);
  border-bottom: 1px solid #14502e;
}
.bankroll { font-size: 20px; font-weight: 800; color: #f3c93b; flex: 1; }
.puck {
  min-width: 52px; text-align: center; padding: 6px 10px; border-radius: 999px; font-weight: 800; font-size: 13px;
  background: #111; color: #ddd; border: 2px solid #333;
}
.puck.on { background: #f7f7f2; color: #111; border-color: #f3c93b; }
.top-actions { display: flex; gap: 4px; }
.icon-btn { position: relative; font-size: 20px; padding: 6px 8px; border-radius: 10px; }
.icon-btn:active { background: #14502e; }
.badge {
  position: absolute; top: 0; right: 0; background: #e5484d; color: #fff; font-size: 10px;
  min-width: 16px; height: 16px; line-height: 16px; border-radius: 999px; text-align: center; font-weight: 700;
}

/* ================= ad slot ================= */
.ad-slot { padding: 6px 10px 0; }
.ad-inner {
  display: flex; align-items: center; gap: 8px; background: #0e2c1c; border: 1px dashed #2c7a4b;
  border-radius: 10px; padding: 8px 12px; font-size: 13px; color: #bfe3ca;
}
.ad-label { font-size: 10px; font-weight: 800; letter-spacing: 1px; color: #7fb290; border: 1px solid #2c7a4b; border-radius: 4px; padding: 1px 5px; }

/* ================= table ================= */
.table-wrap { padding: 10px 10px 210px; max-width: 560px; margin: 0 auto; }
.mode-row { display: flex; align-items: center; gap: 6px; margin: 4px 0 8px; }
.mode-label { font-size: 12px; color: #a8cbb4; }
.mode { padding: 6px 12px; border-radius: 999px; background: #0b4527; border: 1px solid #1d6b40; font-size: 13px; font-weight: 700; }
.mode.on { background: #f3c93b; color: #4a3403; border-color: #f3c93b; }

.numbers-row { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.num-box {
  position: relative; background: #0b4527; border: 2px solid #d9d2b8; border-radius: 10px;
  padding: 8px 2px 20px; text-align: center; min-height: 74px;
}
.num-box .num { display: block; font-size: 22px; font-weight: 800; color: #f7f3e6; }
.num-box .pays { display: block; font-size: 10px; color: #a8cbb4; }
.num-box.hot { border-color: #f3c93b; box-shadow: 0 0 0 2px #f3c93b66; }
.num-box.hot::after {
  content: "ON"; position: absolute; top: -9px; left: 50%; transform: translateX(-50%);
  background: #f7f7f2; color: #111; font-size: 9px; font-weight: 800; border-radius: 999px; padding: 1px 7px; border: 1px solid #f3c93b;
}

.bar {
  position: relative; width: 100%; margin-top: 8px; padding: 14px 10px 18px; border-radius: 10px;
  border: 2px solid #d9d2b8; background: #0b4527; font-weight: 800; letter-spacing: 1px; font-size: 15px; text-align: center;
}
.bar small { display: block; font-weight: 600; font-size: 10.5px; color: #a8cbb4; letter-spacing: 0; margin-top: 2px; }
.bar.come { background: #0d5230; }
.bar.field { background: #14452a; }
.bar.pass { background: #0d5230; border-color: #f3c93b; }
.bar.dontpass { background: #3d1f1f; border-color: #c98c8c; }
.bar.odds { background: #123c26; border-style: dashed; }
.split-row { display: flex; gap: 6px; }
.split-row .half { flex: 1; }

.spot:active { filter: brightness(1.2); }

/* chips rendered on spots */
.chips { position: absolute; right: 4px; bottom: 3px; display: flex; gap: 3px; flex-wrap: wrap; justify-content: flex-end; pointer-events: none; }
.chip-pile {
  min-width: 30px; height: 30px; padding: 0 4px; border-radius: 999px; font-size: 10.5px; font-weight: 800; line-height: 28px;
  background: #e33; color: #fff; border: 2px dashed #fff; box-shadow: 0 2px 4px rgba(0,0,0,.5);
}
.chip-pile.off { opacity: .55; border-style: dotted; }
.chip-pile.cp { background: #2266dd; }   /* come point marker */
.chip-pile.od { background: #7a4dd8; }   /* odds */

/* ================= props ================= */
.props { margin-top: 10px; border: 1px solid #1d6b40; border-radius: 12px; background: #08331d; }
.props summary { padding: 10px 12px; font-weight: 700; color: #d8cf9f; cursor: pointer; }
.prop-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; padding: 0 8px 8px; }
@media (min-width: 420px) { .prop-grid { grid-template-columns: repeat(3, 1fr); } }
.prop {
  position: relative; background: #0b4527; border: 1.5px solid #b8b092; border-radius: 10px;
  padding: 9px 6px 20px; text-align: center; font-weight: 700; font-size: 13.5px; min-height: 58px;
}
.prop small { display: block; color: #a8cbb4; font-weight: 600; font-size: 10.5px; }

/* ================= result strip ================= */
.result-strip {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 205px; z-index: 40;
  width: min(94vw, 540px); max-height: 38dvh; overflow-y: auto;
  background: #041f10f5; border: 1px solid #2c7a4b; border-radius: 14px; padding: 10px 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,.6); font-size: 14px;
}
.result-strip .headline { font-size: 16px; font-weight: 800; margin-bottom: 4px; }
.result-strip .win { color: #7df39b; }
.result-strip .lose { color: #ff9b9b; }
.result-strip .push { color: #d8cf9f; }
.result-line { display: flex; justify-content: space-between; gap: 8px; padding: 2px 0; }

/* ================= controls ================= */
.controls {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 35;
  background: #052b16f8; border-top: 1px solid #14502e; padding: 8px 10px calc(env(safe-area-inset-bottom) + 10px);
}
.chip-row { display: flex; gap: 6px; justify-content: center; margin-bottom: 8px; }
.chip {
  width: 52px; height: 52px; border-radius: 999px; font-weight: 800; font-size: 13px; color: #fff;
  border: 3px dashed #ffffffcc; box-shadow: 0 3px 6px rgba(0,0,0,.45);
}
.chip.c1 { background: #8a8a8a; }
.chip.c5 { background: #c0392b; }
.chip.c10 { background: #2266dd; }
.chip.c25 { background: #1e8f4e; }
.chip.c100 { background: #222; }
.chip.c500 { background: #7a4dd8; }
.chip.on { outline: 3px solid #f3c93b; transform: translateY(-4px); }
.roll-row { display: flex; gap: 10px; align-items: center; max-width: 560px; margin: 0 auto; }
.dice { display: flex; gap: 6px; }
.die {
  width: 46px; height: 46px; background: #fff; color: #c0392b; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 800;
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.15);
}
.die.rolling { animation: shake .5s linear infinite; }
@keyframes shake {
  0% { transform: translate(0,0) rotate(0); } 25% { transform: translate(2px,-3px) rotate(9deg); }
  50% { transform: translate(-2px,2px) rotate(-8deg); } 75% { transform: translate(1px,-1px) rotate(5deg); }
  100% { transform: translate(0,0) rotate(0); }
}
.btn-roll {
  flex: 1; padding: 15px; border-radius: 12px; background: #e5484d; color: #fff;
  font-size: 20px; font-weight: 900; letter-spacing: 3px; box-shadow: 0 4px 0 #a53236;
}
.btn-roll:active { transform: translateY(3px); box-shadow: 0 1px 0 #a53236; }
.btn-roll:disabled { opacity: .55; }

/* ================= sheets ================= */
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; max-height: 72dvh; overflow: hidden;
  background: #0b3a20; border-radius: 18px 18px 0 0; border-top: 2px solid #2c7a4b;
  box-shadow: 0 -12px 40px rgba(0,0,0,.6); display: flex; flex-direction: column;
}
.sheet-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid #14502e; }
.sheet-head b { flex: 1; }
.sheet-close { font-size: 26px; line-height: 1; padding: 0 6px; color: #a8cbb4; }
.sheet-body { overflow-y: auto; padding: 10px 14px calc(env(safe-area-inset-bottom) + 16px); }
.bet-row { display: flex; align-items: center; gap: 8px; padding: 9px 0; border-bottom: 1px solid #124228; font-size: 14px; }
.bet-row .desc { flex: 1; }
.bet-row .desc small { display: block; color: #a8cbb4; }
.bet-row .amt { font-weight: 800; color: #f3c93b; }
.bet-btn { padding: 7px 10px; border-radius: 8px; background: #14502e; font-size: 12px; font-weight: 700; }
.bet-btn.x { background: #5a2323; }
.menu-item { display: block; width: 100%; text-align: left; padding: 13px 8px; border-bottom: 1px solid #124228; font-size: 15px; }
.fineprint { padding: 12px 8px; color: #90b49d; font-size: 12px; line-height: 1.5; }
.hop-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.hop-grid button { padding: 12px 4px; background: #0b4527; border: 1px solid #1d6b40; border-radius: 10px; font-weight: 700; }

.hist-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid #124228; }
.hist-die { width: 26px; height: 26px; font-size: 14px; border-radius: 6px; background: #fff; color: #c0392b; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; }
.hist-note { color: #a8cbb4; font-size: 12.5px; }

/* ================= toast ================= */
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); top: calc(env(safe-area-inset-top) + 64px); z-index: 80;
  background: #041f10f0; border: 1px solid #f3c93b; color: #f3efe4; border-radius: 10px; padding: 10px 16px;
  font-size: 14px; max-width: 90vw; text-align: center; box-shadow: 0 8px 24px rgba(0,0,0,.5);
}
