/* ==========================================================================
   danbo.games - Litho Indigo & Sand Gold Aesthetic (Matched to danbo.music)
   Deep Midnight Indigo + Sand Gold Accent + Parchment Off-White + Poster Shadows
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@500;600;700;800;900&family=Cinzel:wght@700;800;900&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@500;700&display=swap');

:root {
  /* ─── Litho Risograph Duotone Palette ─── */
  --bg-main:           #0B1523;   /* Deep lithographic ink navy */
  --bg-alt:            #14202F;   /* Press shadow mid-tone */
  --bg-card:           #1C2E44;   /* Raised card surface */
  --text-primary:      #F2EDE4;   /* Warm aged parchment */
  --text-secondary:    #8AAABB;   /* Muted press-blue secondary */
  --accent-color:      #D9A84E;   /* Burnished gold registration */
  --border-main:       #EDE6D8;   /* Crisp letterpress edge */
  --shadow-main:       #010407;   /* Maximum ink offset shadow */

  /* ─── Halftone Dot Screen Variants ─── */
  /* These must be visible! Halftone dots are a feature, not noise */
  --dot-color:          rgba(237, 230, 216, 0.07);   /* Body-level grain — ultra-subtle */
  --dot-color-card:     rgba(237, 230, 216, 0.09);   /* Cards — slightly warmer */
  --dot-color-dense:    rgba(237, 230, 216, 0.14);   /* Section bands — clearly visible */
  --dot-color-accent:   rgba(217, 168, 78, 0.18);    /* Gold screen — for hero/upsell */
  --dot-color-hover:    rgba(237, 230, 216, 0.18);   /* Revealed on hover */

  /* ─── Aliases ─── */
  --ink-950: var(--bg-main);
  --ink-900: var(--bg-alt);
  --ink-800: var(--bg-card);
  --ink-700: var(--bg-card);
  --ink-500: var(--border-main);
  --foam-100: var(--text-primary);
  --foam-200: var(--text-secondary);
  --foam-300: var(--text-secondary);
  --accent:   var(--accent-color);

  /* ─── Typography ─── */
  --font-heading: 'Oswald', 'Inter', sans-serif;
  --font-serif:   'Cinzel', serif;
  --font-mono:    'JetBrains Mono', monospace;
  --font-sans:    'Inter', system-ui, -apple-system, sans-serif;

  --radius-xs: 0px;
  --radius-sm: 0px;
  --radius-md: 0px;
  --radius-lg: 0px;
  --t-fast:   0.14s ease;
  --t-normal: 0.22s ease;
}

/* ============================================================
   HALFTONE SCREEN PRINT TEXTURE SYSTEM
   Risograph / lithography / screen-print dot matrix aesthetic.
   Strategy: ultra-subtle on large flat surfaces, denser on
   raised elements (cards, panels) to simulate ink pressure.
   ============================================================ */

/* ── Base grain on any surface ── */
.bg-halftone,
.halftone-overlay-sparse,
.stipple-bg-sparse { position: relative; overflow: hidden; }
.bg-halftone::before,
.halftone-overlay-sparse::before,
.stipple-bg-sparse::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, var(--dot-color-dense) 1px, transparent 1px);
  background-size: 6px 6px;
  pointer-events: none;
  z-index: 0;
}
.bg-halftone > *, .halftone-overlay-sparse > *, .stipple-bg-sparse > * {
  position: relative; z-index: 1;
}

/* ── Dense press — header bands, dividers ── */
.halftone-dense { position: relative; overflow: hidden; }
.halftone-dense::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, var(--dot-color-dense) 1.2px, transparent 1.2px);
  background-size: 5px 5px;
  pointer-events: none;
  z-index: 0;
}
.halftone-dense > * { position: relative; z-index: 1; }

/* ── Gold accent screen — hero, upsell panels ── */
.halftone-gold { position: relative; overflow: hidden; }
.halftone-gold::before {
  content: '';
  position: absolute;
  inset: 0;
  /* Dual-layer risograph: fine parchment dots + coarser gold dots offset by half */
  background-image:
    radial-gradient(circle, var(--dot-color-dense) 1px, transparent 1px),
    radial-gradient(circle, var(--dot-color-accent) 1.5px, transparent 1.5px);
  background-size: 5px 5px, 9px 9px;
  background-position: 0 0, 2.5px 2.5px;
  pointer-events: none;
  z-index: 0;
}
.halftone-gold > * { position: relative; z-index: 1; }

/* GRAPHIC POSTER BORDER SHADOWS FROM DANBO.MUSIC */
.poster-shadow { box-shadow: 6px 6px 0px 0px var(--shadow-main) !important; }
.poster-shadow-white { box-shadow: 6px 6px 0px 0px var(--border-main) !important; }

/* RESETS & TYPOGRAPHY */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
h1, h2, h3, h4, h5, h6, .font-heading {
  font-family: var(--font-heading) !important;
  letter-spacing: 0.02em !important;
  text-transform: uppercase !important;
}
.font-serif-header { font-family: var(--font-serif); letter-spacing: 0.05em; }
.font-mono-code { font-family: var(--font-mono); }

.text-truncate { white-space: nowrap !important; overflow: hidden !important; text-overflow: ellipsis !important; display: block; }
.text-clamp-2 { display: -webkit-box !important; -webkit-line-clamp: 2 !important; -webkit-box-orient: vertical !important; overflow: hidden !important; text-overflow: ellipsis !important; }

html, body {
  width: 100vw;
  height: 100vh;
  margin: 0;
  padding: 0;
  overflow: hidden !important;
  background-color: var(--bg-main);
  /* ── Halftone paper grain on the master ink layer ──
     Fine 8px grid. Dots at 0.07 opacity: visible when you look,
     invisible when you don't. Exactly like newsprint offset grain. */
  background-image: radial-gradient(circle, rgba(237,230,216,0.07) 1px, transparent 1px);
  background-size: 8px 8px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}

.main-viewport-container {
  flex: 1;
  width: 100vw;
  height: calc(100vh - 65px);
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
}
.main-viewport-container::-webkit-scrollbar {
  display: none; /* Chrome/Safari/Webkit */
}

/* APP HEADER & NAVIGATION */
.app-header {
  background: var(--bg-main);
  border-bottom: 2px solid var(--border-main);
  position: relative;
  z-index: 1000;
  width: 100%;
  height: 65px;
  box-sizing: border-box;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  overflow: hidden;
}
/* Header gets the finest, most subtle stipple:
   it's mostly solid—the dots just break up the flat fill slightly */
.app-header::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(237,230,216,0.06) 1px, transparent 1px);
  background-size: 5px 5px;
  pointer-events: none;
  z-index: 0;
}
.nav-container { position: relative; z-index: 1; }
.nav-container {
  width: 100%;
  height: 100%;
  padding: 0 2rem;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--text-primary);
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 1.5rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.brand-icon { width: 38px; height: 38px; flex-shrink: 0; }
.nav-links { display: flex; align-items: center; gap: 0.35rem; list-style: none; }
.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.45rem 0.9rem;
  border: 2px solid transparent;
  transition: all var(--t-fast);
}
.nav-link:hover {
  color: var(--text-primary);
  background: var(--bg-alt);
  border-color: var(--border-main);
}
.nav-link.active {
  color: var(--accent-color);
  background: var(--bg-card);
  border-color: var(--accent-color);
  box-shadow: 4px 4px 0px 0px var(--shadow-main);
  /* Active nav = pressed stamp with gold dot screen */
  background-image: radial-gradient(circle, var(--dot-color-accent) 1px, transparent 1px);
  background-size: 4px 4px;
}

.theme-switcher-btn { display: none !important; }
.nav-actions { display: flex; align-items: center; gap: 0.75rem; }
.mobile-nav-toggle {
  display: none;
  background: transparent;
  border: 2px solid var(--border-main);
  color: var(--text-primary);
  padding: 0.4rem 0.55rem;
  cursor: pointer;
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.6rem;
  font-size: 0.85rem;
  font-weight: 900;
  font-family: var(--font-heading);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: all var(--t-fast);
  border: 2px solid var(--border-main);
  white-space: nowrap;
  box-shadow: 6px 6px 0px 0px var(--shadow-main);
  position: relative;
  overflow: hidden;
}
/* Halftone blooms onto button surface only on hover — tactile ink press */
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(237,230,216,0.15) 1px, transparent 1px);
  background-size: 4px 4px;
  opacity: 0;
  transition: opacity var(--t-fast);
  pointer-events: none;
}
.btn:hover::after { opacity: 1; }
.btn:hover {
  transform: translateY(-2px);
  box-shadow: 9px 9px 0px 0px var(--shadow-main);
}
.btn-primary {
  background: var(--border-main);
  color: var(--bg-main);
  border-color: var(--border-main);
}
.btn-primary:hover {
  background: var(--accent-color);
  color: var(--bg-main);
  border-color: var(--border-main);
}
.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border-color: var(--border-main);
}
.btn-secondary:hover {
  background: var(--bg-alt);
  color: var(--accent-color);
}
.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border-main);
}
.btn-outline:hover {
  background: var(--bg-card);
  color: var(--accent-color);
}

/* HERO SECTION */
.hero-split-section {
  width: 100%;
  padding: 1.5rem 2rem;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2.5rem;
  align-items: center;
  position: relative;
}

.hero-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.45rem 1rem;
  background: var(--bg-card);
  border: 2px solid var(--border-main);
  color: var(--accent-color);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  box-shadow: 6px 6px 0px 0px var(--shadow-main);
  align-self: flex-start;
}

.hero-title {
  font-size: clamp(3.2rem, 6vw, 5.5rem);
  font-weight: 900;
  font-family: var(--font-heading);
  line-height: 0.95;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  margin-bottom: 1.25rem;
  color: var(--text-primary);
}

.hero-subtitle-tag {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  color: var(--accent-color);
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-primary);
  margin-bottom: 2.25rem;
  line-height: 1.65;
  max-width: 800px;
}

.hero-illustration-wrapper {
  position: relative;
  width: 100%;
  border: 2px solid var(--border-main);
  box-shadow: 10px 10px 0px 0px var(--shadow-main);
  background: var(--bg-card);
}
.hero-illustration-wrapper img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

.hero-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 2px solid rgba(245, 242, 235, 0.2);
}
.hero-stat-item { display: flex; flex-direction: column; gap: 0.2rem; }
.hero-stat-val { font-family: var(--font-heading); font-size: 2.2rem; font-weight: 900; color: var(--text-primary); line-height: 1; }
.hero-stat-lbl { font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.08em; }

/* SECTION CONTAINER & HEADERS */
.section-container {
  padding: 2.5rem 2rem;
  width: 100%;
}
.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 2.25rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--border-main);
  gap: 1rem;
  flex-wrap: wrap;
}
.section-title {
  font-size: 2.2rem;
  font-weight: 900;
  font-family: var(--font-heading);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-primary);
}

.header-band {
  background: var(--bg-alt);
  padding: 1.25rem 2rem;
  border-bottom: 2px solid var(--border-main);
  width: 100%;
  position: relative;
  overflow: hidden;
}
/* Dense stipple press on section divider bands */
.header-band::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(var(--dot-color-dense) 1.2px, transparent 1.2px);
  background-size: 5px 5px;
  opacity: 0.5;
  pointer-events: none;
}
.header-band > * { position: relative; z-index: 1; }
.header-band-container { width: 100%; }

/* GAME CARDS */
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.game-card {
  background: var(--bg-card);
  border: 2px solid var(--border-main);
  box-shadow: 8px 8px 0px 0px var(--shadow-main);
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform var(--t-fast), box-shadow var(--t-fast);
  text-decoration: none;
  color: inherit;
  overflow: hidden;
}
/* Card hover: stipple ink wells up from behind, offset shadow deepens */
.game-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(237,230,216,0.1) 1px, transparent 1px);
  background-size: 5px 5px;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
  z-index: 0;
}
.game-card:hover::before { opacity: 1; }
.game-card:hover {
  transform: translateY(-5px);
  box-shadow: 14px 14px 0px 0px var(--shadow-main);
}
.game-card > * { position: relative; z-index: 1; }

.game-thumbnail {
  width: 100%;
  height: 190px;
  background: var(--bg-main);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-bottom: 2px solid var(--border-main);
}
.game-thumbnail svg { width: 100%; height: 100%; object-fit: cover; }

.card-thumbnail-badge {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  background: var(--bg-main);
  color: var(--accent-color);
  border: 1px solid var(--border-main);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 3px 3px 0px 0px var(--shadow-main);
}

.game-info {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.game-title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.game-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
  flex-grow: 1;
  line-height: 1.6;
}

.badge-row { display: flex; flex-wrap: wrap; gap: 0.4rem; }

.badge {
  background: var(--bg-alt);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border: 1px solid var(--border-main);
  text-transform: uppercase;
}
.badge-primary { background: var(--bg-card); color: var(--accent-color); border-color: var(--border-main); }

/* GHOST CARDS */
.ghost-card {
  border: 2px dashed var(--border-main);
  background: var(--bg-main);
  padding: 2.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--text-secondary);
  min-height: 280px;
}
.ghost-card svg { width: 48px; height: 48px; margin-bottom: 0.75rem; stroke: var(--text-secondary); }
.ghost-card h4 { font-family: var(--font-heading); font-size: 1.2rem; color: var(--text-primary); margin-bottom: 0.25rem; font-weight: 800; }
.ghost-card p { font-size: 0.88rem; }

/* UPSELL BANNER — full halftone press treatment */
.upsell-banner {
  background: var(--bg-card);
  border: 2px solid var(--border-main);
  box-shadow: 10px 10px 0px 0px var(--shadow-main);
  padding: 2.5rem;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  position: relative;
  overflow: hidden;
  width: 100%;
}
/* Two-layer halftone: fine dots + coarser dot grid = risograph depth */
.upsell-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(var(--dot-color-dense) 1.5px, transparent 1.5px),
    radial-gradient(var(--dot-color-accent) 1px, transparent 1px);
  background-size: 6px 6px, 12px 12px;
  background-position: 0 0, 3px 3px;
  opacity: 0.6;
  pointer-events: none;
}
.upsell-text { position: relative; z-index: 2; }
.upsell-text h2 { font-family: var(--font-heading); font-size: 1.8rem; font-weight: 900; color: var(--text-primary); margin-bottom: 0.5rem; }
.upsell-text p { font-size: 1rem; color: var(--text-secondary); line-height: 1.6; }

/* FORMS */
.form-card {
  background: var(--bg-card);
  border: 2px solid var(--border-main);
  box-shadow: 10px 10px 0px 0px var(--shadow-main);
  padding: 2.5rem;
  max-width: 480px;
  margin: 3rem auto;
  width: 100%;
}
.form-group { margin-bottom: 1.35rem; display: flex; flex-direction: column; gap: 0.4rem; }
.form-label { font-family: var(--font-heading); font-size: 0.95rem; font-weight: 800; text-transform: uppercase; color: var(--text-primary) !important; }
.form-input {
  width: 100%;
  padding: 0.8rem 1rem;
  background: var(--bg-main);
  color: var(--text-primary);
  border: 2px solid var(--border-main);
  font-size: 0.95rem;
  font-family: var(--font-sans);
}
.form-input:focus { border-color: var(--accent-color); outline: none; }

/* MODAL OVERLAY SYSTEM */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.modal-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: var(--bg-card);
  border: 2px solid var(--border-main);
  box-shadow: 12px 12px 0px 0px var(--shadow-main);
  padding: 2rem;
  width: 90%;
  max-width: 440px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  overflow: hidden;
}
/* Modal card inner stipple grain */
.modal-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(var(--dot-color) 1px, transparent 1px);
  background-size: 5px 5px;
  opacity: 0.4;
  pointer-events: none;
  z-index: 0;
}
.modal-card > * { position: relative; z-index: 1; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--border-main);
}

.modal-title {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 900;
  text-transform: uppercase;
  color: var(--text-primary);
}

/* FOOTER */
.app-footer {
  margin-top: auto;
  background: var(--bg-main);
  border-top: 2px solid var(--border-main);
  padding: 2rem;
  width: 100%;
}
.footer-container {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  text-transform: uppercase;
}

/* FLOATING TOAST NOTIFICATION CONTAINER */
.toast-container {
  position: fixed;
  bottom: 2rem;
  left: 2rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast-notification {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  background: var(--bg-card);
  border: 2px solid var(--border-main);
  color: var(--text-primary);
  padding: 0.6rem 1rem;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow: 6px 6px 0px 0px var(--shadow-main);
  animation: toastSlideIn 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes toastSlideIn {
  from {
    transform: translateY(20px) scale(0.95);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

/* 100% VIEWPORT FULLSCREEN EMULATION ZONE APP LAYOUT */
html, body.emulation-fullscreen-body {
  width: 100vw;
  height: 100vh;
  margin: 0;
  padding: 0;
  overflow: hidden !important;
  background-color: var(--bg-main);
}

.emulation-fullscreen-app {
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: var(--bg-main);
}

.emulation-top-bar {
  background: var(--bg-main);
  border-bottom: 2px solid var(--border-main);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 2rem;
  height: 65px;
  box-sizing: border-box;
  z-index: 100;
  flex-shrink: 0;
  gap: 0.5rem;
  overflow: hidden;
}

.top-bar-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  overflow: hidden;
}

.brand-logo-sm {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text-primary);
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 1.4rem;
  text-decoration: none;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.brand-icon-sm {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.room-pill {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--bg-card);
  border: 1px solid var(--border-main);
  padding: 0.3rem 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  white-space: nowrap;
}

.room-pill-label { color: var(--text-secondary); }
.room-code { color: var(--accent-color); font-weight: bold; }

.status-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4cd964;
  flex-shrink: 0;
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
}

.btn-sm {
  padding: 0.35rem 0.75rem !important;
  font-size: 0.8rem !important;
  box-shadow: 3px 3px 0px 0px var(--shadow-main) !important;
}

.icon-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0 0.2rem;
}

.emulation-viewport-grid {
  display: flex;
  flex: 1;
  width: 100vw;
  height: calc(100vh - 65px);
  overflow: hidden;
  position: relative;
}

/* Emulation canvas: enable smooth touch panning without zoom */
.game-stage canvas, .game-stage #ejs-container {
  touch-action: none;
}

.emulator-stage-container {
  flex: 1;
  height: 100%;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.webcam-sidebar {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 20;
  pointer-events: none;
}

.game-stage {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.game-stage canvas, 
.game-stage video, 
.game-stage #ejs-container,
.game-stage #remote-game-video {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  image-rendering: pixelated;
  margin: auto !important;
}

.emulator-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  gap: 0.5rem;
}

.rom-picker-modal {
  position: absolute;
  z-index: 30;
  background: var(--bg-card);
  border: 2px solid var(--border-main);
  padding: 1.5rem 2rem;
  text-align: center;
  box-shadow: 8px 8px 0px 0px var(--shadow-main);
  max-width: 420px;
  width: 90%;
}

.rom-picker-modal h3 {
  color: var(--text-primary);
  font-size: 1.2rem;
  margin-bottom: 0.35rem;
}

.rom-picker-modal p {
  color: var(--text-secondary);
  font-size: 0.8rem;
  margin-bottom: 0.75rem;
}

.rom-badges {
  display: flex;
  gap: 0.35rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.stream-sidebar {
  width: 300px;
  height: 100%;
  background: var(--bg-alt);
  border-left: 2px solid var(--border-main);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.85rem;
  overflow: hidden;
  transition: transform var(--t-fast);
}

.sidebar-section {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.chat-section {
  flex: 1;
  overflow: hidden;
}

.section-title-sm {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-primary);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.peer-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 120px;
  overflow-y: auto;
}

.peer-item {
  font-size: 0.78rem;
  padding: 0.35rem 0.5rem;
  background: var(--bg-main);
  border: 1px solid var(--border-main);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.share-box {
  background: var(--bg-main);
  border: 1px dashed var(--border-main);
  padding: 0.5rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.chat-log {
  flex: 1;
  background: var(--bg-main);
  border: 1px solid var(--border-main);
  padding: 0.5rem;
  overflow-y: auto;
  font-size: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.chat-welcome {
  color: var(--text-secondary);
  font-style: italic;
  text-align: center;
}

.quick-emoji-row {
  display: flex;
  justify-content: space-between;
  gap: 0.2rem;
}

.emoji-btn {
  background: var(--bg-main);
  border: 1px solid var(--border-main);
  color: #fff;
  padding: 0.2rem 0.4rem;
  cursor: pointer;
  font-size: 0.85rem;
}

.chat-form {
  display: flex;
  gap: 0.35rem;
}

.chat-input {
  flex: 1;
  background: var(--bg-main);
  border: 1px solid var(--border-main);
  color: var(--text-primary);
  padding: 0.35rem 0.5rem;
  font-size: 0.8rem;
}

/* MOBILE & SMALL SCREEN RESPONSIVE OVERRIDES */
@media (max-width: 768px) {
  .emulation-top-bar {
    height: auto;
    min-height: 48px;
    padding: 0.4rem 0.6rem;
    gap: 0.4rem;
    flex-wrap: wrap;
  }

  .top-bar-left {
    gap: 0.4rem;
    flex-wrap: wrap;
  }

  .brand-logo-sm span {
    font-size: 0.8rem;
  }

  .room-pill, .status-pill {
    font-size: 0.7rem;
    padding: 0.1rem 0.35rem;
  }

  .top-bar-right {
    margin-left: auto;
    gap: 0.3rem;
  }

  .emulator-stage-container {
    flex-direction: column;
    justify-content: flex-start;
  }

  .game-stage {
    flex: 1;
    width: 100%;
    height: 100%;
    min-height: 0;
  }

  .rom-picker-modal {
    padding: 1rem;
    width: 92%;
    max-width: 340px;
  }

  .rom-picker-modal h3 {
    font-size: 1rem;
  }

  .rom-picker-modal p {
    font-size: 0.75rem;
  }

  .rom-badges {
    gap: 0.25rem;
  }

  .rom-badges .badge {
    font-size: 0.65rem;
    padding: 0.15rem 0.4rem;
  }

  .stream-sidebar {
    width: 280px;
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    z-index: 50;
    transform: translateX(100%);
    box-shadow: -6px 0px 0px 0px var(--shadow-main);
  }

  .stream-sidebar.is-open {
    transform: translateX(0);
  }
}

/* ================================================================
   COMPREHENSIVE MOBILE RESPONSIVE SYSTEM
   Breakpoints: tablet-landscape(1024), tablet(768), phone-lg(480), phone(375)
   ================================================================ */

/* ── Tablet Landscape (1024–1199px) ── */
@media (max-width: 1199px) {
  .hero-split-section {
    gap: 1.5rem;
  }
  .game-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }
}

/* ── Tablet Portrait (768–1023px) ── */
@media (max-width: 1023px) {
  .nav-container {
    padding: 0 1.25rem;
  }
  .nav-links {
    gap: 0.15rem;
  }
  .nav-link {
    font-size: 0.82rem;
    padding: 0.4rem 0.65rem;
  }
  .nav-actions .btn {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
  }
  .hero-split-section {
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    padding: 1.5rem 1.25rem;
  }
  .hero-title {
    font-size: clamp(2rem, 5vw, 3.2rem);
  }
  .game-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
  }
  .section-container {
    padding: 1.5rem 1.25rem;
  }
}

/* ── Large Phone + Small Tablet Portrait (480–767px) ── */
@media (max-width: 767px) {

  /* === HEADER MOBILE === */
  .app-header {
    height: 56px;
  }
  .nav-container {
    padding: 0 1rem;
    gap: 0;
  }
  .brand-logo {
    font-size: 1.15rem;
    gap: 0.5rem;
  }
  .brand-icon {
    width: 26px;
    height: 26px;
  }

  /* Hide desktop nav & auth buttons, show hamburger */
  nav,
  .nav-actions {
    display: none;
  }
  .mobile-nav-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    padding: 0.5rem;
    border: 2px solid var(--border-main);
    background: transparent;
    color: var(--text-primary);
    cursor: pointer;
    flex-shrink: 0;
  }

  /* === MOBILE NAV DRAWER === */
  .mobile-nav-drawer {
    display: flex !important;
    flex-direction: column;
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    background: var(--bg-alt);
    border-bottom: 2px solid var(--border-main);
    z-index: 999;
    padding: 0.75rem 1rem;
    gap: 0.35rem;
    transform: translateY(-110%);
    transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 0px 0px var(--shadow-main);
    /* Halftone press texture on nav drawer */
    background-image: radial-gradient(circle, rgba(237,230,216,0.1) 1px, transparent 1px);
    background-size: 5px 5px;
    background-color: var(--bg-alt);
  }
  .mobile-nav-drawer.is-open {
    transform: translateY(0);
  }
  .mobile-nav-drawer .nav-link {
    display: block;
    width: 100%;
    min-height: 48px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 2px solid transparent;
    text-align: left;
    background: transparent;
  }
  .mobile-nav-drawer .nav-link.active {
    border-color: var(--accent-color);
    background-image: radial-gradient(circle, var(--dot-color-accent) 1px, transparent 1px);
    background-size: 4px 4px;
    background-color: var(--bg-card);
  }
  .mobile-nav-drawer .drawer-auth-row {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(237,230,216,0.15);
  }
  .mobile-nav-drawer .drawer-auth-row .btn {
    flex: 1;
    min-height: 44px;
    font-size: 0.85rem;
  }

  /* === BOTTOM TAB BAR === */
  .bottom-tab-bar {
    display: flex !important;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: var(--bg-main);
    border-top: 2px solid var(--border-main);
    z-index: 998;
    box-shadow: 0 -4px 0px 0px var(--shadow-main);
  }
  .bottom-tab-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.55rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
    transition: color var(--t-fast), background var(--t-fast);
    padding: 0.25rem;
    min-height: 44px;
    border-right: 1px solid rgba(237,230,216,0.1);
    position: relative;
  }
  .bottom-tab-btn:last-child { border-right: none; }
  .bottom-tab-btn svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
  }
  .bottom-tab-btn.active {
    color: var(--accent-color);
    background-image: radial-gradient(circle, var(--dot-color-accent) 1px, transparent 1px);
    background-size: 4px 4px;
    background-color: var(--bg-card);
  }
  .bottom-tab-btn.active::after {
    content: '';
    position: absolute;
    top: 0;
    left: 25%;
    right: 25%;
    height: 2px;
    background: var(--accent-color);
  }

  /* Main viewport: shrink to leave space for bottom tab bar */
  .main-viewport-container {
    height: calc(100vh - 56px - 56px);
    padding-bottom: 0;
  }

  /* === HERO SECTION MOBILE === */
  .hero-split-section,
  #tab-view-home > section {
    grid-template-columns: 1fr !important;
    gap: 1.25rem;
    padding: 1rem;
  }
  .hero-illustration-wrapper {
    display: none; /* Hide wave image on small phones to save space */
  }
  .hero-title {
    font-size: clamp(2.2rem, 9vw, 3rem);
    margin-bottom: 0.5rem;
  }
  .hero-badge-pill {
    font-size: 0.65rem;
    padding: 0.3rem 0.6rem;
    margin-bottom: 0.75rem;
  }
  .hero-subtitle-tag {
    font-size: 0.82rem;
  }
  .hero-subtitle {
    font-size: 0.88rem;
    margin-bottom: 1rem;
    line-height: 1.55;
  }
  .hero-stats-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
  }
  .hero-stat-val {
    font-size: 1.4rem;
  }
  .hero-stat-lbl {
    font-size: 0.58rem;
  }

  /* === LIBRARY === */
  .game-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
  }
  .game-thumbnail {
    height: 140px;
  }
  .game-info {
    padding: 0.85rem;
  }
  .game-title {
    font-size: 1rem;
  }
  .game-desc {
    font-size: 0.78rem;
    -webkit-line-clamp: 2;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  #spa-filter-buttons {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap !important;
    gap: 0.4rem;
    padding-bottom: 0.35rem;
    scrollbar-width: none;
  }
  #spa-filter-buttons::-webkit-scrollbar { display: none; }
  #spa-filter-buttons .btn {
    flex-shrink: 0;
    white-space: nowrap;
  }
  .section-container {
    padding: 0.85rem 1rem;
  }
  .header-band {
    padding: 0.85rem 1rem;
  }

  /* === TOUCH TARGETS — all interactive elements min 44px === */
  .btn {
    min-height: 44px;
  }
  .btn-sm {
    min-height: 40px;
    padding: 0.5rem 0.9rem !important;
  }
  .form-input,
  .chat-input {
    min-height: 44px;
    font-size: 16px !important; /* prevent iOS zoom */
  }

  /* === SECTION HEADERS MOBILE === */
  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  .section-title {
    font-size: 1.35rem;
  }

  /* === UPSELL BANNER === */
  .upsell-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem;
  }

  /* === FORMS === */
  .form-card {
    margin: 0.75rem;
    padding: 1.25rem;
  }

  /* === FOOTER === */
  .footer-container {
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.7rem;
    text-align: center;
  }
  .app-footer {
    padding: 0.75rem 1rem;
  }

  /* === TAB VIEW PADDING === */
  #tab-view-home,
  #tab-view-library,
  #tab-view-vr,
  #tab-view-emulation,
  #tab-view-gameplay {
    padding: 0.75rem 0.85rem !important;
    overflow-y: auto;
  }

  /* === MODAL === */
  .modal-card {
    width: 96%;
    max-width: none;
    padding: 1.25rem;
    max-height: 85vh;
  }
  .modal-title {
    font-size: 1.05rem;
  }

  /* === EMULATION ROOM HEADER === */
  .app-header.emulation-header {
    height: auto;
    min-height: 56px;
    flex-wrap: wrap;
    padding: 0.4rem 0.75rem;
  }
  .room-pill {
    font-size: 0.7rem;
    padding: 0.2rem 0.45rem;
  }
  .status-pill {
    font-size: 0.7rem;
  }
  .btn-sm {
    font-size: 0.72rem !important;
  }

  /* === ROM PICKER MODAL MOBILE === */
  .rom-picker-modal {
    width: calc(100% - 2rem);
    max-width: 100%;
    padding: 1.25rem;
    border-left: none;
    border-right: none;
    box-shadow: none;
    position: absolute;
    left: 0;
    right: 0;
  }

  /* === EMULATION VIEWPORT FULL-SCREEN === */
  .emulation-viewport-grid {
    height: calc(100vh - 56px);
  }
}

/* ── Small Phone (≤479px) ── */
@media (max-width: 479px) {
  .brand-logo div span:first-child {
    font-size: 1.1rem;
  }

  .hero-title {
    font-size: clamp(1.9rem, 10vw, 2.5rem);
  }

  .hero-stats-grid {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.35rem;
  }
  .hero-stat-val {
    font-size: 1.2rem;
  }

  /* Stack game grid to 1-column on very small screens */
  .game-grid {
    grid-template-columns: 1fr;
  }

  .bottom-tab-btn {
    font-size: 0.48rem;
  }
  .bottom-tab-btn svg {
    width: 18px;
    height: 18px;
  }

  /* Library search row wraps */
  .section-header > div:last-child {
    width: 100%;
    flex-direction: column;
  }
  #spa-library-search,
  #spa-library-sort {
    width: 100% !important;
  }
}

/* ── Tablet Portrait specific (768–1023px) ── */
@media (min-width: 768px) and (max-width: 1023px) {
  /* On tablets keep desktop nav but tighten it */
  .app-header {
    height: 60px;
  }
  .main-viewport-container {
    height: calc(100vh - 60px);
  }
  .bottom-tab-bar {
    display: none !important;
  }
  .mobile-nav-drawer {
    top: 60px;
  }
  .nav-links {
    gap: 0.1rem;
  }
  .nav-link {
    font-size: 0.78rem;
    padding: 0.35rem 0.55rem;
  }
  .nav-actions .btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
  }
  .hero-split-section {
    grid-template-columns: 1fr 1fr !important;
    gap: 1.5rem;
    padding: 1.25rem 1.5rem;
  }
  .game-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }
  .section-container {
    padding: 1.25rem 1.5rem;
  }
  .emulation-viewport-grid {
    height: calc(100vh - 60px);
  }
}


/* ── Ensure bottom-tab-bar is hidden on desktop by default ── */
.bottom-tab-bar {
  display: none;
}
.mobile-nav-drawer {
  display: none;
}

/* ================================================================
   EMULATION ROOM — MOBILE SPECIFIC OVERRIDES
   ================================================================ */

@media (max-width: 767px) {
  /* Emulation room app shell: lock body scrolling */
  body.emulation-fullscreen-body {
    height: 100dvh !important;
    overflow: hidden !important;
  }

  .emulation-fullscreen-app {
    height: 100dvh !important;
    max-height: 100dvh !important;
    overflow: hidden !important;
  }

  /* Compact 44px Header */
  .emulation-fullscreen-app .app-header {
    height: 44px;
    min-height: 44px;
    padding: 0.2rem 0.5rem;
  }

  /* Viewport fills EXACT inner visible height above mobile URL bar and OS navbar */
  .emulation-fullscreen-app .emulation-viewport-grid {
    height: calc(100dvh - 44px);
    max-height: calc(100dvh - 44px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  /* Game Stage on Top: Edge-to-Edge, Zero Black Borders, 38dvh height limit */
  .emulation-fullscreen-app .emulator-stage-container {
    flex: 0 0 auto;
    width: 100%;
    height: 38dvh;
    max-height: 38dvh;
    background: #000;
    position: relative;
    border-bottom: 2px solid var(--border-main);
    overflow: hidden;
  }

  .emulation-fullscreen-app .game-stage {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
  }

  /* Scale game video and canvas up to fill container edge-to-edge with zero black bezel */
  .emulation-fullscreen-app .game-stage canvas,
  .emulation-fullscreen-app .game-stage video,
  .emulation-fullscreen-app .game-stage #ejs-container,
  .emulation-fullscreen-app .game-stage #remote-game-video {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: cover !important; /* Eliminates black borders completely */
    transform: scale(1.02);
  }

  /* Stream Sidebar on Bottom: Flex child that fits remaining visible height cleanly */
  .emulation-fullscreen-app .stream-sidebar {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    bottom: auto;
    width: 100%;
    flex: 1 1 0%;
    min-height: 0;
    transform: none !important;
    border-left: none;
    border-top: none;
    box-shadow: none;
    background: var(--bg-alt);
    padding: 0.35rem 0.5rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    z-index: 10;
  }

  /* Compact Peers Section: Micro Horizontal Bar */
  .emulation-fullscreen-app .sidebar-section:first-child {
    flex: 0 0 auto;
    margin-bottom: 0;
    gap: 0.2rem;
  }

  .emulation-fullscreen-app .sidebar-section:first-child .section-title-sm {
    font-size: 0.72rem;
  }

  .emulation-fullscreen-app .peer-list {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    max-height: none !important;
    gap: 0.25rem !important;
    padding-bottom: 0.15rem;
    scrollbar-width: none;
  }
  .emulation-fullscreen-app .peer-list::-webkit-scrollbar { display: none; }

  .emulation-fullscreen-app .peer-list li {
    flex-shrink: 0;
    padding: 0.15rem 0.35rem !important;
    font-size: 0.68rem !important;
    gap: 0.2rem !important;
    border-radius: 3px;
  }

  /* Chat Section: Fills remaining vertical space inside visible viewport */
  .emulation-fullscreen-app .chat-section {
    flex: 1 1 0%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    overflow: hidden;
  }

  .emulation-fullscreen-app .chat-section .section-title-sm {
    font-size: 0.72rem;
  }

  .emulation-fullscreen-app .chat-log {
    flex: 1 1 0%;
    min-height: 0;
    max-height: none !important;
    overflow-y: auto;
    padding: 0.3rem;
  }

  .emulation-fullscreen-app .quick-emoji-row {
    flex: 0 0 auto;
    gap: 0.2rem;
  }

  .emulation-fullscreen-app .quick-emoji-row .emoji-btn {
    padding: 0.15rem 0.35rem;
    font-size: 0.85rem;
  }

  .emulation-fullscreen-app .chat-form {
    flex: 0 0 auto;
    margin-top: 0.1rem;
    gap: 0.25rem;
  }

  .emulation-fullscreen-app .chat-input {
    min-height: 32px !important;
    height: 32px !important;
    font-size: 13px !important;
    padding: 0.25rem 0.5rem !important;
  }

  .emulation-fullscreen-app .chat-form .btn {
    min-height: 32px !important;
    height: 32px !important;
    padding: 0.25rem 0.6rem !important;
    font-size: 0.75rem !important;
  }

  /* Hide chat toggle button on header */
  .emulation-fullscreen-app #chat-sidebar-toggle {
    display: none;
  }

  /* Icon-only header buttons on mobile */
  .emulation-fullscreen-app .btn-label-text {
    display: none;
  }

  .emulation-fullscreen-app .top-bar-right .btn-sm {
    padding: 0.25rem 0.4rem !important;
    min-height: 32px;
    min-width: 32px;
  }

  .emulation-fullscreen-app .brand-logo > div > span:last-child {
    display: none;
  }

  .emulation-fullscreen-app .room-pill {
    font-size: 0.68rem;
    padding: 0.12rem 0.3rem;
    gap: 0.15rem;
  }

  .emulation-fullscreen-app #status-pill-desktop {
    display: none;
  }

  /* ROM picker: center and full width on mobile */
  .emulation-fullscreen-app .rom-picker-modal {
    width: calc(100% - 1.5rem);
    max-width: none;
    left: 0.75rem;
    right: 0.75rem;
    padding: 0.75rem;
  }
}

@media (max-width: 479px) {
  /* Brand logo shrinks on very small emulation room screens */
  .emulation-fullscreen-app .brand-logo {
    gap: 0.35rem;
  }
  .emulation-fullscreen-app .brand-icon {
    width: 28px;
    height: 28px;
  }
  .emulation-fullscreen-app .brand-logo > div > span:first-child {
    font-size: 1rem;
  }
}








