/* EmpreenderTHZ Flight Simulator — interface */
:root {
  --brand: #0d2f57; --brand-2: #133f73; --accent: #f08a24; --ink: #eef3f7; --muted: #9fb2c2;
  --glass: rgba(10, 20, 32, 0.78); --glass-2: rgba(16, 30, 46, 0.92); --line: rgba(160, 190, 215, 0.18);
  --ok: #35c86b; --warn: #ffc21b; --bad: #ff4d4d;
  --r: 10px; --font: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; --mono: "Consolas", "SFMono-Regular", Menlo, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #05080c; color: var(--ink); font-family: var(--font); overflow: hidden; }
#app, #viewport { position: fixed; inset: 0; }
#viewport canvas { display: block; width: 100%; height: 100%; outline: none; }
.hidden { display: none !important; }
button { font-family: inherit; }
.btn { background: rgba(255, 255, 255, 0.07); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 10px 16px; font-size: 15px; cursor: pointer; transition: background .15s, border-color .15s, transform .05s; }
.btn:hover { background: rgba(255, 255, 255, 0.14); border-color: rgba(240, 138, 36, .55); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: linear-gradient(180deg, #f39a3e, #d9741a); border-color: #f5a24c; color: #1a0f04; font-weight: 700; }
.btn.primary:hover { filter: brightness(1.07); }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn:disabled { opacity: .45; cursor: default; }
.row-btns { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }

/* ---------- telas ---------- */
.screen { position: fixed; inset: 0; display: none; z-index: 20; }
.screen.active { display: flex; }
#loading { align-items: center; justify-content: center; background: radial-gradient(ellipse at 50% 30%, #12304f 0%, #060a10 70%); z-index: 50; }
.load-box { text-align: center; width: min(560px, 90vw); }
.logo-big { width: min(420px, 80vw); }
.load-box h1 { font-weight: 300; letter-spacing: 6px; margin: 4px 0 26px; font-size: 22px; color: var(--muted); text-transform: uppercase; }
.bar { height: 6px; background: rgba(255, 255, 255, .08); border-radius: 3px; overflow: hidden; }
#load-bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), #ffd08a); transition: width .25s; }
#load-text { color: var(--muted); font-size: 14px; margin-top: 12px; }
.tip { color: #7f93a5; font-size: 13px; margin-top: 18px; min-height: 2.4em; }
.warn { color: var(--warn); }

#menu { background: linear-gradient(90deg, rgba(4, 10, 18, .92) 0%, rgba(4, 10, 18, .65) 38%, rgba(4, 10, 18, 0) 62%); }
.menu-left { width: min(460px, 92vw); padding: 7vh 4vw; display: flex; flex-direction: column; }
.menu-left .logo { width: 330px; max-width: 80vw; }
.menu-left .title { font-weight: 300; letter-spacing: 5px; text-transform: uppercase; color: #cfdbe6; margin: 0 0 4px; font-size: 26px; }
.subtitle { color: var(--muted); margin: 0 0 30px; font-size: 14px; }
.menu-buttons { display: flex; flex-direction: column; gap: 10px; }
.menu-buttons .btn { text-align: left; padding: 13px 18px; font-size: 16px; }
.foot { margin-top: auto; color: #6f8496; font-size: 12px; }

.panel-screen { align-items: center; justify-content: center; background: rgba(3, 7, 12, .55); backdrop-filter: blur(3px); }
.sheet { background: var(--glass-2); border: 1px solid var(--line); border-radius: 14px; width: min(640px, 94vw); max-height: 92vh; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); }
.sheet.wide { width: min(1180px, 96vw); }
.sheet > header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); gap: 10px; }
.sheet > header h2 { margin: 0; font-size: 20px; font-weight: 600; }
.sheet > header > div { display: flex; gap: 8px; flex-wrap: wrap; }
.sheet > footer { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.x { background: none; border: none; color: var(--muted); font-size: 28px; cursor: pointer; line-height: 1; }
.tabs { display: flex; gap: 2px; padding: 0 16px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button { background: none; border: none; color: var(--muted); padding: 12px 14px; cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; font-size: 14px; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--accent); }
.tab-body { padding: 18px 20px; overflow: auto; flex: 1; }
.summary { color: var(--muted); font-size: 13px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 820px) { .grid2, .grid3 { grid-template-columns: 1fr; } }
.card { background: rgba(255, 255, 255, .04); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; cursor: pointer; transition: border-color .15s, background .15s; }
.card:hover { border-color: rgba(240, 138, 36, .5); }
.card.sel { border-color: var(--accent); background: rgba(240, 138, 36, .09); }
.card h4 { margin: 0 0 4px; font-size: 15px; } .card p { margin: 0; color: var(--muted); font-size: 13px; }
label.field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
label.field > span.v { color: var(--ink); font-family: var(--mono); }
input[type=range] { width: 100%; accent-color: var(--accent); }
select, input[type=number], input[type=text], input[type=time], input[type=date] { background: #0b1520; color: var(--ink); border: 1px solid var(--line); border-radius: 6px; padding: 7px 9px; font-size: 14px; }
.chk { display: flex; gap: 8px; align-items: center; font-size: 14px; margin: 6px 0; cursor: pointer; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th, table.data td { border-bottom: 1px solid var(--line); padding: 6px 8px; text-align: left; }
table.data th { color: var(--muted); font-weight: 600; }
.mono { font-family: var(--mono); }
.okc { color: var(--ok); } .warnc { color: var(--warn); } .badc { color: var(--bad); }
.pill { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 12px; background: rgba(255, 255, 255, .08); margin: 2px; }
.route-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.route-list .pill { cursor: pointer; }

/* ---------- inspeção pré-voo ---------- */
.overlay-panel { position: fixed; right: 18px; top: 18px; width: min(420px, 92vw); background: var(--glass-2); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; z-index: 30; display: none; max-height: 92vh; overflow: auto; }
.overlay-panel.active { display: block; }
.overlay-panel h3 { margin: 0 0 10px; font-size: 17px; }
#pf-list { padding-left: 20px; margin: 0 0 10px; }
#pf-list li { padding: 6px 4px; cursor: pointer; border-radius: 6px; font-size: 14px; }
#pf-list li:hover { background: rgba(255, 255, 255, .06); }
#pf-list li.done { color: var(--ok); } #pf-list li.done::after { content: " ✓"; }
#pf-list li.cur { background: rgba(240, 138, 36, .14); }
.finding { background: rgba(0, 0, 0, .3); border-left: 3px solid var(--accent); padding: 10px 12px; font-size: 14px; margin-bottom: 12px; border-radius: 4px; min-height: 48px; }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
#hud > * { pointer-events: auto; }
#topbar { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); display: flex; gap: 14px; align-items: center; background: var(--glass); border: 1px solid var(--line); border-radius: 10px; padding: 6px 14px; font-size: 13px; max-width: 92vw; }
.brand-mini img { height: 18px; display: block; }
#mission-ind { display: flex; flex-direction: column; max-width: 46vw; }
#mission-ind b { font-size: 13px; } #mission-ind span { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#phase-ind { color: #ffd08a; font-weight: 600; white-space: nowrap; }
#clock-ind { color: var(--muted); font-family: var(--mono); white-space: nowrap; }
#toolbar { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 4px; background: var(--glass); border: 1px solid var(--line); border-radius: 10px; padding: 5px; opacity: .55; transition: opacity .2s; }
#toolbar:hover { opacity: 1; }
#toolbar button { width: 38px; height: 34px; background: transparent; color: var(--ink); border: 1px solid transparent; border-radius: 7px; cursor: pointer; font-size: 17px; }
#toolbar button:hover, #toolbar button.on { background: rgba(255, 255, 255, .1); border-color: var(--line); }
#strip { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); display: flex; gap: 2px; background: var(--glass); border: 1px solid var(--line); border-radius: 10px; padding: 6px 8px; font-family: var(--mono); }
#strip > div { display: flex; flex-direction: column; align-items: center; min-width: 62px; padding: 0 4px; border-right: 1px solid var(--line); }
#strip > div:last-child { border-right: none; }
#strip span { font-size: 10px; color: var(--muted); font-family: var(--font); } #strip b { font-size: 18px; } #strip i { font-size: 10px; color: var(--muted); font-style: normal; }
#s-warn { color: var(--bad); font-weight: 700; min-width: 0 !important; font-family: var(--font); font-size: 13px; justify-content: center; }
#instructor { position: absolute; left: 14px; top: 64px; width: min(380px, 80vw); background: var(--glass); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 8px; padding: 10px 12px; font-size: 14px; }
#instructor p { margin: 4px 0; } #instructor small { color: var(--muted); }
#tooltip { position: absolute; background: rgba(0, 0, 0, .82); color: #fff; padding: 5px 9px; border-radius: 6px; font-size: 13px; pointer-events: none; transform: translate(14px, 14px); max-width: 320px; }
#toasts { position: absolute; left: 50%; top: 64px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 6px; align-items: center; pointer-events: none; }
.toast { background: var(--glass); border: 1px solid var(--line); padding: 7px 14px; border-radius: 8px; font-size: 14px; animation: fade 4.5s forwards; }
.toast.bad { border-color: var(--bad); color: #ffb1b1; } .toast.good { border-color: var(--ok); } .toast.radio { border-color: #4fe3ff; color: #c9f6ff; font-family: var(--mono); font-size: 13px; max-width: 70vw; }
@keyframes fade { 0% { opacity: 0; transform: translateY(-6px); } 8% { opacity: 1; transform: none; } 85% { opacity: 1; } 100% { opacity: 0; } }
.float-panel { position: absolute; right: 64px; top: 60px; width: 360px; max-height: 76vh; overflow: auto; background: var(--glass-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 13px; }
.float-panel.wide { width: auto; }
.float-panel header { font-weight: 600; margin-bottom: 8px; color: #ffd08a; }
#cam-list button, #atc-opts button { display: block; width: 100%; text-align: left; margin: 3px 0; }
#atc-log { max-height: 220px; overflow: auto; font-family: var(--mono); font-size: 12px; margin-bottom: 8px; }
#atc-log p { margin: 4px 0; } #atc-log b { color: #4fe3ff; } #atc-log .pil b { color: #ffd08a; }
#map-canvas { width: 720px; max-width: 80vw; height: auto; border-radius: 6px; background: #071019; }
#cl-body h4 { margin: 10px 0 4px; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 1px; }
#cl-body li { list-style: none; padding: 2px 0; } #cl-body ul { padding: 0; margin: 0; }
#cl-body li.ok::before { content: "☑ "; color: var(--ok); } #cl-body li:not(.ok)::before { content: "☐ "; color: var(--muted); }
#diag-body { font-family: var(--mono); font-size: 12px; margin: 0; white-space: pre-wrap; }
#tm-body { font-family: var(--mono); font-size: 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 2px 10px; margin-bottom: 8px; }
#tm-chart { width: 100%; background: #071019; border-radius: 6px; }
#pause-ov, #crash-ov { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, .35); }
#pause-ov h2 { font-weight: 300; letter-spacing: 6px; text-transform: uppercase; margin: 0; } #pause-ov { pointer-events: none; text-align: center; }
#crash-ov .sheet { padding: 20px 24px; text-align: center; } #crash-ov h2 { color: var(--bad); margin-top: 0; }

/* ---------- relatório ---------- */
.report #report-body { padding: 16px 20px; overflow: auto; }
.scores { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 10px 0 16px; }
.score { background: rgba(255, 255, 255, .04); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.score .k { color: var(--muted); font-size: 12px; } .score .v { font-size: 28px; font-weight: 700; }
.score .barx { height: 5px; background: rgba(255, 255, 255, .08); border-radius: 3px; margin-top: 6px; overflow: hidden; } .score .barx div { height: 100%; }
.big-score { font-size: 54px; font-weight: 800; line-height: 1; }
.report canvas { width: 100%; background: #071019; border-radius: 8px; }
.events { max-height: 260px; overflow: auto; font-size: 13px; }
.events p { margin: 3px 0; } .events .bad, .events .crash { color: #ffb1b1; } .events .warn { color: #ffe08a; } .events .mission { color: #a8f0c0; }
ul.recs li { margin: 5px 0; }
.help-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 4px 20px; font-size: 14px; }
.help-grid div { display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); padding: 4px 0; gap: 12px; }
.help-grid b { font-family: var(--mono); color: #ffd08a; white-space: nowrap; }
.wb-chart { width: 100%; height: 220px; background: #071019; border-radius: 8px; }
