@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
  --bg-dark: #07050f;
  --bg-gradient: radial-gradient(circle at 50% 50%, #16122d 0%, #07050f 100%);
  --panel-bg: rgba(18, 14, 36, 0.85);
  --panel-border: rgba(255, 255, 255, 0.12);
  --accent-primary: #6366f1;
  --accent-secondary: #06b6d4;
  --accent-gradient: linear-gradient(135deg, #6366f1 0%, #06b6d4 100%);
  --accent-glow: rgba(99, 102, 241, 0.5);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --input-bg: rgba(255, 255, 255, 0.05);
  --input-border: rgba(255, 255, 255, 0.15);
  --input-focus-border: #6366f1;
  --input-focus-glow: rgba(99, 102, 241, 0.3);
  --success-color: #10b981;
  --error-color: #ef4444;
  --warning-color: #f59e0b;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Outfit', sans-serif;
}

body,
html {
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  background-color: var(--bg-dark);
  color: var(--text-main);
}

/* Page Overlay Wrappers */
.page-wrapper {
  min-height: 100vh;
  width: 100%;
  background: #081a10 url('../assets/BG_1.jpg') no-repeat center center / cover;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  position: relative;
}

/* App Header Bar */
.app-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 64px;
  background: rgba(14, 10, 28, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--panel-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 1000;
}

.brand-logo {
  font-size: 1.4rem;
  font-weight: 800;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.5px;
  text-transform: uppercase;
  text-decoration: none;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 12px;
}

.profile-wrapper {
  position: relative;
}

.profile-avatar-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent-gradient);
  border: 2px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
  transition: all 0.2s ease;
  user-select: none;
}

.profile-avatar-btn:hover {
  transform: scale(1.08);
  border-color: #ffffff;
  box-shadow: 0 0 16px var(--accent-glow);
}

.profile-dropdown {
  position: absolute;
  top: 50px;
  right: 0;
  width: 220px;
  background: rgba(18, 14, 36, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
  display: none;
  flex-direction: column;
  gap: 12px;
  z-index: 2000;
  animation: fadeIn 0.2s ease;
}

.profile-dropdown.active {
  display: flex !important;
}

.profile-dropdown-info {
  border-bottom: 1px solid var(--panel-border);
  padding-bottom: 10px;
  text-align: left;
}

.profile-dropdown-info .so-name {
  font-weight: 700;
  color: var(--text-main);
  font-size: 0.95rem;
}

.profile-dropdown-info .so-id {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.btn-dropdown-logout {
  width: 100%;
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 10px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.btn-dropdown-logout:hover {
  background: rgba(239, 68, 68, 0.3);
  color: #ffffff;
}

.highlight-my-score {
  background: rgba(99, 102, 241, 0.25) !important;
  border-left: 4px solid var(--accent-primary) !important;
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.3);
}

.highlight-my-score td {
  font-weight: 700;
  color: #ffffff !important;
}

/* Glassmorphic Login / Main Container */
.login-header-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 18px;
  gap: 12px;
}

.login-page-logo {
  width: clamp(280px, 42vw, 480px);
  max-width: 88vw;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.7));
}

.login-page-headline {
  font-size: clamp(1.3rem, 4.5vw, 2rem);
  line-height: 1.3;
  margin: 0;
  white-space: nowrap;
}

.login-card,
.main-card {
  width: min(88vw, 350px);
  max-width: 88vw;
  background: rgba(255, 255, 255, 0.90);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 2.5px solid rgba(255, 255, 255, 0.95);
  border-radius: 28px;
  padding: 22px 20px 18px 20px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.55),
    inset 0 0 25px rgba(255, 255, 255, 0.7);
  text-align: center;
  position: relative;
  overflow: hidden;
  animation: cardSlideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.35s ease,
    padding 0.35s ease,
    max-width 0.35s ease;
}

/* Mobile Typing / Focus Mode for Login Card - Only when an INPUT or SELECT field is focused */
.input-focused .login-header-section {
  display: none !important;
}

.input-focused .page-wrapper {
  justify-content: flex-start !important;
  padding-top: 15px !important;
}

.input-focused .login-card,
.login-card:has(input:focus),
.login-card:has(select:focus) {
  transform: translateY(-75px) scale(1.01);
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.75),
    0 0 35px rgba(6, 182, 212, 0.4);
  z-index: 100 !important;
}

/* Extra shift up ONLY when password or lower input fields are focused */
.login-card:has(#login-password:focus),
.login-card:has(#reg-password:focus),
.login-card:has(#reg-confirm-password:focus) {
  transform: translateY(-110px) scale(1.01) !important;
}

.main-card-wide {
  max-width: 800px;
}

@keyframes cardSlideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Avatar Ring Top Badge */
.card-avatar-wrapper {
  display: flex;
  justify-content: center;
  margin-bottom: 8px;
}

.card-avatar-ring {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #ffffff;
  border: 2.5px solid #06b6d4;
  box-shadow: 0 0 16px rgba(6, 182, 212, 0.3), inset 0 0 8px rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.card-avatar-ring::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  padding: 2.5px;
  background: linear-gradient(135deg, #f59e0b 0%, #06b6d4 50%, #ec4899 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.avatar-icon {
  width: 28px;
  height: 28px;
  color: #0284c7;
}

.login-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 2px;
  letter-spacing: -0.5px;
}

.login-subtitle {
  color: #475569;
  font-size: 0.82rem;
  margin-bottom: 4px;
  font-weight: 500;
}

.title-accent-bar {
  width: 40px;
  height: 3px;
  background: linear-gradient(90deg, #fcd34d 0%, #f59e0b 100%);
  border-radius: 4px;
  margin: 4px auto 14px auto;
}

/* Dual Tab Switcher */
.tab-container {
  display: flex;
  background: rgba(241, 245, 249, 0.9);
  padding: 3px;
  border-radius: 12px;
  margin-bottom: 14px;
  border: 1.5px solid rgba(203, 213, 225, 0.8);
}

.tab-btn {
  flex: 1;
  padding: 7px 0;
  background: transparent;
  border: none;
  color: #64748b;
  font-weight: 700;
  font-size: 0.82rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.25s ease;
}

.tab-btn.active {
  background: linear-gradient(180deg, #fcd34d 0%, #f59e0b 100%);
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.45);
}

/* Form Styling */
.form-group {
  position: relative;
  margin-bottom: 12px;
  text-align: left;
}

.form-label {
  display: block;
  color: #1e293b;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.input-wrapper {
  position: relative;
  width: 100%;
}

.input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: #d97706;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 2;
}

.login-input,
.form-select {
  width: 100%;
  padding: 10px 14px 10px 40px;
  font-size: 0.88rem;
  font-weight: 500;
  color: #0f172a;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 12px;
  outline: none;
  transition: all 0.2s ease;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
  cursor: pointer;
}

.form-select option {
  background: #ffffff;
  color: #0f172a;
}

.login-input:focus,
.form-select:focus {
  border-color: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.25);
  background: #ffffff;
}

.login-input::placeholder {
  color: #94a3b8;
}

/* Alert Boxes */
.alert-box {
  display: none;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 12px;
  text-align: center;
  animation: fadeIn 0.3s ease;
}

.alert-box.active {
  display: block;
}

.alert-box.error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #ef4444;
}

.alert-box.success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #10b981;
}

.alert-box.info {
  background: rgba(6, 182, 212, 0.15);
  border: 1px solid rgba(6, 182, 212, 0.4);
  color: #0284c7;
}

/* Primary & Secondary Buttons */
.login-btn,
.btn-primary {
  width: 100%;
  padding: 11px;
  font-size: 1.0rem;
  font-weight: 800;
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  background: linear-gradient(180deg, #fcd34d 0%, #f59e0b 50%, #d97706 100%);
  border: 1px solid #fef08a;
  border-radius: 14px;
  cursor: pointer;
  outline: none;
  position: relative;
  overflow: hidden;
  transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.45);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 6px;
}

.login-btn:hover,
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 9px 28px rgba(245, 158, 11, 0.65);
}

.login-btn:active,
.btn-primary:active {
  transform: translateY(1px);
}

/* Card Bottom Security Badge Divider */
.card-footer-divider {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 24px;
  margin-bottom: 2px;
}

.card-footer-divider::before {
  content: '';
  position: absolute;
  left: 5%;
  right: 5%;
  top: 50%;
  height: 1.5px;
  background: linear-gradient(90deg, transparent, #cbd5e1 30%, #cbd5e1 70%, transparent);
}

.shield-badge {
  position: relative;
  z-index: 2;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #ffffff;
  border: 1.5px solid #fcd34d;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  color: #d97706;
  display: flex;
  align-items: center;
  justify-content: center;
}

.shield-badge svg {
  width: 18px;
  height: 18px;
  color: #d97706;
}

.btn-secondary {
  width: 100%;
  padding: 14px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 10px;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.14);
}

/* Doctor Selection Cards & List */
.doctor-list-container {
  max-height: 220px;
  overflow-y: auto;
  margin-bottom: 20px;
  padding-right: 4px;
}

.doctor-list-container::-webkit-scrollbar {
  width: 5px;
}

.doctor-list-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.doctor-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--input-border);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: all 0.25s ease;
  text-align: left;
}

.doctor-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(99, 102, 241, 0.4);
}

.doctor-card.selected {
  background: rgba(99, 102, 241, 0.18);
  border-color: var(--accent-primary);
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.25);
}

.doctor-info h4 {
  font-size: 1rem;
  color: var(--text-main);
  margin-bottom: 4px;
}

.doctor-info p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.doctor-select-indicator {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.doctor-card.selected .doctor-select-indicator {
  border-color: var(--accent-primary);
  background: var(--accent-primary);
}

.doctor-card.selected .doctor-select-indicator::after {
  content: '✓';
  color: #fff;
  font-size: 12px;
  font-weight: bold;
}

/* Sections Divider */
.divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 20px 0;
  color: var(--text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--panel-border);
}

.divider:not(:empty)::before {
  margin-right: 12px;
}

.divider:not(:empty)::after {
  margin-left: 12px;
}

/* Rotate Device Overlay */
#rotate-overlay,
#landscape-rotate-overlay,
.rotate-overlay-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(7, 5, 15, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 999999 !important;
  opacity: 0;
  transform: scale(0.95);
  pointer-events: none;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

#rotate-overlay.active,
#landscape-rotate-overlay.active,
.rotate-overlay-screen.active {
  display: flex !important;
  opacity: 1 !important;
  transform: scale(1) !important;
  pointer-events: auto !important;
}

#rotate-overlay.hidden,
#landscape-rotate-overlay.hidden,
.rotate-overlay-screen.hidden {
  display: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.rotate-card {
  width: 90%;
  max-width: 380px;
  background: var(--panel-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  padding: 36px 28px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5),
    0 0 40px rgba(99, 102, 241, 0.15);
}

.phone-icon-wrapper {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  background: rgba(99, 102, 241, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.phone-icon {
  width: 30px;
  height: 52px;
  border: 3px solid var(--text-main);
  border-radius: 6px;
  position: relative;
  animation: rotateDevice 2.5s infinite ease-in-out;
}

.phone-icon::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 5px;
  height: 5px;
  background: var(--text-muted);
  border-radius: 50%;
}

@keyframes rotateDevice {
  0% {
    transform: rotate(0deg);
  }

  35% {
    transform: rotate(90deg);
  }

  65% {
    transform: rotate(90deg);
  }

  100% {
    transform: rotate(0deg);
  }
}

/* Congratulations Modal Overlay */
#congratulations-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(7, 5, 15, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 999999 !important;
  animation: fadeIn 0.4s ease;
}

#congratulations-overlay.active {
  display: flex !important;
  pointer-events: auto !important;
}

.congrats-card {
  width: 90%;
  max-width: 440px;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  padding: 40px 32px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6),
    0 0 50px rgba(6, 182, 212, 0.2);
  animation: cardSlideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.trophy-icon {
  font-size: 3.5rem;
  margin-bottom: 12px;
  display: inline-block;
  animation: trophyBounce 2s infinite ease-in-out;
}

@keyframes trophyBounce {

  0%,
  100% {
    transform: translateY(0) scale(1);
  }

  50% {
    transform: translateY(-8px) scale(1.05);
  }
}

.congrats-title {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 6px;
}

.congrats-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 24px;
}

.score-badge-wrapper {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 28px;
}

.score-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.score-val {
  font-size: 2.8rem;
  font-weight: 800;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.congrats-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Leaderboard Table Styles */
.leaderboard-container {
  width: 100%;
  margin-top: 16px;
  overflow-x: auto;
}

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.leaderboard-table th {
  padding: 14px 16px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--panel-border);
  background: rgba(255, 255, 255, 0.03);
}

.leaderboard-table td {
  padding: 16px;
  font-size: 0.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text-main);
}

.leaderboard-table tbody tr {
  transition: background 0.2s ease;
}

.leaderboard-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.05);
}

.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.9rem;
}

.rank-1 {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #fff;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
}

.rank-2 {
  background: linear-gradient(135deg, #94a3b8 0%, #64748b 100%);
  color: #fff;
}

.rank-3 {
  background: linear-gradient(135deg, #b45309 0%, #78350f 100%);
  color: #fff;
}

.rank-other {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
}

.doctor-name-td {
  font-weight: 700;
  color: var(--text-main);
}

.score-td {
  font-weight: 800;
  color: var(--accent-secondary);
  font-size: 1rem;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* Unity Canvas Container */
#unity-container {
  width: 100vw;
  height: 100vh;
  position: absolute;
  top: 0;
  left: 0;
}

/* ==========================================
   INTRO / LANDING SCREEN STYLES
   ========================================== */
.intro-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #081a10 url('../assets/BG_1.jpg') no-repeat center center / cover;
  z-index: 999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  /* Bottom padding accounts for iOS home indicator (~34px on iPhone 16) */
  padding: 4vh 20px calc(5vh + env(safe-area-inset-bottom, 0px)) 20px;
  box-sizing: border-box;
  transition: opacity 0.5s ease, transform 0.5s ease, visibility 0.5s;
  overflow: hidden;
}

.intro-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: scale(1.04);
}

.intro-content {
  width: 100%;
  max-width: 500px;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  text-align: center;
}

.intro-top-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 3vh;
  gap: 22px;
}

.intro-logo {
  width: clamp(280px, 44vw, 500px);
  max-width: 90vw;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.7));
  animation: logoPulse 3s ease-in-out infinite alternate;
}

@keyframes logoPulse {
  from {
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.7));
  }

  to {
    filter: drop-shadow(0 6px 22px rgba(251, 191, 36, 0.45));
  }
}

.intro-headline {
  font-size: clamp(1.4rem, 5vw, 2.2rem);
  line-height: 1.3;
  margin: 0;
  letter-spacing: -0.3px;
  white-space: nowrap;
}

.text-white-italic {
  font-style: italic;
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9), 0 0 15px rgba(0, 0, 0, 0.7);
  display: inline-block;
  margin-right: 6px;
}

.text-gold-italic {
  font-style: italic;
  font-weight: 800;
  color: #fbbf24;
  background: linear-gradient(180deg, #fff4a3 0%, #f59e0b 50%, #d97706 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.9));
  display: inline-block;
}

.intro-footer {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-bottom: 60px;
}

/* START SPRINT BUTTON (Glossy Metallic Gold Pill) */
.start-sprint-btn {
  width: min(88%, 340px);
  padding: 14px 28px;
  font-size: 1.25rem;
  font-weight: 900;
  font-style: italic;
  letter-spacing: 1px;
  color: #ffffff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.7);
  background: linear-gradient(180deg, #f59e0b 0%, #d97706 45%, #b45309 80%, #78350f 100%);
  border: 3px solid #fef08a;
  outline: 2px solid #b45309;
  border-radius: 50px;
  cursor: pointer;
  box-shadow:
    0 0 25px rgba(245, 158, 11, 0.6),
    inset 0 3px 6px rgba(255, 255, 255, 0.85),
    inset 0 -3px 6px rgba(0, 0, 0, 0.6),
    0 10px 30px rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  overflow: hidden;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.start-sprint-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 45%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 100%);
  border-top-left-radius: 40px;
  border-top-right-radius: 40px;
  pointer-events: none;
}

.start-sprint-btn:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow:
    0 0 35px rgba(251, 191, 36, 0.85),
    inset 0 3px 8px rgba(255, 255, 255, 0.95),
    inset 0 -3px 6px rgba(0, 0, 0, 0.6),
    0 14px 35px rgba(0, 0, 0, 0.9);
  border-color: #ffffff;
}

.start-sprint-btn:active {
  transform: translateY(1px) scale(0.98);
  box-shadow:
    0 0 15px rgba(245, 158, 11, 0.5),
    inset 0 2px 4px rgba(0, 0, 0, 0.6);
}

.start-sprint-btn .btn-chevrons {
  font-size: 1.3rem;
  font-weight: 900;
  letter-spacing: -2px;
  color: #ffffff;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
  display: inline-block;
  animation: chevronBounce 1.5s infinite;
}

@keyframes chevronBounce {

  0%,
  100% {
    transform: translateX(0);
  }

  50% {
    transform: translateX(4px);
  }
}

/* Responsive adjustments for smaller / short / landscape screens */
@media (max-height: 660px) {
  .intro-top-section {
    margin-top: 1.5vh;
    gap: 12px;
  }

  .intro-logo {
    width: clamp(220px, 35vw, 360px);
  }

  .intro-headline {
    font-size: 1.25rem;
  }

  .start-sprint-btn {
    padding: 10px 22px;
    font-size: 1.05rem;
  }
}

@media (max-width: 360px) {
  .intro-headline {
    font-size: 1.25rem;
  }

  .start-sprint-btn {
    font-size: 1.1rem;
    padding: 12px 20px;
  }
}

@media (max-height: 720px) {
  .login-header-section {
    margin-bottom: 12px;
    gap: 8px;
  }

  .login-page-logo {
    width: clamp(220px, 35vw, 360px);
  }

  .login-card {
    padding: 22px 20px 18px 20px;
    border-radius: 24px;
  }

  .card-avatar-ring {
    width: 56px;
    height: 56px;
  }

  .avatar-icon {
    width: 28px;
    height: 28px;
  }

  .login-title {
    font-size: 1.45rem;
  }

  .tab-container {
    margin-bottom: 16px;
  }

  .form-group {
    margin-bottom: 14px;
  }
}

/* ==========================================
   DOCTOR CREATION PAGE STYLES (BG_2 + MASCOT)
   ========================================== */
.doctor-page-body {
  margin: 0;
  padding: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden !important;
  background: url('../assets/BG_2.jpg') no-repeat center center / cover;
}

.top-right-profile {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 1000;
}

.doctor-page-wrapper {
  width: 100vw;
  height: 100vh;
  background: url('../assets/BG_2.jpg') no-repeat center center / cover;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 2.5vh 16px 3vh 16px;
  box-sizing: border-box;
  position: relative;
  overflow: hidden !important;
}

.doctor-header-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-top: 1vh;
  gap: 8px;
  z-index: 2;
}

.doctor-page-logo {
  width: clamp(280px, 42vw, 480px);
  max-width: 88vw;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.7));
}

.doctor-page-headline {
  font-size: clamp(1.25rem, 4vw, 1.9rem);
  line-height: 1.3;
  margin: 0;
  white-space: nowrap;
}

/* Full-Screen Mascot Background Layer (Spans 100vw x 100vh) */
.mascot-fullscreen-bg {
  position: absolute;
  top: 0;
  left: -40px;
  width: calc(100vw + 100px);
  height: 100vh;
  background: url('../assets/MASCOT.png') no-repeat left bottom / contain;
  pointer-events: none;
  z-index: 1 !important;
  filter: drop-shadow(0 12px 30px rgba(0, 0, 0, 0.65));
  transition: opacity 0.35s ease;
}

.doctor-creation-container {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  width: 100%;
  max-width: 100vw;
  margin: auto 0;
  padding-right: 5px;
  box-sizing: border-box;
  z-index: 10 !important;
  position: relative;
  transition: padding 0.35s ease, justify-content 0.35s ease;
}

.create-player-card {
  position: relative;
  z-index: 12 !important;
  width: min(54vw, 295px);
  max-width: 55vw;
  background: rgba(10, 15, 32, 0.86);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 2px solid #f59e0b;
  border-radius: 22px;
  padding: 16px 13px 13px 13px;
  box-shadow:
    0 0 30px rgba(245, 158, 11, 0.35),
    inset 0 0 20px rgba(245, 158, 11, 0.15),
    0 20px 50px rgba(0, 0, 0, 0.7);
  text-align: center;
  overflow: hidden;
  animation: cardSlideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  margin-left: auto;
  transition: width 0.35s cubic-bezier(0.16, 1, 0.3, 1),
    max-width 0.35s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.35s ease,
    margin 0.35s ease;
}

/* Mobile Typing / Focus Mode when filling input fields */
.input-focused .mascot-fullscreen-bg {
  opacity: 0.05 !important;
  z-index: 1 !important;
  pointer-events: none;
}

.input-focused .doctor-header-section {
  transform: translateY(-8px);
  transition: transform 0.35s ease;
}

.input-focused .doctor-creation-container {
  justify-content: center !important;
  padding-right: 0 !important;
}

.input-focused .create-player-card,
.create-player-card:has(input:focus),
.create-player-card:has(select:focus) {
  width: min(92vw, 360px) !important;
  max-width: 92vw !important;
  margin: 0 auto !important;
  margin-right: auto !important;
  transform: translateY(-28px) scale(1.02);
  box-shadow:
    0 15px 45px rgba(0, 0, 0, 0.85),
    0 0 35px rgba(245, 158, 11, 0.6);
  z-index: 100 !important;
}

.player-avatar-wrapper {
  display: flex;
  justify-content: center;
  margin-bottom: 6px;
}

.player-avatar-img {
  width: 54px;
  height: 54px;
  object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(251, 191, 36, 0.65));
}

.create-player-title {
  font-size: 1.15rem;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: 0.8px;
  margin-bottom: 2px;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.7);
}

.create-player-subtitle {
  color: #cbd5e1;
  font-size: 0.76rem;
  font-weight: 500;
  margin-bottom: 12px;
  line-height: 1.3;
}

.create-player-subtitle .highlight-gold {
  color: #fbbf24;
  font-weight: 700;
  display: block;
  margin-top: 1px;
}

/* Light Grey Form Input Cards */
.input-card {
  background: #f1f5f9;
  border-radius: 12px;
  padding: 8px 10px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
  transition: all 0.25s ease;
  border: 1.5px solid transparent;
}

.input-card:focus-within {
  border-color: #f59e0b;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.3);
  background: #ffffff;
}

.input-card-icon {
  width: 20px;
  height: 20px;
  color: #1e293b;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.input-card-icon svg {
  width: 18px;
  height: 18px;
  color: #1e293b;
}

.input-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.input-card-label {
  font-size: 0.74rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 1px;
}

.card-input {
  width: 100%;
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.84rem;
  font-weight: 600;
  color: #0f172a;
  padding: 0;
}

.card-input::placeholder {
  color: #94a3b8;
  font-weight: 400;
}

select.card-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230f172a' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 4px center;
  background-size: 14px;
  padding-right: 20px;
  cursor: pointer;
}

select.card-select option {
  background: #ffffff;
  color: #0f172a;
  font-weight: 600;
  padding: 6px;
}

.card-input.text-center,
select.card-select.text-center {
  text-align: center;
  text-align-last: center;
}

.searchable-select-card {
  position: relative;
}

.city-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 160px;
  background: #ffffff;
  border: 1.5px solid #f59e0b;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  z-index: 9999;
  overflow-y: auto;
  margin-top: 4px;
}

.city-dropdown-menu.hidden {
  display: none;
}

.city-options-list {
  list-style: none;
  margin: 0;
  padding: 4px 0;
  text-align: center;
}

.city-option-item {
  padding: 8px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #0f172a;
  cursor: pointer;
  text-align: center;
  transition: background 0.15s ease, color 0.15s ease;
}

.city-option-item:hover,
.city-option-item.selected {
  background: #fef3c7;
  color: #d97706;
}

.city-no-match {
  padding: 10px;
  font-size: 0.78rem;
  font-weight: 500;
  color: #94a3b8;
  text-align: center;
}

/* BEGIN BUTTON */
.begin-btn {
  width: 100%;
  padding: 10px;
  font-size: 0.98rem;
  font-weight: 900;
  font-style: italic;
  letter-spacing: 0.8px;
  color: #ffffff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
  background: linear-gradient(180deg, #f59e0b 0%, #d97706 50%, #b45309 100%);
  border: 2px solid #fef08a;
  border-radius: 12px;
  cursor: pointer;
  outline: none;
  transition: all 0.25s ease;
  box-shadow:
    0 0 16px rgba(245, 158, 11, 0.5),
    inset 0 2px 4px rgba(255, 255, 255, 0.6),
    0 6px 20px rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 12px;
}

.begin-btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow:
    0 0 25px rgba(251, 191, 36, 0.75),
    0 10px 25px rgba(0, 0, 0, 0.7);
}

.begin-btn:active {
  transform: translateY(1px) scale(0.98);
}

/* Responsiveness adjustments for mascot background layer */
@media (max-width: 768px) {
  .mascot-fullscreen-bg {
    left: -40px;
    width: calc(100vw + 100px);
    background-position: left bottom;
    opacity: 0.9;
  }

  .doctor-creation-container {
    justify-content: flex-end;
    padding-right: 5px;
  }

  .create-player-card {
    margin-right: -10px;
    width: min(54vw, 270px);
    max-width: 54vw;
    padding: 14px 11px 11px 11px;
  }
}

/* ==========================================
   MISSION INSTRUCTIONS PAGE & CARD STYLES
   ========================================== */
.instructions-page-body {
  margin: 0;
  padding: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: url('../assets/BG_3.jpg') no-repeat center center / cover;
  font-family: 'Outfit', sans-serif;
}

.instructions-page-wrapper {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 2.5vh 0 3vh 0;
  box-sizing: border-box;
  overflow: hidden;
}

.instructions-header-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  z-index: 4;
}

.instructions-page-logo {
  width: clamp(260px, 42vw, 450px);
  max-width: 88vw;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.7));
}

.instructions-page-headline {
  font-size: clamp(1.55rem, 5.2vw, 2.5rem);
  line-height: 1.25;
  margin: 12px 0 16px 0;
  white-space: nowrap;
}

/* Full-Screen Mascot 2 Background Layer */
.mascot2-fullscreen-bg {
  position: absolute;
  top: 2vw;
  left: -26vw;
  width: calc(90vw + 0px);
  height: 100vh;
  background: url('../assets/mascot2.png') no-repeat left bottom / contain;
  pointer-events: none;
  z-index: 5;
  filter: drop-shadow(0 12px 30px rgba(0, 0, 0, 0.65));
  transition: opacity 0.2s ease;
}

/* Full-Screen Mascot 3 Background Layer (Dedicated Independent Rules) */
.mascot3-fullscreen-bg,
.mascot2-fullscreen-bg.mascot3-mode {
  position: absolute;
  top: 2vw;
  left: -25vw;
  width: calc(84vw + 0px);
  height: 100vh;
  background: url('../assets/mascot3.png') no-repeat left bottom / contain !important;
  pointer-events: none;
  z-index: 5;
  filter: drop-shadow(0 12px 30px rgba(0, 0, 0, 0.65));
  transition: opacity 0.2s ease;
}

.instructions-container {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  width: 100%;
  max-width: 100vw;
  margin: auto 0;
  padding-right: 4vw;
  box-sizing: border-box;
  z-index: 4;
}

/* MISSION IMAGE CARD STYLES */
.mission-img-card {
  position: relative;
  width: min(65vw, 340px);
  max-width: 66vw;
  margin-left: auto;
  margin-right: -5px;
  animation: cardSlideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.mission-img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 15px 35px rgba(0, 0, 0, 0.65));
  transition: opacity 0.2s ease;
}

/* Close (X) Button on Top Right Corner of Image */
.mission-close-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  background: #0284c7;
  border: 2px solid #ffffff;
  border-radius: 50%;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  transition: transform 0.2s ease;
  outline: none;
  z-index: 10;
}

.mission-close-btn svg {
  width: 13px;
  height: 13px;
}

.mission-close-btn:hover {
  transform: scale(1.12);
}

/* NEXT >> Button Floating at Bottom Center (Half Below Image) */
.next-btn {
  position: absolute;
  bottom: -33px;
  left: 50%;
  transform: translateX(-50%);
  width: 65%;
  padding: 9px;
  font-size: 0.95rem;
  font-weight: 900;
  font-style: italic;
  letter-spacing: 0.8px;
  color: #ffffff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
  background: linear-gradient(180deg, #f59e0b 0%, #d97706 50%, #b45309 100%);
  border: 2px solid #fef08a;
  border-radius: 50px;
  cursor: pointer;
  outline: none;
  transition: all 0.25s ease;
  box-shadow:
    0 0 18px rgba(245, 158, 11, 0.6),
    inset 0 2px 4px rgba(255, 255, 255, 0.7),
    0 6px 20px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  z-index: 10;
}

.next-btn:hover {
  transform: translateX(-50%) translateY(-2px) scale(1.02);
  box-shadow:
    0 0 25px rgba(251, 191, 36, 0.75),
    0 10px 25px rgba(0, 0, 0, 0.7);
}

.next-btn:active {
  transform: translateX(-50%) translateY(1px) scale(0.98);
}

/* Responsiveness adjustments for Mascot 2 Instructions page */
@media (max-width: 768px) {
  .mascot2-fullscreen-bg {
    left: -27vw;
    width: calc(100vw + 10px);
    background-position: left bottom;
    opacity: 0.9;
    top: 14vw;
  }

  .mascot3-fullscreen-bg,
  .mascot2-fullscreen-bg.mascot3-mode {
    left: -26vw;
    width: calc(90vw + 0px);
    background-position: left bottom;
    opacity: 0.9;
    top: 2vw;
  }

  .instructions-container {
    justify-content: flex-end;
    padding-right: 3vw;
  }

  .mission-img-card {
    width: min(65vw, 340px);
    max-width: 66vw;
    margin-right: -5px;
  }

  .mission-img-card.instruction-mode {
    width: min(68vw, 340px) !important;
    max-width: 68vw !important;
    margin-right: -14px !important;
  }
}

/* SEPARATE INSTRUCTION CARD MODE STYLES */
.mission-img-card.instruction-mode {
  width: min(68vw, 340px) !important;
  max-width: 68vw !important;
  margin-right: -14px !important;
}

.mission-img-card.instruction-mode .next-btn {
  bottom: -12px !important;
  width: 75% !important;
}

/* ==========================================
   MISSION COMPLETE RESULT SCREEN STYLES
   ========================================== */
.result-page-body {
  margin: 0;
  padding: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: url('../assets/bg_4.jpg') no-repeat center center / cover;
  font-family: 'Outfit', sans-serif;
}

.result-page-wrapper {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 2.5vh 16px 3vh 16px;
  box-sizing: border-box;
  overflow: hidden;
  z-index: 4;
}

.result-header-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  z-index: 4;
  text-align: center;
}

.result-page-logo {
  width: clamp(240px, 38vw, 420px);
  max-width: 85vw;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.7));
}

.mission-complete-title {
  font-size: clamp(2.2rem, 7.5vw, 3.8rem);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 2px;
  line-height: 1.05;
  margin: 8px 0 0 0;
  color: #fef08a;
  background: linear-gradient(180deg, #ffffff 0%, #fef08a 35%, #f59e0b 70%, #d97706 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 4px 15px rgba(245, 158, 11, 0.75));
  text-align: center;
}

.result-middle-section {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  width: 100%;
  max-width: 100vw;
  padding-left: 4vw;
  box-sizing: border-box;
  z-index: 4;
  margin: auto 0;
}

.shield-badge-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: min(48vw, 240px);
}

.result-shield-img {
  width: 100%;
  max-width: 220px;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 10px 25px rgba(0, 0, 0, 0.65));
  animation: cardSlideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.champion-caption {
  font-size: clamp(0.72rem, 2.4vw, 0.95rem);
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.6px;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.85);
  margin: 6px 0 0 0;
  text-align: center;
  line-height: 1.3;
}

.result-stats-grid {
  display: flex;
  gap: 10px;
  width: min(92vw, 460px);
  justify-content: center;
  margin-bottom: 8px;
  z-index: 4;
}

.result-stat-card {
  flex: 1;
  background: linear-gradient(180deg, rgba(15, 32, 67, 0.92) 0%, rgba(8, 19, 44, 0.95) 100%);
  border: 2px solid #fcd34d;
  border-radius: 14px;
  padding: 12px 6px 10px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow:
    0 0 20px rgba(245, 158, 11, 0.3),
    inset 0 0 15px rgba(252, 211, 77, 0.15),
    0 12px 30px rgba(0, 0, 0, 0.7);
  transition: transform 0.25s ease;
}

.result-card-icon {
  width: 28px;
  height: 28px;
  color: #fcd34d;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
  filter: drop-shadow(0 2px 6px rgba(245, 158, 11, 0.5));
}

.result-card-icon svg {
  width: 24px;
  height: 24px;
}

.result-card-title {
  font-size: 0.65rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.5px;
  line-height: 1.2;
  margin-bottom: 4px;
}

.result-card-value {
  font-size: 1.6rem;
  font-weight: 900;
  color: #fde047;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
  line-height: 1;
  margin-bottom: 2px;
}

.result-card-label {
  font-size: 0.72rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.6px;
  line-height: 1;
}

.result-footer-section {
  width: min(85vw, 360px);
  z-index: 4;
}

.view-leaderboard-btn {
  width: 100%;
  padding: 12px;
  font-size: 1.08rem;
  font-weight: 900;
  font-style: italic;
  letter-spacing: 1px;
  color: #ffffff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
  background: linear-gradient(180deg, #f59e0b 0%, #d97706 50%, #b45309 100%);
  border: 2.5px solid #fef08a;
  border-radius: 50px;
  cursor: pointer;
  outline: none;
  transition: all 0.25s ease;
  box-shadow:
    0 0 22px rgba(245, 158, 11, 0.65),
    inset 0 2px 4px rgba(255, 255, 255, 0.7),
    0 8px 25px rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.view-leaderboard-btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow:
    0 0 30px rgba(251, 191, 36, 0.8),
    0 12px 30px rgba(0, 0, 0, 0.75);
}

.view-leaderboard-btn:active {
  transform: translateY(1px) scale(0.98);
}

/* Responsiveness adjustments for Result Screen */
@media (max-width: 768px) {
  .result-middle-section {
    padding-left: 2vw;
  }

  .shield-badge-container {
    width: min(52vw, 220px);
  }

  .result-shield-img {
    max-width: 190px;
  }

  .result-stats-grid {
    gap: 8px;
    width: min(94vw, 420px);
  }

  .result-card-value {
    font-size: 1.45rem;
  }
}

/* ==========================================
   NATIONAL LEADERBOARD SCREEN STYLES
   ========================================== */
.leaderboard-page-body {
  margin: 0;
  padding: 0;
  width: 100vw;
  height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
  background: #040711 !important;
  font-family: 'Outfit', sans-serif;
  color: #ffffff;
}

.leaderboard-page-wrapper {
  position: relative;
  width: 100%;
  max-width: 520px;
  min-height: 100vh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 3vh 16px 4vh 16px;
  box-sizing: border-box;
  z-index: 4;
}

.leaderboard-header-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  text-align: center;
  margin-bottom: 10px;
}

.leaderboard-page-logo {
  width: clamp(230px, 36vw, 380px);
  max-width: 82vw;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.8));
}

.national-leaderboard-title {
  font-size: clamp(1.4rem, 4.5vw, 1.85rem);
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.5px;
  margin: 14px 0 0 0;
  text-align: center;
}

.leaderboard-card-panel {
  width: 100%;
  background: #080d1a;
  border: 1px solid #1e293b;
  border-radius: 18px;
  padding: 20px 18px 16px 18px;
  box-sizing: border-box;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.8);
  margin: auto 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.leaderboard-table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid #1e293b;
  font-size: 0.95rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.4px;
}

.col-rank {
  width: 28%;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 6px;
  padding-left: 4px;
}

.trophy-slot {
  width: 24px;
  min-width: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  line-height: 1;
}

.rank-num {
  min-width: 24px;
  font-weight: 800;
  color: #ffffff;
  text-align: left;
}

.col-name {
  width: 48%;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.col-score {
  width: 24%;
  text-align: right;
  padding-right: 4px;
}

.leaderboard-table-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 280px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: #f59e0b #080d1a;
}

.leaderboard-loading-text {
  text-align: center;
  color: #94a3b8;
  padding: 30px 0;
  font-weight: 600;
}

.leaderboard-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 4px;
  border-bottom: 1px solid rgba(30, 41, 59, 0.6);
  font-size: 0.95rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.4px;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.leaderboard-row.highlight-my-score {
  background: rgba(245, 158, 11, 0.18) !important;
  border-left: 4px solid #fcd34d !important;
  border-radius: 6px;
  padding-left: 8px !important;
  box-shadow: inset 0 0 12px rgba(245, 158, 11, 0.2);
}

.leaderboard-row.highlight-my-score .col-name {
  color: #fde047 !important;
  font-weight: 900;
}

.leaderboard-row.highlight-my-score .col-score {
  color: #fde047 !important;
  font-weight: 900;
}

.leaderboard-row .trophy-icon {
  font-size: 1.2rem;
  line-height: 1;
}

.leaderboard-row .col-name {
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.leaderboard-row .col-score {
  font-size: 1.05rem;
  font-weight: 800;
  color: #ffffff;
}

.leaderboard-ellipsis-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 4px;
  color: #cbd5e1;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 2px;
}

.leaderboard-ellipsis-row span {
  width: 33%;
  text-align: center;
}

.user-highlight-pill-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(180deg, #fcd34d 0%, #f59e0b 50%, #d97706 100%);
  border: 2px solid #fef08a;
  border-radius: 14px;
  padding: 11px 0;
  margin-top: 6px;
  box-shadow:
    0 0 20px rgba(245, 158, 11, 0.5),
    inset 0 2px 4px rgba(255, 255, 255, 0.7),
    0 8px 20px rgba(0, 0, 0, 0.6);
  color: #0f172a;
  font-weight: 900;
  font-size: 1.1rem;
}

.user-bar-col {
  flex: 1;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-bar-col:not(:last-child) {
  border-right: 1.5px solid rgba(15, 23, 42, 0.3);
}

.user-bar-col.col-name {
  font-weight: 900;
  color: #0f172a;
  font-size: 1.1rem;
}

.leaderboard-footer-section {
  width: 100%;
  max-width: 420px;
  margin-top: 14px;
}

.see-impact-btn {
  width: 100%;
  padding: 13px;
  font-size: 1.15rem;
  font-weight: 900;
  font-style: italic;
  letter-spacing: 1.2px;
  color: #ffffff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
  background: linear-gradient(180deg, #f59e0b 0%, #d97706 50%, #b45309 100%);
  border: 2.5px solid #fef08a;
  border-radius: 50px;
  cursor: pointer;
  outline: none;
  transition: all 0.25s ease;
  box-shadow:
    0 0 22px rgba(245, 158, 11, 0.65),
    inset 0 2px 4px rgba(255, 255, 255, 0.7),
    0 8px 25px rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.see-impact-btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow:
    0 0 30px rgba(251, 191, 36, 0.8),
    0 12px 30px rgba(0, 0, 0, 0.75);
}

.see-impact-btn:active {
  transform: translateY(1px) scale(0.98);
}

/* ==========================================
   SINGLE PAGE APPLICATION (SPA) VIEWS MANAGEMENT
   ========================================== */
.spa-body {
  margin: 0;
  padding: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  position: relative;
  background: #000000;
  font-family: 'Outfit', sans-serif;
}

.spa-view {
  display: none !important;
  width: 100vw;
  height: 100vh;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 10;
  overflow-x: hidden;
  overflow-y: auto;
  box-sizing: border-box;
}

.spa-view.active {
  display: block !important;
  z-index: 10;
}

.doctor-page-body.active {
  display: block !important;
  background: url('../assets/BG_2.jpg') no-repeat center center / cover !important;
}

.game-view-body {
  background: #000000;
  /* NOT display:none — Unity canvas must always be in DOM for WebGL context to stay alive */
  display: block;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  /* Behind all SPA views by default */
  pointer-events: none;
  /* No interaction when hidden behind other views */
}

.game-view-body.active {
  z-index: 99999 !important;
  /* On top of everything when playing */
  pointer-events: auto !important;
}

#unity-container,
#unity-container.unity-desktop {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: #000000 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

#unity-canvas {
  width: 100vw !important;
  height: 100vh !important;
  display: block !important;
  background: #000000 !important;
  object-fit: contain !important;
}

/* ==========================================
   GLOBAL PRELOADER OVERLAY STYLES
   ========================================== */
.global-loader-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(7, 5, 15, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 9999999 !important;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loader-card {
  width: min(88vw, 380px);
  background: rgba(15, 23, 42, 0.85);
  border: 1.5px solid #f59e0b;
  border-radius: 24px;
  padding: 30px 24px;
  text-align: center;
  box-shadow:
    0 0 35px rgba(245, 158, 11, 0.4),
    0 20px 50px rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.loader-logo {
  width: min(75%, 260px);
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.6));
}

.loader-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: #ffffff;
  margin: 4px 0 0 0;
  letter-spacing: 0.5px;
}

.loader-progress-track {
  width: 100%;
  height: 14px;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(252, 211, 77, 0.4);
  border-radius: 20px;
  overflow: hidden;
  padding: 2px;
  box-sizing: border-box;
}

.loader-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #f59e0b 0%, #fde047 100%);
  border-radius: 20px;
  transition: width 0.15s ease;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.8);
}

.loader-status-text {
  font-size: 0.92rem;
  font-weight: 800;
  color: #fde047;
  letter-spacing: 0.5px;
  margin: 0;
}

/* ==========================================
   SEE THE IMPACT (DID YOU KNOW?) SCREEN STYLES
   ========================================== */
.impact-page-body {
  margin: 0;
  padding: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  position: fixed;
  top: 0;
  left: 0;
  background: #000000;
  font-family: 'Outfit', sans-serif;
  z-index: 1;
}

.impact-page-body.active {
  display: block !important;
  z-index: 99999 !important;
}

.impact-bg-video {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  width: 100vw !important;
  height: 100vh !important;
  min-width: 100% !important;
  min-height: 100% !important;
  transform: translate(-50%, -50%) scale(1.02) !important;
  object-fit: cover !important;
  z-index: 1 !important;
  pointer-events: none !important;
}

.impact-page-wrapper {
  position: relative;
  z-index: 2;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: clamp(10px, 2vh, 20px) 16px clamp(14px, 2.5vh, 24px) 16px;
  box-sizing: border-box;
  overflow-y: auto;
  overflow-x: hidden;
}

.impact-header-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 8px;
}

.impact-page-logo {
  width: clamp(220px, 36vw, 360px);
  max-width: 82vw;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.8));
  margin-bottom: 10px;
}

.impact-main-title {
  font-size: clamp(2.1rem, 6.8vw, 3.1rem);
  color: #ffffff;
  margin: 35px 0 10px 0;
  text-shadow: 0 4px 14px rgba(0, 0, 0, 0.95);
  text-align: center;
  letter-spacing: 0.5px;
}

.impact-subtitle {
  font-size: clamp(1.15rem, 5.8vw, 1.38rem);
  color: #fde047;
  margin: 2px 0 0 0;
  text-align: center;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
  line-height: 1.3;
}

.impact-cards-container {
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 1.6vh, 15px);
  width: min(78vw, 460px);
  margin: clamp(6px, 1.5vh, 14px) 0;
  z-index: 2;
}

@keyframes boxFillLeftToRight {
  0% {
    -webkit-clip-path: inset(0 100% 0 0);
    clip-path: inset(0 100% 0 0);
    opacity: 0.2;
    transform: translateX(-12px);
  }

  100% {
    -webkit-clip-path: inset(0 0 0 0);
    clip-path: inset(0 0 0 0);
    opacity: 1;
    transform: translateX(0);
  }
}

.impact-card {
  background: url('../assets/l_box.png') no-repeat center center / 100% 100%;
  min-height: clamp(94px, 13vh, 115px);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 18px;
  box-sizing: border-box;
  filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.6));
  -webkit-clip-path: inset(0 100% 0 0);
  clip-path: inset(0 100% 0 0);
  animation: boxFillLeftToRight 1.6s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

.impact-card:nth-child(1) {
  animation-delay: 0.1s;
}

.impact-card:nth-child(2) {
  animation-delay: 0.45s;
}

.impact-card:nth-child(3) {
  animation-delay: 0.8s;
}

.impact-card-icon-wrap {
  width: clamp(60px, 14.5vw, 74px);
  height: clamp(60px, 14.5vw, 74px);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.impact-card-icon {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
}

.impact-card-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: #ffffff;
  text-align: left;
}

.impact-card-text {
  font-size: clamp(1.05rem, 3.5vw, 1.22rem);
  font-weight: 500;
  color: #ffffff;
  line-height: 1.25;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
}

.impact-card-value {
  font-size: clamp(1.55rem, 5vw, 1.95rem);
  font-weight: 900;
  line-height: 1.2;
  margin-top: 2px;
}

.green-val {
  color: #22c55e;
  text-shadow: 0 0 12px rgba(34, 197, 94, 0.5), 0 2px 6px rgba(0, 0, 0, 0.9);
}

.gold-val {
  color: #f59e0b;
  text-shadow: 0 0 12px rgba(245, 158, 11, 0.5), 0 2px 6px rgba(0, 0, 0, 0.9);
}

.impact-card-subtext {
  font-size: clamp(0.95rem, 3.1vw, 1.08rem);
  font-weight: 500;
  color: #ffffff;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
}

.impact-footer-caption {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
  margin-top: 4px;
  margin-bottom: 6px;
  z-index: 2;
  width: 100%;
}

.leaf-line-divider-img {
  width: min(88vw, 380px);
  height: auto;
  object-fit: contain;
  margin-bottom: 6px;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.6));
}

.leaf-line-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(88vw, 400px);
  margin-bottom: 6px;
  gap: 12px;
}

.leaf-line-divider .divider-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, #4ade80 50%, transparent 100%);
  opacity: 0.75;
}

.leaf-line-divider .leaf-icon-svg {
  display: flex;
  align-items: center;
  justify-content: center;
}

.impact-tagline {
  font-size: clamp(1.15rem, 5.8vw, 1.38rem);
  color: #ffffff;
  margin: 27px;
  text-align: center;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
  line-height: 1.35;
}

.impact-footer-action {
  width: min(88vw, 380px);
  z-index: 2;
  margin-top: 4px;
}

.impact-home-btn {
  width: 100%;
  padding: clamp(10px, 1.8vh, 14px);
  font-size: clamp(1.15rem, 3.8vw, 1.35rem);
  font-weight: 900;
  letter-spacing: 1px;
  color: #ffffff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
  background: linear-gradient(180deg, #fde047 0%, #f59e0b 45%, #d97706 100%);
  border: 2.5px solid #ffffff;
  border-radius: 50px;
  cursor: pointer;
  outline: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow:
    0 0 25px rgba(245, 158, 11, 0.7),
    inset 0 2px 4px rgba(255, 255, 255, 0.8),
    0 8px 22px rgba(0, 0, 0, 0.6);
  transition: all 0.25s ease;
}

.impact-home-btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow:
    0 0 32px rgba(251, 191, 36, 0.85),
    0 12px 30px rgba(0, 0, 0, 0.75);
}

.impact-home-btn:active {
  transform: translateY(1px) scale(0.98);
}

.home-svg-icon {
  width: 26px;
  height: 26px;
  color: #ffffff;
}

/* ==========================================
   TYPEWRITER & FLOATING LETTER ANIMATIONS
   ========================================== */
.typing-cursor {
  display: inline-block;
  opacity: 1;
  animation: blinkCursor 0.6s infinite;
  color: #fde047;
  font-weight: 300;
  margin-left: 2px;
  vertical-align: baseline;
}

@keyframes blinkCursor {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0;
  }
}

@keyframes letterFloatIn {
  0% {
    opacity: 0;
    transform: translateY(16px) scale(0.75);
    filter: blur(5px);
  }

  60% {
    opacity: 1;
    transform: translateY(-2px) scale(1.05);
    filter: blur(0px);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0px);
  }
}

.floating-letter {
  display: inline-block;
  opacity: 0;
  animation: letterFloatIn 0.55s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  white-space: pre;
}

/* ==========================================
   iOS SAFE AREA (iPhone notch + home indicator)
   viewport-fit=cover lets us fill edge-to-edge,
   but we must push interactive content above
   the home indicator using env(safe-area-inset-bottom).
   ~34px on iPhone 16 / iPhone 15 Pro.
   ========================================== */

/* Any full-screen SPA view that fills 100vh */
.spa-body,
.spa-view,
.r-view,
.intro-screen,
.view {
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* Fixed bottom bars / CTA buttons near page bottom */
.bottom-cta,
.bottom-bar,
.btn-bottom,
.action-footer {
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
}

/* Page wrappers used on login / index pages */
.page-wrapper {
  padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
}

/* Global loader overlay - center content so bottom inset doesn't shift it */
.global-loader-overlay {
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* Scrollable inner areas inside fixed views */
.scroll-inner,
.content-scroll {
  padding-bottom: env(safe-area-inset-bottom, 0px);
}