@font-face { font-family: Baloo2vi; src: url(vendor/fonts/Baloo2-vi.ttf) format('truetype'); font-weight: 400 800; font-display: block; }
:root { --bg: #0b1530; --panel: #14244f; --line: #2c4a94; --txt: #f2f7ff; --dim: #b9cdf5; --acc: #27aef0; --ok: #46d16b; --warn: #ffb23f; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--txt); font: 600 17px/1.3 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overscroll-behavior: none; touch-action: manipulation; -webkit-user-select: none; user-select: none; -webkit-text-size-adjust: 100%; }
#app { height: 100%; height: 100dvh; display: flex; flex-direction: column; gap: 10px;
  padding: max(12px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); position: relative; }
#top { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 40px; }
#who { display: flex; flex-direction: column; min-width: 0; }
#pname { font-size: 22px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#coins { color: var(--warn); font-size: 15px; }
#tummy { flex: 1 1 auto; max-width: 42%; margin-left: auto; height: 16px; border-radius: 8px; background: #08122b; border: 2px solid var(--line); overflow: hidden; }
#tfill { height: 100%; width: 50%; background: var(--ok); transition: width .6s, background .6s; }
#tfill.low { background: var(--warn); }
#gear { flex: none; width: 48px; height: 48px; border-radius: 12px; border: 2px solid var(--line); background: transparent; color: var(--dim); display: grid; place-items: center; padding: 0; }
#gear:active { background: var(--acc); color: #04122b; }
.langopt { min-height: 52px; border-radius: 12px; border: 2px solid var(--line); background: #0e1d44; color: var(--txt); font: inherit; font-size: 19px; font-weight: 800; text-align: left; padding: 0 16px; }
.langopt.on { border-color: var(--ok); color: var(--ok); }
.langopt:active { background: var(--acc); color: #04122b; }
html[lang="vi"] body { font-family: Baloo2vi, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
/* Chinese and Hindi: no font file bundled (nothing online), system fonts: PingFang SC / Microsoft YaHei / Noto Sans SC, Kohinoor Devanagari / Nirmala UI / Noto Sans Devanagari */
html[lang="zh"] body { font-family: system-ui, -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif; }
html[lang="hi"] body { font-family: system-ui, -apple-system, "Kohinoor Devanagari", "Devanagari Sangam MN", "Nirmala UI", "Noto Sans Devanagari", sans-serif; }
.langopt[lang="zh"] { font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif; }
.langopt[lang="hi"] { font-family: system-ui, -apple-system, "Kohinoor Devanagari", "Nirmala UI", "Noto Sans Devanagari", sans-serif; }
#tankbox { width: 100%; flex: 1 1 auto; min-height: 220px; background: #000; border-radius: 14px; overflow: hidden; border: 2px solid var(--line); }
#tank { width: 100%; height: 100%; border: 0; display: block; background: #000; pointer-events: none; }
#msg { margin: 0; min-height: 24px; text-align: center; color: var(--dim); font-size: 16px; }
#bar { margin-top: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.big { min-height: 64px; border-radius: 16px; border: 2px solid var(--line); background: var(--panel); color: var(--txt); font: inherit; font-size: 20px; font-weight: 800; padding: 10px; }
.big:active { background: var(--acc); color: #04122b; }
.big.key { border-color: var(--warn); color: var(--warn); }
.big.key[hidden] { display: none; }
#sheet { position: absolute; left: 0; right: 0; bottom: 0; max-height: 78%; overflow: auto; background: var(--panel); border-top: 3px solid var(--acc); border-radius: 20px 20px 0 0;
  padding: 14px max(16px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); box-shadow: 0 -10px 30px #000a; z-index: 5; }
#sheet[hidden] { display: none; }
#sheetHead { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-size: 20px; }
#sheetClose { min-width: 48px; min-height: 48px; border-radius: 12px; border: 2px solid var(--line); background: transparent; color: var(--txt); font: inherit; font-size: 20px; }
#sheetBody { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 56px; padding: 6px 10px; border-radius: 12px; background: #0e1d44; }
.row img { width: 44px; height: 44px; image-rendering: pixelated; object-fit: contain; flex: none; }
.row .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row button { min-height: 48px; min-width: 96px; border-radius: 12px; border: 2px solid var(--acc); background: transparent; color: var(--txt); font: inherit; font-weight: 800; padding: 0 12px; }
.row button:active { background: var(--acc); color: #04122b; }
.row button[disabled] { opacity: .45; }
.row.cur { outline: 2px solid var(--ok); }
#keyIn { width: 100%; min-height: 52px; border-radius: 12px; border: 2px solid var(--line); background: #08122b; color: var(--txt); font: inherit; padding: 0 12px; -webkit-user-select: text; user-select: text; }
#keyGo { min-height: 56px; border-radius: 14px; border: 0; background: var(--acc); color: #04122b; font: inherit; font-size: 20px; font-weight: 800; }
.hint { color: var(--dim); font-size: 15px; margin: 0; }
@media (prefers-reduced-motion: reduce) { #tfill { transition: none; } }
.langopt[lang="vi"] { font-family: Baloo2vi, system-ui, sans-serif; }

#installgate{position:fixed;inset:0;overflow:auto;display:flex;justify-content:center;padding:calc(env(safe-area-inset-top,0px) + 28px) 16px calc(env(safe-area-inset-bottom,0px) + 28px);background:#0b1530;color:#fff;z-index:50}
#installgate[hidden]{display:none}
#igbox{width:100%;max-width:380px;margin:auto 0;text-align:center}
#iglogo{border-radius:20px;image-rendering:pixelated}
#igh{font-size:26px;line-height:1.15;margin:14px 0 4px}
#igsub{font-size:17px;margin:0 0 18px;color:#bfe6fb}
#igsteps{list-style:none;margin:0;padding:0;display:grid;gap:10px;text-align:left}
#igsteps li{display:flex;align-items:center;gap:12px;background:#16264f;border:3px solid #2a4586;border-radius:14px;padding:10px 12px;box-shadow:0 4px 0 #070d20}
.ign{flex:none;width:34px;height:34px;display:flex;align-items:center;justify-content:center;background:#f2923a;color:#0b1530;font-weight:800;font-size:20px;border-radius:8px}
.igi{flex:none;width:40px;height:40px;display:flex;align-items:center;justify-content:center;background:#e9f6ff;color:#0b1530;border-radius:10px;padding:6px}
.igi svg{width:100%;height:100%}
.igt{font-size:17px;line-height:1.3;font-weight:600}

/* Landscape tank app: the desktop tank (its own corner menu, panels, look) fills the whole screen. Old phone buttons stay hidden. */
#app { padding: 0; gap: 0; }
#top, #bar, #sheet, #msg { display: none !important; }
#tankbox { position: fixed; inset: 0; width: 100%; height: 100%; min-height: 0; border: 0; border-radius: 0; background: #000; }
#tank { pointer-events: auto; }
#rotate { display: none; position: fixed; inset: 0; z-index: 40; background: #0b1530; color: #fff; text-align: center; align-items: center; justify-content: center; flex-direction: column; gap: 18px; padding: 24px; }
#rotate p { font-size: 22px; font-weight: 700; margin: 0; max-width: 300px; }
#rotateicon { width: 64px; height: 104px; border: 6px solid #f2923a; border-radius: 14px; animation: rot 2.4s ease-in-out infinite; }
@keyframes rot { 0%, 25% { transform: rotate(0); } 60%, 100% { transform: rotate(-90deg); } }
@media (prefers-reduced-motion: reduce) { #rotateicon { animation: none; } }
@media (orientation: portrait) { #rotate { display: flex; } }
