:root {
  --accent-1: #ff2e63;
  --accent-2: #08d9d6;
  --accent-3: #8aff00;
  --accent-4: #ffd93d;
  --bg-warm-1: #2b1808;
  --bg-warm-2: #8a5620;
  --bg-warm-3: #d8a962;
  --stripe-1: #c82333;
  --stripe-2: #e67e22;
  --stripe-3: #2ecc71;
  --stripe-4: #2980b9;
  --bezel-bg: #07090e;
  --text-main: #f5f7fa;
  --text-muted: #b8c2cc;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  background: #0d0f14;
  color: var(--text-main);
  font-family: 'Rajdhani', system-ui, -apple-system, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

.hidden {
  display: none !important;
}

/* ==================== RETRO BATOCERA BACKGROUND ==================== */
.bg-stage {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 42%, #f1d39b 0%, #c68d46 52%, #593312 100%);
  transition: filter 0.4s ease;
}

.bg-stripes-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 22%;
  background: repeating-linear-gradient(
    to bottom,
    rgba(190, 42, 22, 0.72) 0px,
    rgba(190, 42, 22, 0.72) 8px,
    rgba(235, 130, 30, 0.72) 8px,
    rgba(235, 130, 30, 0.72) 16px,
    rgba(230, 185, 50, 0.5) 16px,
    rgba(230, 185, 50, 0.5) 22px,
    rgba(40, 20, 8, 0.55) 22px,
    rgba(40, 20, 8, 0.55) 26px
  );
  border-bottom: 3px solid rgba(255, 220, 120, 0.65);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
}

.bg-horizon {
  position: absolute;
  top: 22%;
  left: 50%;
  transform: translateX(-50%);
  width: 180px;
  height: 36%;
  background: linear-gradient(
    to right,
    rgba(46, 160, 67, 0.6) 0% 25%,
    rgba(220, 53, 69, 0.6) 25% 50%,
    rgba(255, 193, 7, 0.6) 50% 75%,
    rgba(13, 110, 253, 0.55) 75% 100%
  );
  opacity: 0.7;
  filter: blur(0.5px);
}

.bg-stripes-floor {
  position: absolute;
  bottom: 0;
  left: -30%;
  right: -30%;
  height: 44%;
  background: conic-gradient(
    from 180deg at 50% 0%,
    transparent 0deg 118deg,
    rgba(30, 120, 50, 0.72) 118deg 134deg,
    rgba(210, 165, 45, 0.65) 134deg 148deg,
    rgba(195, 55, 30, 0.75) 148deg 162deg,
    rgba(28, 35, 48, 0.6) 162deg 198deg,
    rgba(195, 55, 30, 0.75) 198deg 212deg,
    rgba(210, 165, 45, 0.65) 212deg 226deg,
    rgba(30, 120, 50, 0.72) 226deg 242deg,
    transparent 242deg 360deg
  );
  opacity: 0.85;
}

.bg-scanlines {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 0px,
    rgba(0, 0, 0, 0) 3px,
    rgba(0, 0, 0, 0.08) 3px,
    rgba(0, 0, 0, 0.08) 4px
  );
  pointer-events: none;
}

/* ==================== TOP & BOTTOM ARCADE BEZELS ==================== */
.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 68px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 24px;
}

.top-left, .top-right {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 180px;
}

.top-right {
  justify-content: flex-end;
}

.title-bezel {
  background: var(--bezel-bg);
  border: 3px solid #f0f4f8;
  box-shadow: 0 0 0 3px #000, 0 6px 24px rgba(0, 0, 0, 0.65);
  padding: 8px 38px;
  clip-path: polygon(16px 0%, calc(100% - 16px) 0%, 100% 50%, calc(100% - 16px) 100%, 16px 100%, 0% 50%);
  display: flex;
  align-items: center;
  gap: 24px;
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: clamp(1rem, 2.2vw, 1.55rem);
  letter-spacing: 3px;
}

.neon-pink {
  color: #ff2e88;
  text-shadow: 0 0 12px rgba(255, 46, 136, 0.85);
}

.neon-green {
  color: #8aff00;
  text-shadow: 0 0 12px rgba(138, 255, 0, 0.85);
}

.icon-btn {
  background: rgba(7, 9, 14, 0.86);
  border: 2px solid rgba(255, 255, 255, 0.55);
  color: #fff;
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 1rem;
  text-decoration: none;
  transition: transform 0.15s, border-color 0.15s;
}

.icon-btn:hover {
  transform: scale(1.08);
  border-color: var(--accent-2);
}

.user-badge, .clock {
  background: rgba(7, 9, 14, 0.86);
  border: 2px solid rgba(255, 255, 255, 0.45);
  color: #fff;
  border-radius: 8px;
  padding: 6px 12px;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 1px;
}

/* Live Netplay Rooms Pill & Modal */
.rooms-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(7, 9, 14, 0.9);
  border: 2px solid rgba(255, 255, 255, 0.45);
  color: #dbe4ee;
  border-radius: 999px;
  padding: 6px 13px;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 1px;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.2s, box-shadow 0.2s;
}

.rooms-pill:hover {
  transform: scale(1.05);
  border-color: var(--accent-2);
}

.rooms-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #6b7280;
}

.rooms-pill.has-rooms {
  border-color: #8aff00;
  color: #8aff00;
  box-shadow: 0 0 14px rgba(138, 255, 0, 0.45);
}

.rooms-pill.has-rooms .rooms-dot {
  background: #8aff00;
  box-shadow: 0 0 8px #8aff00;
  animation: pulseDot 1.4s infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.8); }
}

.rooms-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(0, 0, 0, 0.76);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.rooms-modal-card {
  width: min(640px, 95vw);
  max-height: 82dvh;
  background: rgba(10, 14, 22, 0.96);
  border: 3px solid #f0f4f8;
  box-shadow: 0 0 0 4px #000, 0 20px 60px rgba(0, 0, 0, 0.85);
  border-radius: 14px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.rooms-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.12);
  padding-bottom: 12px;
}

.rooms-modal-header h3 {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.05rem;
  color: #8aff00;
  letter-spacing: 1.5px;
  margin-bottom: 4px;
}

.rooms-modal-header p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.rooms-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  min-height: 80px;
}

.rooms-empty {
  text-align: center;
  padding: 26px 14px;
  color: var(--text-muted);
  font-size: 1rem;
  border: 2px dashed rgba(255, 255, 255, 0.16);
  border-radius: 10px;
}

.room-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(138, 255, 0, 0.35);
  border-radius: 10px;
  padding: 12px 14px;
}

.room-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.room-game {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.95rem;
  font-weight: 800;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-meta {
  font-size: 0.88rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.room-join-btn {
  flex: 0 0 auto;
  background: linear-gradient(90deg, #52c41a, #8aff00);
  color: #071005;
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: 0.78rem;
  letter-spacing: 1px;
  cursor: pointer;
}

.room-join-btn:hover {
  filter: brightness(1.1);
  transform: scale(1.03);
}

.bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 58px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px 8px;
}

.controls-bezel {
  background: var(--bezel-bg);
  border: 3px solid #f0f4f8;
  box-shadow: 0 0 0 3px #000, 0 -4px 20px rgba(0, 0, 0, 0.6);
  padding: 7px 34px;
  clip-path: polygon(16px 0%, calc(100% - 16px) 0%, 100% 50%, calc(100% - 16px) 100%, 16px 100%, 0% 50%);
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
  justify-content: center;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 1.5px;
}

.ctrl-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.btn-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.7rem;
  font-weight: 900;
  color: #05070a;
}

.btn-pill.green { background: #8aff00; }
.btn-pill.red { background: #ff2e88; color: #fff; }
.btn-pill.cyan { background: #08d9d6; }
.btn-pill.yellow { background: #ffd93d; }

.lbl-green { color: #8aff00; }
.lbl-pink { color: #ff4fa3; }
.lbl-cyan { color: #3df5f2; }
.lbl-yellow { color: #ffd93d; }

.gamepad-status {
  color: #8aff00;
  border-left: 1px solid rgba(255, 255, 255, 0.25);
  padding-left: 14px;
}

/* ==================== VIEWS ==================== */
.view {
  position: fixed;
  inset: 68px 0 58px 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* ==================== LOGIN VIEW ==================== */
.login-card {
  width: min(420px, 92vw);
  background: rgba(8, 11, 18, 0.92);
  border: 3px solid #f0f4f8;
  box-shadow: 0 0 0 4px #000, 0 20px 60px rgba(0, 0, 0, 0.75);
  border-radius: 16px;
  padding: 34px 30px;
  text-align: center;
  backdrop-filter: blur(10px);
}

.brand-logo {
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: 2.1rem;
  letter-spacing: 3px;
  margin-bottom: 6px;
}

.brand-main {
  color: #ff2e88;
  text-shadow: 0 0 18px rgba(255, 46, 136, 0.75);
}

.brand-accent {
  color: #8aff00;
  text-shadow: 0 0 18px rgba(138, 255, 0, 0.75);
}

.brand-sub {
  font-size: 0.85rem;
  letter-spacing: 2px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.field {
  text-align: left;
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.72rem;
  letter-spacing: 2px;
  color: var(--accent-2);
  margin-bottom: 6px;
}

.field input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 8px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  outline: none;
  user-select: text;
}

.field input:focus {
  border-color: var(--accent-3);
  box-shadow: 0 0 14px rgba(138, 255, 0, 0.3);
}

.login-error {
  background: rgba(255, 46, 99, 0.2);
  border: 1px solid #ff2e63;
  color: #ff99b3;
  border-radius: 8px;
  padding: 8px 12px;
  font-weight: 700;
  margin-bottom: 14px;
}

.btn-start {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(90deg, #ff2e88, #ff6b35);
  color: #fff;
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: 1rem;
  letter-spacing: 2px;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(255, 46, 136, 0.45);
  transition: transform 0.15s, filter 0.15s;
}

.btn-start:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
}

/* ==================== BATOCERA SYSTEMS CAROUSEL ==================== */
.brand-watermark {
  margin-bottom: 14px;
}

.wm-text {
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: clamp(1.2rem, 2.5vw, 1.85rem);
  letter-spacing: 6px;
  background: linear-gradient(90deg, #ff2e88, #ffd93d, #8aff00, #08d9d6);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.85));
}

.carousel-stage {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.carousel-band {
  width: 100%;
  height: clamp(170px, 28vh, 250px);
  background: rgba(255, 252, 244, 0.86);
  border-top: 4px solid rgba(255, 255, 255, 0.95);
  border-bottom: 4px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 12px 45px rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.carousel-track {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(24px, 5vw, 80px);
  width: 100%;
  padding: 0 80px;
}

.sys-item {
  flex: 0 0 auto;
  width: clamp(180px, 26vw, 340px);
  height: clamp(120px, 20vh, 185px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.25s ease, filter 0.25s ease;
  opacity: 0.42;
  transform: scale(0.76);
  filter: grayscale(25%);
}

.sys-item.active {
  opacity: 1;
  transform: scale(1.12);
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.32));
}

.sys-item img {
  max-width: 92%;
  max-height: 85%;
  object-fit: contain;
}

.sys-fallback-logo {
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: clamp(1.3rem, 2.6vw, 2.2rem);
  color: #102a43;
  text-align: center;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 10px 18px;
  border: 4px solid #102a43;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.7);
}

.nav-arrow {
  position: absolute;
  z-index: 5;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 3px solid #fff;
  background: rgba(7, 9, 14, 0.85);
  color: #8aff00;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.55);
  transition: transform 0.15s, background 0.15s;
}

.nav-arrow:hover {
  transform: scale(1.12);
  background: #ff2e88;
  color: #fff;
}

.nav-arrow.left { left: 22px; }
.nav-arrow.right { right: 22px; }

.system-counter-bar {
  margin-top: 0;
  width: 100%;
  background: rgba(235, 224, 200, 0.78);
  border-bottom: 2px solid rgba(255, 255, 255, 0.65);
  padding: 10px 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
}

.system-name-pill {
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: 1.05rem;
  letter-spacing: 2.5px;
  color: #111827;
  text-transform: uppercase;
}

.system-count {
  font-family: 'Orbitron', sans-serif;
  font-weight: 800;
  font-size: 0.92rem;
  letter-spacing: 2px;
  color: #27323f;
}

/* Decorative Joysticks */
.joysticks-deco {
  position: fixed;
  bottom: 54px;
  left: 50%;
  transform: translateX(-50%);
  width: min(560px, 75vw);
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  z-index: 15;
}

.stick {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stick .ball {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  box-shadow: inset -6px -6px 10px rgba(0, 0, 0, 0.45), 0 4px 10px rgba(0, 0, 0, 0.4);
}

.stick-green .ball {
  background: radial-gradient(circle at 30% 30%, #c8ff66, #2ea824);
}

.stick-red .ball {
  background: radial-gradient(circle at 30% 30%, #ff7b9c, #c8102e);
}

.stick .shaft {
  width: 6px;
  height: 22px;
  background: linear-gradient(90deg, #999, #fff, #666);
  margin-top: -3px;
}

.stick .base {
  width: 34px;
  height: 8px;
  border-radius: 50%;
  background: #111;
  border: 2px solid #444;
  margin-top: -2px;
}

/* ==================== GAMES LIST VIEW ==================== */
.gamelist-layout {
  width: min(1280px, 95vw);
  height: calc(100% - 20px);
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 20px;
  background: rgba(8, 12, 20, 0.88);
  border: 3px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 0 0 4px #000, 0 20px 60px rgba(0, 0, 0, 0.75);
  border-radius: 16px;
  padding: 18px;
  backdrop-filter: blur(12px);
}

.gamelist-left {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 2px solid rgba(255, 255, 255, 0.12);
  padding-right: 16px;
}

.gamelist-platform-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.btn-back-inline {
  background: #ff2e88;
  border: none;
  color: #fff;
  font-family: 'Orbitron', sans-serif;
  font-weight: 800;
  font-size: 0.75rem;
  letter-spacing: 1px;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
}

.btn-back-inline:hover {
  filter: brightness(1.15);
}

.gamelist-platform-title {
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: 1.15rem;
  color: #8aff00;
  letter-spacing: 2px;
  text-transform: uppercase;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.search-wrap input {
  flex: 1;
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  padding: 9px 12px;
  color: #fff;
  font-family: 'Rajdhani', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  outline: none;
  user-select: text;
}

.search-wrap input:focus {
  border-color: var(--accent-2);
}

.game-count-mini {
  background: rgba(8, 217, 214, 0.2);
  border: 1px solid var(--accent-2);
  color: var(--accent-2);
  font-family: 'Orbitron', sans-serif;
  font-weight: 800;
  font-size: 0.8rem;
  padding: 7px 11px;
  border-radius: 8px;
}

.games-ul {
  list-style: none;
  overflow-y: auto;
  flex: 1;
  padding-right: 6px;
}

.games-ul::-webkit-scrollbar { width: 8px; }
.games-ul::-webkit-scrollbar-track { background: rgba(255,255,255,0.04); border-radius: 4px; }
.games-ul::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.22); border-radius: 4px; }

.game-row {
  padding: 11px 14px;
  margin-bottom: 5px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.12rem;
  font-weight: 700;
  color: #d8e1eb;
  border-left: 4px solid transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  transition: background 0.12s, transform 0.12s;
}

.game-row:hover {
  background: rgba(255, 255, 255, 0.08);
}

.game-row.selected {
  background: linear-gradient(90deg, rgba(138, 255, 0, 0.24), rgba(8, 217, 214, 0.12));
  border-left-color: #8aff00;
  color: #fff;
  transform: translateX(4px);
}

.game-row-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-row-ext {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.65rem;
  color: var(--accent-2);
  opacity: 0.8;
  text-transform: uppercase;
}

/* Right Preview */
.gamelist-right {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
}

.game-preview-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  gap: 16px;
}

.cover-frame {
  width: 100%;
  height: clamp(190px, 34vh, 300px);
  background: radial-gradient(circle at center, rgba(255,255,255,0.08), rgba(0,0,0,0.55));
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 10px;
}

.cover-frame img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.65);
}

.cover-placeholder {
  width: 100%;
  height: 100%;
  border: 2px dashed rgba(255, 255, 255, 0.22);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  text-align: center;
  gap: 10px;
}

.ph-console {
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: 0.9rem;
  color: var(--accent-4);
  letter-spacing: 3px;
}

.ph-title {
  font-family: 'Orbitron', sans-serif;
  font-weight: 800;
  font-size: 1.25rem;
  color: #fff;
}

.game-meta {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 10px;
}

.game-meta h2 {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.3rem;
  font-weight: 900;
  color: #fff;
  line-height: 1.25;
}

.meta-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  padding: 3px 9px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent-2);
}

.game-summary {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.45;
  flex: 1;
  overflow-y: auto;
  max-height: 130px;
}

.play-actions {
  margin-top: auto;
}

.btn-play-big {
  width: 100%;
  padding: 15px 20px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(90deg, #52c41a, #8aff00);
  color: #071005;
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: 1.15rem;
  letter-spacing: 2.5px;
  cursor: pointer;
  box-shadow: 0 8px 28px rgba(138, 255, 0, 0.4);
  transition: transform 0.15s, filter 0.15s;
}

.btn-play-big:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
}

/* ==================== FULLSCREEN PLAYER OVERLAY ==================== */
.player-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #000;
  display: flex;
  flex-direction: column;
}

.player-topbar {
  height: 46px;
  background: rgba(7, 9, 14, 0.94);
  border-bottom: 2px solid rgba(138, 255, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  gap: 12px;
}

.player-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.88rem;
  font-weight: 800;
  color: #8aff00;
  letter-spacing: 1.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-controls {
  display: flex;
  gap: 8px;
}

.player-btn {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #fff;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
}

.player-btn.danger {
  background: #ff2e63;
  border-color: #ff6b91;
}

.player-btn:hover {
  filter: brightness(1.15);
}

#playerFrame {
  flex: 1;
  width: 100%;
  border: none;
  background: #000;
}

/* ==================== RESPONSIVE (TABLET & MOBILE) ==================== */
@media (max-width: 900px) {
  .top-bar {
    height: 54px;
    padding: 6px 10px;
  }

  .top-left, .top-right {
    min-width: auto;
    gap: 6px;
  }

  .user-badge, .clock {
    display: none;
  }

  .icon-btn {
    padding: 5px 8px;
    font-size: 0.9rem;
  }

  .title-bezel {
    padding: 5px 16px;
    gap: 8px;
    font-size: clamp(0.76rem, 3.4vw, 1.05rem);
    letter-spacing: 1.5px;
    border-width: 2px;
    clip-path: polygon(10px 0%, calc(100% - 10px) 0%, 100% 50%, calc(100% - 10px) 100%, 10px 100%, 0% 50%);
  }

  .bottom-bar {
    height: 44px;
    padding: 0 8px 6px;
  }

  .controls-bezel {
    padding: 5px 14px;
    gap: 10px;
    font-size: 0.62rem;
    letter-spacing: 0.8px;
    border-width: 2px;
    clip-path: none;
    border-radius: 999px;
    flex-wrap: nowrap;
    overflow: hidden;
    white-space: nowrap;
  }

  .controls-bezel .ctrl-item:nth-child(4) {
    display: none;
  }

  .view {
    inset: 54px 0 44px 0;
    padding: 6px 0;
  }

  /* Login mobile */
  .login-card {
    width: min(380px, 92vw);
    max-height: calc(100dvh - 115px);
    overflow-y: auto;
    padding: 22px 18px;
  }

  .brand-logo {
    font-size: 1.6rem;
  }

  .brand-sub {
    font-size: 0.72rem;
    margin-bottom: 16px;
  }

  /* Carousel mobile */
  .brand-watermark {
    margin-bottom: 10px;
  }

  .wm-text {
    font-size: 1.05rem;
    letter-spacing: 3px;
  }

  .carousel-band {
    height: clamp(140px, 26dvh, 200px);
  }

  .carousel-track {
    padding: 0 48px;
    gap: 12px;
  }

  .sys-item {
    display: none;
  }

  .sys-item.active {
    display: flex;
    width: min(240px, 64vw);
    height: clamp(100px, 19dvh, 150px);
    transform: scale(1);
    opacity: 1;
  }

  .nav-arrow {
    width: 40px;
    height: 40px;
    font-size: 1.1rem;
    border-width: 2px;
  }

  .nav-arrow.left { left: 8px; }
  .nav-arrow.right { right: 8px; }

  .system-name-pill {
    font-size: 0.92rem;
    letter-spacing: 1.5px;
  }

  .system-count {
    font-size: 0.8rem;
  }

  .joysticks-deco {
    display: none;
  }

  /* Games List mobile: compact preview card on top + full scrollable list below */
  .gamelist-layout {
    width: 96vw;
    height: 100%;
    display: flex;
    flex-direction: column-reverse;
    gap: 10px;
    padding: 10px;
    border-radius: 12px;
    border-width: 2px;
  }

  .gamelist-right {
    flex: 0 0 auto;
    overflow: visible;
    border-bottom: 2px solid rgba(255, 255, 255, 0.14);
    padding-bottom: 10px;
  }

  .game-preview-card {
    flex-direction: row;
    align-items: center;
    gap: 12px;
    height: auto;
  }

  .cover-frame {
    flex: 0 0 92px;
    width: 92px;
    height: 112px;
    padding: 4px;
    border-radius: 8px;
  }

  .cover-placeholder {
    padding: 6px;
    gap: 4px;
  }

  .ph-console {
    font-size: 0.62rem;
    letter-spacing: 1px;
  }

  .ph-title {
    font-size: 0.7rem;
    line-height: 1.15;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
  }

  .game-meta {
    min-width: 0;
    gap: 6px;
  }

  .game-meta h2 {
    font-size: 0.95rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .meta-chips {
    gap: 5px;
  }

  .chip {
    font-size: 0.7rem;
    padding: 2px 6px;
  }

  .game-summary {
    display: none;
  }

  .btn-play-big {
    padding: 10px 14px;
    font-size: 0.88rem;
    letter-spacing: 1.5px;
    border-radius: 8px;
  }

  .gamelist-left {
    flex: 1 1 auto;
    min-height: 0;
    border-right: none;
    padding-right: 0;
  }

  .gamelist-platform-bar {
    margin-bottom: 8px;
    gap: 8px;
  }

  .btn-back-inline {
    padding: 6px 10px;
    font-size: 0.68rem;
  }

  .gamelist-platform-title {
    font-size: 0.9rem;
    letter-spacing: 1px;
  }

  .search-wrap {
    margin-bottom: 8px;
  }

  .search-wrap input {
    padding: 7px 10px;
    font-size: 0.95rem;
  }

  .game-row {
    padding: 11px 12px;
    font-size: 1rem;
  }

  /* Player topbar mobile */
  .player-topbar {
    height: 40px;
    padding: 0 10px;
  }

  .player-title {
    font-size: 0.75rem;
    letter-spacing: 0.8px;
  }

  .player-btn {
    padding: 5px 9px;
    font-size: 0.66rem;
  }
}

/* Mobile landscape optimization (all phones & short landscape screens) */
@media (max-height: 540px) and (orientation: landscape) {
  .top-bar {
    height: 38px;
    padding: 3px 12px;
  }

  .top-left, .top-right {
    min-width: auto;
    gap: 6px;
  }

  .user-badge, .clock {
    display: none;
  }

  .icon-btn {
    padding: 3px 7px;
    font-size: 0.82rem;
  }

  .title-bezel {
    padding: 3px 18px;
    gap: 10px;
    font-size: 0.82rem;
    letter-spacing: 1.5px;
    border-width: 2px;
  }

  .bottom-bar,
  .joysticks-deco,
  .brand-watermark {
    display: none !important;
  }

  .view {
    inset: 38px 0 0 0;
    padding: 4px 0;
  }

  /* Login landscape */
  .login-card {
    width: min(420px, 88vw);
    max-height: calc(100dvh - 48px);
    overflow-y: auto;
    padding: 14px 20px;
  }

  .brand-logo {
    font-size: 1.3rem;
    margin-bottom: 4px;
  }

  .brand-sub {
    display: none;
  }

  .field {
    margin-bottom: 8px;
  }

  .field label {
    font-size: 0.65rem;
    margin-bottom: 3px;
  }

  .field input {
    padding: 7px 10px;
    font-size: 0.95rem;
  }

  .btn-start {
    padding: 9px;
    font-size: 0.88rem;
  }

  /* Carousel landscape */
  .carousel-band {
    height: clamp(120px, 54dvh, 210px);
    border-width: 3px;
  }

  .carousel-track {
    padding: 0 56px;
    gap: 20px;
  }

  .sys-item {
    display: flex;
    width: 24vw;
    height: clamp(80px, 34dvh, 130px);
    opacity: 0.38;
    transform: scale(0.75);
  }

  .sys-item.active {
    display: flex;
    width: 34vw;
    max-width: 260px;
    height: clamp(100px, 44dvh, 160px);
    opacity: 1;
    transform: scale(1.06);
  }

  .nav-arrow {
    width: 38px;
    height: 38px;
    font-size: 1rem;
    border-width: 2px;
  }

  .nav-arrow.left { left: 10px; }
  .nav-arrow.right { right: 10px; }

  .system-counter-bar {
    padding: 5px 12px;
    flex-direction: row;
    justify-content: center;
    gap: 16px;
  }

  .system-name-pill {
    font-size: 0.85rem;
    letter-spacing: 1.5px;
  }

  .system-count {
    font-size: 0.78rem;
  }

  /* Games List landscape */
  .gamelist-layout {
    width: 97vw;
    height: calc(100dvh - 46px);
    display: grid !important;
    grid-template-columns: 1.15fr 1fr;
    grid-template-rows: 1fr;
    gap: 12px;
    padding: 8px 10px;
    border-radius: 10px;
    border-width: 2px;
  }

  .gamelist-left {
    display: flex;
    flex-direction: column;
    min-height: 0;
    border-right: 2px solid rgba(255, 255, 255, 0.14);
    border-bottom: none;
    padding-right: 10px;
    padding-bottom: 0;
  }

  .gamelist-platform-bar {
    margin-bottom: 6px;
    gap: 8px;
  }

  .btn-back-inline {
    padding: 5px 8px;
    font-size: 0.65rem;
  }

  .gamelist-platform-title {
    font-size: 0.85rem;
    letter-spacing: 1px;
  }

  .search-wrap {
    margin-bottom: 6px;
  }

  .search-wrap input {
    padding: 5px 9px;
    font-size: 0.88rem;
  }

  .game-count-mini {
    padding: 4px 8px;
    font-size: 0.72rem;
  }

  .game-row {
    padding: 7px 10px;
    margin-bottom: 3px;
    font-size: 0.92rem;
  }

  .gamelist-right {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow-y: auto;
    border: none;
    padding: 0;
  }

  .game-preview-card {
    flex-direction: column;
    align-items: stretch;
    justify-content: space-between;
    height: 100%;
    gap: 8px;
  }

  .cover-frame {
    width: 100%;
    flex: 1 1 auto;
    height: auto;
    min-height: 85px;
    max-height: 44dvh;
    padding: 4px;
  }

  .game-meta {
    flex: 0 0 auto;
    gap: 5px;
  }

  .game-meta h2 {
    font-size: 0.92rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .game-summary {
    display: none;
  }

  .btn-play-big {
    padding: 8px 12px;
    font-size: 0.85rem;
    letter-spacing: 1.5px;
  }

  /* Player topbar landscape */
  .player-topbar {
    height: 34px;
    padding: 0 10px;
  }

  .player-title {
    font-size: 0.72rem;
  }

  .player-btn {
    padding: 4px 8px;
    font-size: 0.64rem;
  }
}
