:root {
  --bg0: #0d1117; --bg1: #151b24; --panel: rgba(20, 26, 35, 0.86); --line: #2a3442;
  --tx: #e8ecf2; --mut: #9aa6b6; --acc: #e3b665; --acc2: #6ea8ff; --on: #2b3a52;
  --r: 10px; --f: "Avenir Next", "Segoe UI", system-ui, -apple-system, sans-serif;
  --topH: 54px; --barH: 64px; --leftW: 250px; --rightW: 340px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body {
  font: 14px/1.45 var(--f); color: var(--tx); overflow: hidden;
  background: radial-gradient(ellipse at 50% 40%, #27303d 0%, #141a22 55%, #0b0e13 100%);
}
button { font: inherit; color: inherit; cursor: pointer; }

/* felső sáv */
.top {
  position: fixed; inset: 0 0 auto 0; height: calc(var(--topH) + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) 16px 0; display: flex; align-items: center; gap: 14px;
  background: linear-gradient(#0d1117ee, #0d111700); z-index: 5;
}
.brand { font-weight: 600; font-size: 18px; letter-spacing: .04em; white-space: nowrap; }
.brand .logo { color: var(--acc); }
.brand small { font-weight: 400; color: var(--mut); font-size: 13px; letter-spacing: 0; margin-left: 6px; }
.status { margin-left: auto; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font-variant-numeric: tabular-nums; }
#clock { font-weight: 600; letter-spacing: .05em; }
.reserve { display: flex; gap: 8px; align-items: center; }
.reserve .lbl { color: var(--mut); }
.reserve .bar { width: 90px; height: 7px; border-radius: 4px; background: #0008; overflow: hidden; }
#reserve-bar { display: block; height: 100%; width: 50%; transition: width .2s; }
.icon { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel); font-weight: 700; }

/* panelek */
.panel {
  position: fixed; top: calc(var(--topH) + env(safe-area-inset-top, 0px)); bottom: calc(var(--barH) + env(safe-area-inset-bottom, 0px) + 8px);
  background: var(--panel); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--line); border-radius: var(--r); overflow: auto; z-index: 4;
}
#left { left: 12px; width: var(--leftW); padding: 12px 10px; }
#right { right: 12px; width: var(--rightW); padding: 16px 18px; }
.panel-title { font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--mut); margin: 0 4px 8px; }
.quick { display: grid; gap: 6px; margin-bottom: 10px; }
.wide { width: 100%; text-align: left; padding: 7px 10px; border-radius: 8px; border: 1px solid var(--line); background: #ffffff08; }
.wide:hover { background: #ffffff14; }

#tree details { margin-bottom: 4px; }
#tree summary { list-style: none; display: flex; align-items: center; gap: 6px; padding: 3px 4px; border-radius: 6px; cursor: pointer; }
#tree summary::-webkit-details-marker { display: none; }
#tree summary::after { content: "▾"; margin-left: auto; color: var(--mut); font-size: 11px; transition: transform .15s; }
#tree details:not([open]) summary::after { transform: rotate(-90deg); }
#tree ul { list-style: none; margin: 2px 0 6px; padding: 0 0 0 16px; }
#tree li { display: flex; align-items: center; gap: 6px; padding: 1px 4px; border-radius: 6px; }
#tree .cat { font-weight: 600; background: none; border: 0; padding: 3px 0; text-align: left; }
#tree .item { background: none; border: 0; padding: 3px 0; text-align: left; color: #cdd5df; flex: 1; }
#tree .item:hover, #tree .cat:hover { color: var(--acc); }
#tree .active { background: #2b4a8a55; }
#tree .active .item, #tree .active .cat { color: #fff; }
.eye { position: relative; display: inline-flex; width: 18px; height: 18px; flex: none; cursor: pointer; }
.eye input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.eye span { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid #5d6a7c; display: grid; place-items: center; }
.eye input:checked + span { border-color: var(--acc); background: radial-gradient(circle, var(--acc) 0 35%, transparent 40%); }
.eye input:indeterminate + span { border-color: var(--acc); background: radial-gradient(circle, #e3b66577 0 35%, transparent 40%); }
.eye input:focus-visible + span { outline: 2px solid var(--acc2); outline-offset: 2px; }

/* info */
.info-head h2 { margin: 4px 0 8px; font-size: 20px; line-height: 1.2; }
.crumb { font-size: 12px; color: var(--mut); text-transform: uppercase; letter-spacing: .08em; }
.info-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.info-actions button { white-space: nowrap; padding: 4px 9px; border-radius: 999px; border: 1px solid var(--line); background: #ffffff08; font-size: 12.5px; }
.info-actions button:hover { background: #ffffff18; }
.info-actions button.on { background: var(--on); border-color: var(--acc2); }
.specs { width: 100%; border-collapse: collapse; margin: 4px 0 12px; font-size: 13px; }
.specs th { text-align: left; color: var(--mut); font-weight: 500; padding: 4px 8px 4px 0; vertical-align: top; width: 42%; }
.specs td { padding: 4px 0; font-weight: 600; color: var(--acc); }
.specs tr + tr { border-top: 1px solid #ffffff10; }
.info-body p { margin: 0 0 10px; color: #d6dde6; }
.info-body .hint { background: #6ea8ff14; border-left: 3px solid var(--acc2); padding: 7px 10px; border-radius: 0 6px 6px 0; }
.flow { padding-left: 20px; margin: 0 0 10px; } .flow li { margin-bottom: 4px; }
.ratio { width: 100%; border-collapse: collapse; margin: 0 0 10px; font-size: 13px; }
.ratio td { padding: 3px 0; border-bottom: 1px solid #ffffff10; } .ratio td:last-child { text-align: right; color: var(--acc); font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip-link { background: #ffffff0c; border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; font-size: 12.5px; }
.chip-link:hover { border-color: var(--acc); }
.chip-link.cat { text-transform: uppercase; letter-spacing: .06em; font-size: 11px; color: var(--mut); padding: 2px 8px; }
.live { margin-top: 8px; padding: 8px 10px; border-radius: 8px; background: #5cc58a14; color: #bfe9cf; font-variant-numeric: tabular-nums; }
.live b { color: #fff; }

/* 3D vászon */
main { position: fixed; inset: 0; }
#view { width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
#view:active { cursor: grabbing; }
.warn {
  position: fixed; left: 50%; top: calc(var(--topH) + 14px); transform: translateX(-50%); z-index: 6;
  background: #3a1d1dee; border: 1px solid #e0574a; padding: 8px 16px; border-radius: 999px;
}

/* alsó vezérlősáv */
.dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  min-height: calc(var(--barH) + env(safe-area-inset-bottom, 0px));
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
  display: flex; gap: 14px; align-items: center; justify-content: center; flex-wrap: wrap;
  background: linear-gradient(#0d111700, #0d1117f2 40%);
}
.grp { display: flex; gap: 4px; padding: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.grp > button, .segs > button { border: 0; background: transparent; padding: 7px 11px; border-radius: 8px; white-space: nowrap; }
.grp > button:hover, .segs > button:hover { background: #ffffff12; }
.segs { display: flex; gap: 2px; }
.segs > button.on, .tog.on { background: var(--on); color: #fff; box-shadow: inset 0 0 0 1px var(--acc2); }
.tog:not(.on) { color: var(--mut); text-decoration: line-through; text-decoration-color: #ffffff40; }
#btn-xray:not(.on), #btn-explode:not(.on) { text-decoration: none; }
.big { width: 42px; font-size: 15px; background: var(--acc) !important; color: #1a1408 !important; font-weight: 700; }
.action { color: var(--acc) !important; font-weight: 600; }
.action.on { background: #e3b66533 !important; }

.tip { position: fixed; z-index: 9; pointer-events: none; background: #000c; border: 1px solid var(--line); padding: 3px 9px; border-radius: 6px; font-size: 12.5px; }

/* súgó */
.modal { position: fixed; inset: 0; z-index: 10; background: #0009; display: grid; place-items: center; padding: 16px; }
.card { position: relative; max-width: 620px; width: 100%; max-height: 90vh; overflow: auto; background: var(--bg1); border: 1px solid var(--line); border-radius: 14px; padding: 22px 26px; }
.card h2 { margin: 0 0 10px; } .card h3 { margin: 16px 0 8px; font-size: 15px; }
.card ul { padding-left: 18px; } .card li { margin-bottom: 6px; }
.keys { display: flex; flex-wrap: wrap; gap: 8px 16px; color: var(--mut); }
kbd { display: inline-block; min-width: 22px; text-align: center; padding: 1px 6px; border-radius: 5px; border: 1px solid #4a5668; background: #ffffff0d; color: var(--tx); font: 12px var(--f); }
.note { color: var(--mut); font-size: 12.5px; margin-top: 16px; }
.x { position: absolute; top: 12px; right: 12px; border: 0; background: none; font-size: 18px; color: var(--mut); }

.only-mobile { display: none; }

@media (max-width: 400px) { .status { display: none; } #btn-info { margin-left: auto; } }
/* keskeny képernyő */
@media (max-width: 1100px) {
  :root { --rightW: 300px; --leftW: 220px; }
  .brand small { display: none; }
}
@media (max-width: 820px) {
  :root { --barH: 112px; }
  .only-mobile { display: inline-block; }
  .brand { font-size: 16px; }
  .status .stat:not(:first-child) { display: none; }
  .top { gap: 8px; padding-inline: 10px; }
  .grp { flex-wrap: wrap; justify-content: center; }
  #left, #right { transform: translateX(calc(-100% - 20px)); transition: transform .25s; width: min(86vw, 340px); }
  #right { transform: translateX(calc(100% + 20px)); }
  body.tree-open #left { transform: none; }
  body.info-open #right { transform: none; }
  .dock { gap: 6px; padding-inline: 8px; }
  .grp > button, .segs > button { padding: 6px 8px; font-size: 13px; }
}
