:root {
  --bg: #0a0a09; --panel: #121210; --line: #2a2d1c; --text: #f2efe4; --muted: #8f8d80;
  --lime: #a8e63a; --olive: #5a6b1a; --olive-2: #2c3410; --red: #e8664a;
  --cut: 10px;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0; color: var(--text); font: 15px/1.5 Inter, system-ui, sans-serif; min-height: 100vh;
  background:
    radial-gradient(ellipse 60% 45% at 50% 32%, rgba(168,230,58,.07), transparent 70%),
    repeating-linear-gradient(0deg, rgba(255,255,255,.018) 0 1px, transparent 1px 4px),
    var(--bg);
}
a { color: inherit; }
button { font: inherit; cursor: pointer; }
.mono, pre { font-family: 'JetBrains Mono', ui-monospace, monospace; }

/* angular cut corners */
.cut { clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, var(--cut) 100%, 0 calc(100% - var(--cut))); }

/* header */
.top { display: flex; align-items: center; justify-content: space-between; padding: 14px 24px; gap: 12px; }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; font: 700 18px 'Chakra Petch', sans-serif; letter-spacing: .06em; color: var(--lime); }
.mark { width: 22px; height: 22px; border-radius: 50%; background: var(--lime); color: var(--bg); display: grid; place-items: center; font-size: 13px; }
.tabs { display: flex; gap: 8px; }
.tabs a, .connect {
  font: 600 12px 'Chakra Petch', sans-serif; letter-spacing: .08em; text-decoration: none;
  padding: 8px 18px; background: var(--olive-2); color: var(--lime); border: 0;
  box-shadow: inset 0 0 0 1px var(--olive);
}
.tabs a.on { background: #3a4515; color: var(--text); }
.connect:hover, .tabs a:hover { background: #3a4515; }

/* stage */
main { display: flex; flex-direction: column; align-items: center; padding: 10px 16px 30px; gap: 14px; max-width: 560px; margin: 0 auto; }
.stage { position: relative; width: 260px; height: 290px; perspective: 1000px; display: grid; place-items: center; }
.glow { position: absolute; inset: 20px; border-radius: 50%; background: radial-gradient(circle, rgba(168,230,58,.22), transparent 65%); filter: blur(18px); }
.shadow { position: absolute; bottom: 0; width: 150px; height: 16px; border-radius: 50%; background: radial-gradient(rgba(0,0,0,.7), transparent 70%); }
.coin { width: 230px; height: 230px; position: relative; transform-style: preserve-3d; transition: transform 1s cubic-bezier(.2,.7,.2,1); }
.coin .face {
  position: absolute; inset: 0; border-radius: 50%; overflow: hidden; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  box-shadow: 0 0 40px rgba(168,230,58,.22);
}
.coin .face img { width: 100%; height: 100%; object-fit: cover; display: block; transform: scale(1.035); } /* trims the white corners of the art */
.coin .tails { transform: rotateY(180deg); }
.coin.spin { animation: spin .45s linear infinite; }
@keyframes spin { from { transform: rotateY(0) } to { transform: rotateY(360deg) } }

.result { margin: 0; color: var(--muted); text-align: center; min-height: 24px; }
.result.win { color: var(--lime); font-weight: 600; }
.result.lose { color: var(--red); }
h1 { font: 700 22px 'Chakra Petch', sans-serif; letter-spacing: .05em; margin: 0; text-align: center; }

.sides { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; width: 100%; }
.side-btn {
  --cut: 14px; display: flex; align-items: center; justify-content: center; gap: 10px;
  font: 700 16px 'Chakra Petch', sans-serif; letter-spacing: .08em; padding: 16px 12px;
  background: var(--olive-2); color: var(--olive); border: 0; box-shadow: inset 0 0 0 1px var(--olive);
  transition: background .15s, color .15s;
}
.side-btn img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; opacity: .55; }
.side-btn.on { background: #6f8a1c; color: var(--text); box-shadow: inset 0 0 0 1px var(--lime); }
.side-btn.on img { opacity: 1; }
.side-btn:hover:not(.on) { color: var(--lime); }

.bet { width: 100%; display: flex; flex-direction: column; gap: 8px; }
.amount { display: flex; align-items: center; gap: 10px; background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); padding: 2px 16px; }
.amount span, .amount b { font: 600 12px 'Chakra Petch', sans-serif; letter-spacing: .08em; color: var(--muted); }
.amount input { flex: 1; min-width: 0; background: transparent; border: 0; color: var(--text); font: 600 22px 'Chakra Petch', sans-serif; padding: 10px 0; outline: none; text-align: right; }
.chips { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.chips button { --cut: 6px; background: var(--panel); color: var(--text); border: 0; box-shadow: inset 0 0 0 1px var(--line); padding: 7px 0; font: 600 12px 'Chakra Petch', sans-serif; }
.chips button:hover { color: var(--lime); box-shadow: inset 0 0 0 1px var(--olive); }

.win-line { color: var(--muted); font-size: 14px; }
.win-line b { color: var(--text); }
.flip { --cut: 14px; width: 100%; border: 0; background: var(--lime); color: #0a0a09; font: 700 18px 'Chakra Petch', sans-serif; letter-spacing: .14em; padding: 15px; transition: filter .15s; }
.flip:hover { filter: brightness(1.08); }
.flip:disabled { opacity: .45; cursor: not-allowed; }
.flip.small { width: auto; font-size: 13px; padding: 10px 18px; }
.ghost { --cut: 12px; width: 100%; border: 0; background: var(--olive-2); color: var(--lime); box-shadow: inset 0 0 0 1px var(--lime); font: 700 14px 'Chakra Petch', sans-serif; letter-spacing: .1em; padding: 12px; }
.hint { color: var(--muted); font-size: 12px; }
#pending { width: 100%; display: flex; flex-direction: column; gap: 6px; }
.pend { background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); padding: 10px 12px; font-size: 13px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.pend button { border: 0; background: var(--lime); color: #0a0a09; padding: 6px 12px; font: 600 12px 'Chakra Petch', sans-serif; }

/* below the fold */
.below { max-width: 1080px; margin: 0 auto; padding: 10px 24px 40px; display: flex; flex-direction: column; gap: 16px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.card, .panel { background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); padding: 16px 18px; min-width: 0; }
.card { display: flex; flex-direction: column; }
.card small { color: var(--muted); font: 600 11px 'Chakra Petch', sans-serif; letter-spacing: .1em; }
.card b { font: 700 22px 'Chakra Petch', sans-serif; }
.card i { color: var(--muted); font-style: normal; font-size: 12px; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ph { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
h2 { font: 700 14px 'Chakra Petch', sans-serif; letter-spacing: .1em; margin: 0; }
.live { color: var(--muted); font-size: 12px; display: flex; gap: 6px; align-items: center; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 10px var(--lime); display: inline-block; }
.feed { list-style: none; margin: 0; padding: 0; max-height: 380px; overflow: auto; }
.feed li { display: grid; grid-template-columns: 54px 1fr auto; gap: 10px; padding: 8px 2px; border-bottom: 1px solid var(--line); font-size: 13px; align-items: center; }
.feed .empty { display: block; color: var(--muted); }
.feed .w { color: var(--lime); font-weight: 600; }
.feed .l { color: var(--muted); }
.feed a { color: var(--muted); text-decoration: none; }
.badge { font-size: 11px; color: var(--muted); }
.steps { margin: 0 0 12px; padding-left: 18px; color: var(--muted); font-size: 14px; }
.steps b { color: var(--lime); }
.verify { display: flex; gap: 8px; }
.verify input { flex: 1; min-width: 0; background: var(--bg); border: 0; box-shadow: inset 0 0 0 1px var(--line); color: var(--text); padding: 9px 12px; font: inherit; outline: none; }
.vout { background: var(--bg); box-shadow: inset 0 0 0 1px var(--line); padding: 12px; font-size: 12px; color: var(--muted); white-space: pre-wrap; word-break: break-all; margin: 10px 0; }
.head { font-size: 11px; color: var(--muted); word-break: break-all; }
footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; color: var(--muted); font-size: 12px; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--panel); box-shadow: inset 0 0 0 1px var(--olive); padding: 10px 16px; font-size: 14px; max-width: calc(100% - 32px); z-index: 9; }

/* minimal mode (private TEST): only the coin and the bet */
body.minimal .full-only, body.minimal .win-line, body.minimal .hint { display: none !important; }

@media (max-width: 640px) {
  .top { padding: 12px 16px; }
  .tabs { display: none; }
  .stage { width: 210px; height: 236px; }
  .coin { width: 190px; height: 190px; }
  h1 { font-size: 19px; }
  .stats, .grid { grid-template-columns: 1fr 1fr; }
  .grid { grid-template-columns: 1fr; }
  .below { padding: 10px 16px 30px; }
}
