@font-face { font-family: "TP Hearthletter"; src: url(fonts/TP-Hearthletter.ttf) format("truetype"); font-display: swap; }
@font-face { font-family: "TP Ledger Bold"; src: url(fonts/TP-LedgerBold.ttf) format("truetype"); font-display: swap; }
@font-face { font-family: "TP Ledger"; src: url(fonts/TP-Ledger.ttf) format("truetype"); font-display: swap; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #2c2f5e; color: #f6ead0; font-family: "TP Ledger", "TP Ledger Bold", sans-serif;
  touch-action: manipulation; overscroll-behavior: none; -webkit-user-select: none; user-select: none; -webkit-text-size-adjust: 100%; position: fixed; inset: 0; }
button { font: inherit; color: inherit; touch-action: manipulation; cursor: pointer; }
button:disabled { cursor: default; }
.num { font-family: "TP Ledger Bold", sans-serif; font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.head { font-family: "TP Hearthletter", "TP Ledger Bold", sans-serif; font-weight: 400; letter-spacing: .03em; }
#bg, #scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
#bg { z-index: 0; pointer-events: none; } #scene { z-index: 2; }
.lay { position: fixed; left: 0; top: 0; display: none; pointer-events: none; transform-origin: 50% 50%; will-change: transform, opacity; }
#hud { position: fixed; top: max(6px, env(safe-area-inset-top)); right: 8px; z-index: 5; pointer-events: none; }
#modeBadge { font-family: "TP Ledger Bold"; font-size: 12px; background: #1a120c; border: 2px solid #7a5432; border-radius: 6px; padding: 3px 7px; color: #f2d27a; }
/* ---- the garden-wall bet bar ---- */
#bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; padding: 6px 8px calc(8px + env(safe-area-inset-bottom)); background-color: #4a4640; background-size: cover; background-position: center top;
  border-top: 3px solid #1c120c; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "ante bet" "bal win" "btns btns"; gap: 6px; align-items: stretch; }
#barTop, .vals { display: contents; }
#msg { display: none; }
#ante { grid-area: ante; } .betv { grid-area: bet; } .balv { grid-area: bal; } .winv { grid-area: win; } .btns { grid-area: btns; }
.val { background-color: #22150c; border: 2px solid #1c120c; border-radius: 9px; padding: 3px 6px 4px; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.lbl { font-family: "TP Ledger Bold"; font-size: 12px; letter-spacing: .1em; color: #d9b98a; line-height: 1.1; white-space: nowrap; }
.lbl em { font-style: normal; color: #8fd08a; letter-spacing: .04em; }
.val .num { font-size: 17px; line-height: 1.2; color: #fff6e0; white-space: nowrap; display: block; max-width: 100%; text-align: center; }
.betrow { display: flex; align-items: center; justify-content: space-between; width: 100%; gap: 3px; }
.betrow .num { flex: 1; min-width: 0; overflow: hidden; }
.sq { width: 44px; height: 44px; min-width: 44px; flex: none; border: 0; padding: 0; background: transparent center / contain no-repeat; border-radius: 50%; }
.sq:disabled { opacity: .35; }
.btns { display: grid; grid-template-columns: 48px minmax(0, 1fr) 86px minmax(0, 1fr) 48px; align-items: center; gap: 8px; justify-items: center; }
.rb { width: 48px; height: 48px; border: 0; border-radius: 50%; background: transparent center / contain no-repeat; padding: 0; position: relative; }
.rb.wide { width: 100%; max-width: 140px; min-width: 0; height: 46px; overflow: hidden; white-space: nowrap; border-radius: 12px; background-color: #3a2414; border: 2px solid #1c120c; background-size: 30px 30px; background-position: 8px center; padding-left: 40px; text-align: left; }
.rb.wide small { font-family: "TP Ledger Bold"; font-size: 13px; letter-spacing: .08em; color: #fff0c8; }
.rb:disabled { opacity: .4; }
#turbo[aria-pressed="true"] { outline: 3px solid #8fd08a; outline-offset: 1px; }
#spin { width: 86px; height: 86px; border: 0; border-radius: 50%; background: transparent center / contain no-repeat; padding: 0; position: relative; transition: transform .12s; }
#spin:active:not(:disabled) { transform: scale(.94); }
#spin:disabled { filter: grayscale(.6) brightness(.8); }
#spin.busy { animation: knock 1.1s ease-in-out infinite; }
@keyframes knock { 0%,100% { transform: rotate(0); } 30% { transform: rotate(-7deg); } 60% { transform: rotate(6deg); } }
#autoLeft { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); font-size: 13px; color: #fff; background: #1c120c; border-radius: 8px; padding: 1px 6px; }
/* ante switch: grey OFF on the left, green ON on the right */
#ante { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 44px; min-width: 0; padding: 2px 6px 2px 8px; border: 2px solid #1c120c; border-radius: 12px; background: #3a2414; }
#ante .alab { min-width: 0; display: flex; flex-direction: column; font-family: "TP Ledger Bold"; font-size: 12px; letter-spacing: .08em; color: #fff0c8; line-height: 1.15; text-align: left; }
#ante .alab small { font-size: 12px; color: #c9b08a; }
#ante .sw { width: 50px; height: 28px; border-radius: 14px; background: #77746e; border: 2px solid #1c120c; position: relative; flex: none; }
#ante .sw i { position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #e8e2d6; border: 2px solid #1c120c; transition: left .18s; }
#ante[aria-checked="true"] .sw { background: #3f9a48; }
#ante[aria-checked="true"] .sw i { left: 26px; }
#ante[aria-checked="true"] .alab small { color: #9be58f; }
#ante:disabled { opacity: .55; }
/* modals: centered */
.modal { position: fixed; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center; background: rgba(16, 10, 6, .72); padding: 12px; }
.modal[hidden] { display: none; }
.card { position: relative; width: min(560px, 100%); max-height: calc(100% - 16px); overflow: auto; background: #f0e2c2; color: #2a1a0e; border: 4px solid #1c120c; border-radius: 16px; padding: 16px 16px 14px; text-align: center; }
.card.small { width: min(380px, 100%); }
.card.tall { width: min(680px, 100%); text-align: left; }
.card h2 { margin: 2px 0 10px; font-size: 30px; color: #6a2e12; text-align: center; }
.x { position: absolute; top: 8px; right: 8px; width: 40px; height: 40px; border: 0; background: transparent center / contain no-repeat; }
.offers { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.offer { display: flex; flex-direction: column; align-items: center; gap: 4px; background: #2a1a10; color: #f6ead0; border: 3px solid #1c120c; border-radius: 14px; padding: 10px 8px 12px; min-height: 44px; }
.offer:disabled { opacity: .45; }
.oart { width: 76px; height: 76px; }
.oname { font-size: 20px; color: #f4cf5e; line-height: 1.05; }
.odesc { font-size: 12px; line-height: 1.3; color: #e6d6b6; min-height: 46px; }
.oprice { font-size: 18px; color: #fff; background: #3f9a48; border: 2px solid #1c120c; border-radius: 10px; padding: 4px 10px; margin-top: 4px; }
.mbet { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 12px 0 4px; }
.mbet .lbl { color: #6a4426; font-size: 12px; }
.mbet .num { font-size: 20px; min-width: 110px; }
.mbet .sq { background-color: #3a2414; }
.hint { font-size: 12px; color: #6a4426; margin: 4px 0 0; }
.row { display: flex; gap: 10px; justify-content: center; margin-top: 12px; }
.row.wrap { flex-wrap: wrap; }
.btn { min-width: 96px; min-height: 44px; border: 3px solid #1c120c; border-radius: 12px; background: #6a4426; color: #fff3d6; font-family: "TP Ledger Bold"; font-size: 16px; letter-spacing: .05em; padding: 6px 14px; }
.btn.go { background: #3f7a3a; }
.chk { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 14px; min-height: 44px; }
.chk input { width: 22px; height: 22px; }
.rules { font-size: 14px; line-height: 1.45; }
.rules h3 { font-family: "TP Hearthletter"; font-weight: 400; font-size: 20px; color: #6a2e12; margin: 14px 0 4px; }
.rules table { border-collapse: collapse; width: 100%; font-family: "TP Ledger Bold"; font-size: 12px; }
.rules td, .rules th { border-bottom: 1px solid #c8b08a; padding: 3px 4px; text-align: right; }
.rules td:first-child, .rules th:first-child { text-align: left; }
.rules canvas { width: 28px; height: 28px; vertical-align: middle; margin-right: 6px; }
.settings { display: flex; gap: 18px; border-top: 2px solid #c8b08a; margin-top: 12px; }
/* boot */
#boot { position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; background: #2c2f5e; }
#boot[hidden] { display: none; }
#bootArt { max-width: 94vw; }
#bootBar { width: min(60vw, 300px); height: 12px; border: 2px solid #1c120c; border-radius: 6px; background: #1a1430; overflow: hidden; }
#bootBar i { display: block; height: 100%; width: 0; background: #e2b552; transition: width .2s; }
#play { min-width: 200px; min-height: 52px; border: 3px solid #1c120c; border-radius: 14px; background: #3f7a3a; color: #fff3d6; font-family: "TP Ledger Bold"; font-size: 18px; letter-spacing: .08em; }
#play:disabled { background: #5a5468; }
.tiny { font-size: 12px; color: #c9b8d8; margin: 0; }
@media (max-width: 719px), (max-aspect-ratio: 1/1) { .rb.wide { padding: 22px 2px 0; background-size: 22px 22px; background-position: center 3px; text-align: center; } .rb.wide small { font-size: 12px; letter-spacing: .03em; } }
/* phones: compact */
@media (max-width: 370px) { #ante .alab { font-size: 12px; letter-spacing: .02em; } .rb.wide small { letter-spacing: 0; } }
@media (max-height: 700px) and (orientation: portrait) {
  .btns { grid-template-columns: 44px minmax(0, 1fr) 72px minmax(0, 1fr) 44px; }
  #spin { width: 72px; height: 72px; }
  .rb { width: 44px; height: 44px; } .rb.wide { height: 42px; }
  .val .num { font-size: 15px; } .sq { width: 44px; height: 44px; }
  #bar { gap: 4px; padding-top: 4px; }
}
/* wide screens: one row bar */
@media (min-aspect-ratio: 1/1) and (min-width: 720px) {
  #bar { grid-template-columns: 200px minmax(0, 190px) minmax(0, 190px) minmax(0, 230px) auto; grid-template-areas: "ante bal win bet btns"; justify-content: center; column-gap: 12px; padding: 8px 18px 10px; align-items: center; }
  .btns { grid-template-columns: 52px 140px 92px 140px 52px; }
  .val { min-height: 56px; } .val .num { font-size: 20px; }
  #spin { width: 92px; height: 92px; }
}
@media (orientation: landscape) and (max-height: 500px) {
  #bar { grid-template-columns: 116px minmax(0, 1.3fr) minmax(0, .9fr) minmax(146px, 1.25fr) auto; grid-template-areas: "ante bal win bet btns"; column-gap: 6px; padding: 3px 8px 4px; align-items: center; }
  #ante { min-height: 44px; padding: 2px 4px 2px 6px; gap: 4px; } #ante .alab { font-size: 12px; letter-spacing: .02em; } #ante .alab small { font-size: 12px; }
  #ante .sw { width: 38px; height: 24px; } #ante .sw i { width: 16px; height: 16px; } #ante[aria-checked="true"] .sw i { left: 16px; }
  .val { padding: 2px 4px 3px; } .lbl { font-size: 12px; letter-spacing: .05em; }
  .btns { grid-template-columns: 44px 80px 58px 80px 44px; gap: 5px; }
  #spin { width: 58px; height: 58px; } .rb { width: 44px; height: 44px; }
  .rb.wide { height: 46px; padding: 22px 1px 0; background-size: 22px 22px; background-position: center 2px; text-align: center; }
  .rb.wide small { font-size: 12px; letter-spacing: 0; }
  .val .num { font-size: 15px; } .betrow { gap: 1px; }
}
@media (orientation: landscape) and (max-height: 500px) and (max-width: 839px) {
  #bar { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; grid-template-areas: "ante bet btns" "bal win btns"; row-gap: 3px; }
  #ante { min-height: 40px; }
}
/* full-screen feature intro, wheel, dawn and big-win screens hide the bar */
body.ovl #bar { visibility: hidden; }
body.ovl #hud { visibility: hidden; }
#spinLbl { position: absolute; left: 50%; bottom: 7%; transform: translateX(-50%); font-size: 14px; line-height: 1; color: #fff3d6; background: #1c120c; border: 2px solid #7a5432; border-radius: 8px; padding: 2px 7px 3px; pointer-events: none; letter-spacing: .06em; }
#spin:has(#autoLeft:not([hidden])) #spinLbl { display: none; }
@media (orientation: landscape) and (max-height: 500px) { #spinLbl { font-size: 12px; padding: 1px 5px 2px; } }
@keyframes tpSpin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes tpHop { from { transform: translateY(0) rotate(-6deg); } to { transform: translateY(-16px) rotate(6deg); } }
@keyframes tpHopHi { from { transform: translateY(0) rotate(-9deg); } to { transform: translateY(-30px) rotate(9deg); } }
@keyframes tpPop { from { transform: scale(1.6); } to { transform: scale(1); } }
@keyframes tpPulse { from { transform: scale(1); } to { transform: scale(1.05); } }
