/* ===== Overlay Panels ===== */
.overlay-panel {
  position: fixed;
  inset: 0;
  z-index: 50; /* above mobile controls (40) */
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 2, 10, 0.72);
  backdrop-filter: blur(3px);
  padding: 1rem;
  animation: panelFade 0.25s ease-out;
  pointer-events: auto;
}

@keyframes panelFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.panel-frame {
  background: var(--panel-bg);
  border: 3px solid var(--panel-border);
  box-shadow:
    0 0 0 1px rgba(0, 240, 255, 0.3),
    0 0 40px rgba(255, 45, 149, 0.25),
    inset 0 0 60px rgba(0, 0, 0, 0.4);
  max-width: 920px;
  width: 100%;
  max-height: 90vh;
  overflow: auto;
  padding: 1.5rem;
  position: relative;
  color: var(--cream);
}

.panel-title {
  font-family: var(--font-pixel);
  font-size: 1rem;
  color: var(--neon-pink);
  text-align: center;
  text-shadow: 0 0 12px rgba(255, 45, 149, 0.5);
  margin-bottom: 0.5rem;
}

.panel-sub {
  text-align: center;
  color: rgba(245, 230, 200, 0.6);
  margin-bottom: 1.5rem;
  font-size: 1.2rem;
}

.neon-btn {
  display: block;
  width: 100%;
  max-width: 320px;
  margin: 0.6rem auto;
  font-family: var(--font-pixel);
  font-size: 0.55rem;
  padding: 0.9rem 1rem;
  background: transparent;
  color: var(--neon-cyan);
  border: 2px solid var(--neon-cyan);
  cursor: pointer;
  transition: all 0.15s;
  letter-spacing: 0.05em;
}

.neon-btn:hover {
  background: rgba(0, 240, 255, 0.12);
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.35);
  color: #fff;
}

.neon-btn:active { transform: scale(0.98); }

.close-btn {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: transparent;
  border: 1px solid rgba(255, 45, 149, 0.5);
  color: var(--neon-pink);
  font-size: 1rem;
  width: 2rem;
  height: 2rem;
  cursor: pointer;
  font-family: var(--font-mono);
  line-height: 1;
  z-index: 10;
}

.close-btn:hover {
  background: rgba(255, 45, 149, 0.2);
  box-shadow: 0 0 10px rgba(255, 45, 149, 0.4);
}

.info-box {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid rgba(0, 240, 255, 0.3);
  background: rgba(0, 0, 0, 0.35);
  font-size: 1.15rem;
  line-height: 1.6;
}

.info-box p { margin-bottom: 0.4rem; }
.info-box .hint { color: var(--neon-orange); margin-top: 0.75rem; }

/* ===== Media Library ===== */
.media-frame {
  max-width: 960px;
  padding: 0;
  border-color: #2a4a6a;
  box-shadow:
    0 0 0 4px #1a1a1a,
    0 0 0 8px #4a3728,
    0 0 50px rgba(80, 140, 255, 0.2);
  background: #0c1018;
}

.media-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: linear-gradient(180deg, #1a2540, #0e1525);
  border-bottom: 2px solid #3a5a8a;
}

.media-brand {
  font-family: var(--font-pixel);
  font-size: 0.55rem;
  color: var(--neon-cyan);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.brand-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ff3333;
  box-shadow: 0 0 8px #ff3333;
  animation: blink 1.5s step-end infinite;
}

.media-tabs {
  display: flex;
  gap: 0;
  background: #0a0e18;
  border-bottom: 1px solid #2a3a5a;
}

.media-tab {
  flex: 1;
  font-family: var(--font-pixel);
  font-size: 0.5rem;
  padding: 0.85rem;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  color: rgba(245, 230, 200, 0.5);
  cursor: pointer;
  transition: all 0.15s;
}

.media-tab:hover { color: var(--cream); background: rgba(0, 240, 255, 0.05); }
.media-tab.active {
  color: var(--neon-cyan);
  border-bottom-color: var(--neon-cyan);
  background: rgba(0, 240, 255, 0.08);
}

.media-body {
  min-height: 340px;
  max-height: 50vh;
  overflow-y: auto;
  padding: 1rem;
  position: relative;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.85rem;
}

.media-card {
  background: linear-gradient(160deg, #1a2030, #0e121c);
  border: 1px solid #2a3a55;
  padding: 0.55rem;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
  position: relative;
  border-radius: 2px;
}

.media-card:hover {
  border-color: var(--neon-pink);
  box-shadow: 0 0 16px rgba(255, 45, 149, 0.3);
  transform: translateY(-2px);
}

.media-card-art {
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  background:
    linear-gradient(145deg, rgba(40, 60, 90, 0.35), rgba(0, 0, 0, 0.55)),
    repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0, 0, 0, 0.08) 2px, rgba(0, 0, 0, 0.08) 3px);
  margin-bottom: 0.45rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
  position: relative;
  overflow: hidden;
}

.media-card-art::after {
  content: attr(data-format);
  position: absolute;
  top: 4px;
  right: 4px;
  font-size: 0.65rem;
  letter-spacing: 0.04em;
  padding: 0.12rem 0.28rem;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(0, 240, 255, 0.35);
  color: var(--neon-cyan);
  line-height: 1;
}

.media-card-emoji {
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.45));
}

.media-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.media-card-img.media-card-img-ready {
  opacity: 1;
}
.media-card-emoji-fallback {
  position: relative;
  z-index: 0;
}

.media-card-title {
  font-family: var(--font-pixel);
  font-size: 0.4rem;
  color: var(--cream);
  line-height: 1.4;
  margin-bottom: 0.25rem;
}

.media-card-meta {
  font-size: 0.9rem;
  color: rgba(245, 230, 200, 0.45);
}

.media-card-type {
  position: absolute;
  left: 0.4rem;
  top: 0.4rem;
  font-size: 0.6rem;
  color: rgba(245, 230, 200, 0.35);
  letter-spacing: 0.06em;
  pointer-events: none;
}

.media-footer {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 1rem;
  background: #0a0e18;
  border-top: 1px solid #2a3a5a;
  font-size: 1rem;
  color: rgba(245, 230, 200, 0.4);
}

/* Media player */
.media-player {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.player-screen {
  aspect-ratio: 4/3;
  max-height: 320px;
  background: #000;
  border: 3px solid #333;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.player-static {
  position: absolute;
  inset: 0;
  opacity: 0.15;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: noiseMove 0.3s steps(3) infinite;
}

.player-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 1.5rem;
}

.player-content .big-emoji { font-size: 4rem; margin-bottom: 0.75rem; }
.player-content .player-cover {
  width: min(160px, 40%);
  aspect-ratio: 3/4;
  object-fit: cover;
  border: 2px solid rgba(0, 240, 255, 0.35);
  box-shadow: 0 0 24px rgba(0, 100, 200, 0.35);
  margin: 0 auto 0.75rem;
  display: block;
}
.player-content .player-year { opacity: 0.65; font-size: 0.85em; }
.player-content .player-format-pill {
  display: inline-block;
  margin: 0.35rem 0 0.75rem;
  padding: 0.2rem 0.55rem;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  color: #9dffc0;
  border: 1px solid rgba(51, 255, 102, 0.35);
  background: rgba(20, 40, 28, 0.7);
}
.player-content .player-tracking {
  margin-top: 1rem;
  color: #33ff66;
  font-size: 1rem;
  text-shadow: 0 0 8px rgba(51, 255, 102, 0.4);
}
.player-content h3 {
  font-family: var(--font-pixel);
  font-size: 0.7rem;
  color: var(--neon-cyan);
  margin-bottom: 0.5rem;
  text-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
}
.player-content p {
  font-size: 1.2rem;
  color: rgba(245, 230, 200, 0.75);
  line-height: 1.5;
  max-width: 400px;
}

.player-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem;
  background: #111820;
  border: 1px solid #2a3a55;
}

.tape-btn {
  font-family: var(--font-pixel);
  font-size: 0.45rem;
  padding: 0.6rem 0.9rem;
  background: #1a2535;
  border: 1px solid var(--neon-cyan);
  color: var(--neon-cyan);
  cursor: pointer;
}

.tape-btn:hover { background: rgba(0, 240, 255, 0.15); }

.player-title {
  flex: 1;
  font-family: var(--font-pixel);
  font-size: 0.45rem;
  color: var(--cream);
}

.player-status {
  font-size: 1rem;
  color: var(--crt-green);
  font-family: var(--font-mono);
}

/* ===== Chat Room ===== */
.chat-frame {
  max-width: 800px;
  padding: 0;
  border-color: #3366cc;
  background: #c0c0c0;
  color: #000;
  box-shadow: 4px 4px 0 #000, 0 0 40px rgba(51, 102, 204, 0.3);
}

.chat-titlebar {
  background: linear-gradient(90deg, #000080, #1084d0);
  color: #fff;
  padding: 0.4rem 0.75rem;
  font-family: 'Tahoma', 'Segoe UI', sans-serif;
  font-size: 0.85rem;
  font-weight: bold;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-titlebar .close-btn {
  position: static;
  background: #c0c0c0;
  color: #000;
  border: 2px outset #fff;
  width: 1.4rem;
  height: 1.4rem;
  font-size: 0.75rem;
  font-weight: bold;
}

.chat-body {
  display: flex;
  height: 380px;
  border: 2px inset #808080;
  margin: 4px;
  background: #fff;
}

.chat-sidebar {
  width: 160px;
  border-right: 2px solid #808080;
  background: #f0f0f0;
  display: flex;
  flex-direction: column;
  font-family: 'Tahoma', sans-serif;
  font-size: 0.8rem;
}

.chat-sidebar-title {
  padding: 0.4rem;
  background: #d4d0c8;
  border-bottom: 1px solid #808080;
  font-weight: bold;
  font-size: 0.75rem;
}

.chat-users {
  list-style: none;
  flex: 1;
  overflow-y: auto;
  padding: 0.3rem;
}

.chat-users li {
  padding: 0.2rem 0.3rem;
  cursor: default;
}

.chat-users li:hover { background: #000080; color: #fff; }
.chat-users .host { color: #000080; font-weight: bold; }
.chat-users .you { color: #008000; font-weight: bold; }

.chat-sidebar-footer {
  padding: 0.3rem;
  font-size: 0.7rem;
  background: #d4d0c8;
  border-top: 1px solid #808080;
  color: #444;
}

.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
  line-height: 1.45;
  background: #fff;
  color: #000;
}

.chat-msg { margin-bottom: 0.25rem; word-wrap: break-word; }
.chat-msg .user { font-weight: bold; color: #000080; }
.chat-msg .user.you { color: #008000; }
.chat-msg .user.system { color: #808080; font-style: italic; }
.chat-msg.system-line { color: #808080; font-style: italic; }

.chat-input-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem;
  background: #d4d0c8;
  border-top: 2px solid #808080;
}

.chat-prompt {
  font-family: monospace;
  font-weight: bold;
  color: #000;
}

#chat-input {
  flex: 1;
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  padding: 0.35rem 0.5rem;
  border: 2px inset #808080;
  background: #fff;
  color: #000;
  outline: none;
}

.chat-send {
  font-family: 'Tahoma', sans-serif;
  font-size: 0.8rem;
  padding: 0.35rem 0.75rem;
  background: #d4d0c8;
  border: 2px outset #fff;
  cursor: pointer;
}

.chat-send:active { border-style: inset; }

.chat-status {
  display: flex;
  justify-content: space-between;
  padding: 0.3rem 0.6rem;
  font-family: 'Tahoma', sans-serif;
  font-size: 0.75rem;
  background: #d4d0c8;
  color: #333;
  border-top: 1px solid #808080;
}

/* ===== Market ===== */
.market-frame {
  max-width: 880px;
  border-color: var(--neon-orange);
  box-shadow: 0 0 40px rgba(255, 140, 66, 0.25), inset 0 0 40px rgba(0, 0, 0, 0.3);
}

.market-header {
  text-align: center;
  margin-bottom: 1rem;
  position: relative;
}

.market-header h2 {
  font-family: var(--font-pixel);
  font-size: 0.85rem;
  color: var(--neon-orange);
  text-shadow: 0 0 12px rgba(255, 140, 66, 0.5);
  margin-bottom: 0.35rem;
}

.market-header p {
  color: rgba(245, 230, 200, 0.55);
  font-size: 1.15rem;
}

.market-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.market-tab {
  font-family: var(--font-pixel);
  font-size: 0.45rem;
  padding: 0.7rem 1rem;
  background: transparent;
  border: 1px solid rgba(255, 140, 66, 0.4);
  color: rgba(245, 230, 200, 0.55);
  cursor: pointer;
  flex: 1;
  min-width: 120px;
}

.market-tab.active, .market-tab:hover {
  border-color: var(--neon-orange);
  color: var(--neon-orange);
  background: rgba(255, 140, 66, 0.1);
}

.market-body {
  min-height: 280px;
  max-height: 50vh;
  overflow-y: auto;
}

.market-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.75rem;
}

.market-item {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 140, 66, 0.3);
  padding: 0.85rem;
  transition: border-color 0.15s;
}

.market-item:hover { border-color: var(--neon-orange); }

.market-item-emoji { font-size: 2rem; margin-bottom: 0.4rem; }
.market-item-name {
  font-family: var(--font-pixel);
  font-size: 0.42rem;
  color: var(--cream);
  line-height: 1.4;
  margin-bottom: 0.35rem;
}
.market-item-price {
  color: var(--crt-green);
  font-size: 1.2rem;
  margin-bottom: 0.25rem;
}
.market-item-seller {
  font-size: 0.95rem;
  color: rgba(245, 230, 200, 0.4);
  margin-bottom: 0.5rem;
}
.market-item-desc {
  font-size: 1rem;
  color: rgba(245, 230, 200, 0.55);
  margin-bottom: 0.6rem;
  line-height: 1.3;
}

.buy-btn {
  width: 100%;
  font-family: var(--font-pixel);
  font-size: 0.4rem;
  padding: 0.55rem;
  background: transparent;
  border: 1px solid var(--crt-green);
  color: var(--crt-green);
  cursor: pointer;
}

.buy-btn:hover {
  background: rgba(51, 255, 102, 0.12);
  box-shadow: 0 0 10px rgba(51, 255, 102, 0.25);
}

.buy-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.sell-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 420px;
  margin: 0 auto;
}

.sell-form label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-family: var(--font-pixel);
  font-size: 0.4rem;
  color: rgba(245, 230, 200, 0.6);
}

.sell-form input,
.sell-form select,
.sell-form textarea {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  padding: 0.5rem;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 140, 66, 0.4);
  color: var(--cream);
  outline: none;
}

.sell-form input:focus,
.sell-form select:focus,
.sell-form textarea:focus {
  border-color: var(--neon-orange);
}

.sell-form textarea { min-height: 70px; resize: vertical; }

.inventory-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.inv-item {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(180, 74, 255, 0.35);
  padding: 0.7rem;
  font-size: 1.05rem;
}

.inv-item strong {
  font-family: var(--font-pixel);
  font-size: 0.4rem;
  display: block;
  margin-bottom: 0.3rem;
  color: var(--neon-purple);
}

.market-note {
  text-align: center;
  color: var(--neon-cyan);
  font-size: 1.2rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.market-empty {
  text-align: center;
  color: rgba(245, 230, 200, 0.4);
  padding: 2rem;
  font-size: 1.2rem;
}

/* ===== Arcade / Console ===== */
.arcade-frame, .console-frame, .audio-frame {
  max-width: 560px;
  text-align: center;
  border-color: var(--neon-purple);
}

.audio-frame {
  max-width: 620px;
  border-color: #c9a227;
  box-shadow:
    0 0 0 1px rgba(201, 162, 39, 0.35),
    0 0 40px rgba(255, 120, 40, 0.18),
    inset 0 0 60px rgba(0, 0, 0, 0.45);
}

.audio-frame[data-accent="amber"] {
  border-color: #c9a227;
}
.audio-frame[data-accent="magenta"] {
  border-color: var(--neon-pink, #ff2d95);
  box-shadow:
    0 0 0 1px rgba(255, 45, 149, 0.35),
    0 0 40px rgba(255, 45, 149, 0.22),
    inset 0 0 60px rgba(0, 0, 0, 0.45);
}
.audio-frame[data-accent="cyan"] {
  border-color: var(--neon-cyan, #00f0ff);
  box-shadow:
    0 0 0 1px rgba(0, 240, 255, 0.35),
    0 0 40px rgba(0, 240, 255, 0.2),
    inset 0 0 60px rgba(0, 0, 0, 0.45);
}
.audio-frame[data-accent="silver"] {
  border-color: #c8c8d0;
  box-shadow:
    0 0 0 1px rgba(200, 200, 210, 0.4),
    0 0 40px rgba(180, 190, 220, 0.18),
    inset 0 0 60px rgba(0, 0, 0, 0.45);
}

.audio-header {
  position: relative;
  margin-bottom: 0.65rem;
}

.audio-decade {
  display: inline-block;
  font-family: var(--font-pixel);
  font-size: 0.45rem;
  color: #ffcc66;
  letter-spacing: 0.12em;
  border: 1px solid rgba(255, 204, 102, 0.4);
  padding: 0.25rem 0.6rem;
  margin-bottom: 0.5rem;
}

.audio-frame[data-accent="magenta"] .audio-decade {
  color: var(--neon-pink, #ff2d95);
  border-color: rgba(255, 45, 149, 0.45);
}
.audio-frame[data-accent="cyan"] .audio-decade {
  color: var(--neon-cyan, #00f0ff);
  border-color: rgba(0, 240, 255, 0.45);
}
.audio-frame[data-accent="silver"] .audio-decade {
  color: #d0d0d8;
  border-color: rgba(200, 200, 210, 0.5);
}

.audio-frame h2 {
  font-family: var(--font-pixel);
  font-size: 0.7rem;
  color: #ffcc66;
  text-shadow: 0 0 12px rgba(255, 180, 60, 0.45);
  margin-bottom: 0.35rem;
}

.audio-frame[data-accent="magenta"] h2 { color: var(--neon-pink, #ff2d95); text-shadow: 0 0 12px rgba(255, 45, 149, 0.45); }
.audio-frame[data-accent="cyan"] h2 { color: var(--neon-cyan, #00f0ff); text-shadow: 0 0 12px rgba(0, 240, 255, 0.4); }
.audio-frame[data-accent="silver"] h2 { color: #e8e8f0; text-shadow: 0 0 12px rgba(200, 200, 220, 0.35); }

.audio-tagline {
  font-size: 1.05rem;
  color: rgba(245, 230, 200, 0.55);
  margin: 0 0 0.2rem;
}

.audio-device {
  font-family: var(--font-pixel);
  font-size: 0.38rem;
  color: rgba(245, 230, 200, 0.4);
  letter-spacing: 0.08em;
  margin: 0;
}

.audio-pick-label {
  font-family: var(--font-pixel);
  font-size: 0.38rem;
  color: rgba(245, 230, 200, 0.5);
  margin: 0.75rem 0 0.5rem;
  letter-spacing: 0.06em;
}

.audio-track-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.45rem;
  margin-bottom: 1rem;
  text-align: left;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.audio-track-btn {
  appearance: none;
  border: 2px solid rgba(201, 162, 39, 0.35);
  background: rgba(28, 18, 10, 0.92);
  color: var(--cream);
  border-radius: 6px;
  padding: 0.55rem 0.5rem;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.12s;
  font-family: inherit;
  text-align: left;
}

.audio-frame[data-accent="magenta"] .audio-track-btn { border-color: rgba(255, 45, 149, 0.35); background: rgba(28, 10, 22, 0.92); }
.audio-frame[data-accent="cyan"] .audio-track-btn { border-color: rgba(0, 240, 255, 0.3); background: rgba(8, 20, 28, 0.92); }
.audio-frame[data-accent="silver"] .audio-track-btn { border-color: rgba(180, 180, 200, 0.35); background: rgba(18, 18, 24, 0.92); }

.audio-track-btn:hover {
  border-color: #ffcc66;
  transform: translateY(-1px);
}

.audio-track-btn.active {
  border-color: #33ff66;
  box-shadow: 0 0 14px rgba(51, 255, 102, 0.22);
  background: rgba(20, 40, 28, 0.95);
}

.audio-track-btn .at-emoji {
  font-size: 1.2rem;
  display: block;
  margin-bottom: 0.2rem;
}

.audio-track-btn .at-title {
  font-family: var(--font-pixel);
  font-size: 0.34rem;
  line-height: 1.35;
  color: #fff;
}

.audio-track-btn .at-meta {
  font-size: 0.85rem;
  color: rgba(245, 230, 200, 0.45);
  margin-top: 0.15rem;
}

.audio-now {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.85rem;
  align-items: center;
  background: #0a0806;
  border: 3px solid #2a2218;
  padding: 0.9rem 1rem;
  margin-bottom: 0.65rem;
  text-align: left;
  box-shadow: inset 0 0 24px rgba(255, 180, 60, 0.08);
}

.audio-frame[data-accent="magenta"] .audio-now { border-color: #2a1522; box-shadow: inset 0 0 24px rgba(255, 45, 149, 0.1); }
.audio-frame[data-accent="cyan"] .audio-now { border-color: #15222a; box-shadow: inset 0 0 24px rgba(0, 240, 255, 0.08); }
.audio-frame[data-accent="silver"] .audio-now { border-color: #2a2a30; box-shadow: inset 0 0 24px rgba(200, 200, 220, 0.08); }

.audio-now-art {
  font-size: 2.2rem;
  width: 3rem;
  text-align: center;
}

.audio-now-label {
  font-family: var(--font-pixel);
  font-size: 0.32rem;
  color: rgba(245, 230, 200, 0.4);
  letter-spacing: 0.1em;
  margin-bottom: 0.25rem;
}

.audio-now-title {
  font-family: var(--font-pixel);
  font-size: 0.5rem;
  color: var(--crt-green, #33ff66);
  line-height: 1.3;
}

.audio-now.playing .audio-now-title {
  animation: audioPulse 1.6s ease-in-out infinite;
}

@keyframes audioPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.audio-now-artist {
  font-size: 1.05rem;
  color: rgba(245, 230, 200, 0.7);
  margin-top: 0.2rem;
}

.audio-now-format {
  font-size: 0.9rem;
  color: rgba(245, 230, 200, 0.4);
  margin-top: 0.15rem;
}

.audio-vu {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 36px;
  opacity: 0.35;
}

.audio-now.playing .audio-vu {
  opacity: 1;
}

.audio-vu span {
  display: block;
  width: 5px;
  background: #33ff66;
  border-radius: 1px;
  height: 30%;
  transition: height 0.1s;
}

.audio-now.playing .audio-vu span {
  animation: vuBounce 0.45s ease-in-out infinite alternate;
}
.audio-now.playing .audio-vu span:nth-child(1) { animation-delay: 0s; }
.audio-now.playing .audio-vu span:nth-child(2) { animation-delay: 0.08s; height: 55%; }
.audio-now.playing .audio-vu span:nth-child(3) { animation-delay: 0.16s; height: 80%; }
.audio-now.playing .audio-vu span:nth-child(4) { animation-delay: 0.04s; height: 45%; }
.audio-now.playing .audio-vu span:nth-child(5) { animation-delay: 0.12s; height: 65%; }

@keyframes vuBounce {
  from { transform: scaleY(0.45); }
  to { transform: scaleY(1); }
}

.audio-blurb {
  color: rgba(245, 230, 200, 0.55);
  font-size: 1.05rem;
  font-style: italic;
  margin: 0 0 1rem;
  min-height: 1.4em;
}

.audio-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
}

.audio-actions .neon-btn {
  width: auto;
  margin: 0;
  min-width: 120px;
}

.arcade-header {
  position: relative;
  margin-bottom: 0.75rem;
}

.arcade-decade {
  display: inline-block;
  font-family: var(--font-pixel);
  font-size: 0.45rem;
  color: var(--neon-green, #33ff66);
  letter-spacing: 0.15em;
  border: 1px solid rgba(51, 255, 102, 0.4);
  padding: 0.25rem 0.6rem;
  margin-bottom: 0.5rem;
}

.arcade-frame h2, .console-frame h2 {
  font-family: var(--font-pixel);
  font-size: 0.7rem;
  color: var(--neon-purple);
  text-shadow: 0 0 12px rgba(180, 74, 255, 0.5);
  margin-bottom: 0.35rem;
}

.arcade-tagline {
  font-size: 1.05rem;
  color: rgba(245, 230, 200, 0.55);
  margin: 0 0 0.25rem;
}

.arcade-pick-label {
  font-family: var(--font-pixel);
  font-size: 0.38rem;
  color: rgba(245, 230, 200, 0.5);
  margin: 0.75rem 0 0.5rem;
  letter-spacing: 0.06em;
}

.arcade-game-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.45rem;
  margin-bottom: 1rem;
  text-align: left;
}

.arcade-game-btn {
  appearance: none;
  border: 2px solid rgba(180, 74, 255, 0.35);
  background: rgba(20, 10, 28, 0.9);
  color: var(--cream);
  border-radius: 6px;
  padding: 0.55rem 0.5rem;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.12s;
  font-family: inherit;
  text-align: left;
}

.arcade-game-btn:hover {
  border-color: var(--neon-pink);
  transform: translateY(-1px);
}

.arcade-game-btn.active {
  border-color: var(--neon-green, #33ff66);
  box-shadow: 0 0 14px rgba(51, 255, 102, 0.25);
  background: rgba(20, 40, 28, 0.95);
}

.arcade-game-btn .ag-emoji {
  font-size: 1.25rem;
  display: block;
  margin-bottom: 0.2rem;
}

.arcade-game-btn .ag-title {
  font-family: var(--font-pixel);
  font-size: 0.36rem;
  line-height: 1.35;
  color: #fff;
}

.arcade-game-btn .ag-year {
  font-size: 0.85rem;
  color: rgba(245, 230, 200, 0.45);
  margin-top: 0.15rem;
}

.arcade-screen {
  background: #000;
  border: 4px solid #222;
  padding: 1.1rem 1.25rem 1.25rem;
  margin-bottom: 1rem;
  min-height: 160px;
  box-shadow: inset 0 0 30px rgba(180, 74, 255, 0.2);
  text-align: left;
}

.arcade-now-playing {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.arcade-now-playing > span {
  font-size: 1.8rem;
}

.arcade-game-title {
  font-family: var(--font-pixel);
  font-size: 0.55rem;
  color: var(--crt-green);
  line-height: 1.3;
}

.arcade-game-meta {
  font-size: 0.95rem;
  color: rgba(245, 230, 200, 0.5);
  margin-top: 0.2rem;
}

.arcade-screen pre {
  font-family: var(--font-pixel);
  font-size: 0.32rem;
  color: var(--crt-green);
  line-height: 1.25;
  white-space: pre;
  overflow: hidden;
  text-align: center;
  margin: 0.5rem 0;
}

.arcade-screen p {
  margin-top: 0.65rem;
  font-size: 1.1rem;
  color: var(--cream);
}

.arcade-blurb {
  color: rgba(245, 230, 200, 0.55) !important;
  font-size: 1rem !important;
  font-style: italic;
}

.arcade-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
}

.arcade-actions .neon-btn {
  width: auto;
  margin: 0;
  min-width: 140px;
}

.cartridge-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin: 1rem 0 1.5rem;
}

.cart-chip {
  font-family: var(--font-pixel);
  font-size: 0.38rem;
  padding: 0.5rem 0.7rem;
  background: #1a1020;
  border: 1px solid var(--neon-purple);
  color: var(--neon-purple);
}

.console-frame p {
  font-size: 1.2rem;
  color: rgba(245, 230, 200, 0.7);
  line-height: 1.5;
  margin-bottom: 0.5rem;
}

/* Scrollbars */
.media-body::-webkit-scrollbar,
.market-body::-webkit-scrollbar,
.chat-messages::-webkit-scrollbar,
.audio-track-list::-webkit-scrollbar {
  width: 8px;
}
.media-body::-webkit-scrollbar-thumb,
.market-body::-webkit-scrollbar-thumb,
.audio-track-list::-webkit-scrollbar-thumb {
  background: rgba(0, 240, 255, 0.3);
  border-radius: 4px;
}
.chat-messages::-webkit-scrollbar-thumb {
  background: #808080;
}

@media (max-width: 600px) {
  .chat-body { flex-direction: column; height: 420px; }
  .chat-sidebar { width: 100%; max-height: 100px; border-right: none; border-bottom: 2px solid #808080; }
  .chat-users { display: flex; flex-wrap: wrap; gap: 0.25rem; }
  .media-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
}

/* ===== Mobile-friendly overlays ===== */
@media (max-width: 900px), (pointer: coarse) {
  .overlay-panel {
    padding: max(10px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right))
      max(10px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
    align-items: stretch;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .panel-frame {
    width: 100%;
    max-width: none;
    max-height: min(92dvh, 920px);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0.85rem;
  }

  .media-frame,
  .chat-frame,
  .market-frame,
  .arcade-frame,
  .audio-frame,
  .console-frame {
    max-width: none;
    width: 100%;
  }

  .media-header,
  .market-header,
  .audio-header {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .media-tabs,
  .market-tabs {
    flex-wrap: wrap;
    gap: 0.35rem;
  }

  .media-tab,
  .market-tab {
    flex: 1 1 auto;
    min-height: 40px;
    font-size: 0.75rem;
    padding: 0.45rem 0.5rem;
  }

  .media-body {
    max-height: min(52dvh, 420px);
  }

  .media-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.45rem;
  }

  .media-card {
    min-height: 44px;
  }

  .neon-btn,
  .tape-btn,
  .close-btn,
  .chat-send {
    min-height: 44px;
    min-width: 44px;
    touch-action: manipulation;
  }

  .close-btn {
    font-size: 1.1rem;
  }

  .chat-body {
    flex-direction: column;
    height: min(60dvh, 480px);
  }

  .chat-sidebar {
    width: 100%;
    max-height: 88px;
    border-right: none;
    border-bottom: 2px solid #808080;
  }

  .chat-users {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    font-size: 0.85rem;
  }

  .chat-input-row input {
    font-size: 16px; /* prevents iOS zoom on focus */
    min-height: 44px;
  }

  .audio-track-list {
    max-height: min(36dvh, 280px);
  }

  .audio-actions {
    flex-wrap: wrap;
  }

  .arcade-games {
    grid-template-columns: 1fr;
  }

  .panel-title {
    font-size: clamp(0.55rem, 3.5vw, 0.75rem);
  }

  .info-box p {
    font-size: 0.95rem;
    line-height: 1.35;
  }
}

@media (max-height: 500px) and (orientation: landscape) {
  .overlay-panel {
    align-items: flex-start;
  }
  .panel-frame {
    max-height: 96dvh;
  }
  .media-body,
  .chat-body {
    max-height: 48dvh;
    height: auto;
  }
}
