/* App chrome — sidebar/tabs around the 1920x1080 OBS canvas */

html, body {
  margin: 0;
  padding: 0;
  background: #050505;
  overflow: hidden;
  height: 100%;
  width: 100%;
}

#root { height: 100vh; width: 100vw; }

.app-shell {
  display: grid;
  grid-template-rows: 64px 44px 1fr;
  height: 100vh;
  width: 100vw;
  background: #050505;
  color: var(--ash);
}

.canvas-stage-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* ============= TOP TAB BAR ============= */
.tab-bar {
  display: grid;
  grid-template-columns: 220px 1fr;
  align-items: stretch;
  border-bottom: 1px solid var(--border);
  background: var(--void);
  position: relative;
  z-index: 20;
}

.sub-toolbar {
  display: grid;
  grid-template-columns: 220px 1fr auto auto;
  align-items: stretch;
  border-bottom: 1px solid var(--border);
  background: #07070a;
  position: relative;
  z-index: 19;
}
.sub-toolbar .left-spacer {
  border-right: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 16px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--smoke);
}
.sub-toolbar .left-spacer .accent-dot {
  width: 10px; height: 10px;
  background: var(--current-accent, var(--ash));
  margin-right: 10px;
  box-shadow: 0 0 8px var(--current-accent, transparent);
}
.sub-toolbar .archetype-blurb {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 18px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--smoke);
  overflow: hidden;
}
.sub-toolbar .archetype-blurb .jp {
  font-family: var(--font-jp);
  font-weight: 900;
  font-size: 22px;
  color: var(--current-accent, var(--ash));
  line-height: 1;
}
.sub-toolbar .archetype-blurb .tag {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.16em;
  color: var(--ash);
}
.sub-toolbar .archetype-blurb .tagline {
  font-style: italic;
  color: var(--ash);
  letter-spacing: 0.06em;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sub-toolbar .archetype-blurb .palette-name {
  margin-left: auto;
  color: var(--current-accent, var(--smoke));
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border-right: 1px solid var(--border);
  overflow: hidden;
}
.brand-kanji {
  font-family: var(--font-jp);
  font-weight: 900;
  font-size: 28px;
  color: var(--crimson);
  line-height: 1;
  flex-shrink: 0;
}
.brand-meta { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.brand-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--ash);
  text-transform: uppercase;
  white-space: nowrap;
}
.brand-sub {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.22em;
  color: var(--smoke);
  text-transform: uppercase;
  white-space: nowrap;
}

.tabs {
  display: flex;
  align-items: stretch;
  overflow-x: hidden;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tab {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 3px;
  padding: 0 12px;
  cursor: pointer;
  border-right: 1px solid var(--border);
  background: var(--void);
  transition: background var(--t-fast);
  min-width: 0;
  flex: 1 1 auto;
  position: relative;
  overflow: hidden;
}
.tab:hover { background: var(--void-2); }
.tab.is-active { background: var(--void-2); }
.tab.is-active::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: var(--tab-accent, var(--crimson));
}

.tab-num {
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.22em;
  color: var(--smoke);
  text-transform: uppercase;
}
.tab-name {
  display: flex;
  align-items: baseline;
  gap: 4px;
}
.tab-name-jp {
  font-family: var(--font-jp);
  font-weight: 700;
  font-size: 14px;
  color: var(--tab-accent, var(--ash));
  line-height: 1;
}
.tab-name-en {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--ash);
  text-transform: uppercase;
  white-space: nowrap;
}
.tab-romaji {
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.14em;
  color: var(--smoke);
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.gender-sep {
  width: 1px;
  background: var(--crimson);
  opacity: 0.5;
  margin: 14px 0;
}

.status-block {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 22px;
  border-left: 1px solid var(--border);
}
.live-dot {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--crimson);
  text-transform: uppercase;
}
.live-dot::before {
  content: '';
  width: 9px; height: 9px;
  background: var(--crimson);
  border-radius: 50%;
  box-shadow: 0 0 12px var(--crimson);
  animation: livepulse 1.4s ease-in-out infinite;
}
@keyframes livepulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }
.viewer-count {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--smoke);
}
.viewer-count strong { color: var(--ash); font-weight: 700; }

/* ============= CANVAS STAGE ============= */
.canvas-stage {
  position: relative;
  width: 100%;
  height: 100%;
  background: #000;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.canvas-frame {
  position: relative;
  width: 1920px;
  height: 1080px;
  transform-origin: center;
  background: #050505;
  box-shadow: 0 0 0 1px var(--border), 0 40px 120px rgba(0,0,0,0.6);
}

/* "1920 x 1080" frame label */
.canvas-corner {
  position: absolute;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--smoke);
  text-transform: uppercase;
  pointer-events: none;
  z-index: 100;
}
.canvas-corner.tl { top: -22px; left: 0; }
.canvas-corner.tr { top: -22px; right: 0; }
.canvas-corner.br { bottom: -22px; right: 0; color: var(--gold); }

/* OBS bracket markers */
.obs-bracket { position: absolute; width: 22px; height: 22px; border: 1px solid var(--gold); pointer-events: none; opacity: 0.4; }
.obs-bracket.tl { top: -1px; left: -1px; border-right: none; border-bottom: none; }
.obs-bracket.tr { top: -1px; right: -1px; border-left: none; border-bottom: none; }
.obs-bracket.bl { bottom: -1px; left: -1px; border-right: none; border-top: none; }
.obs-bracket.br { bottom: -1px; right: -1px; border-left: none; border-top: none; }

/* ============= MOCK GAMEPLAY SCENE ============= */
.mock-game {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 40%, rgba(0, 80, 110, 0.35) 0%, transparent 65%),
    radial-gradient(ellipse at 80% 90%, rgba(192,21,43,0.18) 0%, transparent 50%),
    linear-gradient(180deg, #0a1218 0%, #050709 60%, #020305 100%);
}

/* Faux hallway perspective */
.mock-hallway {
  position: absolute;
  inset: 0;
  background:
    /* floor */
    linear-gradient(180deg, transparent 60%, rgba(20,30,40,0.35) 100%),
    /* wall lines converging */
    repeating-linear-gradient(
      to right,
      transparent 0,
      transparent 200px,
      rgba(255,255,255,0.025) 200px,
      rgba(255,255,255,0.025) 201px
    );
}

.mock-light-end {
  position: absolute;
  left: 50%;
  top: 38%;
  width: 380px;
  height: 220px;
  transform: translate(-50%, -50%);
  background: radial-gradient(ellipse, rgba(0,212,255,0.22), rgba(0,212,255,0.05) 50%, transparent 80%);
  filter: blur(4px);
}

.mock-silhouette {
  position: absolute;
  left: 50%;
  top: 46%;
  transform: translate(-50%, -50%);
  width: 90px;
  height: 200px;
  background: linear-gradient(180deg, #000 0%, #050709 100%);
  clip-path: polygon(40% 0%, 60% 0%, 70% 18%, 78% 50%, 70% 100%, 30% 100%, 22% 50%, 30% 18%);
  filter: drop-shadow(0 0 8px rgba(0,200,255,0.4));
}
.mock-silhouette::before {
  /* head */
  content: '';
  position: absolute;
  top: -5%;
  left: 50%;
  transform: translateX(-50%);
  width: 40%;
  aspect-ratio: 1;
  background: #000;
  border-radius: 50%;
}

/* Grain + scanline */
.mock-grain {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(
      0deg,
      rgba(255,255,255,0.02) 0,
      rgba(255,255,255,0.02) 1px,
      transparent 1px,
      transparent 3px
    );
  mix-blend-mode: overlay;
}

/* ============= MOCK GAME HUD (the game's own HUD, beneath our overlay) ============= */
.game-hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
  font-family: var(--font-mono);
  color: #cfd8dc;
  font-size: 13px;
  letter-spacing: 0.05em;
  opacity: 0.85;
}

/* ammo bottom-left */
.game-ammo {
  position: absolute;
  bottom: 22px;
  left: 28px;
  display: flex;
  align-items: baseline;
  gap: 10px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.9);
}
.game-ammo .big { font-size: 32px; font-weight: 800; color: #fff; letter-spacing: 0.02em; }
.game-ammo .sm { font-size: 16px; color: #98a4ad; }
.game-ammo .label { font-size: 10px; color: #607078; letter-spacing: 0.3em; }

/* health bottom-left, above ammo */
.game-health {
  position: absolute;
  bottom: 78px;
  left: 28px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.9);
}
.game-health .hp-bar {
  width: 160px;
  height: 4px;
  background: rgba(255,255,255,0.1);
  position: relative;
}
.game-health .hp-bar::after {
  content: '';
  position: absolute;
  inset: 0;
  width: 78%;
  background: linear-gradient(90deg, #5be05b, #2bba2b);
}

/* minimap bottom-right */
.game-minimap {
  position: absolute;
  bottom: 28px;
  right: 28px;
  width: 180px;
  height: 180px;
  border: 1px solid rgba(255,255,255,0.18);
  background:
    radial-gradient(circle at 50% 50%, rgba(0,212,255,0.04), transparent 65%),
    linear-gradient(135deg, #0c1418, #060a0d);
  overflow: hidden;
}
.game-minimap::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.06) 1px, transparent 1px);
  background-size: 18px 18px;
}
.game-minimap::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 8px; height: 8px;
  background: var(--crimson);
  transform: translate(-50%, -50%) rotate(45deg);
  box-shadow: 0 0 8px var(--crimson);
}
.minimap-blip {
  position: absolute;
  width: 4px; height: 4px;
  background: #00d4ff;
  border-radius: 50%;
}

/* killfeed top-right (slim, fake events from the game itself) */
.game-killfeed {
  position: absolute;
  top: 18px;
  right: 230px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 12px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.9);
}
.game-killfeed .kf-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0,0,0,0.45);
  padding: 3px 8px;
}
.game-killfeed .kf-killer { color: #fff; }
.game-killfeed .kf-icon { color: #888; font-size: 10px; }
.game-killfeed .kf-victim { color: #b85a5a; }

/* round timer top center */
.game-timer {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 14px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.9);
}
.game-timer .score { font-size: 24px; font-weight: 800; color: #fff; }
.game-timer .clock { font-size: 22px; font-weight: 700; color: #fff; letter-spacing: 0.05em; }
.game-timer .side-t { color: var(--crimson); }
.game-timer .side-ct { color: var(--cyan); }

/* crosshair center */
.game-crosshair {
  position: absolute;
  top: 50%; left: 50%;
  width: 18px; height: 18px;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.game-crosshair::before, .game-crosshair::after {
  content: '';
  position: absolute;
  background: rgba(0,255,140,0.85);
}
.game-crosshair::before { left: 50%; top: 0; bottom: 0; width: 1px; transform: translateX(-50%); }
.game-crosshair::after { top: 50%; left: 0; right: 0; height: 1px; transform: translateY(-50%); }

/* ============= UTILITY ============= */
.mono { font-family: var(--font-mono); }
.jp { font-family: var(--font-jp); }
.disp { font-family: var(--font-display); }
.upcase { text-transform: uppercase; letter-spacing: 0.16em; }
.eyebrow-mono {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--smoke);
}

/* shared scroll/wipe entrance */
@keyframes wipe-in {
  from { clip-path: inset(0 100% 0 0); opacity: 0; }
  to { clip-path: inset(0 0 0 0); opacity: 1; }
}
@keyframes flash {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
@keyframes slide-in-r {
  from { transform: translateX(40px); }
  to { transform: translateX(0); }
}
@keyframes slide-in-l {
  from { transform: translateX(-40px); }
  to { transform: translateX(0); }
}
@keyframes scope-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.06); opacity: 0.6; }
}
@keyframes glitch {
  0%, 100% { transform: translate(0,0); }
  20% { transform: translate(-2px, 1px); }
  40% { transform: translate(3px, -1px); }
  60% { transform: translate(-1px, -2px); }
  80% { transform: translate(2px, 2px); }
}
@keyframes scanline {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(100vh); }
}
