/* layout.css — top bar, tabs, stage, views, FABs, overlays */

/* ── Top bar ── */
.topbar {
  height: var(--topbar-h);
  display: flex; align-items: center; gap: var(--space-4);
  padding: 0 var(--space-4);
  background: linear-gradient(180deg, #131a26, #0f141d);
  border-bottom: 1px solid var(--line);
  position: relative; z-index: 20;
}
.brand { display: flex; align-items: center; gap: var(--space-2); font-weight: 700; letter-spacing: .5px; }
.brand-mark { color: var(--gold); font-size: 20px; filter: drop-shadow(0 0 6px var(--gold-dim)); }
.brand-name { font-size: var(--fs-lg); }
.brand-vs { color: var(--muted); font-weight: 500; font-size: var(--fs-xs); text-transform: uppercase; margin: 0 4px; }

.tabs {
  display: flex; gap: 2px; background: var(--bg-2); padding: 3px; border-radius: var(--radius); border: 1px solid var(--line-soft);
  overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  appearance: none; border: 0; background: transparent; color: var(--muted);
  padding: 0 var(--space-4); height: 36px; border-radius: 7px; cursor: pointer;
  white-space: nowrap; flex: none;
  font-size: var(--fs-md); font-weight: 600; transition: .15s;
}
.tab:hover { color: var(--text); background: var(--panel); }
.tab[aria-current="page"] { color: var(--text); background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line); }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: var(--space-2); }
.search-trigger {
  display: flex; align-items: center; gap: var(--space-2);
  height: 36px; padding: 0 var(--space-3); border-radius: var(--radius);
  background: var(--bg-2); color: var(--muted); border: 1px solid var(--line-soft); cursor: pointer;
  font-size: var(--fs-sm);
}
.search-trigger:hover { color: var(--text); border-color: var(--line); }
.turn-chip {
  display: flex; align-items: center; gap: var(--space-2);
  height: 36px; padding: 0 var(--space-3); border-radius: var(--radius);
  background: var(--bg-2); border: 1px solid var(--line-soft); font-size: var(--fs-sm); white-space: nowrap;
}
.icon-btn {
  width: 36px; height: 36px; border-radius: var(--radius); border: 1px solid var(--line-soft);
  background: var(--bg-2); color: var(--text); cursor: pointer; font-size: 16px;
}
.icon-btn:hover { border-color: var(--line); background: var(--panel); }

/* ── Stage / views ── */
.stage { position: absolute; inset: var(--topbar-h) 0 0 0; overflow: hidden; }
.view { position: absolute; inset: 0; overflow: auto; }
.view[hidden] { display: none; }

/* Generic content wrapper for scrollable views */
.pad { padding: var(--space-5); }
.wrap { max-width: 1200px; margin: 0 auto; }

/* ── FABs ── */
.fab {
  position: fixed; right: 20px; z-index: 30;
  width: 56px; height: 56px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--text);
  font-size: 24px; cursor: pointer; box-shadow: var(--shadow);
  display: flex; align-items: center; justify-content: center; transition: .15s;
}
.fab:hover { transform: translateY(-2px); background: var(--panel-3); }
.fab-dice { bottom: 20px; }
.fab-notes { bottom: 88px; width: 48px; height: 48px; font-size: 20px; }

/* ── Overlays ── */
.overlay-root { position: fixed; inset: 0; z-index: 40; pointer-events: none; }
.overlay {
  position: absolute; inset: 0; pointer-events: auto;
  background: rgba(6,9,14,.55); backdrop-filter: blur(3px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 8vh var(--space-4) var(--space-4);
  animation: fade .12s ease;
}
.overlay.sheet { align-items: stretch; justify-content: flex-end; padding: 0; }
@keyframes fade { from { opacity: 0; } }
.panel-card {
  width: 100%; max-width: 640px; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow); overflow: hidden;
  display: flex; flex-direction: column; max-height: 84vh; animation: pop .14s ease;
}
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } }
.sheet .panel-card {
  max-width: 420px; height: 100%; max-height: none; border-radius: 0;
  border-left: 1px solid var(--line); animation: slide .18s ease;
}
@keyframes slide { from { transform: translateX(30px); opacity: 0; } }
.panel-head {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-4); border-bottom: 1px solid var(--line);
}
.panel-head h2 { font-size: var(--fs-lg); }
.panel-head .close { margin-left: auto; }
.panel-body { padding: var(--space-4); overflow: auto; }
.panel-foot { padding: var(--space-3) var(--space-4); border-top: 1px solid var(--line); display: flex; gap: var(--space-2); justify-content: flex-end; }

/* ── Tooltip layer ── */
.tooltip-layer { position: fixed; inset: 0; z-index: 60; pointer-events: none; }

/* ── Responsive ── */
@media (max-width: 760px) {
  .brand-name, .search-trigger-label, .search-trigger kbd { display: none; }
  .topbar { gap: var(--space-2); padding: 0 var(--space-2); }
  .tab { padding: 0 var(--space-3); }
  .pad { padding: var(--space-3); }
}
