/* =========================================================================
   Navigation: Suchknopf in der Leiste, Schnellsuche, "Mehr"-Blatt.
   ========================================================================= */

.rail-search .label kbd, .palette-foot kbd {
  font-family: var(--font-mono); font-size: 0.66rem; padding: 1px 5px; margin-left: 6px;
  border-radius: 4px; border: 1px solid var(--line-strong); color: var(--text-dim); background: rgba(255,255,255,0.04);
}
.rail-search { margin-bottom: 6px; }
.rail-more { display: none; }              /* nur auf dem Handy */

/* ---------- Schnellsuche ---------- */
.palette-overlay {
  position: fixed; inset: 0; z-index: 900; display: flex; justify-content: center; align-items: flex-start;
  padding: 12vh 16px 16px; background: rgba(3,5,10,0.72); backdrop-filter: blur(6px);
  animation: fadeIn 0.12s ease-out;
}
.palette {
  width: 100%; max-width: 560px; border-radius: 14px; overflow: hidden;
  background: var(--bg-panel-2); border: 1px solid var(--line-strong);
  box-shadow: 0 30px 80px rgba(0,0,0,0.6); animation: modalIn 0.16s var(--ease);
}
.palette-input {
  width: 100%; border: 0; outline: 0; background: transparent; color: var(--text-bright);
  font: 500 1.05rem var(--font-body); padding: 18px 20px; border-bottom: 1px solid var(--line);
}
.palette-list { max-height: 50vh; overflow-y: auto; padding: 6px; }
.palette-row {
  display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 10px; width: 100%;
  padding: 10px 12px; border: 0; border-radius: 9px; background: transparent; color: var(--text); text-align: left;
  font: inherit; cursor: pointer;
}
.palette-row .ico { font-size: 1.2rem; text-align: center; }
.palette-row .lb { color: var(--text-bright); }
.palette-row .gr { font-size: 0.72rem; color: var(--text-dim); letter-spacing: 1px; text-transform: uppercase; }
.palette-row.on, .palette-row:hover { background: rgba(74,141,255,0.16); }
.palette-empty { padding: 22px; text-align: center; color: var(--text-dim); font-size: 0.9rem; }
.palette-foot { padding: 9px 14px; font-size: 0.72rem; color: var(--text-dim); border-top: 1px solid var(--line); }

/* ---------- "Mehr"-Blatt (Handy) ---------- */
.sheet-overlay {
  position: fixed; inset: 0; z-index: 850; background: rgba(3,5,10,0); transition: background 0.2s;
  display: flex; align-items: flex-end;
}
.sheet-overlay.open { background: rgba(3,5,10,0.7); }
.sheet {
  width: 100%; max-height: 82vh; overflow-y: auto; padding: 10px 14px calc(18px + env(safe-area-inset-bottom));
  border-radius: 18px 18px 0 0; background: #0b1020; border-top: 1px solid var(--line-strong);
  transform: translateY(100%); transition: transform 0.22s var(--ease);
}
.sheet-overlay.open .sheet { transform: none; }
.sheet-grip { width: 42px; height: 4px; border-radius: 4px; background: var(--line-strong); margin: 4px auto 14px; }
.sheet-search {
  width: 100%; padding: 12px 14px; margin-bottom: 8px; border-radius: 10px; text-align: left;
  border: 1px solid var(--line-strong); background: rgba(255,255,255,0.04); color: var(--text-dim); font: inherit; cursor: pointer;
}
.sheet-group { font-family: var(--font-display); font-size: 0.72rem; letter-spacing: 2px; text-transform: uppercase; color: var(--text-dim); margin: 14px 2px 8px; }
.sheet-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.sheet-tile {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px;
  border-radius: 12px; border: 1px solid var(--line); background: var(--bg-panel); color: var(--text); font: inherit; cursor: pointer;
}
.sheet-tile .ico { font-size: 1.45rem; }
.sheet-tile .lb { font-size: 0.68rem; text-align: center; line-height: 1.2; }
.sheet-tile.danger { border-color: rgba(255,77,106,0.4); }

/* ---------- Handy: fuenf feste Plaetze + "Mehr" ---------- */
@media (max-width: 900px) {
  .rail { overflow-x: hidden; justify-content: space-around; }
  .rail-btn { display: none; flex: 1 1 0; min-width: 0; }
  .rail-btn[data-primary], .rail-btn.rail-more { display: flex; }
  .rail-search { display: none !important; }
}
@media (max-width: 380px) {
  .sheet-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- PC: Favoriten + Gruppen-Menues ---------- */
@media (min-width: 901px) {
  .rail.rail-compact > .rail-group { display: none; }
  .rail.rail-compact > .rail-btn[data-tab]:not([data-pin]) { display: none; }
  .rail.rail-compact > .rail-search { order: 0; }
  .rail.rail-compact > .rail-groups { order: 100; display: flex; flex-direction: column; gap: 3px; }
  .rail-sep { margin: 10px 16px 6px; border-top: 1px solid var(--line); position: relative; height: 14px; }
  .rail-sep span { position: absolute; top: 4px; left: 10px; font-size: .6rem; letter-spacing: 2px; text-transform: uppercase; color: var(--text-dim); white-space: nowrap; opacity: 0; transition: opacity .18s; }
  .rail:hover .rail-sep span { opacity: 1; }
  .rail-gbtn .rail-chev { margin-left: auto; margin-right: 14px; color: var(--text-dim); font-size: 1.1rem; opacity: 0; transition: opacity .18s; }
  .rail:hover .rail-gbtn .rail-chev { opacity: 1; }
  .rail-gbtn.open { background: rgba(47,224,228,.1); color: var(--text); border-color: rgba(47,224,228,.25); }
  .rail-gdot { position: absolute; left: 44px; top: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 8px var(--gold); }
  .rail-gdot[hidden] { display: none; }
  .rail.fly-open, .rail.fly-open:hover { width: var(--rail-w); }
  .rail.fly-open .label, .rail.fly-open .rail-count, .rail.fly-open .rail-chev, .rail.fly-open .rail-sep span { opacity: 0 !important; }
}
.rail-fly {
  position: fixed; z-index: 800; width: 270px; max-height: calc(100vh - 90px); overflow-y: auto;
  background: rgba(10, 14, 26, .98); border: 1px solid var(--line-strong); border-radius: 14px; padding: 8px;
  box-shadow: 0 20px 50px rgba(0,0,0,.6), 0 0 0 1px rgba(47,224,228,.06); animation: modalIn .14s var(--ease);
}
.rf-head { display: flex; align-items: center; gap: 10px; padding: 6px 8px 10px; font-family: var(--font-display); font-size: .95rem; letter-spacing: 2px; text-transform: uppercase; color: var(--text-bright); border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.rf-head .ico { font-size: 1.2rem; }
.rf-row { display: flex; align-items: center; gap: 4px; border-radius: 9px; }
.rf-row:hover { background: rgba(47,224,228,.07); }
.rf-row.on { background: linear-gradient(90deg, rgba(47,224,228,.16), rgba(47,224,228,.02)); }
.rf-go { flex: 1; display: flex; align-items: center; gap: 12px; padding: 9px 8px; border: 0; background: none; color: var(--text); font: inherit; cursor: pointer; text-align: left; min-width: 0; }
.rf-row.on .rf-go { color: var(--cyan); }
.rf-row.danger .rf-go { color: var(--red); }
.rf-go .ico { font-size: 1.15rem; width: 24px; text-align: center; flex: none; }
.rf-go .lb { font-family: var(--font-display); font-weight: 600; font-size: 1rem; letter-spacing: .3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rf-go em { margin-left: auto; font-style: normal; font-family: var(--font-display); font-weight: 700; font-size: .72rem; padding: 1px 7px; border-radius: 999px; background: rgba(47,224,228,.16); color: var(--cyan); }
.rf-pin { border: 0; background: none; color: var(--text-dim); font-size: 1.05rem; width: 34px; height: 34px; border-radius: 8px; cursor: pointer; flex: none; }
.rf-pin:hover { color: var(--gold); background: rgba(255,197,66,.08); }
.rf-pin.on { color: var(--gold); }
.rf-foot { font-size: .7rem; color: var(--text-dim); padding: 8px 8px 2px; border-top: 1px solid var(--line); margin-top: 6px; }

/* Handy: gewohnte Reihenfolge der festen Plaetze */
@media (max-width: 900px) {
  .rail-btn[data-tab="hub"] { order: 1; } .rail-btn[data-tab="planets"] { order: 2; }
  .rail-btn[data-tab="quests"] { order: 3; } .rail-btn[data-tab="casino"] { order: 4; } .rail-more { order: 5; }
}

/* ---------- Benachrichtigungs-Center ---------- */
.hud-bell { position: relative; }
.hud-bell.has { color: var(--gold); }
.hud-bell.open { color: var(--cyan); background: rgba(47,224,228,.12); }
.nb-cnt { position: absolute; top: -4px; right: -6px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--red); color: #fff; font: 700 .64rem/17px var(--font-body); text-align: center; box-shadow: 0 0 0 2px #05070d; }
.nb-cnt[hidden] { display: none; }
.nb-panel { position: fixed; top: calc(var(--hud-h, 64px) + 6px); right: 14px; z-index: 880; width: 380px; max-height: min(620px, calc(100vh - 100px)); display: flex; flex-direction: column;
  background: rgba(10,14,26,.98); border: 1px solid var(--line-strong); border-radius: 14px; box-shadow: 0 24px 60px rgba(0,0,0,.65); animation: modalIn .14s var(--ease); }
.nb-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.nb-head b { font-family: var(--font-display); letter-spacing: .08em; text-transform: uppercase; color: var(--text-bright); }
.nb-x { background: none; border: 0; color: var(--text-dim); font-size: 1rem; cursor: pointer; padding: 4px 8px; border-radius: 6px; }
.nb-x:hover { color: var(--text-bright); background: rgba(255,255,255,.06); }
.nb-list { overflow-y: auto; padding: 4px 8px 10px; }
.nb-day { font-size: .66rem; letter-spacing: .12em; text-transform: uppercase; color: var(--text-dim); margin: 12px 6px 4px; }
.nb-item { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: start; width: 100%; padding: 9px 8px; border: 0; border-radius: 10px; background: none; color: var(--text); font: inherit; text-align: left; cursor: default; position: relative; }
.nb-item[data-nb-url] { cursor: pointer; }
.nb-item:hover { background: rgba(47,224,228,.06); }
.nb-item.new { background: rgba(47,224,228,.07); }
.nb-item.new::before { content: ''; position: absolute; left: 0; top: 14px; width: 4px; height: 4px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 6px var(--cyan); }
.nb-ico { font-size: 1.15rem; text-align: center; padding-top: 1px; }
.nb-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.nb-txt b { color: var(--text-bright); font-size: .86rem; font-weight: 600; }
.nb-txt small { color: var(--text-dim); font-size: .76rem; line-height: 1.35; }
.nb-item time { font-size: .68rem; color: var(--text-dim); font-family: var(--font-mono); padding-top: 2px; }
.nb-empty { text-align: center; color: var(--text-dim); padding: 30px 16px; font-size: .88rem; }
.nb-empty span { display: block; font-size: 2rem; margin-bottom: 8px; }
.nb-empty small { display: block; margin-top: 6px; font-size: .74rem; }
.nb-more { width: 100%; margin-top: 8px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: none; color: var(--text-dim); font: inherit; font-size: .8rem; cursor: pointer; }
@media (max-width: 640px) {
  .nb-panel { left: 8px; right: 8px; width: auto; top: calc(var(--hud-h, 60px) + 4px); max-height: calc(100vh - 170px); }
}
.kbd-list kbd { font-family: var(--font-mono); font-size: .78rem; padding: 2px 7px; border-radius: 5px; border: 1px solid var(--line-strong); background: rgba(255,255,255,.05); color: var(--text-bright); }
.sheet-top { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.sheet-sound { width: auto; white-space: nowrap; }
@media (max-width: 640px) {
  .hud-user .hud-icon[data-action="sound-toggle"] { display: none; }
}
