/* ==========================================================================
   PLAYSPACE - TELEBOTHOST INSPIRED DESIGN SYSTEM
   ========================================================================== */

:root {
  --tbh-bg: #F7F9FC;
  --tbh-text-main: #0F172A;
  --tbh-text-muted: #475569;
  --tbh-text-subtle: #64748b;

  --tbh-border: rgba(226, 232, 240, 0.8);
  --tbh-border-hover: rgba(203, 213, 225, 1);

  --tbh-dark: #020617;
  --tbh-dark-hover: #0f172a;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-serif: 'Lora', Georgia, serif;
  --font-hand: 'Caveat', cursive;

  --radius-pill: 9999px;
  --radius-card: 20px;
  --radius-sm: 12px;
}

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

html, body {
  width: 100%;
  min-height: 100vh;
  background-color: var(--tbh-bg);
  color: var(--tbh-text-main);
  font-family: var(--font-sans);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.font-serif {
  font-family: var(--font-serif);
}

.font-hand {
  font-family: var(--font-hand);
  color: #4f46e5;
  font-size: 1.35em;
  font-weight: 700;
  display: inline-block;
  transform: rotate(-2deg);
}

/* --------------------------------------------------------------------------
   Floating Header Navbar (TeleBotHost Pill Header)
   -------------------------------------------------------------------------- */
.site-header-wrapper {
  position: fixed;
  top: 16px;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  justify-content: center;
  padding: 0 16px;
  pointer-events: none;
}

.site-header {
  pointer-events: auto;
  width: 100%;
  max-width: 880px;
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--tbh-border);
  border-radius: var(--radius-pill);
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.04);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-shrink: 0;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--tbh-text-main);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.3px;
  white-space: nowrap;
}

.logo-icon {
  width: 32px;
  height: 32px;
  background: var(--tbh-dark);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
}

.nav-link {
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--tbh-text-muted);
  white-space: nowrap;
  transition: color 0.2s ease;
}

.nav-link:hover, .nav-link.active {
  color: var(--tbh-text-main);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* TeleBotHost Button Styles */
.tbh-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.tbh-btn-dark {
  background: var(--tbh-dark);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(2, 6, 23, 0.15);
}

.tbh-btn-dark:hover {
  background: var(--tbh-dark-hover);
  transform: translateY(-1px);
}

.tbh-btn-outline {
  background: rgba(255, 255, 255, 0.6);
  border-color: rgba(226, 232, 240, 0.8);
  color: var(--tbh-text-main);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.tbh-btn-outline:hover {
  background: #ffffff;
  border-color: var(--tbh-border-hover);
  transform: translateY(-1px);
}

.tbh-btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  justify-content: center;
  background: rgba(255, 255, 255, 0.6);
  border-color: rgba(226, 232, 240, 0.8);
  color: var(--tbh-text-muted);
}

.tbh-btn-icon:hover {
  background: #ffffff;
  color: var(--tbh-text-main);
}

/* --------------------------------------------------------------------------
   Hero Section
   -------------------------------------------------------------------------- */
.tbh-hero {
  padding-top: 130px;
  padding-bottom: 50px;
  text-align: center;
}

.hero-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 20px;
}

.pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--tbh-border);
  border-radius: var(--radius-pill);
  color: var(--tbh-text-muted);
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.badge-dot {
  width: 7px;
  height: 7px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 8px #10b981;
}

.hero-title {
  font-family: var(--font-sans);
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 800;
  line-height: 1.15;
  color: var(--tbh-text-main);
  margin-bottom: 18px;
  letter-spacing: -1px;
}

.hero-description {
  font-size: 17px;
  color: var(--tbh-text-muted);
  line-height: 1.65;
  max-width: 640px;
  margin: 0 auto 36px;
}

.hero-metrics-bar {
  display: inline-flex;
  align-items: center;
  gap: 24px;
  padding: 12px 28px;
  background: #ffffff;
  border: 1px solid var(--tbh-border);
  border-radius: var(--radius-pill);
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.03);
}

.metric-pill {
  display: flex;
  align-items: center;
  gap: 8px;
}

.metric-num {
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 700;
  color: var(--tbh-text-main);
}

.metric-name {
  font-size: 12.5px;
  color: var(--tbh-text-muted);
  font-weight: 500;
}

.metric-sep {
  width: 1px;
  height: 18px;
  background: var(--tbh-border);
}

/* --------------------------------------------------------------------------
   Toolbar & Search
   -------------------------------------------------------------------------- */
.tbh-toolbar-section {
  margin-bottom: 32px;
}

.tbh-container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
}

.toolbar-flex {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.search-input-wrapper {
  position: relative;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--tbh-text-subtle);
  font-size: 15px;
}

#search-input {
  width: 100%;
  padding: 14px 20px 14px 48px;
  background: #ffffff;
  border: 1px solid var(--tbh-border);
  border-radius: var(--radius-card);
  color: var(--tbh-text-main);
  font-family: var(--font-sans);
  font-size: 14.5px;
  outline: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  transition: all 0.2s ease;
}

#search-input:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.category-tabs {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 2px;
  -webkit-overflow-scrolling: touch;
}

.tab-pill {
  padding: 9px 20px;
  border-radius: var(--radius-pill);
  background: #ffffff;
  border: 1px solid var(--tbh-border);
  color: var(--tbh-text-muted);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  transition: all 0.2s ease;
}

.tab-pill:hover {
  border-color: var(--tbh-border-hover);
  color: var(--tbh-text-main);
}

.tab-pill.active {
  background: var(--tbh-dark);
  color: #ffffff;
  border-color: var(--tbh-dark);
  box-shadow: 0 2px 8px rgba(2, 6, 23, 0.15);
}

/* --------------------------------------------------------------------------
   Cards Grid
   -------------------------------------------------------------------------- */
.tbh-main-section {
  margin-bottom: 60px;
}

.tbh-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
}

/* TeleBotHost Clean Card */
.tbh-card {
  position: relative;
  background: #ffffff;
  border: 1px solid var(--tbh-border);
  border-radius: var(--radius-card);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.tbh-card:hover {
  transform: translateY(-4px);
  border-color: rgba(203, 213, 225, 1);
  box-shadow: 0 12px 28px -6px rgba(15, 23, 42, 0.08);
}

/* Decorative Blur Glow inside Card */
.card-blur-glow {
  position: absolute;
  bottom: -40px;
  right: -40px;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  filter: blur(35px);
  opacity: 0.25;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.tbh-card:hover .card-blur-glow {
  opacity: 0.45;
}

.card-top-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 18px;
}

/* Clean Vector Icon Container */
.icon-squircle {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

.tbh-card:hover .icon-squircle {
  transform: scale(1.1);
}

/* Color Schemes */
.icon-blue { background: #eff6ff; color: #2563eb; }
.glow-blue { background: #3b82f6; }

.icon-emerald { background: #ecfdf5; color: #10b981; }
.glow-emerald { background: #10b981; }

.icon-amber { background: #fffbeb; color: #d97706; }
.glow-amber { background: #f59e0b; }

.icon-rose { background: #fff1f2; color: #f43f5e; }
.glow-rose { background: #f43f5e; }

.icon-indigo { background: #eef2ff; color: #6366f1; }
.glow-indigo { background: #6366f1; }

.fav-icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #f8fafc;
  border: 1px solid var(--tbh-border);
  color: var(--tbh-text-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
  cursor: pointer;
  transition: all 0.2s ease;
}

.fav-icon-btn:hover, .fav-icon-btn.active {
  color: #e11d48;
  border-color: #fecdd3;
  background: #fff1f2;
}

.card-title {
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 600;
  color: var(--tbh-text-main);
  margin-bottom: 8px;
  line-height: 1.3;
}

.card-description {
  font-size: 13.5px;
  color: var(--tbh-text-muted);
  line-height: 1.6;
  margin-bottom: 20px;
  flex: 1;
}

.card-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--tbh-border);
  padding-top: 16px;
}

.category-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: #f1f5f9;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  color: var(--tbh-text-muted);
  white-space: nowrap;
}

.play-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--tbh-dark);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-pill);
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tbh-card:hover .play-action-btn {
  background: #1e293b;
  transform: scale(1.04);
}

/* --------------------------------------------------------------------------
   Full Screen Player Modal
   -------------------------------------------------------------------------- */
.game-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.game-modal.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
}

.modal-box {
  position: relative;
  width: 94vw;
  height: 90vh;
  max-width: 1380px;
  background: #ffffff;
  border: 1px solid var(--tbh-border);
  border-radius: var(--radius-card);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 1001;
  transform: scale(0.97);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.game-modal.active .modal-box {
  transform: scale(1);
}

.modal-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: #ffffff;
  border-bottom: 1px solid var(--tbh-border);
  gap: 12px;
}

.modal-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.modal-icon-badge {
  width: 36px;
  height: 36px;
  background: #f1f5f9;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--tbh-dark);
  flex-shrink: 0;
}

.modal-heading {
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 600;
  color: var(--tbh-text-main);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.modal-subheading {
  font-size: 12px;
  color: var(--tbh-text-muted);
  white-space: nowrap;
}

.modal-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.modal-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: #f8fafc;
  border: 1px solid var(--tbh-border);
  border-radius: var(--radius-pill);
  color: var(--tbh-text-main);
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  transition: all 0.2s ease;
}

.modal-btn:hover {
  background: #ffffff;
  border-color: var(--tbh-border-hover);
}

.modal-close-btn {
  background: #fff1f2;
  border-color: #fecdd3;
  color: #e11d48;
}

.modal-close-btn:hover {
  background: #e11d48;
  color: #ffffff;
}

/* Modal Frame & Fullscreen Floating Quit Button */
.modal-frame-wrapper {
  position: relative;
  flex: 1;
  width: 100%;
  height: 100%;
  background: #000;
}

#game-frame {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* Floating Quit Button */
.floating-quit-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 99999;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  background: rgba(2, 6, 23, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-pill);
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 12.5px;
  letter-spacing: 0.5px;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
  transition: all 0.2s ease;
}

.floating-quit-btn:hover {
  background: #e11d48;
  border-color: #e11d48;
  transform: scale(1.05);
}

.modal-preloader {
  position: absolute;
  inset: 0;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  z-index: 10;
  transition: opacity 0.3s ease;
}

.preloader-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(2, 6, 23, 0.1);
  border-top-color: var(--tbh-dark);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

#preloader-msg {
  font-family: var(--font-serif);
  font-size: 14px;
  color: var(--tbh-text-muted);
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.tbh-footer {
  border-top: 1px solid var(--tbh-border);
  padding: 24px 0;
  background: #ffffff;
}

.footer-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--tbh-text-muted);
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-logo {
  font-family: var(--font-serif);
  font-weight: 700;
  color: var(--tbh-text-main);
}

/* Responsive Alignment Fixes */
@media (max-width: 768px) {
  .site-header {
    padding: 8px 14px;
  }

  .nav-links {
    display: none;
  }

  .tbh-btn span {
    display: none;
  }

  .tbh-btn {
    padding: 8px 12px;
  }

  .tbh-cards-grid {
    grid-template-columns: 1fr;
  }

  .footer-flex {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }

  .floating-quit-btn span {
    display: none;
  }

  .floating-quit-btn {
    padding: 8px 12px;
  }

  .modal-btn span {
    display: none;
  }
}
