:root { --bg:#06080c; --panel:rgba(10,13,19,.8); --line:#1f2a36; --fg:#e6edf3; --muted:#7d8896; --accent:#3fd0ff; --bad:#ff4646; }
* { box-sizing:border-box; }
html,body { margin:0; height:100%; background:var(--bg); color:var(--fg); overflow:hidden;
  font-family: ui-monospace, "SF Mono", Menlo, monospace; user-select:none; -webkit-user-select:none; }
#c { display:block; width:100vw; height:100vh; cursor:crosshair; }
.muted { color:var(--muted); } .small { font-size:11px; line-height:1.6; }
b { color:var(--accent); font-weight:600; }

#hud { position:fixed; top:12px; left:12px; pointer-events:none; font-size:13px; line-height:1.6;
  background:var(--panel); padding:10px 14px; border:1px solid var(--line); border-radius:8px; min-width:200px; }
.bar { height:6px; background:var(--line); border-radius:3px; margin-top:4px; overflow:hidden; }
.bar span { display:block; height:100%; background:#ffd23f; width:100%; transition:width .15s; }
#comp { margin-top:8px; }
#comp div { display:flex; align-items:center; gap:8px; }
#comp i, .sw { width:10px; height:10px; display:inline-block; border-radius:2px; flex:none; }

#phase { position:fixed; top:12px; left:50%; transform:translateX(-50%); background:var(--panel); border:1px solid var(--line);
  border-radius:8px; padding:8px 16px; font-size:13px; pointer-events:none; white-space:nowrap; }
#phase:empty { display:none; }
#phase kbd { background:#1a2330; border:1px solid #2b3848; border-radius:4px; padding:0 6px; color:var(--fg); }

#mini { position:fixed; right:12px; bottom:12px; border:1px solid var(--line); border-radius:6px; background:var(--panel); }
@keyframes fade { 0%{opacity:0;transform:translateX(10px)} 10%{opacity:1;transform:none} 75%{opacity:1} 100%{opacity:0} }
#banner { position:fixed; top:36%; left:0; right:0; text-align:center; font-size:36px; letter-spacing:8px; pointer-events:none;
  opacity:0; transition:opacity .4s; text-shadow:0 0 22px rgba(63,208,255,.7); }

.btn { font:inherit; font-size:14px; padding:10px 20px; background:var(--accent); color:#04121a; border:0; border-radius:6px; cursor:pointer; letter-spacing:1px; }
.btn:disabled { opacity:.5; cursor:wait; }
.btn.ghost { background:transparent; color:var(--accent); border:1px solid var(--accent); padding:6px 12px; font-size:12px; }
.btn.small { padding:3px 8px; font-size:11px; }

#screen { position:fixed; inset:0; display:flex; align-items:center; justify-content:center; background:rgba(4,6,9,.78); padding:16px; }
#screen .box { max-width:660px; max-height:94vh; overflow:auto; padding:28px 32px; border:1px solid var(--line); border-radius:12px; background:#0c1118; }
#screen h1 { margin:0 0 6px; font-size:42px; letter-spacing:10px; color:var(--accent); }
#screen p { color:var(--muted); font-size:13px; line-height:1.7; }
#screen .keys b { color:var(--fg); }

/* hangar */
body.in-hangar #hud, body.in-hangar #phase, body.in-hangar #mini { display:none; }
#hangar { position:fixed; inset:0; background:rgba(5,7,11,.94); display:flex; flex-direction:column; padding:16px 20px; gap:12px; }
#hangar[hidden], #ghost[hidden] { display:none; }
.hg-top { display:flex; align-items:center; gap:24px; flex-wrap:wrap; }
.hg-top h2 { margin:0; letter-spacing:8px; color:var(--accent); font-size:24px; }
#hg-stats { flex:1; display:flex; gap:18px; font-size:12px; color:var(--muted); flex-wrap:wrap; }
#hg-stats span b { font-size:14px; }
.hg-main { flex:1; display:flex; gap:16px; min-height:0; }
.hg-gridwrap { flex:1; border:1px solid var(--line); border-radius:10px; background:#080b10; min-width:0; position:relative; }
#hg-grid { width:100%; height:100%; display:block; cursor:grab; }
.hg-side { width:300px; flex:none; overflow:auto; border:1px solid var(--line); border-radius:10px; padding:12px 14px; background:#0a0e14; }
.hg-side h3 { margin:6px 0 4px; font-size:13px; letter-spacing:2px; }
#hg-store { display:flex; flex-direction:column; gap:6px; margin:10px 0 12px; min-height:60px; border:1px dashed var(--line); border-radius:8px; padding:8px; }
#hg-store.drop { border-color:var(--accent); background:rgba(63,208,255,.06); }
#hg-store .empty { color:var(--muted); font-size:12px; text-align:center; padding:12px 0; }
.chip { display:flex; align-items:center; gap:8px; padding:6px 8px; border:1px solid var(--line); border-radius:6px; background:#0f141c; cursor:grab; font-size:12px; }
.chip:hover { border-color:#2f4256; }
.chip .n { color:var(--muted); margin-left:auto; }
.chip .sw { width:14px; height:14px; }
.lvl { color:#ffcf6b; }
#ghost { position:fixed; pointer-events:none; z-index:10; padding:6px 10px; border-radius:6px; background:#0f141c; border:1px solid var(--accent); font-size:12px; display:flex; gap:8px; align-items:center; transform:translate(-50%,-120%); }
@media (max-width:760px){ .hg-main{flex-direction:column} .hg-side{width:auto; max-height:40vh} }

/* fase 4: combo, power-ups, conquistas */
#combo { position:fixed; top:22%; left:0; right:0; text-align:center; font-weight:700; letter-spacing:4px; color:#ffcf6b; pointer-events:none;
  text-shadow:0 0 18px rgba(255,180,60,.8); opacity:0; }
#combo.pop { animation:combo 1.4s ease-out forwards; }
@keyframes combo { 0%{opacity:0;transform:scale(1.8)} 12%{opacity:1;transform:scale(1)} 70%{opacity:1} 100%{opacity:0;transform:translateY(-12px)} }
#buffs { position:fixed; bottom:14px; left:50%; transform:translateX(-50%); display:flex; gap:8px; pointer-events:none; flex-wrap:wrap; justify-content:center; max-width:70vw; }
.buff { position:relative; background:var(--panel); border:1px solid; border-radius:6px; padding:5px 10px 7px; font-size:12px; overflow:hidden; white-space:nowrap; }
.buff b { color:var(--fg); }
.buff i { position:absolute; left:0; bottom:0; height:3px; }
.floattxt { position:fixed; top:30%; left:0; right:0; text-align:center; font-size:28px; letter-spacing:6px; font-weight:700; pointer-events:none;
  animation:floatup 1.3s ease-out forwards; }
@keyframes floatup { 0%{opacity:0;transform:translateY(16px) scale(.9)} 15%{opacity:1;transform:none} 75%{opacity:1} 100%{opacity:0;transform:translateY(-30px)} }
#achpop { position:fixed; bottom:70px; left:50%; transform:translate(-50%,30px); opacity:0; pointer-events:none; display:flex; gap:12px; align-items:center;
  background:linear-gradient(180deg,#1a1508,#0d0b06); border:1px solid #ffcf6b; border-radius:10px; padding:10px 18px; box-shadow:0 0 30px rgba(255,207,107,.35);
  transition:opacity .35s, transform .35s; z-index:5; max-width:92vw; }
#achpop.show { opacity:1; transform:translate(-50%,0); }
.ach-ico { font-size:30px; }
.ach-k { font-size:10px; letter-spacing:3px; color:#ffcf6b; }
.ach-n { font-size:17px; font-weight:700; color:#fff; margin:2px 0; }
.ach-d { font-size:12px; color:var(--muted); }
#ach-box { margin:0 0 14px; font-size:12px; color:var(--muted); }
#ach-box summary { cursor:pointer; color:var(--fg); margin-bottom:8px; }
#ach-list { display:grid; grid-template-columns:repeat(auto-fill,minmax(180px,1fr)); gap:6px; max-height:34vh; overflow:auto; }
.ach { display:flex; gap:8px; align-items:flex-start; padding:6px 8px; border:1px solid var(--line); border-radius:6px; opacity:.55; }
.ach.on { opacity:1; border-color:#6b5726; background:rgba(255,207,107,.05); }
.ach b { color:var(--fg); font-weight:600; }
body.in-hangar #buffs, body.in-hangar #combo { display:none; }

/* formações */
#hg-forms { display:flex; flex-direction:column; gap:6px; margin:8px 0 6px; }
.form { font:inherit; text-align:left; background:#0f141c; color:var(--fg); border:1px solid var(--line); border-radius:8px; padding:7px 10px; cursor:pointer; font-size:12px; }
.form:hover { border-color:#2f4256; }
.form.on { border-color:var(--accent); background:rgba(63,208,255,.08); box-shadow:0 0 12px rgba(63,208,255,.18); }
.form .fi { color:var(--accent); margin-right:6px; }
.form kbd { float:right; background:#1a2330; border:1px solid #2b3848; border-radius:4px; padding:0 5px; font-size:10px; color:var(--muted); }
.form .muted { font-size:11px; margin-top:3px; line-height:1.45; }

/* modo retrato */
#photo { display:none; position:fixed; bottom:14px; left:50%; transform:translateX(-50%); background:var(--panel); border:1px solid var(--line);
  border-radius:8px; padding:8px 14px; font-size:12px; align-items:center; gap:8px; white-space:nowrap; z-index:6; }
#photo kbd { background:#1a2330; border:1px solid #2b3848; border-radius:4px; padding:0 5px; color:var(--fg); }
body.photo #photo { display:flex; }
body.photo #hud, body.photo #phase, body.photo #mini, body.photo #toasts, body.photo #buffs, body.photo #combo, body.photo #banner, body.photo #achpop { display:none; }
body.photo #c { cursor:grab; }

/* ===== menu inicial ===== */
#screen { z-index:10; }
#studio { position:fixed; inset:0; width:100vw; height:100vh; pointer-events:none; z-index:11; display:none; }
#screen .box.menu { max-width:none; width:min(1180px,96vw); height:min(740px,92vh); max-height:92vh; display:grid; grid-template-columns:330px 1fr; gap:26px; padding:26px 28px; }
.menu-left { display:flex; flex-direction:column; min-width:0; }
.menu-left h1 { margin-bottom:2px; }
.sname { color:var(--accent); letter-spacing:3px; font-size:11px; min-height:14px; }
.points { margin:0 0 12px; padding-left:16px; color:var(--muted); font-size:12px; line-height:1.7; }
.points b { color:var(--accent); }
.menu-left .keys { margin-top:auto; font-size:11px; }
.menu-left #start { margin-top:10px; padding:14px; font-size:15px; letter-spacing:3px; }
.menu-right { display:flex; flex-direction:column; min-width:0; min-height:0; }
.tabs { display:flex; gap:4px; border-bottom:1px solid var(--line); margin-bottom:12px; flex:none; }
.tabs button { font:inherit; font-size:12px; letter-spacing:1px; background:none; border:0; border-bottom:2px solid transparent; color:var(--muted); padding:8px 12px; cursor:pointer; }
.tabs button:hover { color:var(--fg); }
.tabs button.on { color:var(--accent); border-bottom-color:var(--accent); }
.tab { overflow:auto; min-height:0; flex:1; padding-right:4px; }
.lvl-toggle { display:flex; align-items:center; gap:6px; margin-bottom:10px; font-size:12px; }
.lvl-toggle button, .seg button { font:inherit; font-size:12px; background:#0f141c; color:var(--muted); border:1px solid var(--line); border-radius:6px; padding:4px 12px; cursor:pointer; }
.lvl-toggle button.on, .seg button.on { color:var(--accent); border-color:var(--accent); background:rgba(63,208,255,.08); }
#unit-cards { display:grid; grid-template-columns:repeat(auto-fill,minmax(190px,1fr)); gap:10px; }
.ucard { border:1px solid var(--line); border-radius:10px; overflow:hidden; background:#0a0e14; display:flex; flex-direction:column; }
.ucard.core { grid-column:span 2; flex-direction:row; }
.ucard .view { height:140px; background:radial-gradient(ellipse at 50% 60%, #16202d 0%, #0a0e14 70%); flex:none; }
.ucard.core .view { width:52%; height:auto; min-height:170px; }
.uinfo { padding:8px 10px 10px; font-size:11px; line-height:1.5; }
.ucard.core .uinfo { display:flex; flex-direction:column; justify-content:center; }
.uname { font-size:13px; color:var(--fg); display:flex; align-items:center; gap:6px; }
.uname i { width:9px; height:9px; border-radius:2px; display:inline-block; }
.ulvl { color:#ffcf6b; }
.urole { color:var(--accent); font-size:10px; letter-spacing:2px; text-transform:uppercase; margin:2px 0 3px; }
.udesc { color:var(--muted); }
.hero-wrap { position:relative; }
.view.hero { height:300px; border:1px solid var(--line); border-radius:10px; background:radial-gradient(ellipse at 50% 65%, #17222f 0%, #080b10 75%); }
.hero-cap { position:absolute; left:12px; bottom:8px; font-size:10px; letter-spacing:2px; }
.custom-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px 20px; margin:14px 0 6px; }
.custom-grid h4 { margin:0 0 6px; font-size:11px; letter-spacing:2px; color:var(--fg); font-weight:600; }
.swatches { display:flex; flex-wrap:wrap; gap:7px; }
.swatch { position:relative; width:26px; height:26px; border-radius:50%; border:2px solid #0a0e14; background:var(--c); cursor:pointer; box-shadow:0 0 0 1px var(--line); padding:0; }
.swatch:hover { box-shadow:0 0 0 1px #4a5b6e; }
.swatch.on { box-shadow:0 0 0 2px var(--fg), 0 0 12px var(--c); }
.swatch span { position:absolute; left:50%; top:-22px; transform:translateX(-50%); font-size:10px; background:#05070a; border:1px solid var(--line); border-radius:4px; padding:1px 5px; white-space:nowrap; opacity:0; pointer-events:none; transition:opacity .15s; }
.swatch:hover span { opacity:1; }
.seg { display:flex; gap:6px; }
#in-name { font:inherit; font-size:13px; width:100%; background:#0f141c; color:var(--fg); border:1px solid var(--line); border-radius:6px; padding:7px 10px; outline:none; }
#in-name:focus { border-color:var(--accent); }
.pucard { display:flex; gap:12px; align-items:center; border:1px solid var(--line); border-left:3px solid var(--c); border-radius:8px; padding:9px 12px; margin-bottom:8px; background:#0a0e14; font-size:12px; }
.pui { font-size:22px; color:var(--c); width:28px; text-align:center; text-shadow:0 0 12px var(--c); }
#tab-ach #ach-list { max-height:none; }
@media (max-width:900px){ #screen .box.menu { grid-template-columns:1fr; overflow:auto; } .menu-right { max-height:none; } .ucard.core { grid-column:auto; flex-direction:column; } .ucard.core .view { width:auto; height:160px; } }

/* ===== avisos por canal ===== */
#toasts, #feed-loot, #feed-event, #feed-alert { position:fixed; display:flex; flex-direction:column; gap:5px; pointer-events:none; z-index:4; }
#toasts { top:12px; right:12px; align-items:flex-end; }
#feed-loot { top:96px; right:12px; align-items:flex-end; }
#feed-event { top:58px; left:50%; transform:translateX(-50%); align-items:center; }
#feed-alert { left:12px; bottom:14px; align-items:flex-start; }
.note { font-size:12px; border-radius:6px; animation:note-in .25s ease-out; white-space:nowrap; }
@keyframes note-in { from { opacity:0; transform:translateY(-6px); } to { opacity:1; transform:none; } }
.note.info { background:rgba(10,13,19,.72); border:1px solid var(--line); color:var(--muted); padding:4px 10px; }
.note.loot { background:rgba(10,13,19,.8); border:1px solid var(--line); padding:3px 9px; display:flex; align-items:center; gap:7px; color:var(--fg); }
.note.loot i { width:8px; height:8px; border-radius:2px; display:inline-block; }
.note.loot .n { color:var(--accent); font-weight:600; min-width:0; }
.note.loot.bump { animation:bump .25s ease-out; }
@keyframes bump { 50% { transform:scale(1.12); } }
.note.event { --c:#ffcf6b; background:linear-gradient(180deg, rgba(26,21,8,.92), rgba(12,10,6,.92)); border:1px solid var(--c); color:#fff; padding:7px 16px; font-size:13px; letter-spacing:.5px; box-shadow:0 0 18px color-mix(in srgb, var(--c) 35%, transparent); }
.note.alert { --c:#ff4646; background:rgba(40,8,10,.88); border:1px solid var(--c); border-left:4px solid var(--c); color:#ffd6d6; padding:6px 12px; font-weight:600; }
body.in-hangar #feed-loot, body.in-hangar #feed-event, body.in-hangar #feed-alert,
body.photo #feed-loot, body.photo #feed-event, body.photo #feed-alert { display:none; }
#hud .sname { margin-bottom:2px; }
/* logo DroneOnDrop */
#screen h1 { font-family:'Orbitron', ui-monospace, monospace; font-weight:900; font-size:30px; letter-spacing:3px; white-space:nowrap; color:#ecf4fc; }
#screen h1 .h1-on { font-family:'Orbitron', monospace; font-weight:800; color:var(--accent); border-width:2px; }
#screen h1 .h1-on { color:var(--fg); font-size:.62em; letter-spacing:3px; margin:0 4px; vertical-align:middle; border:1px solid var(--accent); border-radius:4px; padding:1px 5px; }

/* indicador de zoom */
#zoomind { position:fixed; right:184px; bottom:16px; background:var(--panel); border:1px solid var(--line); border-radius:6px; padding:4px 10px;
  font-size:11px; letter-spacing:2px; color:var(--accent); pointer-events:none; opacity:0; transition:opacity .25s; }
#zoomind.show { opacity:1; }
body.photo #zoomind, body.in-hangar #zoomind { display:none; }

/* véu das transições de zona (clarão / escuridão) */
#veil { position:fixed; inset:0; pointer-events:none; opacity:0; z-index:3; }

/* ===================== CELULAR / TOQUE ===================== */
html, body { overscroll-behavior:none; -webkit-tap-highlight-color:transparent; }
#c, #touchpad, #hg-grid { touch-action:none; }
.touch-only, #touchpad, .stick, #tbar, #ttop, #tform, #hudm, #rotate, .touch-keys { display:none; }
body.touch .touch-only { display:inline-block; }
body.touch .desk-only, body.touch .desk-keys { display:none; }
body.touch .touch-keys { display:block; }

/* área dos joysticks: cobre o campo de batalha (abaixo do HUD e dos botões) */
body.touch.playing #touchpad { display:block; position:fixed; inset:0; z-index:2; }
.stick { position:fixed; width:124px; height:124px; margin:-62px 0 0 -62px; border-radius:50%; pointer-events:none; z-index:2;
  border:2px solid rgba(63,208,255,.45); background:radial-gradient(circle, rgba(63,208,255,.10), rgba(63,208,255,.02) 70%); }
.stick.aim { border-color:rgba(255,207,107,.45); background:radial-gradient(circle, rgba(255,207,107,.10), rgba(255,207,107,.02) 70%); }
.stick i { position:absolute; left:50%; top:50%; width:54px; height:54px; border-radius:50%; transform:translate(-50%,-50%);
  background:rgba(63,208,255,.55); box-shadow:0 0 18px rgba(63,208,255,.6); }
.stick.aim i { background:rgba(255,207,107,.55); box-shadow:0 0 18px rgba(255,207,107,.6); }
body.touch.playing .stick.on { display:block; }

/* botões grandes à direita, embaixo */
body.touch.playing #tbar { display:flex; position:fixed; z-index:5; gap:10px;
  right:calc(14px + env(safe-area-inset-right)); bottom:calc(14px + env(safe-area-inset-bottom)); }
.tbtn { font:inherit; width:62px; height:62px; border-radius:50%; border:1px solid rgba(63,208,255,.5); background:rgba(8,12,18,.72);
  color:var(--accent); font-size:22px; display:flex; flex-direction:column; align-items:center; justify-content:center; line-height:1;
  backdrop-filter:blur(4px); -webkit-backdrop-filter:blur(4px); touch-action:manipulation; user-select:none; }
.tbtn small { font-size:8px; letter-spacing:1px; color:var(--muted); margin-top:4px; text-transform:uppercase; }
.tbtn:active { background:rgba(63,208,255,.22); transform:scale(.94); }
.tbtn.sm { width:42px; height:42px; font-size:15px; }
.tbtn.off { color:var(--muted); border-color:var(--line); text-decoration:line-through; }
body.touch #tb-hangar, body.touch #tb-wave { display:none; }
body.touch.playing.breakphase #tb-hangar, body.touch.playing.breakphase #tb-wave { display:flex; }
body.touch.playing #ttop { display:flex; gap:8px; position:fixed; z-index:5;
  top:calc(10px + env(safe-area-inset-top)); right:calc(10px + env(safe-area-inset-right)); }
body.touch.playing #tform:not([hidden]) { display:flex; flex-direction:column; gap:6px; position:fixed; z-index:6;
  right:calc(14px + env(safe-area-inset-right)); bottom:calc(88px + env(safe-area-inset-bottom)); }
.tf { font:inherit; font-size:13px; display:flex; align-items:center; gap:10px; padding:10px 16px; border-radius:10px; min-width:150px;
  background:rgba(8,12,18,.9); border:1px solid var(--line); color:var(--fg); }
.tf span { color:var(--accent); width:18px; text-align:center; }
.tf.on { border-color:var(--accent); background:rgba(63,208,255,.12); }

/* layout do jogo no toque: HUD compacto, minimapa no alto, avisos fora da área dos polegares */
body.touch #hud { top:calc(8px + env(safe-area-inset-top)); left:calc(8px + env(safe-area-inset-left)); font-size:11px; padding:7px 10px; min-width:150px; }
body.touch #hud #comp { display:none; }
body.touch #phase { top:calc(8px + env(safe-area-inset-top)); font-size:11px; padding:6px 10px; max-width:52vw; white-space:normal; text-align:center; }
body.touch #phase kbd { display:none; }
body.touch #mini { width:96px; height:96px; right:calc(10px + env(safe-area-inset-right)); top:calc(60px + env(safe-area-inset-top)); bottom:auto; }
body.touch #toasts { top:calc(162px + env(safe-area-inset-top)); right:calc(10px + env(safe-area-inset-right)); }
body.touch #feed-loot { top:calc(196px + env(safe-area-inset-top)); right:calc(10px + env(safe-area-inset-right)); }
body.touch #feed-alert { left:50%; transform:translateX(-50%); bottom:auto; top:34%; align-items:center; }
body.touch #feed-event { top:calc(50px + env(safe-area-inset-top)); }
body.touch .note { font-size:11px; }
body.touch #buffs { bottom:auto; top:calc(86px + env(safe-area-inset-top)); max-width:60vw; }
body.touch #zoomind { right:auto; left:50%; transform:translateX(-50%); bottom:calc(16px + env(safe-area-inset-bottom)); }
body.touch #banner { font-size:clamp(18px, 6vw, 36px); letter-spacing:4px; top:30%; }
body.touch #achpop { bottom:calc(90px + env(safe-area-inset-bottom)); }
body.touch #combo { top:18%; }
body.touch #photo { flex-wrap:wrap; justify-content:center; white-space:normal; width:min(94vw, 560px); bottom:calc(10px + env(safe-area-inset-bottom)); }

/* menu no celular: rola, cards menores e botão JOGAR sempre à mão */
@media (max-width:900px), (max-height:520px) {
  #screen { align-items:flex-start; padding:calc(8px + env(safe-area-inset-top)) calc(8px + env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) calc(8px + env(safe-area-inset-left)); }
  #screen .box.menu { grid-template-columns:1fr; height:auto; max-height:none; width:100%; padding:16px; gap:14px; overflow:visible; }
  #screen { overflow-y:auto; -webkit-overflow-scrolling:touch; }
  .menu-right { max-height:none; }
  .tab { overflow:visible; }
  .tabs { overflow-x:auto; scrollbar-width:none; }
  .tabs button { white-space:nowrap; padding:8px 10px; }
  #unit-cards { grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); }
  .ucard .view { height:120px; }
  .view.hero { height:220px; }
  .custom-grid { grid-template-columns:1fr; }
  .menu-left #start { position:sticky; bottom:calc(8px + env(safe-area-inset-bottom)); z-index:2; box-shadow:0 6px 24px rgba(0,0,0,.6); }
  #screen h1 { font-size:24px; }
  .swatch { width:32px; height:32px; }
}
/* paisagem baixa (celular deitado): menu em duas colunas, cada uma rolando sozinha */
@media (max-height:520px) and (orientation:landscape) and (min-width:640px) {
  #screen .box.menu { grid-template-columns:minmax(220px,34%) 1fr; height:calc(100vh - 16px); overflow:hidden; }
  .menu-left { overflow-y:auto; }
  .menu-right { min-height:0; }
  .tab { overflow-y:auto; }
  .points { display:none; }
}
/* hangar no celular */
@media (max-width:760px), (max-height:520px) {
  #hangar { padding:calc(8px + env(safe-area-inset-top)) 10px calc(8px + env(safe-area-inset-bottom)); gap:8px; }
  .hg-top { gap:10px; } .hg-top h2 { font-size:18px; letter-spacing:4px; }
  #hg-stats { gap:8px; font-size:10px; }
  #hg-close { padding:8px 12px; font-size:12px; }
}
@media (max-height:520px) and (orientation:landscape) { .hg-main { flex-direction:row; } .hg-side { width:260px; max-height:none; } }

/* ---- celular: tela mínima ---- */
body.touch #hud, body.touch #toasts, body.touch #feed-loot, body.touch #tb-zoomin, body.touch #tb-zoomout { display:none !important; }
body.touch.playing #hudm { display:flex; align-items:center; gap:8px; position:fixed; z-index:4; pointer-events:none;
  top:calc(8px + env(safe-area-inset-top)); left:calc(10px + env(safe-area-inset-left)); font-size:11px; letter-spacing:1px; color:var(--muted); }
#hudm b { color:var(--fg); }
.mbar { width:90px; height:5px; border-radius:3px; background:rgba(255,255,255,.12); overflow:hidden; }
.mbar i { display:block; height:100%; width:100%; background:#ffd23f; transition:width .15s; }
.mbar.sh { width:60px; } .mbar.sh i { background:#8f7bff; }
body.touch #phase { top:calc(6px + env(safe-area-inset-top)); font-size:11px; padding:4px 10px; background:rgba(10,13,19,.55); max-width:40vw; }
body.touch #mini { width:84px; height:84px; top:calc(58px + env(safe-area-inset-top)); opacity:.85; }
body.touch #feed-event { top:calc(36px + env(safe-area-inset-top)); }
body.touch #feed-event .note:nth-last-child(n+3) { display:none; }   /* no máximo 2 eventos ao mesmo tempo */
body.touch #buffs { top:auto; bottom:calc(14px + env(safe-area-inset-bottom)); max-width:46vw; }
body.touch .buff { padding:3px 7px 5px; font-size:10px; }
body.touch #combo { font-size:22px !important; top:calc(104px + env(safe-area-inset-top)); left:25%; right:25%; }   /* abaixo dos eventos, sem invadir o minimapa */
/* em pé: cobre tudo pedindo para girar */
body.touch.portrait #rotate { display:flex; position:fixed; inset:0; z-index:50; background:#06080c; flex-direction:column; align-items:center; justify-content:center; gap:10px; color:var(--muted); font-size:13px; text-align:center; padding:24px; }
#rotate b { color:var(--accent); font-size:18px; letter-spacing:3px; text-transform:uppercase; }
.rot-ico { font-size:56px; animation:rot 2.2s ease-in-out infinite; }
@keyframes rot { 0%,25% { transform:rotate(0); } 55%,100% { transform:rotate(-90deg); } }
/* menu em paisagem baixa: JOGAR não fica grudado (não cobre "Tela cheia") */
@media (max-height:520px) and (orientation:landscape) {
  .menu-left #start { position:static; padding:11px; }
  /* coluna esquerda cabe sem rolar: o texto de introdução sai (as abas já explicam tudo) */
  body:not(.gameover) .menu-left #screen-text { display:none; }   /* no fim de jogo o texto é o resultado: fica */
  body.gameover .menu-left #screen-text { font-size:12px; line-height:1.5; margin:4px 0; }
  .menu-left .touch-keys { font-size:11px; line-height:1.55; margin:6px 0 8px; }
  .menu-left #fullscreen { padding:6px 10px; }
  .menu-left h1 { margin-bottom:0; }
  /* as 4 abas cabem na largura */
  .tabs button { letter-spacing:0; padding:8px 8px; font-size:11.5px; }
}

/* hangar no toque: mais espaço para o grid (células maiores para o dedo) */
body.touch #hg-stats span:nth-child(n+4) { display:none; }   /* mantém blocos, poder e dano/s */
@media (max-height:520px) and (orientation:landscape) { body.touch .hg-side { width:210px; padding:8px 10px; } body.touch .hg-top { flex-wrap:nowrap; } body.touch .hg-foot { display:none; } }
