/* Font geometris bergaya logo Ueno (Jost, SIL OFL 1.1), satu file variabel 100-900. */
@font-face {
  font-family: "Jost";
  src: url("../assets/fonts/Jost.ttf") format("truetype");
  font-weight: 100 900;
  font-display: swap;
}
:root {
  --primary: #4c392b; --accent: #d1a457; --cream: #f7f1e7; --ink: #2a1f17;
  --brick: #b5432e; --paper: #efe6d8;
  --pix: "Jost", "Segoe UI", system-ui, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; height: 100%; overflow: hidden; background: #2b1d12; color: var(--cream);
  font-family: var(--pix); font-size: 14px; line-height: 1.6; font-weight: 500;
  overscroll-behavior: none; touch-action: none; user-select: none; -webkit-user-select: none;
}
#game { position: fixed; left: 0; top: 0; display: block; touch-action: none; }
.hidden { display: none !important; }
.muted { opacity: .78; font-size: 12px; line-height: 1.7; font-family: var(--body); }
h1, h2 { font-weight: normal; }

/* ---------- tombol bergaya kartun: garis tinta tebal dan sudut membulat ---------- */
.btn {
  appearance: none; border: 3px solid var(--ink); border-radius: 22px; padding: 12px 20px; min-height: 48px;
  font: inherit; font-size: 15px; font-weight: 600; letter-spacing: 2px; color: var(--ink); background: var(--accent);
  cursor: pointer; touch-action: manipulation;
  box-shadow: inset 0 -5px 0 rgba(36,26,20,.22), inset 0 4px 0 rgba(255,255,255,.35), 0 4px 0 var(--ink);
  transition: transform .08s ease, box-shadow .08s ease;
}
.btn:active { transform: translateY(4px); box-shadow: inset 0 -3px 0 rgba(36,26,20,.22), inset 0 3px 0 rgba(255,255,255,.3); }
.btn.big { font-size: 19px; padding: 14px 30px; }
.btn.small { min-height: 40px; padding: 8px 14px; font-size: 13px; }
.btn.ghost { background: var(--paper); color: var(--ink); }
.btn.danger { background: var(--brick); color: var(--cream); }
.btn:disabled { opacity: .45; }
.icon-btn {
  appearance: none; border: 3px solid var(--ink); border-radius: 50%; width: 50px; height: 50px; padding: 0;
  background: var(--paper); color: var(--ink); cursor: pointer; touch-action: manipulation; pointer-events: auto;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: inset 0 -4px 0 rgba(36,26,20,.18), inset 0 3px 0 rgba(255,255,255,.4), 0 4px 0 var(--ink);
}
.icon-btn:active { transform: translateY(4px); box-shadow: none; }
.icon-btn img { width: 28px; height: 28px; }

/* ---------- HUD ---------- */
#hud {
  position: fixed; left: 0; right: 0; top: 0; display: flex; justify-content: space-between; align-items: center;
  padding: calc(env(safe-area-inset-top) + 8px) calc(env(safe-area-inset-right) + 10px) 0 calc(env(safe-area-inset-left) + 10px);
  pointer-events: none; font-size: 19px; text-shadow: 2px 2px 0 var(--ink), -1px -1px 0 var(--ink);
}
#hud > div { flex: 1; display: flex; align-items: center; gap: 8px; }
.hud-c { justify-content: center; gap: 14px; }
.hud-score { display: flex; flex-direction: column; align-items: center; line-height: 1; }
.hud-score small { font-size: 11px; letter-spacing: 2px; color: var(--accent); }
#hud-score { font-size: 28px; }
.hud-coins { display: flex; align-items: center; gap: 6px; font-size: 17px; }
.hud-r { justify-content: flex-end; }
/* Nyawa: lencana krem bergaris tinta supaya tetap terbaca di latar terang (pagi)
   maupun gelap (luar angkasa). Ukurannya naik mengikuti lebar layar. */
#hud-hearts {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 11px 4px 8px; border: 3px solid var(--ink); border-radius: 999px;
  background: radial-gradient(circle at 50% -20%, #fffdf8, #f6ecdb 62%, #e8d9c0);
  box-shadow: inset 0 3px 0 rgba(255,255,255,.8), inset 0 -5px 0 rgba(60,40,25,.15), 0 4px 0 rgba(36,26,20,.45);
}
#hud-hearts img { width: 30px; height: 30px; display: block; filter: drop-shadow(0 1px 0 rgba(255,255,255,.35)); }
@media (min-width: 401px) {
  #hud-hearts { gap: 5px; padding: 4px 12px 5px 9px; }
  #hud-hearts img { width: 38px; height: 38px; }
}
@media (min-width: 600px) {
  #hud-hearts { gap: 7px; padding: 6px 16px 7px 11px; }
  #hud-hearts img { width: 46px; height: 46px; }
}
@media (min-width: 1200px) {
  #hud-hearts { gap: 8px; padding: 7px 19px 8px 13px; border-width: 4px; }
  #hud-hearts img { width: 54px; height: 54px; }
}
/* Nyawa berkurang: lencana bergetar sekali supaya pemain sadar. */
@keyframes lifeHit {
  0% { transform: scale(1) rotate(0); }
  18% { transform: scale(1.12) rotate(-2.5deg); }
  38% { transform: scale(.94) rotate(2.5deg); }
  58% { transform: scale(1.06) rotate(-1.2deg); }
  100% { transform: scale(1) rotate(0); }
}
#hud-hearts.hit { animation: lifeHit .55s cubic-bezier(.34,.72,.38,1); }
@media (prefers-reduced-motion: reduce) {
  #hud-hearts.hit { animation: none; }
}
.coin-ico { width: 28px; height: 28px; display: inline-block; background: center / contain no-repeat; image-rendering: pixelated; }
#hud-coins { display: inline-block; }
@keyframes bump { 50% { transform: scale(1.45); color: var(--accent); } }

/* ---------- layar ---------- */
.screen {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  background: rgba(20,12,6,.6);
}
.screen.top { align-items: flex-start; background: linear-gradient(rgba(20,12,6,.6), rgba(20,12,6,0)); pointer-events: none; }
.screen.top > * { pointer-events: auto; }

.panel {
  background: var(--primary); border: 4px solid var(--ink); border-radius: 16px; padding: 18px;
  width: calc(100% - 24px); max-width: 540px; max-height: calc(100% - 16px);
  box-shadow: inset 0 0 0 3px var(--accent), 0 8px 0 rgba(36,26,20,.5);
}
.panel.center { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.panel h2, .settings-box h2 { margin: 0; color: var(--accent); font-size: 22px; font-weight: 600; letter-spacing: 4px; }
.scroll { overflow-y: auto; overflow-x: hidden; touch-action: pan-y; -webkit-overflow-scrolling: touch; }
.input, select {
  font-family: var(--body); font-size: 14px; color: var(--cream); background: rgba(36,26,20,.4);
  border: 2px solid var(--ink); border-radius: 8px; padding: 10px 12px; min-height: 42px; width: 100%;
  user-select: text; -webkit-user-select: text;
}
.gbtn { min-height: 44px; display: flex; justify-content: center; }
.shake { animation: shake .3s ease; }
@keyframes shake { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }

/* ---------- layar selesai + gacha ---------- */
.stats { display: flex; gap: 8px; width: 100%; }
.stat { flex: 1; background: rgba(0,0,0,.35); border: 3px solid var(--ink); padding: 8px 2px; }
.stat b { display: block; font-weight: normal; font-size: 21px; color: var(--accent); }
.stat span { font-size: 11px; opacity: .85; font-family: var(--body); }
.gacha { width: 100%; background: rgba(0,0,0,.28); border: 3px solid var(--ink); padding: 12px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.gacha > b { font-weight: normal; font-size: 16px; letter-spacing: 1px; color: var(--accent); }
.reel { width: min(100%, 300px); height: 112px; overflow: hidden; border: 3px solid var(--ink); border-radius: 10px; background: #2a1a0e; position: relative; box-shadow: inset 0 0 0 3px var(--accent); }
.reel::before, .reel::after { content: ""; position: absolute; left: 0; right: 0; height: 22px; z-index: 2; pointer-events: none; }
.reel::before { top: 0; background: linear-gradient(rgba(42,26,14,.95), transparent); }
.reel::after { bottom: 0; background: linear-gradient(transparent, rgba(42,26,14,.95)); }
.strip { will-change: transform; }
.it { height: 112px; display: flex; align-items: center; justify-content: center; gap: 12px; padding: 0 12px; font-size: 13px; line-height: 1.5; text-align: left; }
.it img { width: 58px; height: 58px; object-fit: contain; flex: none; }
.result { width: 100%; padding: 12px; background: rgba(214,163,60,.18); border: 3px dashed var(--accent); border-radius: 10px; animation: pop .4s ease; }
.result.zonk { background: rgba(255,255,255,.06); border-color: rgba(242,227,198,.35); }
.result .big { font-size: 16px; color: var(--accent); line-height: 1.6; letter-spacing: .5px; }
.code { font-size: 20px; letter-spacing: 2px; margin: 8px 0; user-select: text; -webkit-user-select: text; word-break: break-all; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } }
.row-btns { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; width: 100%; }

/* ---------- credit ---------- */
#credits-panel h2 { margin-bottom: 12px; }
.credit { border: 2px solid var(--ink); border-radius: 10px; background: rgba(36,26,20,.28); padding: 10px 12px; margin-bottom: 10px; font-size: 12px; line-height: 1.7; font-family: var(--body); }
.credit b { display: block; color: var(--accent); font-weight: normal; font-size: 15px; margin-bottom: 4px; font-family: var(--pix); }
.credit a { color: #9ad7f5; word-break: break-all; }
.credit .lic { opacity: .85; }

/* ---------- pengaturan (isi memakai font sistem agar mudah dibaca) ---------- */
.settings-box {
  width: min(760px, 100%); height: 100%; max-height: 100%; display: flex; flex-direction: column;
  background: #3b2819; padding: 12px 14px; border-left: 4px solid var(--ink); border-right: 4px solid var(--ink);
}
.settings-box header { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; row-gap: 4px; }
.settings-box header h2 { flex: 1 1 auto; }
/* Header boleh terlipat: bila tidak muat, tombol KELUAR/SELESAI turun ke baris berikutnya (rata
   kanan). Dulu satu baris kaku, jadi tombolnya terdorong keluar layar di HP tanpa layar penuh. */
.settings-box header #saved, .settings-box header #who { min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.settings-box header .hdr-btns { display: flex; gap: 10px; flex: none; margin-left: auto; }
#tabs { display: flex; gap: 6px; overflow-x: auto; padding: 12px 0; touch-action: pan-x; flex: none; }
#tabs button { flex: none; border: 2px solid var(--ink); border-radius: 16px; padding: 8px 14px; font: inherit; font-size: 13px; background: var(--paper); color: var(--ink); min-height: 40px; }
#tabs button.on { background: var(--accent); color: var(--ink); box-shadow: inset 0 -3px 0 rgba(36,26,20,.2); }
#settings-body { flex: 1; padding: 0 16px 40px 2px; scrollbar-gutter: stable; font-family: var(--body); font-size: 14px; line-height: 1.4; }
/* Kartu kelompok pengaturan (satu kartu per mode/kelompok). */
.set-card { background: rgba(20,12,6,.35); border: 2px solid var(--ink); border-radius: 14px; padding: 4px 14px 6px; margin: 12px 0; box-shadow: inset 0 0 0 1px rgba(247,241,231,.08); }
.set-card > h3 { margin: 10px 0 2px; font-family: var(--pix); font-size: 16px; font-weight: 600; color: var(--accent); letter-spacing: 1px; }
.set-card > .field:last-child { border-bottom: 0; }
.set-card > .tools { padding: 8px 0; }
#settings-body .btn, #settings-body .section-title { font-family: var(--pix); }
.field { display: flex; flex-direction: column; gap: 6px; padding: 10px 0; border-bottom: 2px solid rgba(255,255,255,.08); }
.field > .lab { display: flex; justify-content: space-between; gap: 8px; font-weight: 600; font-size: 14px; }
.field > .lab b { color: var(--accent); }
.field .hint, .hint { font-size: 12px; opacity: .7; }
.field input[type=range] { width: 100%; accent-color: var(--accent); height: 32px; }
.field input[type=color] { width: 64px; height: 40px; border: 3px solid var(--ink); background: none; padding: 0; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.switch input { width: 26px; height: 26px; accent-color: var(--accent); }
.card { background: rgba(36,26,20,.3); border: 2px solid var(--ink); border-radius: 10px; padding: 12px; margin: 10px 0; display: flex; flex-direction: column; gap: 8px; }
.card .top { display: flex; align-items: center; gap: 10px; }
.card canvas { background: var(--paper); border-radius: 6px; flex: none; }
.card .thumb { width: 56px; height: 56px; flex: none; background: rgba(242,227,198,.12); border-radius: 8px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.card .thumb img { width: 100%; height: 100%; object-fit: contain; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sub { font-size: 12px; opacity: .7; margin-bottom: -4px; }
.tools { display: flex; gap: 6px; flex-wrap: wrap; }
.section-title { margin: 18px 0 4px; color: var(--accent); font-size: 16px; letter-spacing: .5px; }
.claim { font-size: 13px; padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,.08); }
.claim code { color: var(--accent); }

#toast {
  position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 24px); transform: translate(-50%, 20px);
  background: var(--ink); color: var(--cream); padding: 10px 18px; border: 2px solid var(--accent); border-radius: 20px;
  opacity: 0; pointer-events: none; transition: .25s ease; z-index: 50; max-width: 90%; text-align: center;
  font-size: 14px; line-height: 1.6;
}
#toast.on { opacity: 1; transform: translate(-50%, 0); }

/* Lanskap pendek (HP diputar): rapatkan panel supaya tetap muat. */
@media (max-height: 480px) {
  .btn.big { font-size: 16px; padding: 10px 22px; min-height: 44px; }
  .panel { padding: 12px; gap: 8px; }
  .gacha { padding: 8px; }
  .reel, .it { height: 88px; }
  .it img { width: 46px; height: 46px; }
  #hud { font-size: 16px; }
  #hud-hearts { gap: 4px; padding: 2px 9px 3px 6px; border-width: 2px; }
  #hud-hearts img { width: 28px; height: 28px; }
}
.card canvas { width: 108px; height: 100px; }

/* ---------- lobby arcade ---------- */
/* Area kosong tembus ke kanvas supaya pemain bisa mengetuk si gelas. */
.screen.lobby {
  display: grid; grid-template-columns: 1fr minmax(250px, 330px); gap: 18px; align-items: start; justify-items: center;
  padding: calc(env(safe-area-inset-top) + 16px) calc(env(safe-area-inset-right) + 18px) 16px calc(env(safe-area-inset-left) + 18px);
  background: linear-gradient(rgba(20,12,6,.5), rgba(20,12,6,0) 70%); pointer-events: none;
}
.screen.lobby > *, .lobby-main > * { pointer-events: auto; }
.lobby-main { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; pointer-events: none; max-width: 520px; width: 100%; }
.marquee {
  position: relative; padding: 18px 30px 16px; border: 4px solid var(--ink); border-radius: 22px; background: var(--primary);
  box-shadow: inset 0 0 0 3px var(--accent), 0 8px 0 rgba(36,26,20,.55); width: 100%;
}
/* Bingkai dalam ganda seperti papan menu kedai Jepang. */
.marquee::before { content: ""; position: absolute; inset: 8px; border: 1.5px solid rgba(247,241,231,.55); border-radius: 14px; pointer-events: none; }
#logo { width: 150px; height: auto; display: block; margin: 0 auto; animation: breathe 4s ease-in-out infinite; }
@keyframes breathe { 50% { transform: translateY(-3px); } }
.marquee h1 { margin: 10px 0 0; font-size: 22px; font-weight: 500; color: var(--accent); line-height: 1.2; letter-spacing: 10px; padding-left: 10px; text-transform: uppercase; }
.marquee p { margin: 6px 0 0; font-size: 13px; opacity: .92; line-height: 1.6; font-family: var(--body); }
.btn.play { font-size: 34px; font-weight: 700; padding: 10px 64px; border-radius: 30px; letter-spacing: 10px; animation: pulse 1.1s ease-in-out infinite; }
.btn.play:active { animation: none; }
/* Pemilih mode awal (khusus pemilik): tiga tombol kecil di bawah PLAY. */
.mode-pick { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: center; }
.mode-lab { font-size: 10px; letter-spacing: 2px; color: var(--ink); opacity: .85; margin-right: 2px; text-shadow: 0 1px 0 rgba(255,255,255,.6); }
.mode-btn {
  appearance: none; font: inherit; font-size: 12px; font-weight: 600; letter-spacing: 1.5px;
  color: var(--ink); background: var(--paper); border: 3px solid var(--ink); border-radius: 16px;
  padding: 5px 12px; min-height: 36px; cursor: pointer; touch-action: manipulation;
  box-shadow: inset 0 -3px 0 rgba(36,26,20,.18), 0 3px 0 var(--ink);
}
.mode-btn.on { background: var(--accent); box-shadow: inset 0 -3px 0 rgba(36,26,20,.24), 0 3px 0 var(--ink); }
.mode-btn:active { transform: translateY(3px); box-shadow: none; }
@keyframes pulse { 50% { transform: scale(1.06); } }
.toggle {
  appearance: none; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; touch-action: manipulation;
  border: 3px solid var(--ink); border-radius: 26px; padding: 6px 8px 6px 12px; min-height: 48px; background: var(--paper);
  color: var(--ink); font: inherit; font-size: 16px; letter-spacing: 1px;
  box-shadow: inset 0 -4px 0 rgba(36,26,20,.18), 0 4px 0 var(--ink);
}
.toggle img { width: 26px; height: 26px; }
.toggle b { font-weight: normal; min-width: 54px; padding: 4px 10px; border: 2px solid var(--ink); border-radius: 16px; background: #7fb069; color: var(--ink); }
.toggle.off b { background: var(--brick); color: var(--cream); }
.toggle:active { transform: translateY(3px); box-shadow: none; }

.board {
  width: 100%; background: var(--primary); border: 4px solid var(--ink); border-radius: 16px; padding: 12px 14px 10px;
  box-shadow: inset 0 0 0 3px var(--accent), 0 8px 0 rgba(36,26,20,.55);
}
.board h2 { margin: 0 0 8px; text-align: center; color: var(--accent); font-size: 20px; font-weight: 600; letter-spacing: 6px; }
.board ol, .board-list { list-style: none; margin: 0; padding: 0; width: 100%; }
.board li, .board-list li {
  display: grid; grid-template-columns: 30px 1fr auto; gap: 8px; align-items: center;
  padding: 5px 8px; border-radius: 8px; font-size: 17px; letter-spacing: 1px;
}
.board li:nth-child(odd), .board-list li:nth-child(odd) { background: rgba(36,26,20,.3); }
.board .rk, .board-list .rk { color: var(--paper); opacity: .8; text-align: right; }
.board .nm, .board-list .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
.board .sc, .board-list .sc { color: var(--accent); }
li.top1 .rk, li.top1 .sc { color: #ffd54a; }
li.top2 .rk, li.top2 .sc { color: #e3e0d8; }
li.top3 .rk, li.top3 .sc { color: #e0a070; }
li.me { background: var(--accent) !important; color: var(--ink); animation: pop .5s ease; }
li.me .rk, li.me .sc { color: var(--ink) !important; opacity: 1; }
li.empty { display: block; text-align: center; font-family: var(--body); font-size: 13px; opacity: .8; }
#board-note { margin: 6px 0 0; text-align: center; min-height: 1em; }
.lobby-corner { position: fixed; right: calc(env(safe-area-inset-right) + 12px); bottom: calc(env(safe-area-inset-bottom) + 12px); display: flex; gap: 10px; align-items: center; }

/* Layar akhir: skor besar + isi nama. */
.big-score { display: flex; flex-direction: column; align-items: center; line-height: 1; }
.big-score small { font-size: 13px; letter-spacing: 3px; color: var(--paper); }
.big-score b { font-weight: 700; font-size: 54px; color: var(--accent); letter-spacing: 2px; }
.name-form { display: flex; gap: 8px; width: 100%; }
.input.name { font-family: var(--pix); font-size: 22px; letter-spacing: 3px; text-transform: uppercase; text-align: center; color: var(--cream); }
.save-msg { min-height: 1.4em; font-family: var(--body); font-size: 14px; }
.save-msg.ok { color: var(--accent); font-family: var(--pix); font-size: 18px; }
.save-msg.err { color: #ffb4a2; }
.board-list.mini li { font-size: 15px; padding: 3px 8px; }

/* Papan skor disembunyikan: judul, PLAY, dan suara di tengah layar. */
.screen.lobby.no-board { grid-template-columns: 1fr; }

@media (max-aspect-ratio: 1/1) {
  .screen.lobby { grid-template-columns: 1fr; gap: 12px; overflow-y: auto; }
  .board { max-width: 520px; }
  .marquee h1 { font-size: 20px; }
  #logo { width: 130px; }
  .btn.play { font-size: 30px; padding: 10px 52px; }
}
@media (max-height: 480px) {
  .screen.lobby { gap: 12px; padding-top: 8px; }
  .lobby-main { gap: 8px; }
  #logo { width: 84px; }
  .marquee { padding: 10px 20px; }
  .marquee h1 { font-size: 16px; margin-top: 4px; }
  .marquee p { display: none; }
  .btn.play { font-size: 26px; padding: 6px 44px; }
  .board li { font-size: 14px; padding: 2px 8px; }
  .board h2 { font-size: 18px; margin-bottom: 4px; }
  .big-score b { font-size: 38px; }
}

/* ---------- layar akhir: kartu skor untuk kasir ---------- */
.score-card { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; }
.score-canvas { width: 320px; max-width: 100%; height: auto; aspect-ratio: 320 / 168; display: block; }
.cashier { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; font-family: var(--body); }
.cashier > b { font-size: 18px; color: var(--accent); letter-spacing: .5px; }
.cashier small { font-size: 12px; opacity: .85; }
.confirm-bg { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; background: rgba(20,12,6,.6); padding: 16px; }
.confirm { max-width: 360px; text-align: center; }
.confirm p { margin: 0 0 14px; font-family: var(--body); font-size: 16px; font-weight: 600; line-height: 1.4; }
.ticks { display: flex; justify-content: space-between; font-size: 11px; opacity: .7; margin-top: -4px; }

/* Layar akhir di HP lanskap (layar pendek): skor di kiri, angka dan tombol di kanan, supaya semua
   terlihat tanpa menggulir. Isi tambahan (simpan nama, papan skor, gacha) di bawahnya, selebar panel. */
@media (max-height: 480px) and (min-aspect-ratio: 4/3) {
  #over-panel {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 14px; row-gap: 8px;
    align-items: center; max-width: 760px; padding: 8px 14px;
  }
  #over-panel > * { grid-column: 1 / -1; }
  #over-panel > h2 { grid-row: 1; font-size: 18px; }
  #over-panel > .muted { grid-row: 2; margin: 0; }
  #over-panel .score-card { display: contents; }
  #over-panel .score-canvas { grid-column: 1; grid-row: 3 / span 3; justify-self: center; width: min(320px, 100%, calc((100vh - 70px) * 1.9)); width: min(320px, 100%, calc((100dvh - 70px) * 1.9)); }
  #over-panel .stats { grid-column: 2; grid-row: 3; }
  #over-panel .cashier { grid-column: 2; grid-row: 4; }
  #over-panel > .row-btns { grid-column: 2; grid-row: 5; }
  #over-panel .stat { padding: 5px 2px; }
  #over-panel .stat b { font-size: 18px; }
  #over-panel .stat span { font-size: 10px; }
  #over-panel .cashier > b { font-size: 15px; }
  #over-panel .row-btns .btn { min-height: 0; padding: 7px 18px; font-size: 15px; }
}

/* Petunjuk layar penuh di lobi (HP, selama belum layar penuh; lihat wantFull di js/ui.js). */
#fs-hint {
  position: fixed; left: calc(env(safe-area-inset-left) + 12px); bottom: calc(env(safe-area-inset-bottom) + 12px);
  padding: 6px 12px; border-radius: 999px; background: rgba(36,26,20,.78); border: 2px solid rgba(247,241,231,.35);
  color: var(--cream); font-family: var(--body); font-size: 12px; letter-spacing: .5px; pointer-events: none;
  animation: fs-blink 1.8s ease-in-out infinite;
}
@keyframes fs-blink { 50% { opacity: .55; } }
@media (max-aspect-ratio: 1/1) {
  #fs-hint { left: 50%; bottom: calc(env(safe-area-inset-bottom) + 76px); transform: translateX(-50%); white-space: nowrap; }
}

/* Saran orientasi lanskap untuk HP tegak (lihat paintRotateTip di js/ui.js). */
#rotate-tip { z-index: 60; background: rgba(20,12,6,.72); }
#rotate-tip .panel { max-width: 340px; gap: 10px; }
#rotate-tip p { margin: 0; font-family: var(--body); font-size: 14px; line-height: 1.45; }
#rotate-tip .row-btns { margin-top: 4px; }
.rotate-ico {
  width: 40px; height: 66px; border: 4px solid var(--cream); border-radius: 9px; position: relative;
  animation: rotate-hp 2.4s ease-in-out infinite;
}
.rotate-ico::after { content: ""; position: absolute; left: 50%; bottom: 4px; width: 8px; height: 8px; margin-left: -4px; border-radius: 50%; background: var(--cream); }
@keyframes rotate-hp { 0%, 25% { transform: rotate(0); } 55%, 85% { transform: rotate(-90deg); } 100% { transform: rotate(0); } }
@media (prefers-reduced-motion: reduce) { .rotate-ico { animation: none; transform: rotate(-90deg); } }

/* Tombol layar penuh (lihat toggleFull di js/ui.js). */
.fs-btn svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2.8; stroke-linecap: round; stroke-linejoin: round; }

/* Menu pause: tombol bersusun; di layar pendek (HP lanskap tanpa layar penuh) sebaris supaya
   tidak keluar dari panel. */
.pause-btns { display: flex; flex-direction: column; align-items: center; gap: 12px; }
@media (max-height: 480px) {
  #pause .panel { padding: 12px 16px; gap: 10px; }
  .pause-btns { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 10px; }
  .pause-btns .btn { min-height: 0; padding: 9px 18px; font-size: 15px; }
}
@media (max-height: 480px) {
  .settings-box { padding: 8px 12px; }
  .settings-box header h2 { font-size: 18px; letter-spacing: 3px; }
  #tabs { padding: 6px 0; }
  #tabs button { min-height: 34px; padding: 6px 12px; }
}
