/* =============================================================================
   OUSEYE — Futuristic UI (FUI) design system
   Dark sci-fi interface · full Arabic (RTL) + English (LTR) support
   ============================================================================= */
:root {
  --bg: #04070f;
  --bg-2: #071020;
  --panel: rgba(8, 18, 34, 0.82);
  --panel-solid: #0a1322;
  --line: rgba(0, 229, 255, 0.14);
  --line-strong: rgba(0, 229, 255, 0.4);
  --cyan: #00e5ff;
  --blue: #2f7bff;
  --violet: #7a5cff;
  --magenta: #ff3da6;
  --green: #27e8a7;
  --yellow: #ffd166;
  --red: #ff5d7a;
  --gray: #5c6f8a;
  --text: #cfe9ff;
  --text-dim: #7f9ab8;
  --mono: "Share Tech Mono", "Consolas", "Courier New", monospace;
  --head: "Orbitron", "Cairo", "Segoe UI", sans-serif;
  --body: "Cairo", "Segoe UI", Tahoma, sans-serif;
  --radius: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%; height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

body::before { /* subtle vignette + scanlines */
  content: "";
  position: fixed; inset: 0; z-index: 3; pointer-events: none;
  background:
    repeating-linear-gradient(0deg, rgba(255,255,255,0.012) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,0.55) 100%);
  mix-blend-mode: screen;
}

canvas { display: block; }

/* ---------- Layout -------------------------------------------------------- */
#stage { position: fixed; inset: 0; z-index: 0; }
#graph { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 1; cursor: grab; }
#graph:active { cursor: grabbing; }

.hud { position: fixed; z-index: 10; }

/* Top bar */
#topbar {
  top: 0; left: 0; right: 0; height: 64px;
  display: flex; align-items: center; gap: 16px;
  padding: 0 20px;
  background: linear-gradient(180deg, rgba(4,8,16,0.92), rgba(4,8,16,0.55) 80%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(6px);
}
#topbar .logo {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--head); letter-spacing: 2px; font-size: 15px; color: #fff;
}
#topbar .logo .mark {
  width: 34px; height: 34px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #aef4ff, var(--cyan) 45%, #0a4f7a 90%);
  box-shadow: 0 0 18px var(--cyan), inset 0 0 8px #fff;
  animation: pulse 2.4s ease-in-out infinite;
}
#topbar .logo small { display:block; color: var(--text-dim); font-size: 10px; letter-spacing: 3px; font-weight: 400; }

.hud-spacer { flex: 1; }

.chip {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 12px; letter-spacing: 1px;
  padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(0,229,255,0.05); color: var(--cyan);
}
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); }
.chip.offline .dot { background: var(--red); box-shadow: 0 0 8px var(--red); }
.chip.offline { color: var(--red); border-color: rgba(255,93,122,0.4); }

/* Live exam session bar (full-width strip, never overlaps side panels) */
#session-bar {
  position: fixed; top: 64px; left: 0; right: 0; height: 42px; z-index: 8;
  display: flex; align-items: center; gap: 14px; padding: 0 22px;
  background: linear-gradient(180deg, rgba(4,8,16,0.92), rgba(4,8,16,0.55));
  border-bottom: 1px solid var(--line); backdrop-filter: blur(6px);
  white-space: nowrap; overflow: hidden;
}
#session-bar .s-tz { margin-inline-start: auto; }
.s-dot { width: 9px; height: 9px; flex-shrink: 0; border-radius: 50%; background: var(--green); box-shadow: 0 0 9px var(--green); animation: blink 1.5s infinite; }
.s-dot.inactive { background: var(--gray); box-shadow: none; animation: none; }
.s-name { font-family: var(--head); font-size: 13px; letter-spacing: 1px; color: #fff; }
.s-time { font-family: var(--mono); font-size: 12px; color: var(--cyan); }
.s-count { font-family: var(--mono); font-size: 12px; color: var(--yellow); }
.s-sep { width: 1px; height: 16px; background: var(--line-strong); flex-shrink: 0; }
.s-tz { display: flex; gap: 14px; font-family: var(--mono); font-size: 10.5px; color: var(--text-dim); }
.s-tz b { color: var(--cyan); font-weight: normal; }

/* Language switch */
.langswitch {
  display: flex; border: 1px solid var(--line-strong); border-radius: 999px; overflow: hidden;
}
.icon-btn {
  width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center;
  background: rgba(7,16,32,0.7); border: 1px solid var(--line-strong); border-radius: 10px;
  color: var(--cyan); font-size: 16px; cursor: pointer; transition: all .2s;
}
.icon-btn:hover { background: rgba(0,229,255,0.14); box-shadow: 0 0 14px rgba(0,229,255,0.4); }
.logo-img { object-fit: contain; border-radius: 10px; background: transparent !important; }

/* University emblem at the graph core */
#core-logo {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%);
  z-index: 2; pointer-events: none; text-align: center;
}
#core-logo img {
  display: block;
  width: 74px; height: 74px; object-fit: contain;
  border-radius: 50%; padding: 5px;
  background: #ffffff;
  box-shadow: 0 0 22px rgba(0,229,255,0.35), 0 0 50px rgba(0,229,255,0.15);
  animation: pulse 3s ease-in-out infinite;
}
#core-logo .core-title {
  margin-top: 8px; font-family: var(--head); font-size: 12px; letter-spacing: 2px;
  color: #fff; text-shadow: 0 0 12px rgba(0,229,255,0.8);
}

/* Republic of Sudan branding (inside the left side window) */
.nation-banner {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 11px; margin-bottom: 9px;
  border: 1px solid var(--line-strong); border-radius: 11px;
  background: linear-gradient(120deg, rgba(0,229,255,0.08), rgba(122,92,255,0.05));
}
.nation-banner > div { min-width: 0; }
.nation-banner img {
  width: 42px; height: 42px; flex-shrink: 0;
  border-radius: 50%; object-fit: contain;
  background: #fff; padding: 2px;
  box-shadow: 0 0 12px rgba(0,229,255,0.3);
}
.nation-banner.mohe img {
  background: rgba(4,10,20,0.75);
  border: 1px solid rgba(0,229,255,0.2);
  box-shadow: 0 0 10px rgba(0,229,255,0.2);
}
.nation-name { font-family: var(--head); font-size: 12px; letter-spacing: 1px; color: #fff; line-height: 1.5; }
.nation-banner.mohe .nation-name { font-size: 11.5px; }
.nation-sub { font-size: 8px; letter-spacing: 1.5px; color: var(--text-dim); margin-top: 2px; line-height: 1.5; }
.nation-banner.mohe .nation-sub { font-size: 7px; letter-spacing: 1px; }

/* Supervisor credit (photo) */
.nation-banner.credit {
  flex-direction: column; align-items: center; text-align: center; gap: 6px;
  padding: 10px 12px;
  background: linear-gradient(120deg, rgba(0,229,255,0.06), rgba(122,92,255,0.04));
}
.nation-banner.credit img {
  width: 44px; height: 44px; object-fit: cover;
  background: transparent; padding: 0;
  border: 2px solid var(--line-strong);
  box-shadow: 0 0 12px rgba(0,229,255,0.28);
}
.nation-banner.credit .nation-name { font-size: 12px; }
.nation-banner.credit .nation-sub { letter-spacing: 1px; text-align: center; }
.credit-text { font-size: 9.5px; color: var(--text-dim); line-height: 1.7; margin-top: 2px; }
#core-logo .core-sub {
  font-family: var(--mono); font-size: 9px; letter-spacing: 3px; color: var(--cyan);
  margin-top: 3px; opacity: 0.75;
}
.langswitch button {
  background: transparent; border: 0; color: var(--text-dim);
  font-family: var(--mono); font-size: 12px; letter-spacing: 1px;
  padding: 7px 14px; cursor: pointer; transition: all .25s;
}
.langswitch button.active {
  background: linear-gradient(180deg, rgba(0,229,255,0.22), rgba(0,229,255,0.06));
  color: #fff; text-shadow: 0 0 8px var(--cyan);
}

/* Side panels */
.panel {
  position: fixed; top: 112px; bottom: 20px; width: 320px; z-index: 10;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  backdrop-filter: blur(10px);
  display: flex; flex-direction: column;
  box-shadow: 0 0 40px rgba(0, 140, 255, 0.06), inset 0 0 30px rgba(0,229,255,0.03);
}
.panel::before { /* corner brackets */
  content: ""; position: absolute; inset: -1px; pointer-events: none; border-radius: var(--radius);
  background:
    linear-gradient(var(--cyan), var(--cyan)) top left / 22px 2px no-repeat,
    linear-gradient(var(--cyan), var(--cyan)) top left / 2px 22px no-repeat,
    linear-gradient(var(--cyan), var(--cyan)) top right / 22px 2px no-repeat,
    linear-gradient(var(--cyan), var(--cyan)) top right / 2px 22px no-repeat,
    linear-gradient(var(--cyan), var(--cyan)) bottom left / 22px 2px no-repeat,
    linear-gradient(var(--cyan), var(--cyan)) bottom left / 2px 22px no-repeat,
    linear-gradient(var(--cyan), var(--cyan)) bottom right / 22px 2px no-repeat,
    linear-gradient(var(--cyan), var(--cyan)) bottom right / 2px 22px no-repeat;
  opacity: 0.5;
}
#left-panel  { left: 20px; }
#right-panel { right: 20px; }

.panel-head {
  padding: 16px 18px 12px; border-bottom: 1px solid var(--line);
  font-family: var(--head); font-size: 12px; letter-spacing: 2px; color: var(--cyan);
  text-transform: uppercase; display: flex; align-items: center; gap: 10px;
}
.panel-head .bar { width: 3px; height: 14px; background: var(--cyan); box-shadow: 0 0 10px var(--cyan); }
.panel-body { flex: 1; overflow-y: auto; padding: 14px 16px; scrollbar-width: thin; scrollbar-color: #1b3a55 transparent; }
.panel-body::-webkit-scrollbar { width: 6px; }
.panel-body::-webkit-scrollbar-thumb { background: #1b3a55; border-radius: 3px; }

/* ---------- Stats / demographics ----------------------------------------- */
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat {
  position: relative; padding: 11px 10px; border-radius: 10px;
  border: 1px solid var(--line); background: rgba(7,16,32,0.6); overflow: hidden;
}
.stat::after {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--sc, var(--cyan)); box-shadow: 0 0 12px var(--sc, var(--cyan));
}
.stat .v { font-family: var(--head); font-size: 21px; color: #fff; line-height: 1; }
.stat .k { font-size: 10.5px; color: var(--text-dim); margin-top: 5px; letter-spacing: .5px; }

.demog { margin-top: 18px; }
.demog h4 { font-size: 11px; color: var(--text-dim); letter-spacing: 2px; text-transform: uppercase; margin-bottom: 10px; }
.country-row { display: flex; align-items: center; gap: 10px; padding: 5px 0; border-bottom: 1px solid rgba(255,255,255,0.04); font-size: 12.5px; }
.country-row .flag { font-size: 18px; }
.flag-img { width: 22px; height: 16px; border-radius: 3px; object-fit: cover; box-shadow: 0 0 6px rgba(0,0,0,0.5); vertical-align: -2px; }
.country-row .name { flex: 1; }
.country-row .bars { display: flex; gap: 2px; height: 14px; align-items: flex-end; }
.country-row .bars i { width: 5px; border-radius: 2px 2px 0 0; display: block; }
.bars i.b-absent { background: var(--gray); }
.bars i.b-checked { background: var(--blue); }
.bars i.b-progress { background: var(--yellow); }
.bars i.b-submitted { background: var(--green); }
.bars i.b-flagged { background: var(--red); }

/* ---------- Security feed -------------------------------------------------- */
#feed { display: flex; flex-direction: column; gap: 10px; }
.event {
  border: 1px solid var(--line); border-left-width: 3px; border-radius: 8px;
  padding: 10px 12px; font-size: 12.5px; background: rgba(7,16,32,0.55);
  animation: slideIn .4s ease both;
}
.event.sev-critical { border-left-color: var(--red); }
.event.sev-warning  { border-left-color: var(--yellow); }
.event.sev-info     { border-left-color: var(--cyan); }
.event .t { font-family: var(--mono); font-size: 11px; letter-spacing: 1px; color: var(--cyan); display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.event .d { color: var(--text-dim); margin-top: 5px; line-height: 1.6; word-break: break-word; }
.event .acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.event .acts button {
  font-family: var(--mono); font-size: 10px; letter-spacing: .5px; cursor: pointer;
  padding: 5px 9px; border-radius: 6px; border: 1px solid var(--line-strong);
  background: rgba(0,229,255,0.06); color: var(--cyan); transition: all .2s;
}
.event .acts button:hover { background: rgba(0,229,255,0.2); box-shadow: 0 0 12px rgba(0,229,255,0.4); }
.event .acts button.danger { color: var(--red); border-color: rgba(255,93,122,0.4); }
.event .acts button.danger:hover { background: rgba(255,93,122,0.18); }

/* ---------- Bottom legend -------------------------------------------------- */
#legend {
  bottom: 20px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 22px; align-items: center;
  padding: 10px 22px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--line); backdrop-filter: blur(10px);
}
.leg { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-dim); }
.leg i { width: 10px; height: 10px; border-radius: 50%; box-shadow: 0 0 8px currentColor; }

/* ---------- FAB ------------------------------------------------------------- */
.fab {
  position: fixed; right: 24px; bottom: 24px; z-index: 20;
  display: flex; align-items: center; gap: 10px;
  padding: 14px 20px; border-radius: 12px; cursor: pointer;
  font-family: var(--head); font-size: 13px; letter-spacing: 1px; color: #001018;
  background: linear-gradient(120deg, #aef4ff, var(--cyan) 45%, #1e8fd8);
  border: 0; box-shadow: 0 0 26px rgba(0,229,255,0.5), 0 4px 18px rgba(0,0,0,0.4);
  transition: transform .2s, box-shadow .2s;
}
.fab:hover { transform: translateY(-2px); box-shadow: 0 0 40px rgba(0,229,255,0.8); }
.fab .icon { font-size: 18px; }

/* ---------- Modal (hall grid) ---------------------------------------------- */
.modal {
  position: fixed; inset: 0; z-index: 50; display: none;
  align-items: center; justify-content: center;
  background: rgba(2,5,10,0.82); backdrop-filter: blur(6px);
}
.modal.open { display: flex; }
.modal-card {
  width: min(1280px, 94vw); height: min(860px, 92vh);
  background: var(--panel-solid); border: 1px solid var(--line-strong);
  border-radius: 16px; display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 0 80px rgba(0,229,255,0.18);
}
.modal-head {
  display: flex; align-items: center; gap: 12px; padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.modal-head h2 { font-family: var(--head); font-size: 15px; letter-spacing: 2px; color: #fff; }
.modal-head .close { margin-inline-start: auto; cursor: pointer; color: var(--text-dim);
  font-size: 22px; background: 0; border: 0; }
.modal-head .close:hover { color: var(--red); }
#grid-scroll { flex: 1; overflow-y: auto; padding: 20px; }

.hall-block { margin-bottom: 26px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: rgba(7,16,32,0.5); }
.hall-title { padding: 10px 16px; font-family: var(--mono); font-size: 12px; letter-spacing: 1px;
  color: var(--cyan); border-bottom: 1px solid var(--line); display: flex; gap: 10px; align-items: center; }
.hall-title .loc { color: var(--text-dim); }
.seat-grid { display: grid; gap: 8px; padding: 14px 16px; }
.seat {
  width: 26px; height: 26px; border-radius: 6px; cursor: pointer; position: relative;
  border: 1px solid rgba(255,255,255,0.12); transition: transform .15s, box-shadow .15s;
}
.seat:hover { transform: scale(1.25); z-index: 2; }
.seat.st-absent { background: #1b2636; }
.seat.st-checked_in { background: var(--blue); box-shadow: 0 0 8px var(--blue); }
.seat.st-in_progress { background: var(--yellow); box-shadow: 0 0 8px var(--yellow); }
.seat.st-submitted { background: var(--green); box-shadow: 0 0 8px var(--green); }
.seat.st-flagged { background: var(--red); box-shadow: 0 0 12px var(--red); animation: blink 1s infinite; }
.seat.frozen { outline: 2px solid #fff; }

/* ---------- Buttons (detail panel) ------------------------------------------ */
.btn {
  flex: 1; font-family: var(--mono); font-size: 11px; letter-spacing: 1px;
  padding: 10px 12px; border-radius: 8px; cursor: pointer; color: var(--cyan);
  background: rgba(0,229,255,0.06); border: 1px solid var(--line-strong); transition: all .2s;
}
.btn:hover { background: rgba(0,229,255,0.2); box-shadow: 0 0 14px rgba(0,229,255,0.4); }
.btn.warn { color: var(--yellow); border-color: rgba(255,209,102,0.4); }
.btn.warn:hover { background: rgba(255,209,102,0.16); }
.btn.danger { color: var(--red); border-color: rgba(255,93,122,0.4); }
.btn.danger:hover { background: rgba(255,93,122,0.16); }

/* ---------- Toasts ------------------------------------------------------------ */
#toasts { position: fixed; top: 78px; right: 24px; z-index: 70; display: flex; flex-direction: column; gap: 10px; }
html[dir="rtl"] #toasts { right: auto; left: 24px; }
.toast {
  min-width: 240px; max-width: 360px; padding: 12px 16px; border-radius: 10px;
  font-size: 13px; color: #fff; background: rgba(6,14,26,0.95);
  border: 1px solid var(--line-strong); border-left-width: 4px; box-shadow: 0 0 24px rgba(0,229,255,0.2);
  animation: slideIn .35s ease both; transition: opacity .4s, transform .4s;
}
.toast.sev-critical { border-left-color: var(--red); }
.toast.sev-info { border-left-color: var(--cyan); }
.toast.out { opacity: 0; transform: translateY(-10px); }
html[dir="rtl"] .toast { border-left-width: 1px; border-right-width: 4px; }

/* ---------- Tooltip --------------------------------------------------------- */
#tooltip {
  position: fixed; z-index: 60; pointer-events: none; display: none;
  min-width: 200px; max-width: 280px;
  background: rgba(6,14,26,0.96); border: 1px solid var(--line-strong);
  border-radius: 10px; padding: 12px 14px; font-size: 12.5px;
  box-shadow: 0 0 30px rgba(0,229,255,0.25);
}
#tooltip .tt-name { color: #fff; font-weight: 600; margin-bottom: 6px; }
#tooltip .tt-row { display: flex; justify-content: space-between; gap: 16px; color: var(--text-dim); padding: 2px 0; }
#tooltip .tt-row b { color: var(--cyan); font-weight: 500; }

/* ---------- Animations ------------------------------------------------------ */
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 18px var(--cyan), inset 0 0 8px #fff; transform: scale(1); }
  50% { box-shadow: 0 0 34px var(--cyan), 0 0 60px rgba(0,229,255,0.5), inset 0 0 12px #fff; transform: scale(1.06); }
}
@keyframes slideIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes blink { 50% { opacity: 0.5; } }
@keyframes scan { from { background-position: 0 0; } to { background-position: 0 6px; } }

/* ---------- RTL / LTR -------------------------------------------------------- */
html[dir="rtl"] #left-panel { left: auto; right: 20px; }
html[dir="rtl"] #right-panel { right: auto; left: 20px; }
html[dir="rtl"] .fab { right: auto; left: 24px; }
html[dir="rtl"] .event { border-left-width: 1px; border-right-width: 3px; border-right-style: solid; }
html[dir="rtl"] .event.sev-critical { border-left-color: var(--line); border-right-color: var(--red); }
html[dir="rtl"] .event.sev-warning  { border-left-color: var(--line); border-right-color: var(--yellow); }
html[dir="rtl"] .event.sev-info     { border-left-color: var(--line); border-right-color: var(--cyan); }

/* Mobile: collapse side panels into bottom sheets is out of scope; keep usable */
@media (max-width: 1100px) {
  .panel { width: 270px; }
}

/* ---------- Panel hide / show ------------------------------------------------ */
body.hide-panels .panel { display: none; }

/* ---------- AI command stats overlay ------------------------------------------ */
.cmd-overlay {
  position: fixed; top: 78px; left: 50%; transform: translateX(-50%) translateY(-14px);
  z-index: 40; width: min(360px, 92vw);
  background: var(--panel-solid); border: 1px solid var(--line-strong); border-radius: 14px;
  padding: 16px 18px; opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s;
  box-shadow: 0 0 40px rgba(0,229,255,0.22);
}
.cmd-overlay.open { opacity: 1; pointer-events: auto; transform: translateX(-50%) translateY(0); }
.cmd-head { display: flex; align-items: center; gap: 10px; font-family: var(--head); font-size: 13px; letter-spacing: 1px; color: var(--cyan); margin-bottom: 12px; }
.cmd-head .bar { width: 3px; height: 14px; background: var(--cyan); box-shadow: 0 0 10px var(--cyan); }
.cmd-head .close { margin-inline-start: auto; cursor: pointer; color: var(--text-dim); background: 0; border: 0; font-size: 16px; }
.cmd-head .close:hover { color: var(--red); }
.cmd-total { display: flex; align-items: baseline; gap: 10px; padding: 8px 0 12px; border-bottom: 1px solid var(--line); }
.cmd-total b { font-family: var(--head); font-size: 30px; color: #fff; }
.cmd-total span { color: var(--text-dim); font-size: 12px; }
.cmd-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-size: 13px; }
.cmd-row i { width: 10px; height: 10px; border-radius: 50%; box-shadow: 0 0 8px currentColor; }
.cmd-row span { flex: 1; color: var(--text-dim); }
.cmd-row b { color: #fff; font-family: var(--mono); }

/* ---------- Entity drill-down overlay ---------------------------------------- */
.d-total { display: flex; align-items: baseline; gap: 10px; padding: 4px 0 10px; }
.d-total b { font-family: var(--head); font-size: 28px; color: #fff; }
.d-total span { color: var(--text-dim); font-size: 12px; }
.d-segs { display: flex; height: 10px; border-radius: 6px; overflow: hidden; gap: 2px; }
.d-segs .seg { height: 100%; min-width: 3px; border-radius: 2px; }
.seg.st-absent { background: #3a4a63; }
.seg.st-checked_in { background: #2f7bff; }
.seg.st-in_progress { background: #ffd166; }
.seg.st-submitted { background: #27e8a7; }
.seg.st-flagged { background: #ff5d7a; }
.d-sec { color: var(--cyan); font-family: var(--head); font-size: 11px; letter-spacing: 2px; text-transform: uppercase; margin: 16px 0 8px; }
.d-row { display: flex; align-items: center; gap: 12px; padding: 7px 0; border-bottom: 1px solid rgba(255,255,255,0.05); }
.d-name { flex: 1; font-size: 13px; }
.d-name small { color: var(--text-dim); }
.d-row .d-segs { flex: 1.4; }
.d-count { font-family: var(--mono); color: var(--text-dim); width: 36px; text-align: end; }
.d-hall { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 12px; background: rgba(7,16,32,0.45); }
.d-hall-title { font-family: var(--mono); font-size: 12px; letter-spacing: 1px; color: var(--cyan); margin-bottom: 9px; }
.d-hall-title span { color: var(--text-dim); }
.d-seats { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- Animated detail overlay (FUI) -------------------------------------- */
.modal.open .modal-card { animation: modalIn .42s cubic-bezier(.2,.8,.2,1) both; }
@keyframes modalIn { from { opacity: 0; transform: translateY(26px) scale(.97); } to { opacity: 1; transform: none; } }

.d-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; animation: dIn .45s cubic-bezier(.2,.8,.2,1) both; }
.d-badge {
  width: 48px; height: 48px; border-radius: 14px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 23px;
  background: linear-gradient(135deg, rgba(0,229,255,.2), rgba(122,92,255,.14));
  border: 1px solid var(--line-strong); box-shadow: 0 0 24px rgba(0,229,255,.3);
}
.d-head-txt h2 { font-family: var(--head); font-size: 19px; letter-spacing: 1px; color: #fff; margin: 0; }
.d-type {
  display: inline-block; margin-top: 3px; font-family: var(--mono); font-size: 10px; letter-spacing: 2px;
  color: var(--cyan); background: rgba(0,229,255,.1); border: 1px solid var(--line-strong);
  border-radius: 999px; padding: 3px 11px;
}
.d-hero { animation: dIn .5s .06s cubic-bezier(.2,.8,.2,1) both; }
.d-hero .d-total b { font-size: 34px; text-shadow: 0 0 18px rgba(0,229,255,.5); }
.d-legend { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.d-legend span { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--text-dim); }
.d-legend i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; box-shadow: 0 0 6px currentColor; }
.d-row { animation: dIn .4s cubic-bezier(.2,.8,.2,1) both; }
.d-hall { animation: dIn .4s cubic-bezier(.2,.8,.2,1) both; }
.d-seg-anim .seg { transform-origin: left; animation: segGrow .55s ease both; }
html[dir="rtl"] .d-seg-anim .seg { transform-origin: right; }
@keyframes dIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes segGrow { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ---------- Mobile / fullscreen responsiveness --------------------------------- */
@media (max-width: 860px) {
  #topbar { height: 56px; padding: 0 10px; gap: 8px; }
  #topbar .logo small { display: none; }
  #topbar .logo span { font-size: 12px; }
  #clock { display: none; }
  #search { width: 110px; }
  .panel { top: 68px; bottom: 14px; width: min(300px, 84vw); }
  #legend { display: none; }
  #session-bar { top: 56px; height: 38px; padding: 0 12px; gap: 8px; }
  .s-tz, .s-sep, .s-time { display: none; }
  .panel { top: 100px; bottom: 14px; width: min(300px, 84vw); }
  .fab { padding: 12px 14px; font-size: 11px; right: 14px; bottom: 14px; }
  html[dir="rtl"] .fab { left: 14px; right: auto; }
  #toasts { top: 66px; right: 12px; }
  html[dir="rtl"] #toasts { right: auto; left: 12px; }
  #core-logo img { width: 58px; height: 58px; }
  #core-logo .core-title { font-size: 11px; }
}
