/* OCHE 3D - hoop orange and garden mint on near-black glass, over the garden */
:root {
  --ink: #f4f1ea; --mute: #a8a49b; --bg: #111311; --glass: rgba(17, 19, 17, 0.82); --line: rgba(255, 255, 255, 0.1);
  --orange: #ff5a26; --mint: #9fd8c4; --gold: #ffd23f; --red: #e0322f;
  --num: 'Bebas Neue', 'Arial Narrow', Impact, sans-serif;
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--ink); font: 15px/1.4 Inter, system-ui, sans-serif; }
body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
::selection { background: transparent; }
input { -webkit-user-select: text; user-select: text; }
#game { position: fixed; inset: 0; }
#game canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.hidden { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; }
#buildTag { position: fixed; right: 6px; bottom: calc(4px + var(--safe-b)); font: 10px Inter, sans-serif; color: rgba(255, 255, 255, 0.35); z-index: 50; pointer-events: none; }

/* --- loading */
#loading { position: fixed; inset: 0; background: var(--bg); display: grid; place-items: center; z-index: 80; transition: opacity 0.6s; }
#loading.gone { opacity: 0; pointer-events: none; }
.ld { text-align: center; width: 240px; }
.ld b { display: block; font: 54px var(--num); letter-spacing: 3px; }
.ld .bar { height: 4px; background: rgba(255, 255, 255, 0.1); border-radius: 2px; margin: 12px 0 8px; overflow: hidden; }
.ld .bar i { display: block; height: 100%; width: 0; background: var(--orange); transition: width 0.3s; }
.ld span { color: var(--mute); font-size: 13px; }

/* --- screens, cards, buttons */
.screen { position: fixed; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center; padding: calc(16px + var(--safe-t)) 16px calc(16px + var(--safe-b)); }
#sheet, #signin { background: rgba(8, 9, 8, 0.45); z-index: 40; }
.card { width: min(460px, 100%); max-height: 100%; overflow-y: auto; background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid var(--line); border-radius: 18px; padding: 20px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45); touch-action: pan-y; }
.card h2 { margin: 0 0 12px; font: 36px/1 var(--num); letter-spacing: 1.5px; }
.card h3 { margin: 18px 0 6px; font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--mint); }
.card p { margin: 6px 0 10px; }
.muted { color: var(--mute); }
.small { font-size: 12.5px; }
.btns { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.btn { flex: 1; min-height: 46px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.07); font-weight: 700; }
.btn.gold { background: var(--orange); border-color: var(--orange); color: #fff; }
.btn.ghost { background: transparent; }
.btn:disabled { opacity: 0.6; }
.link { background: none; border: 0; color: var(--mint); padding: 8px 0; font-weight: 600; }
.err { color: #ff8b78; min-height: 18px; font-size: 13px; margin: 4px 0; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 10px 0; flex-wrap: wrap; }
.row > span { font-weight: 600; font-size: 14px; }
.inline { display: flex; align-items: center; gap: 10px; }
.inline b { font: 22px var(--num); color: var(--gold); }
.seg { display: flex; background: rgba(255, 255, 255, 0.06); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: none; padding: 7px 11px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--mute); }
.seg button.on { background: var(--ink); color: #111; }
.swatches { display: flex; gap: 7px; flex-wrap: wrap; }
.swatches button { width: 28px; height: 28px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.25); }
.swatches button.on { border-color: #fff; box-shadow: 0 0 0 2px var(--orange); }
input[type=range] { accent-color: var(--orange); width: 160px; }
.card input:not([type=range]) { width: 100%; height: 46px; border-radius: 12px; border: 1px solid var(--line); background: rgba(0, 0, 0, 0.35); color: var(--ink); padding: 0 14px; font: inherit; margin-bottom: 8px; }
form { margin: 0; }

/* --- the menu */
#menu { align-items: stretch; justify-content: flex-start; flex-direction: column; z-index: 20; background: linear-gradient(90deg, rgba(10, 11, 10, 0.9) 0, rgba(10, 11, 10, 0.72) 380px, rgba(10, 11, 10, 0) 620px), linear-gradient(180deg, rgba(10, 11, 10, 0.5), rgba(10, 11, 10, 0) 18%); }
.menuTop { display: flex; justify-content: space-between; align-items: center; }
.acct { display: flex; gap: 8px; align-items: center; height: 38px; padding: 0 14px; border-radius: 19px; border: 1px solid var(--line); background: var(--glass); font-weight: 700; font-size: 13px; }
.acct .mxc { display: flex; align-items: center; gap: 4px; color: var(--gold); }
.menuBody { margin: auto 0 0; width: min(440px, 100%); align-self: flex-start; padding-left: 8px; }
@media (max-aspect-ratio: 1/1) {
  #menu { background: linear-gradient(180deg, rgba(10, 11, 10, 0.55) 0%, rgba(10, 11, 10, 0) 18%, rgba(10, 11, 10, 0) 40%, rgba(10, 11, 10, 0.88) 62%, rgba(10, 11, 10, 0.95) 100%); }
  .menuBody { align-self: center; padding-left: 0; }
}
.logo { display: flex; align-items: baseline; gap: 10px; }
.logo .l1 { font: 84px/0.9 var(--num); letter-spacing: 4px; text-shadow: 0 4px 24px rgba(0, 0, 0, 0.5); }
.logo .l2 { font: 84px/0.9 var(--num); color: var(--orange); }
.tag { margin: 6px 0 16px; color: #e8e4da; text-shadow: 0 1px 8px rgba(0, 0, 0, 0.7); }
.modes { display: flex; flex-direction: column; gap: 10px; }
.mode { text-align: left; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--glass); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); display: flex; flex-direction: column; gap: 2px; }
.mode b { font: 24px/1 var(--num); letter-spacing: 1px; }
.mode span { color: var(--mute); font-size: 13px; }
#mCpu { border-color: rgba(255, 90, 38, 0.6); }
#mCpu b { color: #fff; }
.minor { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin-top: 12px; }
.minor button, .minor a { background: none; border: 0; color: var(--mint); font-weight: 600; font-size: 13px; padding: 6px 8px; text-decoration: none; }

/* --- HUD */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; display: none; }
body[data-phase=play] #hud, body[data-phase=results] #hud { display: block; }
.scoreboard { position: absolute; left: 10px; top: calc(10px + var(--safe-t)); min-width: 230px; background: var(--glass); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.scoreboard .head { font: 11px Inter; font-weight: 800; letter-spacing: 1.6px; color: var(--mint); padding: 6px 10px 4px; border-bottom: 1px solid var(--line); }
.scoreboard .row { display: grid; grid-template-columns: 6px 1fr auto; grid-template-rows: auto auto; column-gap: 9px; margin: 0; padding: 6px 10px 6px 0; border-left: 3px solid transparent; }
.scoreboard .row.on { border-left-color: var(--orange); background: rgba(255, 90, 38, 0.12); }
.scoreboard .row i { grid-row: 1 / 3; width: 6px; border-radius: 3px; margin-left: 8px; }
.scoreboard .row .nm { font-weight: 700; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.scoreboard .row .nm em { font-style: normal; color: var(--mute); font-weight: 600; font-size: 11px; margin-left: 4px; }
.scoreboard .row b { grid-row: 1 / 3; grid-column: 3; font: 38px/1 var(--num); align-self: center; min-width: 54px; text-align: right; }
.scoreboard .row small { color: var(--mute); font-size: 11.5px; }
.visit { position: absolute; left: 10px; top: calc(var(--sbh, 128px) + var(--safe-t)); display: flex; gap: 5px; }
.visit span { min-width: 46px; height: 28px; padding: 0 6px; display: grid; place-items: center; border-radius: 8px; background: var(--glass); border: 1px solid var(--line); font: 19px var(--num); letter-spacing: 0.5px; }
.visit span.hit { color: #fff; border-color: rgba(255, 210, 63, 0.5); }
.visit span.miss { color: var(--mute); }
.checkout { position: absolute; left: 10px; top: calc(var(--sbh, 128px) + 36px + var(--safe-t)); display: none; gap: 5px; align-items: center; background: rgba(255, 90, 38, 0.9); color: #fff; padding: 4px 10px; border-radius: 8px; font-size: 12px; font-weight: 700; max-width: calc(100vw - 20px); }
.checkout.on { display: flex; }
.checkout b { font: 18px var(--num); letter-spacing: 0.5px; }
.hudBtns { position: absolute; right: 10px; top: calc(10px + var(--safe-t)); display: flex; gap: 8px; pointer-events: auto; }
.ibtn { width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--line); background: var(--glass); display: grid; place-items: center; }
.ibtn svg { width: 22px; height: 22px; fill: currentColor; }
.chat { position: absolute; right: 10px; top: calc(60px + var(--safe-t)); display: flex; flex-direction: column; gap: 6px; pointer-events: auto; }
.chat button { background: var(--glass); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; font-weight: 600; text-align: left; }
#banner { position: absolute; left: 50%; top: 34%; transform: translate(-50%, -50%) scale(0.8); opacity: 0; transition: opacity 0.2s, transform 0.25s; font: 74px/1 var(--num); letter-spacing: 2px; text-shadow: 0 4px 30px rgba(0, 0, 0, 0.6); white-space: nowrap; color: #fff; }
#banner.on { opacity: 1; transform: translate(-50%, -50%) scale(1); }
#banner.max { color: var(--gold); font-size: 110px; }
#banner.ton { color: var(--gold); }
#banner.bust { color: #ff6b5a; }
#banner.win, #banner.basket { color: var(--orange); }
#banner.chat { font: 700 17px Inter; letter-spacing: 0; background: var(--glass); padding: 10px 16px; border-radius: 12px; top: 22%; white-space: normal; max-width: 90vw; text-align: center; }
#status { position: absolute; left: 0; right: 0; bottom: calc(18px + var(--safe-b)); text-align: center; color: #fff; font-weight: 600; font-size: 13.5px; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.9); padding: 0 60px; }
.flick { position: absolute; left: 50%; bottom: calc(52px + var(--safe-b)); transform: translateX(-50%); width: 220px; opacity: 0; transition: opacity 0.3s; text-align: center; }
.flick.on { opacity: 1; }
.flick .bar { position: relative; height: 8px; border-radius: 4px; background: linear-gradient(90deg, #4c8cff, rgba(255, 255, 255, 0.25) 40%, rgba(255, 255, 255, 0.25) 60%, #ff5a5a); }
.flick .sweet { position: absolute; left: 46%; width: 8%; top: -2px; bottom: -2px; border-radius: 3px; background: var(--mint); }
.flick .mark { position: absolute; top: -5px; width: 4px; height: 18px; margin-left: -2px; border-radius: 2px; background: #fff; box-shadow: 0 0 6px rgba(0, 0, 0, 0.6); transition: left 0.25s; }
.flick span { display: block; margin-top: 6px; font-size: 12.5px; font-weight: 700; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9); }
.hint { position: absolute; left: 50%; bottom: calc(90px + var(--safe-b)); transform: translateX(-50%); width: min(360px, calc(100vw - 32px)); background: var(--glass); border: 1px solid rgba(255, 90, 38, 0.5); border-radius: 14px; padding: 12px 14px; font-size: 14px; opacity: 0; transition: opacity 0.4s; }
.hint.on { opacity: 1; }
#pops { position: fixed; inset: 0; pointer-events: none; z-index: 11; }
.pop { position: absolute; left: 0; top: 0; font: 30px/1 var(--num); color: #fff; letter-spacing: 1px; text-shadow: 0 2px 10px rgba(0, 0, 0, 0.85); white-space: nowrap; }
.pop.big { color: var(--gold); font-size: 36px; }
.pop.miss { color: #d8d4cc; font-size: 22px; }

/* --- results */
.kick { font-size: 11px; font-weight: 800; letter-spacing: 1.6px; color: var(--mint); margin-bottom: 4px; }
.resTitle { font-size: 44px !important; color: #fff; }
table.res { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.res th, table.res td { padding: 6px 4px; border-bottom: 1px solid var(--line); text-align: right; }
table.res th:first-child, table.res td:first-child { text-align: left; color: var(--mute); }
table.res th i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; }
table.res td { font: 19px var(--num); letter-spacing: 0.5px; }
table.res td:first-child { font: 13px Inter; }
.resMxc { margin-top: 10px; display: flex; gap: 6px; align-items: center; font-weight: 700; color: var(--gold); min-height: 20px; }
.card.results { width: min(500px, 100%); }

/* --- online */
.code { font: 64px/1 var(--num); letter-spacing: 10px; text-align: center; color: var(--gold); margin: 10px 0; }
.join { display: flex; gap: 8px; margin-top: 10px; }
.join input { margin: 0 !important; text-transform: uppercase; letter-spacing: 4px; font-weight: 700; }
.join .btn { flex: 0 0 90px; }
.spinner { width: 32px; height: 32px; margin: 14px auto 0; border-radius: 50%; border: 3px solid rgba(255, 255, 255, 0.15); border-top-color: var(--orange); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* --- how to / stats */
.howimg { width: 100%; max-width: 260px; display: block; margin: 0 auto 6px; }
ol.how { padding-left: 20px; margin: 6px 0; }
ol.how li { margin: 8px 0; color: #dcd8cf; }
ul.stats { list-style: none; padding: 0; margin: 0; }
ul.stats li { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid var(--line); }
ul.stats li span { font: 20px var(--num); color: var(--gold); }

/* the shared back link pill sits over the 3D view */
.mdt-back { pointer-events: auto; }

@media (max-width: 430px) {
  .logo .l1, .logo .l2 { font-size: 70px; }
  .scoreboard { min-width: 200px; }
  .scoreboard .row b { font-size: 32px; }
  #banner { font-size: 60px; }
  #banner.max { font-size: 90px; }
  .hudBtns .ibtn { width: 38px; height: 38px; }
}
@media (prefers-reduced-motion: reduce) { #banner, .flick, .hint { transition: none; } }

/* walking: the Step back button and the floating stick */
.stepBtn { position: absolute; left: 12px; bottom: calc(50px + var(--safe-b)); pointer-events: auto; display: none; padding: 9px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--glass); color: #fff; font: 700 13px Inter, system-ui, sans-serif; }
.stepBtn.on { display: block; }
.stick { position: fixed; width: 112px; height: 112px; margin: -56px 0 0 -56px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.35); background: rgba(0, 0, 0, 0.18); pointer-events: none; display: none; z-index: 11; }
.stick.on { display: block; }
.stick i { position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; border-radius: 50%; background: rgba(242, 201, 76, 0.85); transform: translate(-50%, -50%); }
