/* Screen Reader / Text Hidden Utility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ==========================================================================
   DROIDRECOMP — Modern Design System for Android
   ========================================================================== */

:root {
  --midnight: #0B1220;
  --midnight-alt: #0e172a;
  --frost: #F4F8FC;
  --cyan: #34F2E8;
  --cyan-glow: rgba(52, 242, 232, 0.35);
  --cyan-soft: rgba(52, 242, 232, 0.12);
  --cyan-border: rgba(52, 242, 232, 0.35);
  --muted: #A7B3C4;
  --line: rgba(244, 248, 252, 0.14);
  --line-strong: rgba(244, 248, 252, 0.25);
  --glass: rgba(244, 248, 252, 0.07);
  --glass-card: rgba(14, 23, 42, 0.75);
  --glass-hover: rgba(244, 248, 252, 0.13);
  --glass-active: rgba(52, 242, 232, 0.15);
  --glass-highlight: rgba(52, 242, 232, 0.18);
  --card-foot-bg: rgba(11, 18, 32, 0.45);
  --select-bg: #111b2e;
  --select-border: rgba(244, 248, 252, 0.18);
  --bg: var(--midnight);
  --btn-brand-text: #0B1220;
  --btn-action-bg: rgba(52, 242, 232, 0.12);
  --btn-action-text: #34F2E8;
  --btn-action-border: rgba(52, 242, 232, 0.35);
  --btn-action-hover-bg: #34F2E8;
  --btn-action-hover-text: #0B1220;
  --acc: #34F2E8;
  --acc2: #377BB6;
  --brand: linear-gradient(180deg, var(--acc), var(--acc2));
  --brand-h: linear-gradient(135deg, #34F2E8 0%, #377BB6 100%);
  --danger: #ff5c77;
  --success: #34d399;
  --warning: #fbbf24;
  --wrap: 1600px;
  --gut: clamp(16px, 3.5vw, 48px);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  --scrollbar-thumb: rgba(244, 248, 252, 0.22);
  --scrollbar-thumb-hover: rgba(52, 242, 232, 0.6);
  --scrollbar-track: transparent;
  --font-sans: 'Figtree', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: 'Archivo', var(--font-sans);
  --scrollbar-thumb: rgba(15, 23, 42, 0.25);
  --scrollbar-thumb-hover: rgba(2, 132, 199, 0.65);
  --scrollbar-track: transparent;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 25px rgba(52, 242, 232, 0.25);
  --nav-bg: rgba(11, 18, 32, 0.85);
  --card-bg: rgba(14, 23, 42, 0.75);
  --input-bg: #111b2e;
  --modal-bg: #0E172A;
  --modal-overlay: rgba(5, 9, 16, 0.8);
  --mobile-nav-bg: rgba(11, 18, 32, 0.94);
  --hero-fade: linear-gradient(90deg, #0B1220 0%, rgba(11, 18, 32, 0.85) 45%, rgba(11, 18, 32, 0.2) 100%);
  --poster-fade: linear-gradient(0deg, #0E172A 0%, rgba(14, 23, 42, 0.7) 60%, rgba(14, 23, 42, 0.2) 100%);
  transition: background-color 0.3s ease, color 0.3s ease;
}

[data-theme="light"] {
  --midnight: #F1F5F9;
  --midnight-alt: #FFFFFF;
  --frost: #0F172A;
  --cyan: #0284C7;
  --cyan-glow: rgba(2, 132, 199, 0.25);
  --cyan-soft: rgba(2, 132, 199, 0.10);
  --cyan-border: rgba(2, 132, 199, 0.35);
  --muted: #475569;
  --line: rgba(15, 23, 42, 0.12);
  --line-strong: rgba(15, 23, 42, 0.22);
  --glass: #FFFFFF;
  --glass-card: #FFFFFF;
  --glass-hover: #F8FAFC;
  --glass-active: rgba(2, 132, 199, 0.12);
  --glass-highlight: rgba(2, 132, 199, 0.14);
  --success: #059669;
  --warning: #D97706;
  --card-foot-bg: #F8FAFC;
  --select-bg: #FFFFFF;
  --select-border: rgba(15, 23, 42, 0.22);
  --bg: #F1F5F9;
  --btn-brand-text: #FFFFFF;
  --btn-action-bg: #E0F2FE;
  --btn-action-text: #0284C7;
  --btn-action-border: #BAE6FD;
  --btn-action-hover-bg: #0284C7;
  --btn-action-hover-text: #FFFFFF;
  --acc: #0284C7;
  --acc2: #2563EB;
  --brand: linear-gradient(180deg, var(--acc), var(--acc2));
  --brand-h: linear-gradient(135deg, #0284C7 0%, #2563EB 100%);
  --nav-bg: rgba(255, 255, 255, 0.94);
  --card-bg: #FFFFFF;
  --input-bg: #FFFFFF;
  --modal-bg: #FFFFFF;
  --modal-overlay: rgba(15, 23, 42, 0.6);
  --mobile-nav-bg: rgba(255, 255, 255, 0.96);
  --hero-fade: linear-gradient(90deg, #F1F5F9 0%, rgba(241, 245, 249, 0.92) 45%, rgba(241, 245, 249, 0.2) 100%);
  --poster-fade: linear-gradient(0deg, #FFFFFF 0%, rgba(255, 255, 255, 0.9) 60%, rgba(255, 255, 255, 0.2) 100%);
  --scrollbar-thumb: rgba(15, 23, 42, 0.25);
  --scrollbar-thumb-hover: rgba(2, 132, 199, 0.65);
  --scrollbar-track: transparent;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08);
  --shadow-card: 0 4px 20px -2px rgba(15, 23, 42, 0.08), 0 0 1px rgba(15, 23, 42, 0.15);
  --shadow-glow: 0 0 20px rgba(2, 132, 199, 0.2);
}

[data-theme="oled"] {
  --midnight: #000000;
  --midnight-alt: #050505;
  --frost: #FFFFFF;
  --cyan: #00FFCC;
  --cyan-glow: rgba(0, 255, 204, 0.45);
  --cyan-soft: rgba(0, 255, 204, 0.12);
  --cyan-border: rgba(0, 255, 204, 0.35);
  --muted: #8E9BAE;
  --line: rgba(255, 255, 255, 0.15);
  --line-strong: rgba(255, 255, 255, 0.3);
  --glass: rgba(255, 255, 255, 0.06);
  --glass-card: #050505;
  --glass-hover: rgba(255, 255, 255, 0.12);
  --glass-active: rgba(0, 255, 204, 0.2);
  --glass-highlight: rgba(0, 255, 204, 0.25);
  --card-foot-bg: #030303;
  --select-bg: #080808;
  --select-border: rgba(255, 255, 255, 0.22);
  --bg: #000000;
  --btn-brand-text: #000000;
  --btn-action-bg: rgba(0, 255, 204, 0.12);
  --btn-action-text: #00FFCC;
  --btn-action-border: rgba(0, 255, 204, 0.35);
  --btn-action-hover-bg: #00FFCC;
  --btn-action-hover-text: #000000;
  --acc: #00FFCC;
  --acc2: #0099FF;
  --brand: linear-gradient(180deg, var(--acc), var(--acc2));
  --brand-h: linear-gradient(135deg, #00FFCC 0%, #0099FF 100%);
  --nav-bg: rgba(0, 0, 0, 0.92);
  --card-bg: #050505;
  --input-bg: #000000;
  --modal-bg: #050505;
  --modal-overlay: rgba(0, 0, 0, 0.88);
  --mobile-nav-bg: rgba(0, 0, 0, 0.96);
  --hero-fade: linear-gradient(90deg, #000000 0%, rgba(0, 0, 0, 0.88) 45%, rgba(0, 0, 0, 0.2) 100%);
  --poster-fade: linear-gradient(0deg, #050505 0%, rgba(5, 5, 5, 0.8) 60%, rgba(5, 5, 5, 0.2) 100%);
  --scrollbar-thumb: rgba(15, 23, 42, 0.25);
  --scrollbar-thumb-hover: rgba(2, 132, 199, 0.65);
  --scrollbar-track: transparent;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.8);
  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.95);
  --shadow-glow: 0 0 25px rgba(0, 255, 204, 0.35);
}

/* Base Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

[hidden],
.search-overlay[hidden],
.modal-backdrop[hidden] {
  display: none !important;
}

html {
  font-family: var(--font-sans);
  background-color: var(--midnight);
  color: var(--frost);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  position: relative;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  background-color: var(--midnight);
  padding-bottom: 70px; /* Space for mobile nav */
}

@media (min-width: 769px) {
  body {
    padding-bottom: 0;
  }
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ==========================================================================
   DYNAMIC AMBIENT BACKDROP
   ========================================================================== */
.backdrop {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
}

.backdrop-img {
  position: absolute;
  inset: -10%;
  width: 120%;
  height: 120%;
  background-size: cover;
  background-position: center;
  filter: blur(80px) saturate(1.8) brightness(0.25);
  opacity: 0.45;
  transition: opacity 0.8s ease, background-image 0.8s ease;
}

.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
}

.glow-primary {
  width: 600px;
  height: 600px;
  top: -200px;
  left: 20%;
  background: radial-gradient(circle, rgba(52, 242, 232, 0.16) 0%, transparent 70%);
}

.glow-secondary {
  width: 700px;
  height: 700px;
  top: 15%;
  right: -200px;
  background: radial-gradient(circle, rgba(55, 123, 182, 0.18) 0%, transparent 70%);
}

[data-theme="light"] .backdrop-img {
  opacity: 0.08;
  filter: blur(80px) saturate(1.1) brightness(1.1);
}

[data-theme="light"] .glow-primary {
  background: radial-gradient(circle, rgba(2, 132, 199, 0.08) 0%, transparent 70%);
}

[data-theme="light"] .glow-secondary {
  background: radial-gradient(circle, rgba(37, 99, 235, 0.06) 0%, transparent 70%);
}

/* ==========================================================================
   DESKTOP TOP NAVIGATION
   ========================================================================== */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--line);
}

.top-in {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gut);
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  margin-inline-end: 16px;
  text-decoration: none;
}

.brand-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-logo-img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px var(--cyan-glow));
  transition: transform 0.25s ease, filter 0.25s ease;
}

.brand:hover .brand-logo-img {
  transform: scale(1.08) rotate(-3deg);
  filter: drop-shadow(0 4px 14px var(--cyan-glow));
}

.brand-name {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--frost);
}

.brand-name b {
  color: var(--cyan);
  font-weight: 800;
}

.badge-android {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: rgba(52, 242, 232, 0.12);
  color: var(--cyan);
  border: 1px solid rgba(52, 242, 232, 0.3);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link {
  font-size: 0.88rem;
  font-weight: 600;
  padding: 7px 13px;
  border-radius: var(--radius-full);
  color: var(--muted);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  text-decoration: none;
}

.nav-link:hover {
  color: var(--frost);
  background: var(--glass-hover);
}

.nav-link.on {
  color: var(--cyan);
  background: rgba(52, 242, 232, 0.12);
  border: 1px solid rgba(52, 242, 232, 0.3);
  box-shadow: 0 0 10px rgba(52, 242, 232, 0.15);
}

.tag-sub {
  display: none;
}

.badge-count {
  background: var(--cyan);
  color: var(--midnight);
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  line-height: 1;
}

/* Header Actions */
.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.search-trigger-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--glass);
  border: 1px solid var(--line-strong);
  padding: 0 14px;
  height: 38px;
  box-sizing: border-box;
  border-radius: var(--radius-full);
  color: var(--muted);
  font-size: 0.84rem;
  transition: all 0.2s ease;
  cursor: pointer;
  white-space: nowrap;
}

.search-trigger-btn:hover {
  background: var(--glass-hover);
  border-color: rgba(52, 242, 232, 0.45);
  color: var(--frost);
  box-shadow: 0 2px 10px rgba(52, 242, 232, 0.15);
}

.search-shortcut {
  font-size: 0.7rem;
  background: rgba(244, 248, 252, 0.1);
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-family: inherit;
  font-weight: 600;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 0.86rem;
  font-weight: 700;
  padding: 0 16px;
  height: 38px;
  box-sizing: border-box;
  border-radius: var(--radius-full);
  transition: all 0.2s ease;
  white-space: nowrap;
  text-decoration: none;
}

.btn-primary {
  background: var(--brand);
  color: var(--btn-brand-text);
  box-shadow: 0 4px 14px var(--cyan-glow);
  font-weight: 700;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--cyan-glow);
  filter: brightness(1.05);
}

.btn-secondary {
  background: var(--glass);
  border: 1px solid var(--line-strong);
  color: var(--frost);
  font-weight: 600;
}

.btn-secondary:hover {
  background: var(--glass-hover);
  border-color: var(--cyan);
  color: var(--frost);
}

.icon-controls-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.icon-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  box-sizing: border-box;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  background: var(--glass);
  border: 1px solid var(--line-strong);
  color: var(--frost);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  flex-shrink: 0;
}

.icon-chip:hover {
  background: var(--glass-hover);
  border-color: var(--cyan);
  color: var(--cyan);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--cyan-glow);
}

.btn-apk-nav {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 16px;
  height: 38px;
  box-sizing: border-box;
  border-radius: var(--radius-full);
  font-size: 0.84rem;
  font-weight: 700;
  background: linear-gradient(135deg, rgba(52, 242, 232, 0.16), rgba(55, 123, 182, 0.22));
  border: 1px solid rgba(52, 242, 232, 0.45);
  color: var(--cyan);
  transition: all 0.25s ease;
  white-space: nowrap;
  text-decoration: none;
  box-shadow: 0 2px 10px rgba(52, 242, 232, 0.12);
}

.btn-apk-nav:hover {
  background: linear-gradient(135deg, rgba(52, 242, 232, 0.3), rgba(55, 123, 182, 0.4));
  border-color: var(--cyan);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px var(--cyan-glow);
}

/* ==========================================================================
   SUB-NAV BAR (Origin Pills)
   ========================================================================== */
.sub-nav-bar {
  background: var(--nav-bg);
  border-top: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) transparent;
  padding-bottom: 2px;
}

.sub-nav-in {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 8px var(--gut);
}

.origin-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  width: max-content;
}

.pill {
  font-size: 0.84rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: var(--glass);
  border: 1px solid var(--line);
  color: var(--muted);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.pill:hover {
  background: var(--glass-hover);
  color: var(--frost);
  border-color: var(--line-strong);
}

.pill.on {
  background: var(--btn-action-bg);
  color: var(--btn-action-text);
  border-color: var(--cyan);
  font-weight: 700;
}

/* ==========================================================================
   MAIN VIEWPORT & CONTAINER
   ========================================================================== */
.main-view {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 24px var(--gut) 48px;
}

/* ==========================================================================
   HERO CAROUSEL
   ========================================================================== */
.hero-slider {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 40px;
  background: var(--card-bg);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-card);
}

.hero-slide {
  display: none;
  position: relative;
  padding: clamp(32px, 6vw, 64px);
  min-height: 440px;
  align-items: center;
}

.hero-slide.active {
  display: flex;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-size: cover;
  background-position: center;
  filter: brightness(0.35);
  transition: transform 0.6s ease;
}

.hero-gradient {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: var(--hero-fade);
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 680px;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.tag {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: var(--glass);
  color: var(--frost);
  border: 1px solid var(--line-strong);
}

.tag-origin {
  background: var(--brand-h);
  color: var(--btn-brand-text);
  border: none;
  font-weight: 800;
}

.tag-turnip {
  background: rgba(251, 191, 36, 0.15);
  color: var(--warning);
  border-color: rgba(251, 191, 36, 0.4);
}

.tag-touch {
  background: rgba(52, 211, 153, 0.15);
  color: var(--success);
  border-color: rgba(52, 211, 153, 0.4);
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 12px;
  color: var(--frost);
}

.hero-lead {
  font-size: clamp(0.95rem, 1.4vw, 1.15rem);
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 24px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-dots {
  position: absolute;
  bottom: 20px;
  right: 28px;
  z-index: 3;
  display: flex;
  gap: 8px;
}

.hero-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(244, 248, 252, 0.3);
  transition: all 0.3s ease;
}

.hero-dot.active {
  width: 28px;
  border-radius: var(--radius-full);
  background: var(--cyan);
}

/* ==========================================================================
   SECTION & ROW STYLES
   ========================================================================== */
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-link {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--cyan);
  display: flex;
  align-items: center;
  gap: 4px;
}

.section-link:hover {
  text-decoration: underline;
}

/* Horizontal Poster Row (Carousels) */
.rowscroll {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 14px;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) transparent;
}

.rowscroll::-webkit-scrollbar {
  height: 6px;
}

.rowscroll::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: var(--radius-full);
}

.rowscroll::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
}

/* Poster Card (2:3 Aspect Ratio) */
.poster-card {
  flex: 0 0 170px;
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--glass);
  border: 1px solid var(--line);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  cursor: pointer;
}

.poster-card:hover {
  transform: translateY(-4px);
  border-color: rgba(52, 242, 232, 0.4);
  box-shadow: 0 12px 28px -8px rgba(0, 0, 0, 0.7);
}

.poster-media {
  position: relative;
  aspect-ratio: 2/3;
  width: 100%;
  background-color: #131c2e;
}

.poster-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.poster-rank {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(11, 18, 32, 0.85);
  backdrop-filter: blur(8px);
  color: var(--cyan);
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 900;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(52, 242, 232, 0.3);
}

.poster-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  text-transform: uppercase;
}

.poster-info {
  padding: 10px 12px;
}

.poster-title {
  font-size: 0.88rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--frost);
  margin-bottom: 2px;
}

.poster-sub {
  font-size: 0.74rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================================================
   QUAD-FILTER COMPONENT (DroidPorts Inspired)
   ========================================================================== */
.filter-bar {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 28px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  box-shadow: var(--shadow-sm);
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.filter-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.filter-select {
  background: var(--select-bg);
  border: 1px solid var(--select-border);
  color: var(--frost);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.filter-select:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 2px var(--cyan-soft);
}

.filter-select option {
  background: var(--midnight-alt);
  color: var(--frost);
}

.filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: var(--glass);
  border: 1px solid var(--line-strong);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-toggle:hover {
  color: var(--frost);
  border-color: var(--cyan);
}

.filter-toggle.on {
  background: var(--btn-action-bg);
  color: var(--btn-action-text);
  border-color: var(--cyan);
  font-weight: 700;
}

/* ==========================================================================
   MAIN GAME GRID
   ========================================================================== */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.game-card {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}

.game-card:hover {
  transform: translateY(-4px);
  border-color: var(--cyan);
  box-shadow: var(--shadow-card);
}

.game-card-head {
  display: flex;
  gap: 14px;
  padding: 16px;
}

.game-card-cover {
  width: 80px;
  height: 115px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
  background-color: #131c2e;
}

.game-card-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.game-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}

.game-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--frost);
  line-height: 1.25;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.game-card-by {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 6px;
}

.game-card-blurb {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: auto;
}

.game-card-foot {
  padding: 10px 16px;
  background: var(--card-foot-bg);
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
}

.game-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-card-action {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  background: var(--btn-action-bg);
  color: var(--btn-action-text);
  border: 1px solid var(--btn-action-border);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-card-action:hover {
  background: var(--btn-action-hover-bg);
  color: var(--btn-action-hover-text);
  border-color: var(--btn-action-hover-bg);
  transform: translateY(-1px);
}

/* ==========================================================================
   DISCLAIMER CALLOUT (No Game Files Here)
   ========================================================================== */
.disc-note {
  background: rgba(244, 248, 252, 0.05);
  border: 1px solid var(--line);
  border-left: 4px solid var(--cyan);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin: 32px 0;
}

.disc-note .kicker {
  display: block;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--cyan);
  margin-bottom: 6px;
}

.disc-note p {
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.5;
}

/* ==========================================================================
   MODAL & BOTTOM SHEET (Adaptive Responsive UI)
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

.modal-backdrop.open,
.modal-backdrop:not([hidden]) {
  display: flex !important;
}

.modal-backdrop[hidden] {
  display: none !important;
}

.modal-container {
  background: var(--modal-bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.9);
  animation: scaleUp 0.25s ease;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 10;
  background: var(--glass);
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--frost);
  transition: all 0.2s;
  cursor: pointer;
}

.modal-close:hover {
  background: var(--cyan);
  color: var(--btn-brand-text);
  border-color: var(--cyan);
}

.modal-hero {
  position: relative;
  height: 240px;
  background-size: cover;
  background-position: center;
}

.modal-hero-gradient {
  position: absolute;
  inset: 0;
  background: var(--poster-fade);
}

.modal-header-content {
  position: relative;
  margin-top: -60px;
  padding: 0 28px 20px;
  display: flex;
  gap: 20px;
  align-items: flex-end;
}

.modal-cover {
  width: 120px;
  height: 170px;
  border-radius: var(--radius-md);
  object-fit: cover;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
  border: 2px solid var(--line);
  flex-shrink: 0;
  background: #111b2e;
}

.modal-title-area {
  flex: 1;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1.15;
  color: var(--frost);
  margin-bottom: 6px;
}

.modal-based {
  font-size: 0.9rem;
  color: var(--cyan);
  margin-bottom: 8px;
}

/* Modal Tabs */
.modal-tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
  padding: 0 28px;
  gap: 8px;
  margin-top: 10px;
}

.modal-tab {
  padding: 12px 18px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

.modal-tab.active {
  color: var(--cyan);
  border-bottom-color: var(--cyan);
}

.modal-inner {
  padding: 24px 28px 36px;
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 28px;
}

.modal-main-body {
  font-size: 0.95rem;
  color: var(--frost);
  line-height: 1.6;
}

.modal-features-list {
  list-style: none;
  margin: 16px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.modal-features-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--frost);
}

.modal-features-list li svg {
  color: var(--cyan);
  flex-shrink: 0;
}

/* Sidebar Facts Card */
.modal-sidebar-card {
  background: rgba(244, 248, 252, 0.04);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.fact-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  border-bottom: 1px solid rgba(244, 248, 252, 0.06);
  padding-bottom: 8px;
}

.fact-row dt {
  color: var(--muted);
}

.fact-row dd {
  font-weight: 600;
  color: var(--frost);
  text-align: right;
}

.btn-full {
  width: 100%;
}

/* ROM Checksum Tester Component inside Modal */
.rom-checker-box {
  background: rgba(52, 242, 232, 0.05);
  border: 1px dashed rgba(52, 242, 232, 0.35);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
  margin-top: 16px;
}

.rom-drop-zone {
  cursor: pointer;
  padding: 12px;
}

/* ==========================================================================
   SEARCH OVERLAY
   ========================================================================== */
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(12px);
  padding: 40px 20px;
  display: none;
  justify-content: center;
}

.search-overlay.open,
.search-overlay:not([hidden]) {
  display: flex !important;
}

.search-overlay[hidden] {
  display: none !important;
}

.search-dialog {
  background: var(--modal-bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 680px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
}

.search-header {
  display: flex;
  align-items: center;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  gap: 12px;
}

.search-header input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 1.1rem;
  color: var(--frost);
}

.search-quick-tags {
  padding: 10px 20px;
  background: rgba(244, 248, 252, 0.03);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--muted);
  overflow-x: auto;
}

.tag-chip {
  background: var(--glass);
  border: 1px solid var(--line);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  color: var(--frost);
  cursor: pointer;
}

.search-results {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}

.search-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
  cursor: pointer;
}

.search-item:hover {
  background: var(--glass-hover);
}

.search-item-thumb {
  width: 44px;
  height: 60px;
  border-radius: 4px;
  object-fit: cover;
  background: #111b2e;
}

.search-item-info {
  flex: 1;
}

.search-item-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--frost);
}

.search-item-meta {
  font-size: 0.8rem;
  color: var(--muted);
}

/* ==========================================================================
   MOBILE UI SPECIFICS (Phones & Handhelds)
   ========================================================================== */
.mobile-nav {
  display: none;
}

.mobile-only {
  display: none !important;
}

@media (max-width: 768px), (pointer: coarse) and (max-width: 1024px) {
  .desktop-only {
    display: none !important;
  }

  .mobile-only {
    display: block !important;
  }

  /* Viewport and Layout Containment (Fix Mobile 100% Width) */
  html, body {
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }

  .top-nav {
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
  }

  .top-in {
    padding: 0 14px;
    height: 58px;
    gap: 8px;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
  }

  .brand {
    gap: 8px;
    min-width: 0;
  }

  .brand-logo-img {
    width: 28px;
    height: 28px;
  }

  .brand-name {
    font-size: 1.15rem;
    white-space: nowrap;
  }

  .top-actions {
    gap: 6px;
    flex-shrink: 0;
  }

  .top-actions .btn {
    padding: 7px 11px;
    font-size: 0.82rem;
  }

  .top-actions .icon-chip {
    width: 34px;
    height: 34px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .sub-nav-bar {
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
  }

  .sub-nav-in {
    padding: 6px 12px;
    max-width: 100vw;
    box-sizing: border-box;
  }

  .main-view {
    padding: 14px 12px 80px;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
    overflow-x: hidden;
  }

  .hero-slider {
    margin-bottom: 24px;
    width: 100%;
    box-sizing: border-box;
  }

  .hero-slide {
    padding: 20px 16px;
    min-height: 340px;
    width: 100%;
    box-sizing: border-box;
  }

  .hero-content {
    width: 100%;
    max-width: 100%;
  }

  .hero-title {
    font-size: 1.45rem;
    line-height: 1.25;
  }

  .hero-lead {
    font-size: 0.85rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .hero-actions {
    gap: 8px;
  }

  .hero-actions .btn {
    padding: 8px 14px;
    font-size: 0.82rem;
  }

  .section-row {
    width: 100%;
    box-sizing: border-box;
  }

  .section-head {
    margin-bottom: 12px;
  }

  .section-title {
    font-size: 1.15rem;
  }

  .rowscroll {
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
    gap: 12px;
    padding-bottom: 10px;
  }

  .poster-card {
    flex: 0 0 140px;
  }

  .foot {
    padding: 32px 14px 90px;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
  }

  /* Fixed Bottom Nav Bar */
  .mobile-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 150;
    background: var(--mobile-nav-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--line);
    padding: 6px 12px calc(6px + env(safe-area-inset-bottom, 0px));
    justify-content: space-around;
    align-items: center;
  }

  .mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--muted);
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    transition: color 0.2s;
  }

  .mobile-nav-item.on {
    color: var(--cyan);
  }

  .mobile-nav-search-bubble {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--brand);
    color: var(--midnight);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: -8px;
    box-shadow: 0 4px 14px rgba(52, 242, 232, 0.4);
  }

  /* Mobile Bottom Sheet Modal */
  .modal-backdrop {
    padding: 0;
    align-items: flex-end;
  }

  .modal-container {
    max-height: 85vh;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    animation: slideUpMobile 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .modal-drag-handle {
    width: 44px;
    height: 5px;
    background: rgba(244, 248, 252, 0.3);
    border-radius: var(--radius-full);
    margin: 12px auto 0;
  }

  .modal-inner {
    grid-template-columns: 1fr;
    padding: 16px 20px 30px;
    gap: 20px;
  }

  .modal-header-content {
    padding: 0 20px 16px;
    margin-top: -40px;
  }

  .modal-cover {
    width: 90px;
    height: 130px;
  }

  .modal-title {
    font-size: 1.35rem;
  }

  .games-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .hero-slide {
    padding: 24px 20px;
    min-height: 380px;
  }

  .hero-title {
    font-size: 1.7rem;
  }
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.foot {
  background: var(--midnight-alt);
  border-top: 1px solid var(--line);
  padding: 56px var(--gut) 32px;
  margin-top: 60px;
}

.foot-in {
  max-width: var(--wrap);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: 40px;
  margin-bottom: 40px;
}

@media (max-width: 900px) {
  .foot-in {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}

.foot-desc {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.5;
  margin: 14px 0 18px;
  max-width: 420px;
}

.foot-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.foot-pill {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background: var(--glass);
  color: var(--muted);
  border: 1px solid var(--line);
}

.foot-col h4 {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--frost);
  margin-bottom: 14px;
}

.foot-col a {
  display: block;
  font-size: 0.86rem;
  color: var(--muted);
  margin-bottom: 8px;
  transition: color 0.2s;
}

.foot-col a:hover {
  color: var(--cyan);
}

.foot-base {
  max-width: var(--wrap);
  margin: 0 auto;
  padding-top: 24px;
  border-top: 1px solid rgba(244, 248, 252, 0.06);
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleUp {
  from { transform: scale(0.96); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes slideUpMobile {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

/* ==========================================================================
   LIBRARY & LAUNCHER SYSTEM
   ========================================================================== */
.library-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}

.library-tabs-nav {
  display: inline-flex;
  gap: 8px;
  background: var(--glass-card);
  padding: 5px;
  border-radius: var(--radius-full);
  border: 1px solid var(--line);
}

.library-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  color: var(--muted);
  border: 1px solid transparent;
  padding: 8px 18px;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.library-tab-btn:hover {
  color: var(--frost);
}

.library-tab-btn.active {
  background: var(--btn-action-bg);
  color: var(--btn-action-text);
  border: 1px solid var(--cyan);
  box-shadow: 0 0 16px var(--cyan-glow);
}

.library-tab-badge {
  background: var(--btn-action-border);
  color: var(--btn-action-text);
  font-size: 0.72rem;
  padding: 2px 7px;
  border-radius: 999px;
  font-weight: 800;
}

.library-installed-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 20px;
}

.installed-card {
  position: relative;
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-sm);
}

.installed-card:hover {
  transform: translateY(-3px);
  border-color: var(--cyan);
  box-shadow: var(--shadow-card);
}

.installed-card-top {
  display: flex;
  gap: 14px;
}

.installed-card-cover {
  width: 75px;
  height: 105px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.installed-card-body {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  flex: 1;
}

.installed-card-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--frost);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.installed-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.badge-installed {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(52, 211, 153, 0.15);
  color: var(--success);
  border: 1px solid rgba(52, 211, 153, 0.3);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
}

.badge-package {
  font-family: monospace;
  font-size: 0.65rem;
  color: var(--muted);
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.installed-card-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.btn-launch-game {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--brand);
  color: var(--btn-brand-text) !important;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.92rem;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 4px 16px var(--cyan-glow);
  transition: all 0.2s ease;
}

.btn-launch-game:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px var(--cyan-glow);
  filter: brightness(1.06);
}

.btn-launch-game:hover {
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 6px 24px rgba(52, 242, 232, 0.55);
}

.btn-remove-installed {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(248, 113, 113, 0.1);
  color: var(--danger);
  border: 1px solid rgba(248, 113, 113, 0.25);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.btn-remove-installed:hover {
  background: rgba(248, 113, 113, 0.25);
  border-color: var(--danger);
}

/* Modal Installed Bar */
.modal-installed-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px 18px;
  background: rgba(52, 242, 232, 0.06);
  border: 1px solid rgba(52, 242, 232, 0.25);
  border-radius: var(--radius-md);
  margin-bottom: 20px;
}

.toast-container {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: #0B1220;
  border: 1px solid var(--brand);
  color: var(--frost);
  padding: 12px 24px;
  border-radius: var(--radius-full);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(52, 242, 232, 0.3);
  font-weight: 700;
  font-size: 0.9rem;
  z-index: 10000;
  pointer-events: none;
  animation: fadeIn 0.2s ease;
}


/* ==========================================================================
   EMULATORS HUB STYLES
   ========================================================================== */
.emulators-header {
  padding: 30px 20px 20px;
  max-width: 1300px;
  margin: 0 auto;
}

.emulators-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: rgba(52, 242, 232, 0.12);
  border: 1px solid rgba(52, 242, 232, 0.3);
  color: var(--brand);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.emulators-title {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 900;
  color: var(--frost);
  line-height: 1.15;
  margin-bottom: 8px;
}

.emulators-subtitle {
  font-size: 0.95rem;
  color: var(--muted);
  max-width: 780px;
  line-height: 1.5;
  margin-bottom: 24px;
}

.emulators-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 24px;
}

.emulators-search-box {
  position: relative;
  flex: 1;
  min-width: 260px;
  max-width: 440px;
}

.emulators-search-box input {
  width: 100%;
  padding: 10px 14px 10px 38px;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: var(--frost);
  font-size: 0.9rem;
  outline: none;
  transition: all 0.2s ease;
}

.emulators-search-box input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 14px rgba(52, 242, 232, 0.2);
}

.emulators-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

.emulators-filter-pills {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  -webkit-overflow-scrolling: touch;
}

.emulators-filter-pill {
  padding: 7px 14px;
  background: var(--glass);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-full);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.emulators-filter-pill:hover,
.emulators-filter-pill.active {
  background: var(--brand);
  color: var(--btn-brand-text);
  border-color: transparent;
}

.emulators-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 20px 60px;
}

@media (max-width: 600px) {
  .emulators-grid {
    grid-template-columns: 1fr;
    padding: 0 14px 80px;
  }
}

.emulator-card {
  display: flex;
  flex-direction: column;
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.emulator-card:hover {
  transform: translateY(-3px);
  border-color: var(--cyan);
  box-shadow: var(--shadow-card);
}

.emulator-card-head {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.emulator-icon-wrap {
  width: 58px;
  height: 58px;
  border-radius: 14px;
  background: var(--glass);
  border: 1px solid var(--line-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.emulator-icon-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.emulator-meta {
  flex: 1;
  min-width: 0;
}

.emulator-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.emulator-name {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--frost);
}

.emulator-version-chip {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 6px;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--muted);
}

.emulator-system-label {
  font-size: 0.8rem;
  color: var(--cyan);
  font-weight: 700;
}

.emulator-author {
  font-size: 0.75rem;
  color: var(--muted);
}

.emulator-desc {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.45;
  margin-bottom: 14px;
  flex: 1;
}

.emulator-features {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
  padding: 10px 12px;
  background: var(--glass);
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
}

.emulator-feature-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--frost);
}

.emulator-feature-item svg {
  color: var(--cyan);
  flex-shrink: 0;
}

.emulator-specs-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--muted);
  border-top: 1px solid var(--line);
  padding-top: 12px;
  margin-bottom: 16px;
}

.emulator-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-emu-apk {
  flex: 1;
  min-width: 120px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--brand);
  color: var(--btn-brand-text);
  padding: 9px 12px;
  border-radius: var(--radius-md);
  font-weight: 800;
  font-size: 0.82rem;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 2px 10px var(--cyan-glow);
}

.btn-emu-apk:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px var(--cyan-glow);
  filter: brightness(1.06);
}

.btn-emu-obtainium {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--btn-action-bg);
  color: var(--btn-action-text);
  border: 1px solid var(--btn-action-border);
  padding: 9px 12px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.82rem;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-emu-obtainium:hover {
  background: var(--btn-action-hover-bg);
  color: var(--btn-action-hover-text);
  border-color: var(--btn-action-hover-bg);
}

.btn-emu-repo {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--glass);
  color: var(--frost);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-emu-repo:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}

.btn-emu-paid {
  background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%) !important;
  color: #0B1220 !important;
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.35) !important;
}

.btn-emu-paid:hover {
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.5) !important;
  filter: brightness(1.08) !important;
}

.tag-paid {
  background: rgba(251, 191, 36, 0.15);
  color: var(--warning);
  border: 1px solid rgba(251, 191, 36, 0.4);
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
}

.tag-free {
  background: rgba(52, 211, 153, 0.15);
  color: var(--success);
  border: 1px solid rgba(52, 211, 153, 0.4);
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
}

.tag-price-paid {
  background: rgba(251, 191, 36, 0.12);
  color: var(--warning);
  border-color: rgba(251, 191, 36, 0.35);
}

.tag-price-free {
  background: rgba(52, 211, 153, 0.12);
  color: var(--success);
  border-color: rgba(52, 211, 153, 0.35);
}

/* ==========================================================================
   CUSTOM UNLISTED GAMES & SUBMISSION WORKFLOW STYLES
   ========================================================================== */
.badge-custom {
  display: inline-block;
  padding: 2px 7px;
  background: rgba(168, 85, 247, 0.2);
  border: 1px solid rgba(168, 85, 247, 0.5);
  color: #C084FC;
  font-size: 0.65rem;
  font-weight: 800;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.custom-form-group {
  margin-bottom: 16px;
}

.custom-form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--frost);
  margin-bottom: 6px;
}

.custom-form-hint {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 4px;
}

.custom-form-input,
.custom-form-select {
  width: 100%;
  padding: 10px 14px;
  background: var(--select-bg);
  border: 1px solid var(--select-border);
  border-radius: var(--radius-md);
  color: var(--frost);
  font-size: 0.9rem;
  outline: none;
  transition: all 0.2s ease;
}

.custom-form-input:focus,
.custom-form-select:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 2px var(--cyan-soft);
}

.custom-form-select option {
  background: var(--midnight-alt);
  color: var(--frost);
}

.submit-portal-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 20px 80px;
}

.submit-portal-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 30px;
  align-items: flex-start;
}

@media (max-width: 860px) {
  .submit-portal-grid {
    grid-template-columns: 1fr;
  }
}

.submit-preview-box {
  position: sticky;
  top: 90px;
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.submit-preview-title {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.submit-actions-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}

.btn-github-issue {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #238636;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-weight: 800;
  font-size: 0.9rem;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-github-issue:hover {
  background: #2ea043;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(46, 160, 67, 0.35);
}

.btn-copy-json {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--glass);
  color: var(--frost);
  border: 1px solid var(--line-strong);
  padding: 11px 18px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-copy-json:hover {
  background: var(--glass-hover);
  border-color: var(--cyan);
}

.btn-add-local {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--brand);
  color: var(--btn-brand-text);
  border: none;
  padding: 11px 18px;
  border-radius: var(--radius-md);
  font-weight: 800;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-add-local:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}


/* ============================================================================
   RTL & ARABIC LOCALIZATION SUPPORT
   ============================================================================ */
html[dir="rtl"],
body.rtl-mode {
  direction: rtl;
  text-align: right;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Tahoma, "Noto Sans Arabic", "Cairo", Roboto, sans-serif;
}

html[dir="rtl"] .top-actions {
  margin-left: 0;
  margin-right: auto;
}

html[dir="rtl"] .brand {
  margin-right: 0;
  margin-left: 20px;
}

html[dir="rtl"] .brand-logo {
  margin-right: 0;
  margin-left: 10px;
}

html[dir="rtl"] .search-trigger-btn svg {
  margin-right: 0;
  margin-left: 8px;
}

html[dir="rtl"] .search-shortcut {
  margin-left: 0;
  margin-right: auto;
}

html[dir="rtl"] .poster-badge {
  right: auto;
  left: 8px;
}

html[dir="rtl"] .poster-rank {
  left: auto;
  right: 8px;
}

html[dir="rtl"] .section-head {
  flex-direction: row;
}

html[dir="rtl"] .section-title {
  text-align: right;
}

html[dir="rtl"] .section-link {
  direction: rtl;
}

html[dir="rtl"] .fact-row {
  flex-direction: row;
}

html[dir="rtl"] .modal-close {
  right: auto;
  left: 16px;
}

html[dir="rtl"] .foot-cols {
  direction: rtl;
}

html[dir="rtl"] .foot-brand {
  text-align: right;
}

html[dir="rtl"] .mobile-nav {
  direction: rtl;
}

html[dir="rtl"] .sub-nav-in {
  direction: rtl;
}

html[dir="rtl"] .origin-pills {
  direction: rtl;
}

html[dir="rtl"] .search-box svg {
  left: auto;
  right: 14px;
}

html[dir="rtl"] .search-box input {
  padding-left: 16px;
  padding-right: 42px;
}

html[dir="rtl"] .hero-tags {
  justify-content: flex-start;
}

html[dir="rtl"] .game-card-tags {
  justify-content: flex-start;
}

.badge-master {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  background: rgba(52, 242, 232, 0.15);
  border: 1px solid rgba(52, 242, 232, 0.4);
  color: var(--cyan);
  font-size: 0.65rem;
  font-weight: 800;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.security-alert-box {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  font-size: 0.88rem;
  line-height: 1.5;
  background: rgba(52, 242, 232, 0.08);
  border: 1px solid rgba(52, 242, 232, 0.25);
  color: var(--frost);
}


/* Compact Language Toggle (Displays only E or ع) */
.lang-toggle-chip {
  min-width: 36px;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  line-height: 1;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid transparent;
}
.lang-toggle-chip.lang-en {
  color: #38bdf8 !important; /* Blue for English */
  background: rgba(56, 189, 248, 0.12) !important;
  border-color: rgba(56, 189, 248, 0.45) !important;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.25);
}
.lang-toggle-chip.lang-en:hover {
  background: rgba(56, 189, 248, 0.22) !important;
  border-color: rgba(56, 189, 248, 0.7) !important;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.45);
}
.lang-toggle-chip.lang-ar {
  color: #10b981 !important; /* Green for Arabic */
  background: rgba(16, 185, 129, 0.12) !important;
  border-color: rgba(16, 185, 129, 0.45) !important;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.25);
}
.lang-toggle-chip.lang-ar:hover {
  background: rgba(16, 185, 129, 0.22) !important;
  border-color: rgba(16, 185, 129, 0.7) !important;
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.45);
}
.lang-toggle-chip svg {
  display: block !important;
  stroke: currentColor;
}


/* ==========================================================================
   DESKTOP RESPONSIVE NAV POLISH (Clean, tidy, spacious at all resolutions)
   ========================================================================== */
@media (min-width: 769px) {
  .top-in {
    gap: 16px;
  }
  
  .brand {
    margin-inline-end: 8px;
  }
}

@media (max-width: 1360px) and (min-width: 769px) {
  .search-placeholder {
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  
  .nav-link {
    padding: 7px 10px;
    font-size: 0.85rem;
  }
}

@media (max-width: 1180px) and (min-width: 769px) {
  .main-nav a[data-nav="top"],
  .main-nav a[data-nav="handheld"] {
    display: none !important;
  }

  .search-trigger-btn {
    width: 38px;
    height: 38px;
    padding: 0;
    justify-content: center;
  }

  .search-placeholder,
  .search-shortcut {
    display: none !important;
  }

  .btn-apk-nav span {
    display: none;
  }
  
  .btn-apk-nav {
    padding: 0 12px;
  }
}

@media (max-width: 960px) and (min-width: 769px) {
  .main-nav a[data-nav="how"] {
    display: none !important;
  }
}


/* Status Readiness Tags & Card Version Date */
.tag-status-alpha, .tag-status-indev {
  background: rgba(245, 158, 11, 0.16) !important;
  color: #f59e0b !important;
  border: 1px solid rgba(245, 158, 11, 0.35) !important;
  font-weight: 700 !important;
}

.tag-status-playable {
  background: rgba(16, 185, 129, 0.16) !important;
  color: #10b981 !important;
  border: 1px solid rgba(16, 185, 129, 0.35) !important;
  font-weight: 700 !important;
}

.game-card-ver-date {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--muted);
}

.game-card-ver-date .game-ver {
  font-weight: 700;
  color: var(--frost);
}

.game-card-ver-date .game-sep {
  opacity: 0.45;
  font-size: 0.7rem;
}

.game-card-ver-date .game-date {
  color: var(--muted);
  font-weight: 500;
}
