@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700&display=swap');

:root {
  /* Default Modern Light Theme */
  --bg: #f8fafc;
  --panel: #ffffff;
  --panel-rgb: 255, 255, 255;
  --text: #0f172a;
  --line: #e2e8f0;
  --accent: #3b82f6;
  --accent-2: #8b5cf6;
  --accent-soft: #eff6ff;
  --muted: #64748b;
  --start-bg: linear-gradient(180deg, #60a5fa 0%, #3b82f6 100%);
  --start-border: #2563eb;
  --start-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
  --shadow-soft: 0 8px 24px rgba(15, 23, 42, 0.04);
  --shadow-deep: 0 16px 40px rgba(15, 23, 42, 0.08);
  --hero-bg: radial-gradient(circle at top right, rgba(59, 130, 246, 0.1) 0%, transparent 60%),
             radial-gradient(circle at bottom left, rgba(139, 92, 246, 0.1) 0%, transparent 60%);
  --card-hover-border: #93c5fd;
  --card-hover-bg: #ffffff;
}

[data-theme="dark"] {
  /* Sleek Dark Theme */
  --bg: #0f1214;
  --panel: #1a1d21;
  --panel-rgb: 26, 29, 33;
  --text: #f8fafc;
  --line: #2d3339;
  --accent: #38bdf8;
  --accent-2: #818cf8;
  --accent-soft: #0f172a;
  --muted: #94a3b8;
  --start-bg: linear-gradient(180deg, #38bdf8 0%, #0284c7 100%);
  --start-border: #0369a1;
  --start-shadow: 0 4px 12px rgba(56, 189, 248, 0.25);
  --shadow-soft: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-deep: 0 16px 40px rgba(0, 0, 0, 0.6);
  --hero-bg: radial-gradient(circle at top right, rgba(56, 189, 248, 0.15) 0%, transparent 60%),
             radial-gradient(circle at bottom left, rgba(129, 140, 248, 0.1) 0%, transparent 60%);
  --card-hover-border: #38bdf8;
  --card-hover-bg: #202428;
}

[data-theme="classic"] {
  /* Classic Biblical Theme (Enhanced) */
  --bg: #fdfaf6;
  --panel: #ffffff;
  --panel-rgb: 255, 255, 255;
  --text: #272016;
  --line: #e6dfd1;
  --accent: #285e45;
  --accent-2: #9f6b2e;
  --accent-soft: #eef5f0;
  --muted: #6a5f50;
  --start-bg: linear-gradient(180deg, #327e5a 0%, #255a42 100%);
  --start-border: #2b5f45;
  --start-shadow: 0 4px 12px rgba(40, 94, 69, 0.3);
  --shadow-soft: 0 8px 24px rgba(39, 32, 22, 0.06);
  --shadow-deep: 0 16px 40px rgba(28, 23, 17, 0.12);
  --hero-bg: radial-gradient(circle at top right, rgba(40, 94, 69, 0.08) 0%, transparent 60%),
             radial-gradient(circle at bottom left, rgba(159, 107, 46, 0.08) 0%, transparent 60%);
  --card-hover-border: #d2b78d;
  --card-hover-bg: #ffffff;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--text);
  background: var(--bg);
  transition: background-color 0.3s ease, color 0.3s ease;
  padding-top: calc(max(96px, 86px + env(safe-area-inset-top)));
}

body {
  overflow-x: hidden;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.9rem;
  margin-top: 0.8rem;
  box-shadow: var(--shadow-soft);
}

.home-link,
.back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.home-link:hover,
.back-link:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1.5px);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}

[data-theme="dark"] .home-link:hover,
[data-theme="dark"] .back-link:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.home-link:active,
.back-link:active {
  transform: translateY(0);
  box-shadow: var(--shadow-soft);
}

.home-link:focus-visible,
.back-link:focus-visible {
  outline: 3px solid #d8a64c;
  outline-offset: 2px;
  border-radius: 10px;
}

.topbar .home-link,
.top .back-link {
  margin-left: auto;
}

.actions .start-action,
.bottom-actions .start-action {
  background: var(--start-bg);
  color: #f8fffb;
  border-color: var(--start-border);
  box-shadow: var(--start-shadow);
}

.theme-switcher {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 0.3rem 0.6rem;
  display: flex;
  gap: 0.5rem;
  align-items: center;
  box-shadow: var(--shadow-soft);
}

.theme-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  padding: 0.2rem;
  border-radius: 50%;
  opacity: 0.5;
  transition: opacity 0.2s, transform 0.2s;
  min-height: auto;
}

.theme-btn:hover {
  transform: scale(1.1);
  opacity: 0.8;
}

.theme-btn.active {
  opacity: 1;
  background: var(--accent-soft);
}

/* Welcome Box and Settings Modal shared styles */
.header-row {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: rgba(var(--panel-rgb), 0.85);
  backdrop-filter: blur(16px) saturate(120%);
  -webkit-backdrop-filter: blur(16px) saturate(120%);
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem max(1rem, calc((100vw - 920px) / 2));
  padding-top: max(0.6rem, env(safe-area-inset-top));
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.02);
  transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.logo-link {
  text-decoration: none;
  color: inherit;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: nowrap;
}

.site-logo {
  height: 36px;
  width: auto;
  object-fit: contain;
}

.site-title {
  margin: 0;
  font-size: clamp(1.1rem, 0.95rem + 0.6vw, 1.4rem);
  font-weight: 700;
  letter-spacing: -0.015em;
  background: linear-gradient(135deg, var(--text) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.game-title-styled {
  margin: 0;
  font-size: clamp(1.8rem, 1.4rem + 1.8vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--text) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: nowrap;
}

@media (max-width: 600px) {
  /* Removed hiding of welcome text since we have two rows now */
}

.welcome-box {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 0.35rem 0.85rem;
  font-size: 0.92rem;
  box-shadow: var(--shadow-soft);
  font-weight: 500;
  color: var(--text);
}

.welcome-box strong {
  color: var(--accent);
  font-weight: 700;
}

.settings-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  padding: 0.2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.65;
  transition: opacity 0.2s, transform 0.2s;
  min-height: auto;
}

.settings-btn:hover {
  opacity: 1;
  transform: rotate(30deg);
}

.reroll-btn {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.3rem 0.6rem;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  margin-bottom: 0;
  min-height: auto;
}

.reroll-btn:hover {
  background: var(--line);
  border-color: var(--card-hover-border);
}

/* Modal styles for static pages */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  /* Modal layers sit above the fixed .header-row and mobile .bottom-nav-bar (z-index 9999, theme.css);
  below that they opened underneath the header, hiding the card's title and close button. */
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay:not([hidden]) {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  width: min(90vw, 400px);
  box-shadow: var(--shadow-deep);
  transform: scale(0.95);
  transition: transform 0.25s ease;
  overflow: hidden;
  max-height: 85vh !important;
  display: flex !important;
  flex-direction: column !important;
}

.modal-overlay:not([hidden]) .modal-content {
  transform: scale(1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.9rem 1.2rem;
  border-bottom: 1px solid var(--line);
  background: var(--accent-soft);
  flex-shrink: 0;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
}

.close-btn {
  background: transparent;
  border: none;
  font-size: 1.6rem;
  cursor: pointer;
  color: var(--muted);
  padding: 0.2rem;
  line-height: 1;
  transition: color 0.2s;
  min-height: auto;
}

.close-btn:hover {
  color: var(--text);
}

.modal-body {
  padding: 1.2rem;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
  flex: 1;
  min-height: 0;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  padding: 0.8rem 1.2rem;
  border-top: 1px solid var(--line);
  background: var(--accent-soft);
  flex-shrink: 0;
}

.done-btn {
  padding: 0.5rem 1.2rem;
  border: 1px solid var(--start-border);
  border-radius: 8px;
  background: var(--start-bg);
  color: #ffffff;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  box-shadow: var(--start-shadow);
  transition: transform 0.2s, filter 0.2s;
  min-height: auto;
}

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

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

/* Golden Reward Share Button */
.share-btn {
  padding: 0.5rem 1.2rem;
  border: 1px solid #d8a64c;
  border-radius: 8px;
  background: linear-gradient(180deg, #f0c265 0%, #d8a64c 100%);
  color: #272016;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(216, 166, 76, 0.2);
  transition: transform 0.2s, filter 0.2s;
  min-height: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.share-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

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

/* Game Card Cover Image and Header Logo Styles */
.card-image-container {
  height: 160px;
  width: 100%;
  overflow: hidden;
  border-radius: 12px;
  margin-bottom: 1rem;
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Specific matching backgrounds for game logos to prevent cutoff edges */
.card-tossup-banner {
  background: #0d2818;
}

.card-canon-banner {
  background: #060f1e;
}

/* "New" pill beside a home card title (kept outside the h2, whose text is gradient-clipped). */
.card-new-badge {
  display: inline-block;
  vertical-align: middle;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: #f5c451;
  color: #3a2508;
}

.card-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: block;
}

.card:hover .card-image {
  transform: scale(1.05);
}

.game-header-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.game-brand-logo {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s ease;
}

.game-header-brand:hover .game-brand-logo {
  transform: scale(1.05);
}


/* --- Global Premium Game Styles --- */

:root {
  /* Add rgb values for theme-based overlays */
  --accent-rgb: 59, 130, 246; /* default blue */
}
[data-theme="dark"] {
  --accent-rgb: 56, 189, 248; /* light blue */
}
[data-theme="classic"] {
  --accent-rgb: 40, 94, 69; /* green */
}

/* Screen Flashes */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  z-index: 999;
}

body.screen-flash-good::before {
  animation: screen-flash-good-anim 220ms ease;
}

body.screen-flash-bad::before {
  animation: screen-flash-bad-anim 220ms ease;
}

@keyframes screen-flash-good-anim {
  0% {
    opacity: 0.25;
    background: #10b981;
  }
  100% {
    opacity: 0;
    background: transparent;
  }
}

@keyframes screen-flash-bad-anim {
  0% {
    opacity: 0.22;
    background: #ef4444;
  }
  100% {
    opacity: 0;
    background: transparent;
  }
}

/* Floating Text Feedback */
.floating-text-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 20;
  overflow: hidden;
}

.floating-text {
  position: absolute;
  font-size: 1.5rem;
  font-weight: 900;
  color: #10b981;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  animation: float-up-fade-anim 800ms ease-out forwards;
}

.floating-text.bonus {
  color: #f59e0b;
  font-size: 1.8rem;
}

@keyframes float-up-fade-anim {
  0% { opacity: 1; transform: translateY(0) scale(0.85); }
  12% { transform: translateY(-5px) scale(1.15); }
  100% { opacity: 0; transform: translateY(-50px) scale(1); }
}

/* Screen Shake Effect */
.screen-shake {
  animation: shake-anim 320ms ease-in-out;
}

@keyframes shake-anim {
  0% { transform: translate(1px, 1px) rotate(0deg); }
  10% { transform: translate(-1px, -2px) rotate(-1deg); }
  20% { transform: translate(-3px, 0px) rotate(1deg); }
  30% { transform: translate(3px, 2px) rotate(0deg); }
  40% { transform: translate(1px, -1px) rotate(1deg); }
  50% { transform: translate(-1px, 2px) rotate(-1deg); }
  60% { transform: translate(-3px, 1px) rotate(0deg); }
  70% { transform: translate(3px, 1px) rotate(-1deg); }
  80% { transform: translate(-1px, -1px) rotate(1deg); }
  90% { transform: translate(1px, 2px) rotate(0deg); }
  100% { transform: translate(1px, -2px) rotate(-1deg); }
}

/* Premium Game Choice / Action Buttons */
.btn-game-emerald {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%) !important;
  color: #ffffff !important;
  border: 1.5px solid #047857 !important;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25) !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.btn-game-blue {
  background: linear-gradient(135deg, #1d4ed8 0%, #3b82f6 100%) !important;
  color: #ffffff !important;
  border: 1.5px solid #1e40af !important;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25) !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.btn-game-rose {
  background: linear-gradient(135deg, #be123c 0%, #f43f5e 100%) !important;
  color: #ffffff !important;
  border: 1.5px solid #9f1239 !important;
  box-shadow: 0 4px 12px rgba(244, 63, 94, 0.25) !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.btn-game-gold {
  background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%) !important;
  color: #ffffff !important;
  border: 1.5px solid #b45309 !important;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.25) !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.btn-game-option {
  background: linear-gradient(180deg, #fffcf6 0%, #f7f1e3 100%) !important;
  color: #47351f !important;
  border: 1.5px solid #dcd1bd !important;
  box-shadow: 0 4px 10px rgba(83, 64, 40, 0.08) !important;
}

[data-theme="dark"] .btn-game-option {
  background: linear-gradient(180deg, #23272d 0%, #171a1e 100%) !important;
  color: #f1f5f9 !important;
  border: 1.5px solid #334155 !important;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3) !important;
}

[data-theme="classic"] .btn-game-option {
  background: linear-gradient(180deg, #fffefb 0%, #fcf8ee 100%) !important;
  color: #2e2417 !important;
  border: 1.5px solid #e2d7c5 !important;
  box-shadow: 0 4px 10px rgba(46, 36, 23, 0.05) !important;
}

.btn-game-emerald:hover:not(:disabled),
.btn-game-blue:hover:not(:disabled),
.btn-game-rose:hover:not(:disabled),
.btn-game-gold:hover:not(:disabled),
.btn-game-option:hover:not(:disabled) {
  transform: translateY(-2px) scale(1.02);
  filter: brightness(1.08);
}

.btn-game-emerald:active:not(:disabled),
.btn-game-blue:active:not(:disabled),
.btn-game-rose:active:not(:disabled),
.btn-game-gold:active:not(:disabled),
.btn-game-option:active:not(:disabled) {
  transform: translateY(1px) scale(0.98);
}

/* Rival Profile Styles */
.rival-name-btn {
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  color: inherit;
  padding: 0;
  text-align: left;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: color 0.2s ease;
}

.rival-name-btn:hover {
  color: var(--accent);
}

.rival-name-btn:focus-visible {
  outline: 3px solid #d8a64c;
  outline-offset: 2px;
  border-radius: 4px;
}

.profile-header-banner {
  height: 60px;
  width: 100%;
  background: var(--accent-soft);
  position: relative;
}

.profile-avatar-container {
  position: absolute;
  bottom: -45px;
  left: 50%;
  transform: translateX(-50%);
  width: 90px;
  height: 90px;
  margin: 0;
  z-index: 5;
}

.profile-avatar-circle {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 4px solid var(--panel);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.75rem;
  box-shadow: var(--shadow-soft);
  user-select: none;
}

.profile-badge-overlay {
  position: absolute;
  bottom: 0px;
  right: 0px;
  width: 32px;
  height: 32px;
  background: var(--panel);
  border: 2px solid var(--line);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
  user-select: none;
}

.profile-title {
  text-align: center;
  font-size: 1.35rem;
  font-weight: 800;
  margin: 0 0 0.25rem 0;
  color: var(--text);
  word-break: break-all;
}

.profile-country {
  text-align: center;
  font-size: 0.88rem;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

.profile-tags {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 1.2rem;
}

.profile-tag {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.profile-tag.style-tag {
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid rgba(var(--accent-rgb), 0.2);
}

.profile-tag.level-tag {
  background: rgba(139, 92, 246, 0.12);
  color: #8b5cf6;
  border: 1px solid rgba(139, 92, 246, 0.2);
}
[data-theme="dark"] .profile-tag.level-tag {
  color: #a78bfa;
}

.profile-level-section {
  padding: 0 1rem;
  margin-bottom: 1.2rem;
}

.profile-xp-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.profile-xp-bar {
  width: 100%;
  height: 8px;
  background: var(--line);
  border-radius: 4px;
  overflow: hidden;
}

.profile-xp-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-2) 100%);
  border-radius: 4px;
  transition: width 0.5s ease-out;
}

.profile-stats-container {
  padding: 0 1rem;
  margin-bottom: 1.5rem;
}

.profile-section-title {
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin: 0 0 0.65rem 0;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.25rem;
}

.profile-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.profile-stat-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.55rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.profile-stat-card.total-card {
  grid-column: 1 / -1;
  background: var(--accent-soft);
  border-color: rgba(var(--accent-rgb), 0.2);
}

.profile-stat-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
}

.profile-stat-value {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.profile-stat-card.total-card .profile-stat-value {
  color: var(--accent);
  font-size: 1.05rem;
}

.profile-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0 1rem;
  margin-top: 1rem;
}

/* Sent Challenges Styles */
.sent-challenges-section {
  margin-top: 1rem;
  border-top: 1px solid var(--line);
  padding-top: 0.8rem;
}

.sent-challenges-title {
  font-size: 0.88rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.sent-challenge-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sent-challenge-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 0.5rem 0.75rem;
  font-size: 0.88rem;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.sent-challenge-info {
  flex-grow: 1;
}

.sent-challenge-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.timer-pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid rgba(var(--accent-rgb), 0.15);
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}

.outcome-pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}

.outcome-pill.won {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.outcome-pill.lost {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.outcome-pill.declined {
  background: var(--accent-soft);
  color: var(--muted);
  border: 1px solid var(--line);
}

.clear-challenge-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1.15rem;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.1rem;
  border-radius: 4px;
  transition: background 0.2s, color 0.2s;
  width: 22px;
  height: 22px;
}

.clear-challenge-btn:hover {
  background: var(--line);
  color: var(--text);
}

/* Daily Quest Alert Banner */
.daily-banner-alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  color: #ffffff;
  padding: 0.75rem 1.1rem;
  border-radius: 12px;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
  font-weight: 500;
  box-shadow: var(--shadow-soft);
  gap: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: opacity 0.3s ease, transform 0.3s ease;
  animation: slideDownFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideDownFadeIn {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}

.daily-banner-content {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  line-height: 1.45;
}

.daily-banner-icon {
  font-size: 1.2rem;
  display: inline-flex;
  align-items: center;
}

.daily-banner-btn-go {
  background: #ffffff;
  color: var(--accent);
  border: none;
  padding: 0.4rem 0.85rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.2s, transform 0.2s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.daily-banner-btn-go:hover {
  opacity: 0.95;
  transform: translateY(-1px);
  background: #fdfdfd;
}

.daily-banner-btn-close {
  background: transparent;
  border: none;
  color: #ffffff;
  opacity: 0.7;
  font-size: 1.4rem;
  cursor: pointer;
  padding: 0.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s;
  min-height: auto;
  line-height: 1;
  width: 24px;
  height: 24px;
  border-radius: 50%;
}

.daily-banner-btn-close:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.15);
}

.settings-help {
  margin: 0.25rem 0 0 0;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.35;
}

/* Weekly Cup / Tournament styles */
.tournament-timer-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--accent-soft);
  border: 1.5px solid var(--accent);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-soft);
  gap: 1rem;
}

@media (max-width: 480px) {
  .tournament-timer-banner {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    gap: 0.75rem;
  }
  .tournament-timer-banner > div:last-child {
    text-align: center !important;
  }
}

.force-end-btn {
  font-size: 0.75rem;
  color: var(--muted);
  cursor: pointer;
  text-decoration: underline;
  background: transparent;
  border: none;
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
  margin-left: 0.5rem;
  transition: all 0.2s;
  display: none;
}

.force-end-btn:hover {
  color: var(--accent);
  background: rgba(var(--accent-rgb), 0.1);
}

/* Season Ended Modal specifically styled */
.season-ended-badge-display {
  font-size: 4rem;
  margin: 1rem auto;
  text-align: center;
  animation: badgePop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes badgePop {
  0% { transform: scale(0.5); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.season-ended-title {
  text-align: center;
  font-weight: 800;
  font-size: 1.35rem;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.season-ended-desc {
  text-align: center;
  font-size: 0.95rem;
  color: var(--text);
  margin-bottom: 1.2rem;
  line-height: 1.45;
}

/* Badge Gallery on Profile */
.profile-badges-section {
  padding: 0 1rem;
  margin-bottom: 1.5rem;
}

.profile-badges-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.75rem;
  min-height: 52px;
}

.profile-badge-item {
  font-size: 1.6rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: help;
  position: relative;
  transition: transform 0.2s, border-color 0.2s;
  box-shadow: var(--shadow-soft);
}

.profile-badge-item:hover {
  transform: scale(1.1);
  border-color: var(--accent);
}

.profile-badges-empty {
  font-size: 0.82rem;
  color: var(--muted);
  font-style: italic;
  display: flex;
  align-items: center;
  width: 100%;
  justify-content: center;
}

/* --- Desktop Multi-Column Refined Layout --- */
@media (min-width: 1024px) {
  .dashboard-container {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 1.5rem;
    align-items: start;
    margin-top: 1rem;
  }

  .main-column {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
  }

  .sidebar-column {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    position: sticky;
    top: 120px;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
    scrollbar-width: thin;
  }

  /* Hide bottom navigation bar on desktop viewports */
  .bottom-nav-bar {
    display: none !important;
  }
}

/* --- Mobile Bottom Navigation and Layout Controls --- */
@media (max-width: 1023px) {
  /* Remove wrapping layout constraints on mobile */
  .dashboard-container,
  .main-column,
  .sidebar-column {
    display: contents;
  }

  /* Force hide all sections by default on mobile unless active */
  body:not(.tab-games-active) #game-list-section,
  body:not(.tab-games-active) #welcome-hero-panel,
  body:not(.tab-games-active) #newsletter-section,
  body:not(.tab-games-active) .site-footer {
    display: none !important;
  }
  body:not(.tab-games-active) #versus-arena-panel {
    display: none !important;
  }
  body:not(.tab-daily-active) #daily-hub-section {
    display: none !important;
  }
  body:not(.tab-leaderboard-active) #leaderboard-section {
    display: none !important;
  }
  body:not(.tab-achievements-active) #achievements-section {
    display: none !important;
  }
  body:not(.tab-activity-active) #activity-feed-section {
    display: none !important;
  }

  /* Pad main container to clear the floating bottom navigation bar */
  main {
    padding-bottom: 90px !important;
  }

  /* Floating Glassmorphic Bottom Navigation Bar styling */
  .bottom-nav-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    height: 72px;
    background: rgba(var(--panel-rgb), 0.85);
    backdrop-filter: blur(16px) saturate(120%);
    -webkit-backdrop-filter: blur(16px) saturate(120%);
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 0 0.8rem;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.04);
    transition: background-color 0.3s ease, border-color 0.3s ease;
  }

  /* Float styling for tablets (floating rounded capsule) */
  @media (min-width: 600px) {
    .bottom-nav-bar {
      left: 50%;
      right: auto;
      transform: translateX(-50%);
      width: 500px;
      bottom: 1.25rem;
      border-radius: 20px;
      border: 1px solid var(--line);
      height: 70px;
      box-shadow: var(--shadow-deep);
    }
  }

  /* Navigation item/button style */
  .nav-item {
    background: transparent;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    height: 100%;
    color: var(--muted);
    cursor: pointer;
    gap: 0.25rem;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    padding: 0.3rem 0;
  }

  /* Icon styles */
  .nav-icon {
    font-size: 1.4rem;
    transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  }

  /* Label styles */
  .nav-label {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    opacity: 0.8;
  }

  /* Hover micro-animation */
  .nav-item:hover .nav-icon {
    transform: scale(1.15) translateY(-2px);
  }

  /* Active state styles with glow & accent coloring */
  .nav-item.active {
    color: var(--accent);
  }

  .nav-item.active .nav-icon {
    transform: scale(1.2) translateY(-4px);
    text-shadow: 0 0 10px rgba(var(--accent-rgb), 0.4);
  }

  .nav-item.active .nav-label {
    font-weight: 700;
    opacity: 1;
  }

  /* Active pill indicator at the top of active tab button */
  .nav-item::after {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 28px;
    height: 3px;
    background: var(--accent);
    border-radius: 0 0 4px 4px;
    transition: transform 0.25s ease;
  }

  .nav-item.active::after {
    transform: translateX(-50%) scaleX(1);
  }

  /* Style adjustment for float styling */
  @media (min-width: 600px) {
    .nav-item::after {
      top: auto;
      bottom: 0;
      border-radius: 4px 4px 0 0;
    }
  }
}

/* --- Smooth Transition Animation for active content --- */
.tab-fade-in {
  animation: tabFadeIn 250ms ease forwards;
}

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

/* --- Mobile view title and username truncation --- */
@media (max-width: 480px) {
  #welcome-username {
    max-width: 200px !important;
    display: inline-block !important;
    vertical-align: bottom !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }
  .logo-container {
    gap: 0.4rem !important;
  }
  .welcome-box {
    padding: 0.3rem 0.6rem !important;
    gap: 0.4rem !important;
  }
}







/* Crawlable "About this game" block at the foot of each game page (SEO A1.4, 2026-09-20).
   Game pages keep a fixed emerald art direction, so this uses the game palette vars
   (--cream-dim / --gold-bright) with theme fallbacks for any page that lacks them. */
.game-about {
  margin: 1.4rem 0 0;
  padding: 1rem 1.1rem;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(245, 196, 81, 0.28);
  color: var(--cream-dim, var(--muted));
  font-size: 0.92rem;
  line-height: 1.55;
}

.game-about h2 {
  margin: 0 0 0.45rem;
  font-size: 1.05rem;
  color: var(--gold-bright, var(--accent));
}

.game-about p {
  margin: 0 0 0.6rem;
}

.game-about p:last-child {
  margin-bottom: 0;
}

.game-about a {
  color: var(--gold-bright, var(--accent));
}
