/* === NEWGROUNDS / CARTOON NETWORK / RETRO PORTAL LAYER ===
   Section-aware: most accents come from var(--accent), set by [data-theme]
   wrappers (ng=orange, myspace=pink, cn=cyan, silkroad=green).
   The WinAmp player keeps hardcoded green-on-black (pledit identity). */

/* Chunky portal nav tabs (in-page NG tabs; global nav uses .navbar) */
.portal-nav {
  display: flex;
  gap: 0;
  background: #000;
  border: 2px solid #333;
  border-bottom: none;
  margin-bottom: 0;
}

.portal-nav a {
  flex: 1;
  text-align: center;
  padding: 4px 8px;
  font-family: var(--font-sans);
  font-size: var(--t-xs);
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-decoration: none;
  color: var(--text-primary);
  background: #222;
  border-right: 1px solid #444;
  transition: background 0.15s, color 0.15s;
}

.portal-nav a:last-child { border-right: none; }
.portal-nav a:hover { background: #333; color: var(--accent); }
.portal-nav a.active {
  background: var(--accent-dim);
  color: var(--accent);
  text-shadow: 0 0 6px var(--accent-glow);
}

/* Retro section headers */
/* page banner role: the one mono header (DESIGN_CONTRACT sec 4 exceptions) */
.retro-header {
  background: var(--accent-dim);
  border: 1px solid #000;
  padding: 5px 10px;
  font-family: var(--font);
  font-size: var(--t-md);
  font-weight: bold;
  color: var(--accent);
  position: relative;
  overflow: hidden;
}

/* NG tank-logo sunburst rays behind a header (static, painted once) */
.retro-header.sunburst::before {
  content: "";
  position: absolute;
  inset: -40px -10px;
  background: repeating-conic-gradient(
    from 0deg at 50% 50%,
    rgba(252, 162, 56, 0.10) 0deg 6deg,
    transparent 6deg 16deg
  );
  pointer-events: none;
}

.retro-header.sunburst > * { position: relative; }

/* Flash game frame */
.game-frame {
  border: 3px solid #555;
  background: #000;
  box-shadow: inset 0 0 20px rgba(0,0,0,0.8), 0 0 10px rgba(0,0,0,0.5);
  position: relative;
}

.game-frame-title {
  background: var(--grad-header);
  padding: 4px 8px;
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 2px;
  border-bottom: 1px solid #000;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.game-frame-title .frame-dots {
  display: flex;
  gap: 4px;
}

.game-frame-title .frame-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.game-frame-title .frame-dots span:nth-child(1) { background: var(--red); }
.game-frame-title .frame-dots span:nth-child(2) { background: var(--yellow); }
.game-frame-title .frame-dots span:nth-child(3) { background: var(--green-bright); }

/* === LEADERBOARD — RuneScape-hiscores-style ranked table === */
.leaderboard {
  border: 2px solid #333;
  background: var(--surface-bg);
  font-family: var(--font-mono);
}

/* prestige surface: the game page's signature header (CONTRACT exception) */
.leaderboard-title {
  background: var(--grad-header);
  padding: 4px 8px;
  text-align: center;
  font-weight: bold;
  color: var(--yellow);
  text-transform: uppercase;
  letter-spacing: 3px;
  text-shadow: 0 0 10px rgba(255,204,0,0.4);
  border-bottom: 1px solid #000;
  font-family: var(--font-pixel);
  font-size: var(--t-lg);
}

.leaderboard-cols {
  display: flex;
  justify-content: space-between;
  padding: 2px 8px;
  font-size: var(--t-xs);
  color: #555;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 1px solid #222;
  background: #0d0d0d;
}

.leaderboard-cols .lb-rank { width: 24px; }
.leaderboard-cols .lb-name { flex: 1; }
.leaderboard-cols .lb-score { text-align: right; min-width: 60px; }

.leaderboard-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 8px;
  font-size: var(--t-base);
  border-bottom: 1px solid #1a1a1a;
}

.leaderboard-row:nth-child(odd) { background: #0f0f0f; }
.leaderboard-row .lb-rank { color: var(--accent); width: 24px; }
.leaderboard-row .lb-name { color: #e8d8b0; flex: 1; overflow: hidden; text-overflow: ellipsis; }
.leaderboard-row .lb-score { color: var(--yellow); text-align: right; min-width: 60px; font-family: var(--font-pixel); font-size: var(--t-md); }
.leaderboard-row.top-1 .lb-name { color: var(--yellow); text-shadow: 0 0 6px rgba(255,204,0,0.5); }
.leaderboard-row.top-1 .lb-rank { color: var(--yellow); }

.leaderboard-empty {
  padding: 12px 8px;
  text-align: center;
  font-size: var(--t-xs);
  color: #444;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* === NG VOTE BAR (face-reacting 0-5, doodle edition) === */
.vote-bar {
  border: 2px solid var(--border-dim);
  background: var(--surface-bg);
  padding: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
}

.vote-face {
  width: 34px;
  height: 34px;
  background: #fff;
  border: 1px solid #555;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.vote-face img {
  width: 30px;
  height: 30px;
  object-fit: contain;
  transition: transform 0.15s, filter 0.15s;
}

.vote-bar[data-score="0"] .vote-face img { transform: rotate(180deg); filter: saturate(0); }
.vote-bar[data-score="1"] .vote-face img { transform: rotate(140deg); }
.vote-bar[data-score="2"] .vote-face img { transform: rotate(60deg); }
.vote-bar[data-score="3"] .vote-face img { transform: rotate(0deg); }
.vote-bar[data-score="4"] .vote-face img { transform: scale(1.1); }
.vote-bar[data-score="5"] .vote-face img { transform: scale(1.25); filter: drop-shadow(0 0 4px var(--accent)); }

.vote-btns {
  display: flex;
  gap: 2px;
}

.vote-btns button {
  width: 22px;
  padding: 4px 0;
  background: var(--grad-control);
  border: 1px outset #555;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: var(--t-base);
  cursor: pointer;
}

.vote-btns button:hover { color: var(--accent); border-color: var(--accent); }
.vote-btns button.voted {
  border-style: inset;
  color: var(--accent);
  background: var(--accent-dim);
}

.vote-label {
  font-size: var(--t-xs);
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
  flex: 1;
}

.vote-label b { color: var(--accent); display: block; font-size: var(--t-xs); }

/* chips share the badge exemption: Silkscreen 8px (images-as-text family) */
.uj-chip {
  display: inline-block;
  background: #1a1a1a;
  border: 1px solid var(--ng-orange);
  color: var(--ng-orange);
  font-family: var(--font-badge);
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 2px 4px;
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
}

/* HOT / NEW flags (Addicting Games style) */
.flag-chip {
  display: inline-block;
  font-family: var(--font-badge);
  font-size: 8px;
  padding: 2px 4px;
  text-transform: uppercase;
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
}

.flag-new { background: var(--red); color: #fff; }
.flag-hot { background: var(--ng-orange); color: #1a0d00; }

/* BV crest watermark (eBaum's stamp, knowingly) */
.wm-crest::after {
  content: "";
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 28px;
  height: 42px;
  background: url("../assets/bagel/crest.png") no-repeat center / contain;
  opacity: 0.35;
  pointer-events: none;
  filter: drop-shadow(0 0 1px #000);
}

/* === MUSIC PLAYER / DROPS — WinAmp chrome (keeps green pledit identity) === */
.drops-section {
  border: 2px solid #333;
  background: var(--surface-bg);
  margin-bottom: 8px;
}

.drops-header {
  background: var(--grad-header);
  padding: 4px 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #000;
  gap: 8px;
}

.drops-header-title {
  font-family: var(--font-sans);
  font-size: var(--t-xs);
  font-weight: bold;
  color: var(--hot-pink);
  text-transform: uppercase;
  letter-spacing: 1px;
  text-shadow: 0 0 6px rgba(255,20,147,0.4);
  flex-shrink: 0;
}

/* scrolling marquee title (WinAmp text.bmp energy) */
.drops-now-playing {
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  color: var(--green-bright);
  text-shadow: 0 0 4px rgba(0,255,65,0.3);
  overflow: hidden;
  white-space: nowrap;
  max-width: 50%;
  position: relative;
}

.drops-now-playing .np-scroll {
  display: inline-block;
  white-space: nowrap;
  padding-left: 100%;
  animation: np-mq 9s linear infinite;
  animation-play-state: paused;
}

.drops-section.playing .drops-now-playing .np-scroll { animation-play-state: running; }

@keyframes np-mq {
  0% { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}

.drops-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-bottom: 1px solid #222;
  background: var(--panel-bg);
}

.drops-controls button {
  background: none;
  border: 1px solid #444;
  color: var(--green-bright);
  font-family: var(--font-mono);
  font-size: var(--t-md);
  padding: 2px 8px;
  cursor: pointer;
  transition: border-color 0.15s;
}

.drops-controls button:hover {
  border-color: var(--green-bright);
  text-shadow: 0 0 6px rgba(0,255,65,0.5);
}

.drops-controls button.active {
  color: var(--hot-pink);
  border-color: var(--hot-pink);
}

.drops-progress {
  flex: 1;
  height: 4px;
  background: #222;
  border: 1px solid #333;
  cursor: pointer;
  position: relative;
}

.drops-progress-fill {
  height: 100%;
  background: var(--green-bright);
  width: 100%;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 100ms linear;
  box-shadow: 0 0 4px rgba(0,255,65,0.4);
}

/* LED-segment time (numbers.bmp; click toggles elapsed/remaining) */
.drops-time {
  font-family: var(--font-pixel);
  font-size: var(--t-lg);
  color: var(--green-bright);
  min-width: 46px;
  text-align: right;
  background: #000;
  border: 1px inset #333;
  padding: 0 4px;
  cursor: pointer;
  text-shadow: 0 0 5px rgba(0,255,65,0.5);
  user-select: none;
}

/* fake kbps/khz micro-readouts */
.drops-readouts {
  display: flex;
  gap: 4px;
  align-items: center;
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  color: #5a5a5a;
}

.drops-readouts b { color: var(--green-bright); font-weight: normal; }

.drops-stereo { color: #333; letter-spacing: 1px; }
.drops-section.playing .drops-stereo { color: var(--green-bright); text-shadow: 0 0 4px rgba(0,255,65,0.4); }

/* decorative spectrum analyzer (viscolor ramp; CSS-only, transform anim) */
.drops-analyzer {
  display: flex;
  align-items: flex-end;
  gap: 1px;
  height: 16px;
  width: 64px;
  background: #000;
  border: 1px inset #333;
  padding: 1px 2px;
  overflow: hidden;
}

.drops-analyzer span {
  flex: 1;
  height: 100%;
  background: linear-gradient(0deg, #00ff41 0%, #aaff00 55%, #ffcc00 75%, #ff3300 100%);
  transform: scaleY(0.05);
  transform-origin: bottom;
}

.drops-section.playing .drops-analyzer span {
  animation: viz 0.5s ease-in-out infinite alternate;
}

.drops-analyzer span:nth-child(1) { animation-duration: 0.42s; }
.drops-analyzer span:nth-child(2) { animation-duration: 0.36s; animation-delay: 0.08s; }
.drops-analyzer span:nth-child(3) { animation-duration: 0.52s; animation-delay: 0.02s; }
.drops-analyzer span:nth-child(4) { animation-duration: 0.31s; animation-delay: 0.12s; }
.drops-analyzer span:nth-child(5) { animation-duration: 0.47s; animation-delay: 0.05s; }
.drops-analyzer span:nth-child(6) { animation-duration: 0.39s; animation-delay: 0.10s; }
.drops-analyzer span:nth-child(7) { animation-duration: 0.55s; }
.drops-analyzer span:nth-child(8) { animation-duration: 0.34s; animation-delay: 0.07s; }
.drops-analyzer span:nth-child(9) { animation-duration: 0.45s; animation-delay: 0.03s; }
.drops-analyzer span:nth-child(10) { animation-duration: 0.50s; animation-delay: 0.09s; }

@keyframes viz {
  0% { transform: scaleY(0.08); }
  100% { transform: scaleY(1); }
}

/* shade mode (WinAmp windowshade) */
.drops-shade-btn {
  background: none;
  border: 1px solid #444;
  color: #666;
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  padding: 2px 4px;
  cursor: pointer;
  flex-shrink: 0;
}

.drops-shade-btn:hover { color: var(--green-bright); border-color: var(--green-bright); }

.drops-section.shade .drops-controls,
.drops-section.shade .drops-toggle,
.drops-section.shade .drops-playlist { display: none; }

.drops-playlist {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.drops-playlist.open {
  max-height: 600px;
  overflow-y: auto;
}

.drops-release {
  border-top: 1px solid #1a1a1a;
}

/* NG orange here = the Audio Portal release-subhead rule (CONTRACT sec 7) */
.drops-release-header {
  padding: 4px 8px;
  font-family: var(--font-sans);
  font-size: var(--t-xs);
  font-weight: bold;
  color: var(--ng-orange);
  text-transform: uppercase;
  letter-spacing: 1px;
  background: var(--panel-bg);
  border-bottom: 1px solid #1a1a1a;
}

.drops-track {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px 4px 16px;
  font-family: var(--font-mono);
  font-size: var(--t-base);
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 1px solid #0f0f0f;
  transition: background 0.1s;
}

.drops-track:hover {
  background: #1a1a1a;
  color: var(--green-bright);
}

.drops-track.active {
  color: var(--green-bright);
  background: #1a1a1a;
}

.drops-track.active .dt-title { text-shadow: 0 0 4px rgba(0,255,65,0.3); }
.drops-track.unavailable { color: #333; cursor: default; }
.drops-track.unavailable:hover { background: transparent; color: #333; }

.drops-track .dt-num { width: 16px; text-align: right; color: #444; font-size: var(--t-xs); }
.drops-track .dt-title { flex: 1; }
.drops-track .dt-playing { color: var(--green-bright); font-size: var(--t-xs); }

/* spotify fallback link on unavailable tracks */
.dt-spotify {
  font-size: var(--t-xs);
  color: #1DB954;
  text-decoration: none;
}

.drops-release-meta { color: #555; font-weight: normal; }

/* Playlist toggle button */
.drops-toggle {
  display: block;
  width: 100%;
  padding: 4px;
  background: var(--panel-bg);
  border: none;
  border-top: 1px solid #222;
  color: #666;
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  text-transform: uppercase;
  letter-spacing: 2px;
  cursor: pointer;
}

.drops-toggle:hover { color: var(--green-bright); }

/* === AVATAR CREATOR — CN zone (thick keylines, flat fills) === */
.creator-panel {
  border: 3px solid #000;
  outline: 1px solid var(--accent-dim);
  background: var(--panel-bg);
  position: relative;
}

/* CN-zone header: flat accent-dim fill instead of the gradient — the one
   named exception (thick-keyline section identity, CONTRACT sec 4) */
.creator-panel-header {
  background: var(--accent-dim);
  padding: 4px 8px;
  font-family: var(--font-sans);
  font-size: var(--t-xs);
  font-weight: bold;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 3px solid #000;
}

.creator-options {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 8px;
}

.creator-option {
  width: 48px;
  height: 48px;
  border: 2px solid #333;
  background: var(--surface-bg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s;
}

.creator-option:hover { border-color: var(--accent); }
.creator-option.selected {
  border-color: var(--hot-pink);
  box-shadow: 0 0 6px rgba(255,20,147,0.4);
}

/* hidden clickspot unlockable (Club Penguin catalog secret) */
.creator-secret {
  position: absolute;
  width: 16px;
  height: 16px;
  right: 8px;
  bottom: 8px;
  cursor: pointer;
  opacity: 0.12;
  color: var(--accent);
  font-size: var(--t-base);
  line-height: 16px;
  text-align: center;
  user-select: none;
}

.creator-secret:hover { opacity: 0.5; }

.creator-tabs {
  display: flex;
  gap: 0;
}

.creator-tab {
  flex: 1;
  padding: 4px 8px;
  background: #1a1a1a;
  border: 1px solid var(--border-dim);
  border-bottom: none;
  color: #666;
  font-family: var(--font-sans);
  font-size: var(--t-xs);
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-align: center;
  cursor: pointer;
}

.creator-tab:hover { color: #aaa; }
.creator-tab.active {
  background: var(--panel-bg);
  color: var(--accent);
  border-bottom: 1px solid var(--panel-bg);
}

/* Scanline overlay: retired in v2 (cyber tell). Kept as no-op for HTML compat. */
.scanline-overlay { display: none; }

/* Retro input */
.retro-input {
  background: var(--surface-bg);
  border: 2px inset #444;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: var(--t-base);
  padding: 4px 8px;
  outline: none;
}

.retro-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 6px var(--accent-glow);
}

.retro-btn {
  background: var(--grad-control);
  border: 2px outset #555;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: var(--t-base);
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 8px 16px;
  cursor: pointer;
}

.retro-btn:hover {
  text-shadow: 0 0 6px var(--accent-glow);
}

.retro-btn:active { border-style: inset; }

.retro-btn-pink {
  color: var(--hot-pink);
}

.retro-btn-pink:hover {
  text-shadow: 0 0 6px rgba(255,20,147,0.4);
}

/* Pixel text glow */
.glow-green { color: var(--green-bright); text-shadow: 0 0 8px rgba(0,255,65,0.4); }
.glow-pink { color: var(--hot-pink); text-shadow: 0 0 8px rgba(255,20,147,0.4); }
.glow-orange { color: var(--ng-orange); text-shadow: 0 0 8px rgba(252,162,56,0.4); }
.glow-yellow { color: var(--yellow); text-shadow: 0 0 8px rgba(255,204,0,0.4); }
.glow-cyan { color: var(--cyan); text-shadow: 0 0 8px rgba(0,255,204,0.4); }

/* Star burst decorators */
.starburst {
  display: inline-block;
  font-size: var(--t-xs);
  color: var(--yellow);
  text-shadow: 0 0 6px rgba(255,204,0,0.6);
  animation: pulse-glow 2s ease-in-out infinite;
  margin: 0 2px;
}

@keyframes pulse-glow {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* Under construction bar (Newgrounds style) */
.construction-banner {
  background: repeating-linear-gradient(
    -45deg,
    #111,
    #111 10px,
    #1a1a1a 10px,
    #1a1a1a 20px
  );
  border: 1px solid var(--border-dim);
  padding: 4px 8px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  color: var(--ng-orange);
  text-transform: uppercase;
  letter-spacing: 2px;
}

/* === P2P TABLE (LimeWire search-results mode for the shop) === */
.p2p-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: var(--t-base);
  background: var(--surface-bg);
  border: 2px solid var(--border-dim);
}

.p2p-table th {
  background: var(--grad-header);
  border: 1px solid #000;
  border-bottom: 1px solid #444;
  color: #aaa;
  font-family: var(--font-sans);
  font-size: var(--t-xs);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 4px 8px;
  text-align: left;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.p2p-table th:hover { color: var(--accent); }
.p2p-table th .sort-arrow { color: var(--accent); font-size: var(--t-xs); }

.p2p-table td {
  padding: 4px 8px;
  border-bottom: 1px solid #161616;
  color: var(--text-muted);
  white-space: nowrap;
}

.p2p-table td.p2p-name { color: var(--accent); font-weight: bold; cursor: pointer; max-width: 0; width: 45%; overflow: hidden; text-overflow: ellipsis; }
.p2p-table td.p2p-name:hover { text-decoration: underline; }
.p2p-table tr:nth-child(odd) td { background: #0d0d0d; }
.p2p-table tr:hover td { background: #1a1a1a; }
.p2p-table td.p2p-price { color: var(--red-bright); font-weight: bold; }

/* connection-quality stock glyph (5 bars) */
.stock-glyph {
  display: inline-flex;
  align-items: flex-end;
  gap: 1px;
  height: 10px;
  margin-right: 4px;
  vertical-align: middle;
}

.stock-glyph i {
  width: 2px;
  background: #2a2a2a;
  display: inline-block;
}

.stock-glyph i:nth-child(1) { height: 3px; }
.stock-glyph i:nth-child(2) { height: 5px; }
.stock-glyph i:nth-child(3) { height: 7px; }
.stock-glyph i:nth-child(4) { height: 9px; }
.stock-glyph i:nth-child(5) { height: 10px; }

.stock-glyph[data-q="5"] i { background: var(--green-bright); }
.stock-glyph[data-q="3"] i:nth-child(-n+3) { background: var(--yellow); }
.stock-glyph[data-q="1"] i:nth-child(1) { background: var(--red-bright); }

.p2p-typeicon { color: var(--text-dim); font-size: var(--t-xs); margin-right: 4px; }

/* shop view toggle */
.view-toggle {
  display: inline-flex;
  gap: 0;
  margin-left: 8px;
}

.view-toggle button {
  background: var(--grad-control);
  border: 1px outset #555;
  color: #888;
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  text-transform: uppercase;
  padding: 2px 8px;
  cursor: pointer;
}

.view-toggle button.active {
  border-style: inset;
  color: var(--accent);
  background: var(--surface-bg);
}

/* === BOOT SEQUENCE: retired in v2 (cyber tell). === */
.boot-overlay { display: none !important; }

/* === NUDGE (MSN screen shake) === */
@keyframes nudge {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-6px, 3px); }
  40% { transform: translate(5px, -4px); }
  60% { transform: translate(-4px, -3px); }
  80% { transform: translate(3px, 4px); }
}

.nudging {
  animation: nudge 0.45s linear 2;
}

@media (prefers-reduced-motion: reduce) {
  .drops-analyzer span,
  .drops-now-playing .np-scroll,
  .starburst,
  .nudging { animation: none !important; }
  .boot-overlay { display: none; }
  .card-img { transition: none !important; }
}

/* ============================================================
   SHOP CARD GRID — image-forward listings (single unified view)
   ============================================================ */
#product-area.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 10px 2px 14px;
  align-items: start;
}

@media (max-width: 600px) {
  #product-area.shop-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
}

.card {
  position: relative;
  background: var(--surface-bg);
  border: 2px solid #000;
  box-shadow: 4px 4px 0 rgba(0,0,0,0.6);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: border-color .15s, box-shadow .15s, transform .15s;
  outline: none;
}

.card:hover,
.card:focus-visible {
  border-color: var(--green-bright);
  box-shadow: 4px 4px 0 rgba(0,255,65,0.3);
  transform: translateY(-2px);
}

.card-media {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: #0d0d0d;
}

.card-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity .25s ease, transform .35s ease;
}

.card-img--back { opacity: 0; }

@media (hover: hover) {
  .card:hover .card-img--front { opacity: 0; }
  .card:hover .card-img--back  { opacity: 1; }
  .card:hover .card-img        { transform: scale(1.05); }
}

.card-cta {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.8);
  color: var(--green-bright);
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  text-transform: uppercase;
  letter-spacing: 1px;
  text-align: center;
  padding: 4px 0;
  transform: translateY(100%);
  transition: transform .18s ease;
}

@media (hover: hover) { .card:hover .card-cta { transform: none; } }
@media (hover: none)  { .card-cta { transform: none; opacity: .85; } }

.card-body {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px;
  padding: 7px 8px 8px;
}

.card-name {
  font-family: var(--font);
  font-size: var(--t-base);
  color: var(--text-primary);
  font-weight: bold;
  line-height: 1.25;
}

.card-price {
  font-family: var(--font-mono);
  font-size: var(--t-base);
  color: var(--green-bright);
  font-weight: bold;
  white-space: nowrap;
}

.badge {
  position: absolute;
  top: 7px; left: 7px;
  z-index: 2;
  padding: 2px 7px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .5px;
  text-transform: lowercase;
  font-weight: bold;
  pointer-events: none;
  border: 1px solid #000;
}

.badge--new { background: var(--green-bright); color: #000; }
.badge--hot { background: var(--hot-pink); color: #000; }
.badge--soon { background: #f0d264; color: #000; }
.badge--judgment { background: #1a1a1a; color: var(--ng-orange); border-color: var(--ng-orange); }

/* shop infobar: active category label */
.infobar-cat {
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  margin-left: 8px;
  text-transform: lowercase;
}


/* ============================================================
   RUNNER — ink-on-paper game stage + hiscore board
   ============================================================ */
.runner-layout { display: flex; gap: 0; flex-wrap: wrap; }
.runner-main { flex: 1; min-width: 0; background: #0a0a0a; padding: 12px; display: flex; flex-direction: column; justify-content: center; }
.runner-side { flex: 0 0 210px; background: #111; border-left: 2px solid #333; }
.runner-stage { background: #f2efe8; line-height: 0; }
.runner-stage canvas { display: block; width: 100%; touch-action: none; user-select: none; -webkit-user-select: none; image-rendering: pixelated; image-rendering: crisp-edges; }
.runner-best { padding: 8px; font-family: var(--font-mono); font-size: var(--t-xs); color: #777; text-transform: uppercase; letter-spacing: 1px; }
.runner-best b { color: var(--yellow); font-family: var(--font-pixel); font-size: var(--t-md); letter-spacing: 0; }
.leaderboard-row.lb-you { background: #1e2a14; }
.leaderboard-row.lb-you .lb-name { color: var(--green-live); }
.runner-submit { margin: 4px 8px 8px; padding: 8px; border: 2px solid var(--yellow); background: #15150c; }
.runner-submit-title { font-family: var(--font-pixel); font-size: var(--t-lg); color: var(--yellow); text-transform: uppercase; letter-spacing: 2px; margin-bottom: 6px; text-align: center; }
.runner-submit-row { display: flex; gap: 6px; }
.runner-submit-row input {
  width: 4.2em; flex: 0 0 auto; text-align: center; text-transform: uppercase;
  font-family: var(--font-pixel); font-size: 22px; letter-spacing: 4px;
  background: #000; color: var(--yellow); border: 2px inset #555; padding: 2px 4px;
}
.runner-submit-row .retro-btn { flex: 1; }
.runner-submit-note { margin-top: 6px; font-family: var(--font-mono); font-size: 9px; color: #888; text-align: center; }
@media (max-width: 768px) {
  .runner-side { flex: 1 1 100%; border-left: none; border-top: 2px solid #333; }
}

/* ============================================================
   AUDIO PLAYER — transport press-feedback + volume slider
   ============================================================ */
.drops-controls button:active {
  border-style: inset;
  border-color: #444;
  box-shadow: inset 1px 1px 0 rgba(0,0,0,0.6);
  text-shadow: none;
}

.drops-vol {
  display: flex;
  align-items: center;
  gap: 4px;
}

.drops-mute {
  background: none;
  border: 1px solid #444;
  color: var(--green-bright);
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  line-height: 1;
  padding: 3px 5px;
  cursor: pointer;
  transition: border-color 0.15s;
}

.drops-mute:hover { border-color: var(--green-bright); }
.drops-mute.muted { color: var(--hot-pink); border-color: var(--hot-pink); }

.drops-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 64px;
  height: 14px;
  background: transparent;
  cursor: pointer;
}

/* sunken Win9x groove with a green "filled" portion driven by --fill */
.drops-slider::-webkit-slider-runnable-track {
  height: 8px;
  background:
    linear-gradient(var(--green-bright), var(--green-bright)) left/var(--fill, 80%) 100% no-repeat,
    #1a1a1a;
  border: 1px solid #000;
  box-shadow: inset 1px 1px 0 #000, inset -1px -1px 0 #444;
}
.drops-slider::-moz-range-track {
  height: 8px;
  background: #1a1a1a;
  border: 1px solid #000;
  box-shadow: inset 1px 1px 0 #000, inset -1px -1px 0 #444;
}
.drops-slider::-moz-range-progress { height: 8px; background: var(--green-bright); }

/* raised Winamp thumb */
.drops-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 10px;
  height: 14px;
  margin-top: -4px;
  background: linear-gradient(#dcdcdc, #9a9a9a);
  border: 1px solid #000;
  box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 #6a6a6a;
}
.drops-slider::-moz-range-thumb {
  width: 10px;
  height: 14px;
  border: 1px solid #000;
  border-radius: 0;
  background: linear-gradient(#dcdcdc, #9a9a9a);
  box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 #6a6a6a;
}
.drops-slider:focus-visible { outline: none; }
.drops-slider:focus-visible::-webkit-slider-thumb { outline: 2px dotted var(--green-bright); outline-offset: 1px; }
