/* ========================================================
   TD GAMES HUB - STYLESHEET
   Cyberpunk / Dark Neon Purple Gamer Theme
   ======================================================== */

:root {
  --bg-dark: #0a0614;
  --bg-card: rgba(22, 14, 38, 0.88);
  --bg-card-hover: rgba(38, 24, 68, 0.95);
  --neon-purple: #9d4edd;
  --neon-purple-glow: rgba(157, 78, 221, 0.45);
  --neon-violet: #7b2cbf;
  --neon-magenta: #e0aaff;
  --neon-cyan: #00f0ff;
  --neon-cyan-glow: rgba(0, 240, 255, 0.35);
  --neon-pink: #ff007f;
  --text-primary: #ffffff;
  --text-secondary: #c8b6ff;
  --text-muted: #7b7294;
  --border-glow: rgba(157, 78, 221, 0.35);
  --font-gamer: 'Orbitron', 'Rajdhani', sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  padding: 0;
  background-color: var(--bg-dark);
  color: var(--text-primary);
  font-family: var(--font-body);
  overflow-x: hidden;
  background-image: radial-gradient(circle at 50% 20%, #240046 0%, #0a0614 75%);
}

/* Mobile First Responsive Viewport */
.app-viewport {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  position: relative;
  background-color: #0c0817;
  display: flex;
  flex-direction: column;
}

@media (min-width: 600px) {
  body.gamer-theme {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
  }
  .app-viewport {
    max-width: 480px;
    height: 94vh;
    border-radius: 16px;
    border: 1px solid rgba(157, 78, 221, 0.4);
    box-shadow: 0 0 50px rgba(112, 0, 255, 0.3);
  }
}

/* Screen Switcher */
.screen {
  display: none;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  flex-direction: column;
  position: relative;
}

.screen.active {
  display: flex;
}

/* Typography & Glows */
.glow-text {
  font-family: var(--font-gamer);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #ffffff;
  text-shadow: 0 0 10px #c77dff, 0 0 20px #7b2cbf, 0 0 30px #5a189a;
}

.glow-pulse {
  animation: logoPulse 3s infinite ease-in-out;
}

@keyframes logoPulse {
  0%, 100% {
    filter: drop-shadow(0 0 15px rgba(157, 78, 221, 0.6)) drop-shadow(0 0 35px rgba(123, 44, 191, 0.4));
  }
  50% {
    filter: drop-shadow(0 0 25px rgba(224, 170, 255, 0.8)) drop-shadow(0 0 50px rgba(157, 78, 221, 0.6));
  }
}

/* ========================================================
   SCREEN 1: LOGIN & WELCOME
   ======================================================== */
#screen-login {
  background-image: url('assets/background.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  justify-content: center;
  align-items: center;
  position: relative;
}

.login-bg-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10, 6, 20, 0.65) 0%, rgba(20, 10, 36, 0.85) 60%, rgba(10, 6, 20, 0.95) 100%);
  backdrop-filter: blur(2px);
}

.login-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 30px 24px;
  width: 100%;
}

.logo-wrapper {
  margin-bottom: 18px;
}

.main-logo {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  border: 3px solid #b5179e;
  object-fit: cover;
  background-color: #000;
}

.gaming-title {
  font-size: 26px;
  margin-bottom: 24px;
  color: #ffffff;
}

.promo-badge-box {
  background: rgba(22, 14, 42, 0.75);
  border: 1px solid rgba(157, 78, 221, 0.5);
  border-radius: 14px;
  padding: 16px 20px;
  margin-bottom: 32px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), inset 0 0 15px rgba(157, 78, 221, 0.2);
  backdrop-filter: blur(10px);
  width: 100%;
  max-width: 380px;
}

.promo-text-primary {
  font-size: 15px;
  font-weight: 600;
  color: #f1f1f1;
  margin-bottom: 6px;
}

.promo-text-secondary {
  font-size: 14px;
  color: var(--text-secondary);
}

.highlight-games {
  color: #ff007f;
  font-weight: 700;
  text-shadow: 0 0 8px rgba(255, 0, 127, 0.6);
}

.auth-buttons-container {
  width: 100%;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background-color: #1a73e8;
  color: #ffffff;
  border: none;
  border-radius: 30px;
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(26, 115, 232, 0.45);
  transition: transform 0.2s, box-shadow 0.2s, background-color 0.2s;
  text-transform: capitalize;
}

.btn-google:hover {
  background-color: #1558b0;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(26, 115, 232, 0.6);
}

.btn-google:active {
  transform: translateY(0);
}

.btn-guest {
  background: rgba(255, 255, 255, 0.08);
  color: #e0aaff;
  border: 1px solid rgba(224, 170, 255, 0.35);
  border-radius: 30px;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-guest:hover {
  background: rgba(224, 170, 255, 0.18);
  border-color: #e0aaff;
}

.monetize-badge-hint {
  margin-top: 26px;
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

/* ========================================================
   HEADER STYLES
   ======================================================== */
.app-header {
  height: 60px;
  min-height: 60px;
  background: linear-gradient(180deg, #180d2c 0%, rgba(18, 10, 32, 0.95) 100%);
  border-bottom: 1px solid rgba(157, 78, 221, 0.35);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  position: relative;
  z-index: 20;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.header-left, .header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 80px;
}

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

.mini-logo {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid #c77dff;
}

.header-brand {
  font-family: var(--font-gamer);
  font-size: 13px;
  font-weight: 800;
  color: #e0aaff;
}

.header-title {
  font-size: 18px;
  text-align: center;
  letter-spacing: 1px;
}

.back-nav-btn {
  background: rgba(157, 78, 221, 0.2);
  border: 1px solid rgba(157, 78, 221, 0.5);
  color: #fff;
  border-radius: 8px;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-gamer);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.back-nav-btn:hover {
  background: rgba(157, 78, 221, 0.4);
}

.action-btn-pill {
  background: rgba(157, 78, 221, 0.25);
  border: 1px solid #c77dff;
  color: #fff;
  border-radius: 20px;
  padding: 6px 12px;
  font-family: var(--font-gamer);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s;
}

.action-btn-pill.highlight {
  background: linear-gradient(135deg, #7b2cbf, #ff007f);
  border-color: #ff007f;
  box-shadow: 0 0 10px rgba(255, 0, 127, 0.5);
}

.action-btn-pill:hover {
  transform: scale(1.04);
}

.user-chip {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7b2cbf, #ff007f);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  border: 1px solid rgba(255, 255, 255, 0.5);
}

/* ========================================================
   SCREEN 2: CATEGORIES (3 COLUMNS GRID)
   ======================================================== */
.search-category-bar, .hub-controls {
  padding: 12px 16px;
  background: rgba(15, 9, 26, 0.8);
  border-bottom: 1px solid rgba(157, 78, 221, 0.2);
}

.input-icon-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 14px;
  font-size: 14px;
  color: var(--text-muted);
}

.input-icon-wrapper input {
  width: 100%;
  background: rgba(30, 18, 50, 0.6);
  border: 1px solid rgba(157, 78, 221, 0.4);
  border-radius: 20px;
  padding: 10px 14px 10px 38px;
  color: #fff;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input-icon-wrapper input:focus {
  border-color: #c77dff;
  box-shadow: 0 0 10px rgba(199, 125, 255, 0.3);
}

.categories-scroll-wrapper {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.category-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glow);
  border-radius: 10px;
  padding: 12px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.category-card:hover, .category-card:active {
  transform: translateY(-2px);
  background: var(--bg-card-hover);
  border-color: #c77dff;
  box-shadow: 0 4px 15px rgba(157, 78, 221, 0.4);
}

.category-card.card-all {
  border-color: #ff007f;
  background: rgba(45, 12, 50, 0.9);
}

.cat-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: rgba(123, 44, 191, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 6px;
  border: 1px solid rgba(157, 78, 221, 0.3);
}

.cat-name {
  font-family: var(--font-gamer);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  color: #f1f1f1;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cat-count {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 3px;
}

/* ========================================================
   SCREEN 3: GAMES HUB / LIST
   ======================================================== */
.quick-category-pills {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 8px 16px;
  background: rgba(15, 9, 26, 0.6);
  scrollbar-width: none;
}
.quick-category-pills::-webkit-scrollbar {
  display: none;
}

.pill-item {
  white-space: nowrap;
  background: rgba(30, 18, 50, 0.8);
  border: 1px solid rgba(157, 78, 221, 0.3);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s;
}

.pill-item.active {
  background: linear-gradient(135deg, #7b2cbf, #b5179e);
  color: #fff;
  border-color: #e0aaff;
  box-shadow: 0 0 10px rgba(181, 23, 158, 0.5);
}

.games-scroll-wrapper {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
}

.hub-results-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 12px;
  color: var(--text-muted);
}

.ad-ready-tag {
  color: #10b981;
  font-weight: 600;
  font-size: 11px;
  background: rgba(16, 185, 129, 0.1);
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

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

.game-card:hover {
  transform: translateY(-3px);
  border-color: #c77dff;
  box-shadow: 0 8px 24px rgba(123, 44, 191, 0.45);
}

.game-thumb-box {
  width: 100%;
  aspect-ratio: 16 / 10;
  background: #150d26;
  position: relative;
  overflow: hidden;
}

.game-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.game-card:hover .game-thumb-img {
  transform: scale(1.06);
}

.card-play-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
}

.game-card:hover .card-play-overlay {
  opacity: 1;
}

.play-bubble {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff007f, #7b2cbf);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 18px;
  box-shadow: 0 0 15px rgba(255, 0, 127, 0.8);
}

.game-info-box {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.game-title {
  font-family: var(--font-gamer);
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.game-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--text-muted);
}

.game-cat-tag {
  color: #c8b6ff;
  background: rgba(157, 78, 221, 0.2);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
}

/* ========================================================
   SCREEN 4: GAME PLAYER (HALF SCREEN & FULLSCREEN)
   ======================================================== */
.player-layout {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  position: relative;
}

.game-half-screen-box {
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 220px;
  max-height: 52vh;
  background-color: #000;
  position: relative;
  border-bottom: 2px solid #9d4edd;
  box-shadow: 0 4px 25px rgba(157, 78, 221, 0.4);
}

@media (orientation: landscape) {
  .game-half-screen-box {
    aspect-ratio: auto;
    height: 55vh;
    min-height: 200px;
  }
}

.game-half-screen-box.is-fullscreen {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 99999 !important;
  max-height: none !important;
  border: none !important;
}

.game-loading-spinner {
  position: absolute;
  inset: 0;
  background: #0d0818;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--text-secondary);
  font-size: 13px;
  z-index: 5;
  transition: opacity 0.3s;
}

.spinner-ring {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(157, 78, 221, 0.3);
  border-top-color: #ff007f;
  border-radius: 50%;
  animation: spin 1s infinite linear;
}

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

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

.game-floating-bar {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 6px;
  z-index: 10;
  background: rgba(10, 6, 20, 0.7);
  padding: 4px;
  border-radius: 20px;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(157, 78, 221, 0.4);
}

.game-mini-btn {
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s, transform 0.2s;
}

.game-mini-btn:hover {
  background: rgba(157, 78, 221, 0.6);
  transform: scale(1.1);
}

.game-started-bottom-section {
  flex: 1;
  background-image: url('assets/background.png');
  background-size: cover;
  background-position: center;
  position: relative;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.bottom-bg-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(12, 8, 24, 0.85) 0%, rgba(20, 10, 36, 0.95) 100%);
  backdrop-filter: blur(4px);
}

.started-banner-wrap {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 6px 0;
}

.game-started-title {
  font-size: 22px;
  letter-spacing: 1.5px;
  color: #fff;
  text-shadow: 0 0 10px #ff007f, 0 0 25px #9d4edd;
}

.active-game-meta-card {
  position: relative;
  z-index: 2;
  background: var(--bg-card);
  border: 1px solid var(--border-glow);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}

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

.meta-game-title {
  font-family: var(--font-gamer);
  font-size: 18px;
  color: #fff;
  margin-bottom: 6px;
}

.meta-tags-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tag-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(157, 78, 221, 0.25);
  border: 1px solid rgba(157, 78, 221, 0.5);
  color: #e0aaff;
}

.tag-badge.rating {
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.4);
}

.tag-badge.plays {
  color: #ff007f;
  border-color: rgba(255, 0, 127, 0.4);
}

.btn-fav-large {
  background: rgba(255, 0, 127, 0.15);
  border: 1px solid #ff007f;
  color: #fff;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-fav-large.favorited {
  background: #ff007f;
  box-shadow: 0 0 12px rgba(255, 0, 127, 0.8);
}

.meta-game-desc {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
}

/* Related Games Bar */
.related-games-bar {
  position: relative;
  z-index: 2;
}

.related-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #c8b6ff;
}

.btn-link {
  background: none;
  border: none;
  color: #00f0ff;
  font-size: 12px;
  cursor: pointer;
}

.related-slider {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: none;
}
.related-slider::-webkit-scrollbar {
  display: none;
}

.mini-game-card {
  min-width: 110px;
  max-width: 110px;
  background: var(--bg-card);
  border: 1px solid var(--border-glow);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s;
}

.mini-game-card:hover {
  transform: translateY(-2px);
  border-color: #c77dff;
}

.mini-thumb {
  width: 100%;
  height: 65px;
  object-fit: cover;
}

.mini-title {
  padding: 4px 6px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #fff;
}

/* Toast */
.app-toast {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(50px);
  background: #ff007f;
  color: #fff;
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(255, 0, 127, 0.6);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s, opacity 0.3s;
  z-index: 2000;
}

.app-toast.visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}


.header-google-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(30, 18, 51, 0.95);
  border: 1px solid #9d4edd;
  color: #ffffff;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 0 10px rgba(157, 78, 221, 0.35);
}

.header-google-btn:hover {
  background: #7b2cbf;
  box-shadow: 0 0 15px rgba(224, 170, 255, 0.5);
  transform: scale(1.03);
}

.game-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background-color: #120a22;
}

/* ========================================================
   V7.0 UPDATES: LOGIN BG, COINS, PROGRESS, BOTTOM NAV,
   LEADERBOARD, ACCOUNT, PROFILE EDIT, REFER, & ROTATE FIX
   ======================================================== */

.login-bg-overlay,
.subscreen-bg-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(12, 8, 23, 0.72) 0%, rgba(12, 8, 23, 0.92) 100%),
              url('assets/background.png') center/cover no-repeat;
  z-index: 0;
  pointer-events: none;
}

.powered-by-footer {
  margin-top: 22px;
  font-size: 12px;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
  opacity: 0.9;
}

/* Header Coin Pill */
.coin-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(25, 16, 48, 0.95);
  border: 1px solid rgba(255, 215, 0, 0.55);
  color: #ffd700;
  padding: 5px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.2);
  white-space: nowrap;
}

.user-chip {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #9d4edd, #ff007f);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  color: #fff;
  cursor: pointer;
  overflow: hidden;
  border: 1.5px solid rgba(224, 170, 255, 0.7);
  flex-shrink: 0;
}

.user-chip img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Task Progress Bar (0% -> 100% -> Claim 1000) */
.task-progress-bar-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: rgba(18, 11, 34, 0.9);
  border-bottom: 1px solid rgba(157, 78, 221, 0.25);
}

.task-star-icon {
  font-size: 15px;
  color: #ffd700;
  flex-shrink: 0;
}

.task-segments {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 3px;
  height: 12px;
  background: #0a0614;
  padding: 2px;
  border-radius: 6px;
  border: 1px solid rgba(157, 78, 221, 0.4);
}

.task-segment {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  transition: background 0.3s ease;
}

.task-segment.filled {
  background: linear-gradient(180deg, #ffffff, #00f0ff);
  box-shadow: 0 0 6px rgba(0, 240, 255, 0.6);
}

.task-pct-label {
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  min-width: 34px;
  text-align: right;
}

.task-show-more-btn {
  background: #1a1130;
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #e0aaff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 12px;
  cursor: pointer;
  white-space: nowrap;
}

.task-show-more-btn.claim-ready {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #fff;
  border-color: #fde047;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.6);
  animation: pulseBtn 1.4s infinite;
}

@keyframes pulseBtn {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

/* Bottom Floating 3-Button Navigation Bar */
.games-scroll-wrapper.with-bottom-nav {
  padding-bottom: 84px;
}

.bottom-floating-nav {
  position: fixed;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 28px);
  max-width: 420px;
  height: 58px;
  background: linear-gradient(135deg, rgba(88, 28, 135, 0.65), rgba(30, 18, 56, 0.85));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(224, 170, 255, 0.35);
  border-radius: 30px;
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 40;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
}

.bottom-nav-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-icon-circle {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  transition: all 0.2s ease;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.bottom-nav-btn.active .nav-icon-circle {
  background: #ffffff;
  color: #1e1238;
  box-shadow: 0 0 18px rgba(255, 255, 255, 0.65);
  transform: translateY(-2px);
}

/* Fix Player Header Overlap (Page 14 of Read.pdf) */
.player-app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px !important;
}

.player-header-left,
.player-header-right {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.player-header-center {
  flex: 1;
  min-width: 0;
  text-align: center;
}

.player-title-truncate {
  display: block;
  font-family: var(--font-gamer);
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.compact-btn {
  font-size: 11px !important;
  padding: 5px 9px !important;
  white-space: nowrap;
}

/* Pure CSS Horizontal/Vertical Rotation (No Restart, No Chrome Toast!) */
.game-half-screen-box.is-landscape-rotated {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  width: 100vh !important;
  width: 100dvh !important;
  height: 100vw !important;
  max-height: none !important;
  aspect-ratio: auto !important;
  transform: translate(-50%, -50%) rotate(90deg) !important;
  z-index: 99999 !important;
  border: none !important;
  background: #000 !important;
}

.play-reward-pill {
  display: inline-block;
  margin-top: 6px;
  font-size: 11px;
  font-weight: 700;
  color: #00f0ff;
  background: rgba(0, 240, 255, 0.1);
  border: 1px solid rgba(0, 240, 255, 0.35);
  padding: 3px 10px;
  border-radius: 12px;
}

/* Leaderboard Screen */
.leaderboard-scroll-wrapper {
  flex: 1;
  overflow-y: auto;
  padding: 14px 14px 20px;
  position: relative;
  z-index: 1;
}

.lb-podium {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 12px;
  margin: 10px 0 20px;
  padding-top: 14px;
}

.lb-podium-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 30%;
}

.lb-podium-item.rank-1 {
  transform: translateY(-10px);
}

.lb-crown {
  font-size: 22px;
  margin-bottom: -4px;
}

.lb-rank-num {
  font-size: 12px;
  font-weight: 800;
  color: var(--neon-cyan);
  margin-bottom: 4px;
}

.lb-podium-avatar {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 2.5px solid #c8b6ff;
  background: rgba(123, 44, 191, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 6px;
}

.lb-podium-item.rank-1 .lb-podium-avatar {
  width: 68px;
  height: 68px;
  border-color: #ffd700;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.lb-podium-avatar img,
.lb-row-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lb-podium-name {
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lb-podium-coins {
  font-size: 11px;
  font-weight: 800;
  color: #ffd700;
}

.lb-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lb-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(68, 24, 118, 0.65);
  border: 1px solid rgba(157, 78, 221, 0.45);
  border-radius: 14px;
  padding: 8px 12px;
}

.lb-row.is-me {
  border-color: #00f0ff;
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.35);
}

.lb-row-rank {
  font-size: 13px;
  font-weight: 800;
  color: #e0aaff;
  min-width: 22px;
}

.lb-row-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #7b2cbf;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}

.lb-row-name {
  flex: 1;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lb-row-coins {
  background: rgba(157, 78, 221, 0.45);
  padding: 4px 10px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 800;
  color: #ffd700;
}

.lb-footer-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: rgba(12, 8, 23, 0.95);
  border-top: 1px solid rgba(157, 78, 221, 0.35);
  position: relative;
  z-index: 2;
}

.lb-total-users {
  font-size: 12px;
  font-weight: 700;
  color: #c8b6ff;
}

.lb-total-users span {
  color: #00f0ff;
}

.lb-show-more-btn {
  background: #1a1130;
  border: 1px solid #9d4edd;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 6px 14px;
  border-radius: 14px;
  cursor: pointer;
}

/* Account Menu Screen */
.account-menu-content {
  position: relative;
  z-index: 1;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px 20px;
}

.account-avatar-large {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  border: 3px solid #e0aaff;
  background: linear-gradient(135deg, #7b2cbf, #ff007f);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-size: 36px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 10px;
  box-shadow: 0 0 25px rgba(157, 78, 221, 0.5);
}

.account-avatar-large img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.account-user-title {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 4px;
}

.account-coin-badge {
  font-size: 13px;
  font-weight: 700;
  color: #ffd700;
  background: rgba(25, 16, 48, 0.85);
  padding: 4px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 215, 0, 0.4);
  margin-bottom: 22px;
}

.account-buttons-stack {
  width: 100%;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.account-pill-btn {
  display: block;
  width: 100%;
  text-align: center;
  text-decoration: none;
  background: linear-gradient(135deg, #1d4ed8, #2563eb);
  color: #fff;
  border: none;
  border-radius: 26px;
  padding: 13px 16px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.account-pill-btn.accent {
  background: linear-gradient(135deg, #7b2cbf, #ff007f);
}

.account-pill-btn.daily {
  background: linear-gradient(135deg, #059669, #10b981);
}

.account-done-btn {
  margin-top: 8px;
  align-self: center;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  border: none;
  border-radius: 24px;
  padding: 10px 36px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}

/* Edit Profile Screen */
.profile-edit-content {
  position: relative;
  z-index: 1;
  flex: 1;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.upload-photo-box {
  width: 148px;
  height: 148px;
  background: rgba(255, 255, 255, 0.95);
  border: 3px solid #9d4edd;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  position: relative;
  color: #1e1238;
}

.upload-photo-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.upload-cloud-icon {
  font-size: 40px;
}

.upload-label-text {
  font-size: 13px;
  font-weight: 800;
  color: #1e1238;
}

.profile-field-group {
  width: 100%;
  max-width: 340px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(22, 14, 38, 0.9);
  border: 1px solid #9d4edd;
  border-radius: 14px;
  padding: 10px 14px;
}

.profile-field-group label {
  font-size: 14px;
  font-weight: 700;
  color: #e0aaff;
  white-space: nowrap;
}

.profile-field-group input {
  flex: 1;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 14px;
  outline: none;
}

.legal-consent-box {
  width: 100%;
  max-width: 340px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 11px;
  color: #c8b6ff;
  line-height: 1.4;
  background: rgba(18, 11, 34, 0.85);
  padding: 10px;
  border-radius: 10px;
  border: 1px solid rgba(157, 78, 221, 0.3);
}

.profile-save-btn {
  background: #93c5fd;
  color: #0f172a;
  border: none;
  border-radius: 16px;
  padding: 10px 34px;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
}

/* Refer & Earn Screen */
.refer-content {
  position: relative;
  z-index: 1;
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.refer-hero-card {
  background: linear-gradient(135deg, rgba(123, 44, 191, 0.5), rgba(255, 0, 127, 0.3));
  border: 1px solid rgba(224, 170, 255, 0.45);
  border-radius: 18px;
  padding: 20px;
  text-align: center;
}

.refer-big-emoji {
  font-size: 42px;
  margin-bottom: 6px;
}

.refer-hero-card h3 {
  font-size: 17px;
  color: #fff;
  margin-bottom: 6px;
}

.refer-hero-card p {
  font-size: 13px;
  color: #e0aaff;
  line-height: 1.4;
}

.refer-stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.refer-stat-box {
  background: rgba(22, 14, 38, 0.9);
  border: 1px solid rgba(157, 78, 221, 0.4);
  border-radius: 14px;
  padding: 14px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.refer-stat-box .stat-val {
  font-size: 22px;
  font-weight: 800;
  color: #00f0ff;
}

.refer-stat-box .stat-lbl {
  font-size: 11px;
  color: #c8b6ff;
}

.refer-link-box,
.refer-apply-box {
  background: rgba(22, 14, 38, 0.9);
  border: 1px solid rgba(157, 78, 221, 0.35);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.refer-link-box label,
.refer-apply-box label {
  font-size: 12px;
  font-weight: 700;
  color: #e0aaff;
}

.refer-link-box input,
.refer-apply-row input {
  width: 100%;
  background: #0a0614;
  border: 1px solid #7b2cbf;
  color: #fff;
  border-radius: 8px;
  padding: 9px 10px;
  font-size: 12px;
  outline: none;
}

.refer-action-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.btn-refer-copy {
  background: #7b2cbf;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.btn-refer-wa {
  background: #10b981;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.refer-apply-row {
  display: flex;
  gap: 8px;
}

.refer-apply-row button {
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0 16px;
  font-weight: 700;
  cursor: pointer;
}

/* Task Guide Modal */
.app-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 18px;
}

.app-modal-card {
  background: #160e26;
  border: 1.5px solid #9d4edd;
  border-radius: 18px;
  padding: 22px;
  max-width: 380px;
  width: 100%;
  box-shadow: 0 0 35px rgba(157, 78, 221, 0.5);
}

.app-modal-card h3 {
  font-size: 17px;
  color: #00f0ff;
  margin-bottom: 12px;
  text-align: center;
}

.task-guide-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 12.5px;
  color: #e2d9f3;
  line-height: 1.45;
}


/* V8.0 Fixes: Compact Recommended Cards & Legal Footer */
.mini-game-card {
  flex-shrink: 0;
}

.mini-game-card img,
.mini-thumb {
  width: 100%;
  height: 65px;
  object-fit: cover;
  display: block;
}

.mini-game-card p,
.mini-title {
  padding: 4px 6px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #fff;
}

.legal-footer-links {
  margin-top: 14px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: #9b8ec4;
}

.legal-footer-links a {
  color: #c8b6ff;
  text-decoration: underline;
  font-weight: 600;
}

.hub-legal-footer {
  padding: 18px 10px 10px;
}
