/* ==========================================================
   PLAYBOX DESIGN SYSTEM & STYLESHEET
   Matching the high-fidelity console/web dashboard
   ========================================================== */

:root {
  --pb-bg: #0b1329;
  --pb-bg-surface: #101b38;
  --pb-bg-card: #152245;
  --pb-bg-card-hover: #1c2e5c;
  --pb-border: rgba(255, 255, 255, 0.08);
  --pb-border-focus: #3b82f6;

  --pb-primary: #3b5bfd;
  --pb-primary-hover: #4f6ffd;
  --pb-accent-cyan: #38bdf8;
  --pb-accent-pink: #f472b6;
  --pb-accent-yellow: #facc15;
  --pb-accent-teal: #2dd4bf;
  --pb-accent-orange: #fb923c;
  --pb-accent-purple: #a78bfa;

  --pb-text-main: #ffffff;
  --pb-text-sub: #94a3b8;
  --pb-text-muted: #64748b;

  --pb-font-sans: 'Plus Jakarta Sans', 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --pb-font-display: 'Outfit', 'Plus Jakarta Sans', sans-serif;

  --pb-radius-lg: 18px;
  --pb-radius-md: 14px;
  --pb-radius-sm: 8px;
  --pb-radius-full: 9999px;

  --pb-shadow-card: 0 10px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
  --pb-shadow-glow: 0 0 25px rgba(59, 91, 253, 0.4);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.playbox-app {
  background-color: var(--pb-bg);
  background-image: 
    radial-gradient(circle at 20% 0%, rgba(30, 58, 138, 0.25) 0%, transparent 50%),
    radial-gradient(circle at 80% 10%, rgba(79, 70, 229, 0.2) 0%, transparent 60%),
    radial-gradient(circle at 50% 100%, rgba(15, 23, 42, 0.8) 0%, transparent 100%);
  color: var(--pb-text-main);
  font-family: var(--pb-font-sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  user-select: none;
}

/* ================= HEADER ================= */
.pb-header {
  height: 68px;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(11, 19, 41, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.pb-header-left {
  display: flex;
  align-items: center;
}

.pb-logo {
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: transform 0.2s ease;
  outline: none;
}

.pb-logo:hover, .pb-logo:focus-visible {
  transform: scale(1.03);
}

.pb-logo-img {
  height: 44px;
  width: auto;
  object-fit: contain;
  display: block;
}

/* Navigation Pills */
.pb-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  padding: 4px 6px;
  border-radius: var(--pb-radius-full);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.pb-nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: var(--pb-radius-full);
  border: none;
  background: transparent;
  color: #94a3b8;
  font-family: var(--pb-font-sans);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  outline: none;
}

.pb-nav-icon {
  width: 17px;
  height: 17px;
  display: block;
}

.pb-nav-item:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.pb-nav-item.active {
  background: var(--pb-primary);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(59, 91, 253, 0.4);
}

.pb-nav-item:focus-visible {
  outline: 2px solid var(--pb-accent-cyan);
  outline-offset: 2px;
}

/* Header Right */
.pb-header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.pb-icon-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  outline: none;
}

.pb-icon-btn:hover, .pb-icon-btn:focus-visible {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  transform: translateY(-1px);
}

.pb-clock {
  font-family: var(--pb-font-display);
  font-size: 15px;
  font-weight: 700;
  color: #f1f5f9;
  letter-spacing: 0.5px;
  padding: 0 4px;
}

.pb-status-icons {
  display: flex;
  align-items: center;
  color: #cbd5e1;
}

.pb-wifi-icon.active {
  color: #38bdf8;
  filter: drop-shadow(0 0 6px rgba(56, 189, 248, 0.5));
}

/* ================= MAIN CONTENT ================= */
.pb-main-content {
  flex: 1;
  padding: 18px 32px 80px 32px;
  max-width: 1560px;
  margin: 0 auto;
  width: 100%;
}

.pb-tab-pane {
  display: none;
  animation: pbFadeIn 0.28s ease;
}

.pb-tab-pane.active {
  display: block;
}

@keyframes pbFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ================= HERO GRID ================= */
.pb-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  margin-bottom: 22px;
  height: 310px;
}

.pb-hero-card {
  border-radius: var(--pb-radius-lg);
  overflow: hidden;
  position: relative;
  background: var(--pb-bg-surface);
  border: 1px solid var(--pb-border);
  box-shadow: var(--pb-shadow-card);
  transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.24s ease, border-color 0.2s;
  outline: none;
  height: 100%;
}

.pb-hero-card:focus-visible, .pb-hero-card.pb-focused, .pb-hero-card:hover {
  border-color: var(--pb-accent-cyan);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.4), var(--pb-shadow-card);
  transform: translateY(-3px);
}

/* Hero Carousel (Left Card) */
.pb-hero-featured {
  height: 100%;
  background: #0b142c;
}

.pb-hero-carousel-track {
  position: relative;
  width: 100%;
  height: 100%;
}

.pb-hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease-in-out;
  display: flex;
  align-items: center;
}

.pb-hero-slide.active {
  opacity: 1;
  pointer-events: auto;
}

.pb-hero-bg-wrapper {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
}

.pb-dino-banner-bg {
  background: radial-gradient(circle at 75% 30%, #201a4a 0%, #0d152c 60%, #080d1e 100%);
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.pb-hero-dino-chars {
  height: 100%;
  width: auto;
  max-width: 65%;
  object-fit: cover;
  object-position: left center;
  mask-image: linear-gradient(to right, transparent 0%, black 18%);
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 18%);
  transition: transform 0.5s ease;
}

.pb-hero-card:hover .pb-hero-dino-chars {
  transform: scale(1.03);
}

.pb-hero-cosmic-glow {
  position: absolute;
  top: -40px;
  right: -40px;
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, rgba(167, 139, 250, 0.25) 0%, transparent 70%);
  pointer-events: none;
}

.pb-hero-bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.pb-kart-hero-bg {
  object-position: top center;
  filter: brightness(0.85) contrast(1.1);
}

.pb-hero-overlay-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(11, 19, 41, 0.95) 0%, rgba(11, 19, 41, 0.65) 50%, rgba(11, 19, 41, 0.2) 100%);
}

.pb-hero-content {
  position: relative;
  z-index: 2;
  padding: 28px 36px;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.pb-hero-badge {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #93c5fd;
  margin-bottom: 6px;
}

.pb-hero-badge.kart-badge {
  color: #facc15;
  background: rgba(234, 179, 8, 0.15);
  padding: 4px 10px;
  border-radius: var(--pb-radius-full);
  border: 1px solid rgba(234, 179, 8, 0.3);
}

.pb-hero-title {
  font-family: var(--pb-font-display);
  font-size: 36px;
  font-weight: 900;
  line-height: 1.08;
  color: #ffffff;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
}

.pb-hero-desc {
  font-size: 14px;
  line-height: 1.4;
  color: #e2e8f0;
  margin-bottom: 20px;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.7);
}

.pb-hero-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pb-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: var(--pb-radius-full);
  font-family: var(--pb-font-sans);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  outline: none;
}

.pb-btn-hero {
  background: linear-gradient(135deg, #7c88ff 0%, #5865f2 100%);
  color: #ffffff;
  box-shadow: 0 6px 20px rgba(88, 101, 242, 0.45);
  padding: 11px 24px;
  font-size: 15px;
}

.pb-btn-hero:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(88, 101, 242, 0.6);
  filter: brightness(1.08);
}

.pb-btn-kart {
  background: linear-gradient(135deg, #ef4444 0%, #f59e0b 100%);
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.45);
}

.pb-btn-kart:hover {
  box-shadow: 0 8px 25px rgba(239, 68, 68, 0.6);
}

.pb-btn-outline {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
}

.pb-btn-outline:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Carousel dots */
.pb-hero-dots {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  display: flex;
  gap: 8px;
  background: rgba(0, 0, 0, 0.35);
  padding: 5px 10px;
  border-radius: var(--pb-radius-full);
  backdrop-filter: blur(8px);
}

.pb-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: all 0.24s ease;
  outline: none;
}

.pb-dot.active {
  background: #ffffff;
  width: 20px;
  border-radius: 6px;
}

/* Hero Full-Artwork Cards (Card 2 & Card 3) */
.pb-hero-full-card {
  cursor: pointer;
  position: relative;
  background: transparent;
  display: flex;
  align-items: stretch;
}

.pb-hero-full-img {
  width: 100%;
  height: 100%;
  object-fit: fill;
  display: block;
  transition: transform 0.3s ease;
}

.pb-hero-full-card:hover .pb-hero-full-img {
  transform: scale(1.02);
}

.pb-card-hotspot {
  position: absolute;
  inset: 0;
  cursor: pointer;
}

/* ================= SECTION COMMON ================= */
.pb-section {
  margin-bottom: 22px;
}

.pb-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.pb-section-title {
  font-family: var(--pb-font-display);
  font-size: 21px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.3px;
}

.pb-section-link {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-family: var(--pb-font-sans);
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: color 0.2s;
  outline: none;
}

.pb-section-link:hover, .pb-section-link:focus-visible {
  color: #ffffff;
}

/* ================= MINA SPEL GRID ================= */
.pb-grid-mina {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  align-items: stretch;
}

.pb-game-card {
  background: var(--pb-bg-surface);
  border-radius: var(--pb-radius-md);
  border: 1px solid var(--pb-border);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  outline: none;
  position: relative;
}

.pb-game-card:hover, .pb-game-card:focus-visible, .pb-game-card.pb-focused {
  transform: translateY(-4px) scale(1.01);
  border-color: var(--pb-accent-cyan);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5), 0 0 0 2px rgba(56, 189, 248, 0.3);
}

.pb-card-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0f172a;
  overflow: hidden;
  position: relative;
}

.pb-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.pb-game-card:hover .pb-card-img {
  transform: scale(1.05);
}

.pb-card-info {
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--pb-bg-surface);
  flex: 1;
}

.pb-card-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pb-card-title {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
}

.pb-card-sub {
  font-size: 12.5px;
  color: var(--pb-text-sub);
}

.pb-menu-dots-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.18s ease;
  outline: none;
}

.pb-menu-dots-btn:hover, .pb-menu-dots-btn:focus-visible {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

/* Card 4: Add new game button */
.pb-card-add-new {
  border: 2px dashed rgba(255, 255, 255, 0.15);
  background: rgba(16, 27, 56, 0.4);
  align-items: center;
  justify-content: center;
  height: 100%;
}

.pb-card-add-new:hover, .pb-card-add-new:focus-visible {
  border-color: var(--pb-accent-cyan);
  background: rgba(16, 27, 56, 0.85);
}

.pb-add-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 16px;
}

.pb-add-plus-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #e2e8f0;
  transition: all 0.22s ease;
}

.pb-card-add-new:hover .pb-add-plus-circle {
  background: var(--pb-primary);
  color: #ffffff;
  transform: scale(1.1) rotate(90deg);
}

.pb-add-text {
  font-size: 14px;
  font-weight: 700;
  color: #cbd5e1;
}

/* ================= POPULAR GRID ================= */
.pb-grid-popular {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
}

.pb-pop-card {
  background: var(--pb-bg-surface);
  border-radius: var(--pb-radius-md);
  border: 1px solid var(--pb-border);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  outline: none;
  position: relative;
}

.pb-pop-card:hover, .pb-pop-card:focus-visible, .pb-pop-card.pb-focused {
  transform: translateY(-4px) scale(1.02);
  border-color: var(--pb-accent-cyan);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5), 0 0 0 2px rgba(56, 189, 248, 0.3);
}

.pb-pop-thumb {
  width: 100%;
  aspect-ratio: 16 / 10;
  background: #0f172a;
  overflow: hidden;
  position: relative;
}

.pb-pop-card:hover .pb-card-img {
  transform: scale(1.06);
}

.pb-pop-highlighted {
  border-color: rgba(245, 158, 11, 0.4);
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.15);
}

.pb-kart-live-tag {
  position: absolute;
  top: 6px;
  right: 6px;
  background: #ef4444;
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  padding: 3px 7px;
  border-radius: var(--pb-radius-full);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  letter-spacing: 0.3px;
  animation: pbPulse 2s infinite;
}

@keyframes pbPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.85; }
}

.pb-pop-info {
  padding: 10px 12px;
}

.pb-pop-title {
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pb-pop-stats {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: #94a3b8;
}

.pb-heart-icon {
  color: #60a5fa;
  font-size: 13px;
}

.pb-rating-score {
  font-weight: 700;
  color: #f1f5f9;
}

.pb-plays-count {
  color: #64748b;
  margin-left: 2px;
}

/* ================= FOOTER / CONSOLE BAR ================= */
.pb-footer {
  height: 56px;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(11, 19, 41, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 90;
}

.pb-controller-guide {
  display: flex;
  align-items: center;
  gap: 18px;
}

.pb-ctrl-hint {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  color: #cbd5e1;
  transition: transform 0.15s ease;
}

.pb-ctrl-hint.pressed {
  transform: scale(1.15);
}

.pb-btn-pill {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  color: #0b1329;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.pb-btn-a { background: #22c55e; color: #ffffff; }
.pb-btn-b { background: #ef4444; color: #ffffff; }
.pb-btn-y { background: #eab308; color: #000000; }
.pb-btn-menu { background: #94a3b8; color: #0b1329; font-size: 12px; }

.pb-btn-lbl {
  letter-spacing: 0.2px;
}

.pb-gamepad-status {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.05);
  padding: 4px 10px;
  border-radius: var(--pb-radius-full);
  font-size: 12px;
  color: #94a3b8;
  margin-left: 8px;
}

.pb-user-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.05);
  padding: 4px 12px 4px 5px;
  border-radius: var(--pb-radius-full);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: all 0.2s ease;
  outline: none;
}

.pb-user-badge:hover, .pb-user-badge:focus-visible {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

.pb-user-avatar-wrap {
  position: relative;
  width: 30px;
  height: 30px;
}

.pb-user-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.pb-online-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 8px;
  height: 8px;
  background: #22c55e;
  border: 2px solid var(--pb-bg);
  border-radius: 50%;
}

.pb-user-name {
  font-size: 13.5px;
  font-weight: 700;
  color: #ffffff;
}

/* ================= MODALS & ARCADE OVERLAY ================= */
.pb-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.pb-modal-overlay.active {
  display: flex;
  animation: pbModalFade 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes pbModalFade {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

/* 1. DevKart Arcade Modal */
.pb-arcade-container {
  width: 96vw;
  height: 94vh;
  max-width: 1600px;
  background: #090e1a;
  border-radius: var(--pb-radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 30px rgba(59, 91, 253, 0.3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.pb-arcade-bar {
  height: 54px;
  padding: 0 20px;
  background: #0f172a;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pb-arcade-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.pb-arcade-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #ffffff;
  padding: 6px 14px;
  border-radius: var(--pb-radius-full);
  font-family: var(--pb-font-sans);
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.pb-arcade-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
}

.pb-arcade-back-btn {
  background: #dc2626;
  border-color: #ef4444;
}

.pb-arcade-back-btn:hover {
  background: #ef4444;
}

.pb-key-badge {
  background: rgba(0, 0, 0, 0.3);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
}

.pb-arcade-title-box {
  display: flex;
  flex-direction: column;
}

.pb-arcade-tag {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #f59e0b;
}

.pb-arcade-title {
  font-size: 15px;
  font-weight: 800;
  color: #ffffff;
}

.pb-arcade-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pb-track-badge {
  font-size: 12.5px;
  font-weight: 700;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.1);
  padding: 5px 12px;
  border-radius: var(--pb-radius-full);
  border: 1px solid rgba(56, 189, 248, 0.2);
}

.pb-arcade-viewport {
  flex: 1;
  position: relative;
  background: #000000;
  overflow: hidden;
}

.pb-game-iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.pb-iframe-loader {
  position: absolute;
  inset: 0;
  background: #090e1a;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  z-index: 10;
  transition: opacity 0.4s ease;
}

.pb-iframe-loader.hidden {
  opacity: 0;
  pointer-events: none;
}

.pb-kart-spinner {
  font-size: 48px;
  animation: pbKartBounce 0.8s infinite alternate ease-in-out;
}

@keyframes pbKartBounce {
  from { transform: translateY(0); }
  to { transform: translateY(-16px); }
}

/* Controls Drawer */
.pb-controls-drawer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(16px);
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding: 20px 30px;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 20;
}

.pb-controls-drawer.open {
  transform: translateY(0);
}

.pb-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.pb-controls-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.pb-ctrl-col h4 {
  font-size: 15px;
  color: #38bdf8;
  margin-bottom: 10px;
}

.pb-ctrl-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13.5px;
  color: #cbd5e1;
}

.pb-ctrl-col strong {
  color: #ffffff;
}

/* 2 & 3. Canvas Mini-Game Modal */
.pb-game-canvas-modal {
  width: 960px;
  background: #0f172a;
  border-radius: var(--pb-radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.pb-modal-header {
  padding: 14px 20px;
  background: #1e293b;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.pb-modal-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.pb-btn-back {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  padding: 6px 14px;
}

.pb-modal-stats {
  display: flex;
  gap: 12px;
}

.pb-stat-pill {
  background: rgba(255, 255, 255, 0.08);
  padding: 5px 12px;
  border-radius: var(--pb-radius-full);
  font-size: 13px;
  font-weight: 700;
  color: #38bdf8;
}

.pb-canvas-wrapper {
  position: relative;
  background: #000;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#dinoCanvas, #robotCanvas {
  display: block;
  width: 100%;
  max-height: 520px;
  object-fit: contain;
}

.pb-game-instructions {
  width: 100%;
  padding: 10px 20px;
  background: #1e293b;
  text-align: center;
  font-size: 13px;
  color: #94a3b8;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* Dialog Common */
.pb-dialog-card {
  width: 520px;
  background: #131d3b;
  border-radius: var(--pb-radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
  padding: 24px;
  position: relative;
}

.pb-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.pb-dialog-badge {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--pb-accent-cyan);
  background: rgba(56, 189, 248, 0.12);
  padding: 4px 10px;
  border-radius: var(--pb-radius-full);
}

.pb-close-dialog-btn {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: #94a3b8;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all 0.2s;
}

.pb-close-dialog-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

/* 4. AI Studio Dialog */
.pb-ai-step-building {
  text-align: center;
  padding: 28px 10px;
}

.pb-ai-anim-robot {
  font-size: 52px;
  margin-bottom: 14px;
  animation: pbFloat 1.8s infinite ease-in-out;
}

@keyframes pbFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.pb-progress-bar {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--pb-radius-full);
  overflow: hidden;
  margin-top: 18px;
}

.pb-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #3b82f6, #ec4899);
  transition: width 0.3s ease;
}

.pb-result-canvas-box {
  margin: 16px 0;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
}

#aiGameCanvas {
  width: 100%;
  height: 240px;
  display: block;
}

.pb-dialog-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.pb-btn-primary {
  background: var(--pb-primary);
  color: #ffffff;
}

.pb-btn-primary:hover {
  background: var(--pb-primary-hover);
}

.pb-btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

/* 5. Search Modal */
.pb-search-dialog {
  width: 680px;
  max-height: 80vh;
  background: #111a36;
  border-radius: var(--pb-radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.pb-search-input-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.06);
  padding: 12px 18px;
  border-radius: var(--pb-radius-md);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
}

.pb-search-field {
  flex: 1;
  background: transparent;
  border: none;
  color: #ffffff;
  font-family: var(--pb-font-sans);
  font-size: 16px;
  outline: none;
}

.pb-search-results {
  margin-top: 16px;
  overflow-y: auto;
  max-height: 480px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pb-search-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  border-radius: var(--pb-radius-md);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: all 0.2s ease;
}

.pb-search-item:hover, .pb-search-item:focus {
  background: rgba(255, 255, 255, 0.1);
  transform: translateX(4px);
}

.pb-search-item-thumb {
  width: 50px;
  height: 38px;
  border-radius: 6px;
  object-fit: cover;
}

/* 6. Settings Modal */
.pb-settings-dialog {
  width: 480px;
}

.pb-settings-group {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.pb-setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pb-setting-row h4 {
  font-size: 14.5px;
  color: #ffffff;
  margin-bottom: 2px;
}

.pb-setting-row p {
  font-size: 12.5px;
  color: #94a3b8;
}

.pb-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.pb-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.pb-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #334155;
  transition: 0.3s;
  border-radius: 34px;
}

.pb-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

input:checked + .pb-slider {
  background-color: var(--pb-primary);
}

input:checked + .pb-slider:before {
  transform: translateX(20px);
}

.pb-select {
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #ffffff;
  padding: 6px 12px;
  border-radius: var(--pb-radius-sm);
  outline: none;
}

.pb-status-pill.online {
  font-size: 11.5px;
  font-weight: 800;
  color: #22c55e;
  background: rgba(34, 197, 94, 0.12);
  padding: 3px 9px;
  border-radius: var(--pb-radius-full);
}

.pb-settings-footer {
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
  font-size: 12px;
  color: #64748b;
}

/* 7. Game Details Modal */
.pb-details-dialog {
  width: 620px;
  padding: 0;
  overflow: hidden;
}

.pb-details-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 10;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
}

.pb-details-hero {
  height: 220px;
  position: relative;
  background: #000;
}

.pb-detail-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pb-detail-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, #131d3b 100%);
}

.pb-details-body {
  padding: 24px;
}

.pb-detail-tags {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.pb-tag-pill {
  font-size: 11px;
  font-weight: 700;
  color: var(--pb-accent-cyan);
  background: rgba(56, 189, 248, 0.12);
  padding: 3px 8px;
  border-radius: var(--pb-radius-full);
}

.pb-detail-title {
  font-family: var(--pb-font-display);
  font-size: 26px;
  font-weight: 900;
  color: #ffffff;
  margin-bottom: 6px;
}

.pb-detail-meta {
  display: flex;
  gap: 12px;
  font-size: 13px;
  color: #94a3b8;
  margin-bottom: 14px;
}

.pb-detail-desc {
  font-size: 14px;
  line-height: 1.5;
  color: #cbd5e1;
  margin-bottom: 22px;
}

.pb-detail-actions {
  display: flex;
  gap: 12px;
}

/* Dropdown Context Menu */
.pb-context-menu {
  position: fixed;
  background: #19254a;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--pb-radius-sm);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
  padding: 6px;
  z-index: 2000;
  display: none;
  flex-direction: column;
  gap: 2px;
  min-width: 160px;
}

.pb-ctx-item {
  background: transparent;
  border: none;
  color: #ffffff;
  padding: 8px 12px;
  font-family: var(--pb-font-sans);
  font-size: 13.5px;
  font-weight: 600;
  text-align: left;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}

.pb-ctx-item:hover {
  background: var(--pb-primary);
}

/* Helper */
.hidden {
  display: none !important;
}

/* ================= TAB 2: SPELA LIBRARY ================= */
.pb-library-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 16px;
}

.pb-filter-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pb-pill {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  padding: 6px 15px;
  border-radius: var(--pb-radius-full);
  font-family: var(--pb-font-sans);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pb-pill:hover, .pb-pill.active {
  background: var(--pb-primary);
  color: #ffffff;
  border-color: var(--pb-primary);
}

.pb-library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 18px;
}

/* ================= TAB 3: SKAPA STUDIO ================= */
.pb-studio-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 16px 0;
}

.pb-studio-header {
  text-align: center;
  margin-bottom: 26px;
}

.pb-studio-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #f472b6;
  background: rgba(244, 114, 182, 0.12);
  padding: 4px 14px;
  border-radius: var(--pb-radius-full);
  margin-bottom: 10px;
}

.pb-studio-title {
  font-family: var(--pb-font-display);
  font-size: 34px;
  font-weight: 900;
  color: #ffffff;
  margin-bottom: 6px;
}

.pb-studio-sub {
  font-size: 15px;
  color: #94a3b8;
}

.pb-studio-form-box {
  background: #131d3b;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--pb-radius-lg);
  padding: 22px;
  margin-bottom: 30px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
}

.pb-input-wrapper {
  display: flex;
  gap: 12px;
  margin-bottom: 14px;
}

.pb-studio-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--pb-radius-md);
  padding: 13px 16px;
  color: #ffffff;
  font-family: var(--pb-font-sans);
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
}

.pb-studio-input:focus {
  border-color: var(--pb-accent-cyan);
}

.pb-quick-ideas {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pb-ideas-label {
  font-size: 12.5px;
  font-weight: 600;
  color: #64748b;
}

.pb-idea-tag {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  padding: 5px 11px;
  border-radius: var(--pb-radius-full);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.pb-idea-tag:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.pb-studio-templates h3 {
  font-size: 18px;
  margin-bottom: 14px;
}

.pb-template-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.pb-template-card {
  background: #131d3b;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--pb-radius-md);
  padding: 18px;
  cursor: pointer;
  transition: all 0.2s;
}

.pb-template-card:hover {
  transform: translateY(-3px);
  border-color: var(--pb-accent-cyan);
}

.pb-tmpl-icon {
  font-size: 28px;
  margin-bottom: 8px;
}

.pb-template-card h4 {
  font-size: 15px;
  color: #ffffff;
  margin-bottom: 4px;
}

.pb-template-card p {
  font-size: 12.5px;
  color: #94a3b8;
}

/* ================= TAB 4: COMMUNITY ================= */
.pb-community-page {
  max-width: 1200px;
  margin: 0 auto;
}

.pb-community-hero {
  text-align: center;
  padding: 24px 20px;
  margin-bottom: 20px;
}

.pb-community-hero h2 {
  font-family: var(--pb-font-display);
  font-size: 32px;
  font-weight: 900;
  margin-bottom: 6px;
}

.pb-community-hero p {
  color: #94a3b8;
}

.pb-feed-tabs {
  display: flex;
  gap: 12px;
  margin-bottom: 18px;
}

.pb-feed-tab {
  background: rgba(255, 255, 255, 0.06);
  border: none;
  color: #94a3b8;
  padding: 7px 16px;
  border-radius: var(--pb-radius-full);
  font-weight: 700;
  cursor: pointer;
}

.pb-feed-tab.active {
  background: var(--pb-primary);
  color: #ffffff;
}

.pb-feed-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}

/* ================= TAB 5: MIN SIDA ================= */
.pb-profile-container {
  max-width: 1000px;
  margin: 0 auto;
}

.pb-profile-card {
  background: #131d3b;
  border-radius: var(--pb-radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 30px;
  display: flex;
  align-items: center;
  gap: 28px;
  margin-bottom: 28px;
}

.pb-profile-avatar-wrap {
  position: relative;
  width: 100px;
  height: 100px;
  flex-shrink: 0;
}

.pb-profile-large-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--pb-primary);
}

.pb-profile-online-badge {
  position: absolute;
  bottom: 4px;
  right: 4px;
  width: 16px;
  height: 16px;
  background: #22c55e;
  border: 3px solid #131d3b;
  border-radius: 50%;
}

.pb-profile-tag {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #facc15;
  margin-bottom: 4px;
}

.pb-profile-name {
  font-family: var(--pb-font-display);
  font-size: 30px;
  font-weight: 900;
  color: #ffffff;
}

.pb-profile-handle {
  font-size: 14px;
  color: #94a3b8;
  margin-bottom: 16px;
}

.pb-profile-stats {
  display: flex;
  gap: 20px;
}

.pb-stat-box {
  display: flex;
  flex-direction: column;
}

.pb-stat-num {
  font-family: var(--pb-font-display);
  font-size: 22px;
  font-weight: 800;
  color: #ffffff;
}

.pb-stat-lbl {
  font-size: 11.5px;
  color: #64748b;
}

.pb-trophy-row {
  display: flex;
  gap: 14px;
  margin-top: 12px;
}

.pb-trophy {
  background: #131d3b;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--pb-radius-md);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.pb-trophy-icon {
  font-size: 26px;
}

.pb-trophy-name {
  font-weight: 700;
  color: #ffffff;
}

/* ================= RESPONSIVE ================= */
@media (max-width: 1280px) {
  .pb-hero-grid {
    grid-template-columns: 1fr;
    height: auto;
  }
  .pb-hero-featured {
    height: 320px;
  }
  .pb-hero-full-card {
    height: 280px;
  }
  .pb-grid-mina {
    grid-template-columns: repeat(2, 1fr);
  }
  .pb-grid-popular {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .pb-header {
    padding: 0 16px;
  }
  .pb-main-content {
    padding: 14px 16px 76px 16px;
  }
  .pb-nav {
    display: none;
  }
  .pb-grid-mina {
    grid-template-columns: 1fr;
  }
  .pb-grid-popular {
    grid-template-columns: repeat(2, 1fr);
  }
  .pb-profile-card {
    flex-direction: column;
    text-align: center;
  }
  .pb-profile-stats {
    justify-content: center;
  }
}
