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

:root {
  --blue: #3b82f6;
  --blue-light: #93c5fd;
  --blue-bg: #eff6ff;
  --green: #22c55e;
  --green-light: #86efac;
  --green-bg: #f0fdf4;
  --pink: #ec4899;
  --pink-light: #f9a8d4;
  --pink-bg: #fdf2f8;
  --bg: #0f0f23;
  --bg-card: #1a1a2e;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --accent: #e94560;
  --gold: #fbbf24;
  --success: #22c55e;
}

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

body {
  font-family: 'Nunito', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* --- Starfield Background --- */
.stars {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.star {
  position: absolute;
  background: #fff;
  border-radius: 50%;
  animation: twinkle 3s ease-in-out infinite alternate;
}

@keyframes twinkle {
  0% { opacity: 0.15; }
  100% { opacity: 0.9; }
}

/* --- Login / Home Page --- */
.home-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem 1rem;
  position: relative;
  z-index: 1;
}

.logo {
  font-size: 3rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--accent), var(--gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.25rem;
  text-shadow: none;
}

.subtitle {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin-bottom: 2.5rem;
  text-align: center;
}

/* --- Pixel Art Hero --- */
.pixel-hero-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 1.5rem;
}

.pixel-hero {
  width: 6px;
  height: 6px;
  background: transparent;
  animation: heroFloat 3s ease-in-out infinite;
  /* 16x20 pixel knight — each "pixel" is 6px */
  box-shadow:
    /* Helmet top */
     30px  0px 0 #7c8ca1, 36px  0px 0 #7c8ca1, 42px  0px 0 #7c8ca1, 48px  0px 0 #7c8ca1,
    /* Helmet row 2 */
     24px  6px 0 #7c8ca1, 30px  6px 0 #8fa4bd, 36px  6px 0 #8fa4bd, 42px  6px 0 #8fa4bd, 48px  6px 0 #8fa4bd, 54px  6px 0 #7c8ca1,
    /* Helmet visor row */
     24px 12px 0 #7c8ca1, 30px 12px 0 #3b82f6, 36px 12px 0 #7c8ca1, 42px 12px 0 #3b82f6, 48px 12px 0 #7c8ca1, 54px 12px 0 #7c8ca1,
    /* Helmet plume */
     60px  0px 0 #e94560, 66px  0px 0 #e94560, 60px  6px 0 #e94560,
    /* Face */
     30px 18px 0 #f5c6a0, 36px 18px 0 #f5c6a0, 42px 18px 0 #f5c6a0, 48px 18px 0 #f5c6a0,
    /* Face row 2 — eyes + mouth */
     30px 24px 0 #f5c6a0, 36px 24px 0 #2d1b0e, 42px 24px 0 #f5c6a0, 48px 24px 0 #2d1b0e,
     30px 30px 0 #f5c6a0, 36px 30px 0 #f5c6a0, 42px 30px 0 #d4956b, 48px 30px 0 #f5c6a0,
    /* Armor torso */
     24px 36px 0 #3b82f6, 30px 36px 0 #3b82f6, 36px 36px 0 #60a5fa, 42px 36px 0 #60a5fa, 48px 36px 0 #3b82f6, 54px 36px 0 #3b82f6,
     24px 42px 0 #3b82f6, 30px 42px 0 #60a5fa, 36px 42px 0 #fbbf24, 42px 42px 0 #fbbf24, 48px 42px 0 #60a5fa, 54px 42px 0 #3b82f6,
     24px 48px 0 #3b82f6, 30px 48px 0 #3b82f6, 36px 48px 0 #60a5fa, 42px 48px 0 #60a5fa, 48px 48px 0 #3b82f6, 54px 48px 0 #3b82f6,
    /* Sword arm (right) */
     60px 36px 0 #7c8ca1, 66px 36px 0 #7c8ca1,
     66px 30px 0 #c0c0c0, 66px 24px 0 #c0c0c0, 66px 18px 0 #c0c0c0, 66px 12px 0 #fbbf24,
    /* Shield arm (left) */
     12px 36px 0 #e94560, 6px 36px 0 #e94560,
     6px 42px 0 #e94560, 12px 42px 0 #fbbf24, 18px 42px 0 #e94560,
     6px 48px 0 #e94560, 12px 48px 0 #e94560, 18px 48px 0 #e94560,
    /* Belt */
     30px 54px 0 #8b5e34, 36px 54px 0 #fbbf24, 42px 54px 0 #fbbf24, 48px 54px 0 #8b5e34,
    /* Legs */
     30px 60px 0 #3b82f6, 36px 60px 0 #3b82f6, 42px 60px 0 #3b82f6, 48px 60px 0 #3b82f6,
     30px 66px 0 #2563eb, 36px 66px 0 #2563eb, 42px 66px 0 #2563eb, 48px 66px 0 #2563eb,
    /* Boots */
     24px 72px 0 #8b5e34, 30px 72px 0 #8b5e34, 36px 72px 0 #8b5e34, 42px 72px 0 #8b5e34, 48px 72px 0 #8b5e34, 54px 72px 0 #8b5e34;
  transform: scale(1.8);
  margin: 20px 60px;
}

.pixel-shadow {
  width: 60px;
  height: 8px;
  background: radial-gradient(ellipse, rgba(0,0,0,0.4) 0%, transparent 70%);
  border-radius: 50%;
  margin-top: 30px;
  animation: shadowPulse 3s ease-in-out infinite;
}

@keyframes heroFloat {
  0%, 100% { transform: scale(1.8) translateY(0px); }
  50% { transform: scale(1.8) translateY(-8px); }
}

@keyframes shadowPulse {
  0%, 100% { transform: scaleX(1); opacity: 0.4; }
  50% { transform: scaleX(0.75); opacity: 0.25; }
}

/* --- OAuth Login Buttons --- */
.login-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
  max-width: 320px;
  margin-bottom: 2rem;
}

.oauth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.875rem 1.25rem;
  border: none;
  border-radius: 0.75rem;
  color: white;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s;
  text-decoration: none;
  font-family: 'Nunito', sans-serif;
}

.oauth-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.oauth-btn:active { transform: scale(0.97); }

.oauth-btn.microsoft-btn {
  background: #2f2f2f;
  border: 1px solid #444;
}

.oauth-btn.google-btn {
  background: #1a1a2e;
  border: 1px solid #333;
}

/* --- Login Form --- */
.login-card {
  background: var(--bg-card);
  border-radius: 1.5rem;
  padding: 2rem;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.login-card h2 {
  text-align: center;
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
}

.login-card .microsoft-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.875rem;
  border: none;
  border-radius: 0.75rem;
  background: #2f2f2f;
  color: white;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  text-decoration: none;
  margin-bottom: 1.5rem;
}

.login-card .microsoft-btn:hover { background: #404040; }

.login-card .divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.login-card .divider::before,
.login-card .divider::after {
  content: '';
  flex: 1;
  border-top: 1px solid #333;
}

.login-card label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--text-muted);
}

.login-card input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid #333;
  border-radius: 0.75rem;
  background: #0f0f23;
  color: var(--text);
  font-size: 1rem;
  font-family: 'Nunito', sans-serif;
  margin-bottom: 1rem;
  transition: border-color 0.2s;
}

.login-card input:focus {
  outline: none;
  border-color: var(--accent);
}

.login-card .submit-btn {
  width: 100%;
  padding: 0.875rem;
  border: none;
  border-radius: 0.75rem;
  background: var(--accent);
  color: white;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.1s, background 0.2s;
}

.login-card .submit-btn:hover { background: #d63d56; }
.login-card .submit-btn:active { transform: scale(0.97); }

.login-error {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  padding: 0.75rem;
  border-radius: 0.5rem;
  text-align: center;
  margin-bottom: 1rem;
  font-weight: 600;
  display: none;
}

.login-error.visible { display: block; }

.admin-link {
  margin-top: 2rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.admin-link a {
  color: var(--text-muted);
  text-decoration: underline;
}

/* --- Hero Cards (shown after login to pick kid) --- */
.hero-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1.25rem;
  width: 100%;
  max-width: 600px;
  margin-top: 1rem;
}

.hero-card {
  background: var(--bg-card);
  border-radius: 1.5rem;
  padding: 2rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  border: 3px solid transparent;
}

.hero-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
}

.hero-card:active { transform: scale(0.96); }

.hero-card.blue { border-color: var(--blue); background: linear-gradient(135deg, var(--bg-card), rgba(59, 130, 246, 0.15)); }
.hero-card.green { border-color: var(--green); background: linear-gradient(135deg, var(--bg-card), rgba(34, 197, 94, 0.15)); }
.hero-card.pink { border-color: var(--pink); background: linear-gradient(135deg, var(--bg-card), rgba(236, 72, 153, 0.15)); }

.hero-card .avatar {
  font-size: 3.5rem;
  margin-bottom: 0.75rem;
}

.hero-card .name {
  font-size: 1.3rem;
  font-weight: 800;
}

.hero-card .points {
  font-size: 0.95rem;
  color: var(--gold);
  font-weight: 700;
  margin-top: 0.25rem;
}

/* --- Dashboard --- */
.dashboard {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem;
  padding-bottom: 4rem;
}

/* --- Two-column layout --- */
.dash-columns {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}

.dash-col-left {
  flex: 0 0 320px;
  position: sticky;
  top: 1rem;
}

.dash-col-right {
  flex: 1;
  min-width: 0;
}

@media (max-width: 768px) {
  .dashboard { max-width: 600px; }
  .dash-columns {
    flex-direction: column;
  }
  .dash-col-left {
    flex: none;
    width: 100%;
    position: static;
  }
}

.dash-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.dash-header .back-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
}

.dash-header .avatar { font-size: 2.5rem; }

.dash-header .info { flex: 1; }

.dash-header .name { font-size: 1.4rem; font-weight: 800; }

.dash-header .balance {
  font-size: 1.1rem;
  color: var(--gold);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.dash-header .logout-btn {
  background: none;
  border: 1px solid #333;
  color: var(--text-muted);
  font-size: 0.8rem;
  padding: 0.4rem 0.75rem;
  border-radius: 0.5rem;
  cursor: pointer;
}

/* --- Progress Bar --- */
.progress-section {
  background: var(--bg-card);
  border-radius: 1rem;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}

.progress-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.progress-bar {
  height: 12px;
  background: #333;
  border-radius: 6px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--accent), var(--gold));
  transition: width 0.5s ease;
}

.progress-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
  text-align: right;
}

/* --- Section Headers --- */
.section-title {
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* --- Quest Board --- */
.slot-header {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-muted, #888);
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
  padding-left: 0.75rem;
  border-left: 3px solid var(--accent, #fbbf24);
}

.slot-header:first-child {
  margin-top: 0;
}

.quest-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.quest-card {
  background: var(--bg-card);
  border-radius: 1rem;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: transform 0.1s;
}

.quest-card .emoji { font-size: 2rem; }

.quest-card .quest-info { flex: 1; }

.quest-card .quest-name { font-weight: 700; font-size: 1rem; }

.quest-card .quest-points {
  font-size: 0.85rem;
  color: var(--gold);
  font-weight: 600;
}

.quest-card .complete-btn {
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: 0.75rem;
  background: var(--success);
  color: white;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: transform 0.1s, background 0.2s;
  white-space: nowrap;
  font-family: 'Nunito', sans-serif;
}

.quest-card .complete-btn:hover { background: #16a34a; }
.quest-card .complete-btn:active { transform: scale(0.93); }
.quest-card .complete-btn:disabled {
  background: #333;
  color: #666;
  cursor: not-allowed;
}

/* --- Quest Done State --- */
.quest-card.quest-done {
  opacity: 0.5;
}

.quest-card.quest-done .complete-btn {
  background: #1a5c2e;
  color: #86efac;
}

/* --- Slot status badges --- */
.slot-status {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 1rem;
  margin-left: 0.5rem;
  vertical-align: middle;
}

.slot-active {
  background: rgba(34, 197, 94, 0.2);
  color: #86efac;
}

.slot-upcoming {
  background: rgba(251, 191, 36, 0.2);
  color: #fbbf24;
}

/* --- Locked slot header --- */
.slot-header.slot-locked {
  opacity: 0.6;
}

/* --- Locked quest card --- */
.quest-card.quest-locked {
  opacity: 0.4;
  filter: grayscale(0.5);
}

.quest-card.quest-locked .locked-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 700;
  white-space: nowrap;
}

/* --- Upcoming toggle --- */
.upcoming-toggle {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.2s;
}

.upcoming-toggle:hover {
  background: rgba(255, 255, 255, 0.08);
}

.upcoming-toggle.open {
  border-color: rgba(251, 191, 36, 0.3);
}

.upcoming-arrow {
  font-size: 0.8rem;
  transition: transform 0.2s;
}

/* --- Reward Chest --- */
.chest-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.chest-card {
  background: linear-gradient(135deg, #1a1a2e, rgba(251, 191, 36, 0.1));
  border: 2px solid rgba(251, 191, 36, 0.3);
  border-radius: 1rem;
  padding: 1.25rem 0.75rem;
  text-align: center;
}

.chest-card .emoji { font-size: 2rem; margin-bottom: 0.4rem; }

.chest-card .chest-name {
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
  min-height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chest-card .use-btn {
  width: 100%;
  padding: 0.5rem;
  border: none;
  border-radius: 0.6rem;
  background: var(--gold);
  color: #1a1a2e;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: transform 0.1s;
  font-family: 'Nunito', sans-serif;
}

.chest-card .use-btn:hover { background: #f59e0b; }
.chest-card .use-btn:active { transform: scale(0.95); }
.chest-card .use-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* --- Reward Vault --- */
.reward-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.reward-card {
  background: var(--bg-card);
  border-radius: 1rem;
  padding: 1.25rem 1rem;
  text-align: center;
  transition: transform 0.2s;
}

.reward-card .emoji { font-size: 2.5rem; margin-bottom: 0.5rem; }

.reward-card .reward-name {
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
  min-height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.reward-card .reward-cost {
  font-size: 0.85rem;
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.reward-card .claim-btn {
  width: 100%;
  padding: 0.5rem;
  border: none;
  border-radius: 0.6rem;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: transform 0.1s;
  font-family: 'Nunito', sans-serif;
}

.reward-card .claim-btn.available {
  background: var(--accent);
  color: white;
}

.reward-card .claim-btn.available:hover { background: #d63d56; }
.reward-card .claim-btn.available:active { transform: scale(0.95); }

.reward-card .claim-btn.locked {
  background: #1f1f35;
  color: var(--text-muted);
  cursor: not-allowed;
  font-size: 0.75rem;
}

/* --- Battle Log --- */
.log-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.log-entry {
  background: var(--bg-card);
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
}

.log-entry .emoji { font-size: 1.3rem; }
.log-entry .log-info { flex: 1; }
.log-entry .log-name { font-weight: 600; }
.log-entry .log-time { font-size: 0.75rem; color: var(--text-muted); }
.log-entry .log-points { color: var(--gold); font-weight: 700; font-size: 0.85rem; }
.log-entry .log-points-earn { color: var(--success); font-weight: 700; font-size: 0.85rem; }
.log-entry .log-points-spend { color: var(--accent); font-weight: 700; font-size: 0.85rem; }

.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 2rem;
  font-size: 0.95rem;
}

/* --- Toast --- */
.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  padding: 0.75rem 1.25rem;
  border-radius: 0.75rem;
  font-weight: 700;
  font-size: 1rem;
  animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s forwards;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.toast.success { background: var(--success); color: white; }
.toast.error { background: #ef4444; color: white; }
.toast.info { background: var(--blue); color: white; }

@keyframes toastIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

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

/* --- Confetti --- */
.confetti-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 999;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  width: 10px;
  height: 10px;
  top: -10px;
  animation: confettiFall 2s ease-out forwards;
}

@keyframes confettiFall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* --- Day Calendar --- */
.day-calendar-card {
  background: var(--bg-card);
  border-radius: 1rem;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.day-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.day-date {
  font-weight: 800;
  font-size: 1rem;
  color: var(--text);
}

.day-time {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gold);
}

.allday-events {
  margin-bottom: 0.75rem;
}

.allday-event {
  padding: 0.5rem 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 0.5rem;
  margin-bottom: 0.4rem;
  font-size: 0.9rem;
}

.allday-event .event-desc {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.day-timeline {
  margin-left: 3.5rem;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.hour-line {
  position: absolute;
  left: -3.5rem;
  right: 0;
  height: 1px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.hour-line.past {
  opacity: 0.5;
}

.hour-label {
  position: absolute;
  left: 0;
  top: -0.5rem;
  font-size: 0.7rem;
  color: var(--text-muted);
  width: 3rem;
  text-align: right;
}

.now-line {
  position: absolute;
  left: -3.5rem;
  right: 0;
  height: 2px;
  z-index: 10;
  pointer-events: none;
}

.now-dot {
  position: absolute;
  left: 3rem;
  top: -4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ef4444;
}

.now-bar {
  position: absolute;
  left: 3.5rem;
  right: 0;
  top: 0;
  height: 2px;
  background: #ef4444;
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.5);
}

.timeline-event {
  position: absolute;
  left: 0.5rem;
  right: 0.5rem;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 0.5rem;
  padding: 0.35rem 0.6rem;
  overflow: hidden;
  z-index: 5;
}

.timeline-event.event-past {
  opacity: 0.4;
}

.event-time {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 600;
}

.event-title {
  font-size: 0.85rem;
  font-weight: 700;
}

.event-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* --- Loot Chest Cards --- */
.loot-chest-grid {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  margin-bottom: 1.5rem;
}

.loot-card {
  background: linear-gradient(135deg, #1a1a2e, rgba(168, 85, 247, 0.15));
  border-color: rgba(168, 85, 247, 0.4);
  padding: 1rem 0.75rem;
}

.loot-card.chest-opened {
  opacity: 0.4;
  filter: grayscale(0.5);
}

.loot-emoji { font-size: 2.5rem !important; }

.chest-cost {
  color: var(--gold);
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.chest-drops-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  justify-content: center;
  margin-bottom: 0.75rem;
}

.drop-tag {
  font-size: 0.7rem;
  padding: 0.15rem 0.4rem;
  border: 1px solid;
  border-radius: 0.4rem;
  background: rgba(0, 0, 0, 0.3);
  white-space: nowrap;
}

/* --- Chest Open Overlay --- */
.chest-open-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.chest-open-box {
  text-align: center;
  padding: 2rem;
}

.chest-open-emoji {
  font-size: 5rem;
  margin-bottom: 1rem;
}

.chest-bounce {
  animation: chestBounce 0.5s ease infinite alternate;
}

@keyframes chestBounce {
  from { transform: scale(1) rotate(-3deg); }
  to { transform: scale(1.15) rotate(3deg); }
}

.chest-open-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--gold);
  animation: pulse 1s ease infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.chest-reward-reveal {
  animation: revealIn 0.5s ease;
}

@keyframes revealIn {
  from { transform: scale(0.3); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.reward-glow {
  font-size: 4rem;
  margin-bottom: 0.5rem;
  text-shadow: 0 0 30px currentColor;
}

.reward-name {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 0.25rem;
}

.reward-rarity {
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 2px;
  margin-bottom: 1.5rem;
}

.chest-reward-reveal + .claim-btn {
  margin-top: 1rem;
  padding: 0.75rem 2rem;
  border: none;
  border-radius: 0.75rem;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  font-family: 'Nunito', sans-serif;
}

/* --- Responsive --- */
@media (min-width: 480px) {
  .quest-grid { grid-template-columns: 1fr 1fr; }
  .hero-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 360px) {
  .reward-grid { grid-template-columns: 1fr 1fr; }
  .logo { font-size: 2rem; }
}
