/* ════════════════════════════════════════════════════════════════
   TIME TRAVELER — game.css v1.0
   Time portal theme — deep purple/indigo with gold & cyan accents
   ════════════════════════════════════════════════════════════════ */

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

#tt-wrap, #tt-wrap * { box-sizing: border-box; }

#tt-wrap {
  --bg-deep:    #160b2e;
  --bg-mid:     #241247;
  --bg-light:   #341a5e;
  --accent-gold:   #fbbf24;
  --accent-purple: #8b5cf6;
  --accent-cyan:   #22d3ee;
  --accent-rose:   #f472b6;
  --text-bright: #f3f0ff;
  --text-soft:   #cbbdf0;
  --text-mute:   #8b7bb0;
  --card-bg:     rgba(255,255,255,0.06);
  --card-bg-2:   rgba(255,255,255,0.10);
  --card-border: rgba(251,191,36,0.22);

  font-family: 'Nunito', 'Segoe UI', sans-serif;
  background: var(--bg-deep);
  color: var(--text-bright);
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  max-width: 720px;
  margin: 0 auto;
  box-shadow: 0 20px 80px rgba(139,92,246,0.25);
  -webkit-font-smoothing: antialiased;
}

#tt-wrap button {
  font-family: 'Nunito', 'Segoe UI', sans-serif;
}

/* ═══ PORTAL BACKGROUND ═══════════════════════════════════════ */
.tt-portal-bg {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 70% 50% at 20% 0%, rgba(139,92,246,0.25) 0%, transparent 60%),
    radial-gradient(ellipse 60% 60% at 85% 20%, rgba(34,211,238,0.15) 0%, transparent 65%),
    radial-gradient(ellipse 80% 50% at 50% 100%, rgba(251,191,36,0.10) 0%, transparent 70%),
    linear-gradient(180deg, var(--bg-deep) 0%, var(--bg-mid) 50%, var(--bg-deep) 100%);
}
.tt-stars { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; opacity: 0.6; }
.tt-star {
  position: absolute; font-size: 0.7rem; opacity: 0.5;
  animation: tt-twinkle 3s ease-in-out infinite;
}
@keyframes tt-twinkle { 0%,100% { opacity: 0.2; } 50% { opacity: 0.8; } }

/* ═══ SCREENS ═════════════════════════════════════════════════ */
.tt-screen { display: none; position: relative; z-index: 1; padding: 24px; }
.tt-screen.active { display: flex; flex-direction: column; gap: 16px; min-height: 480px; }
.hidden { display: none !important; }

/* ════════════════════════════════════════════════════════════════
   WELCOME
   ════════════════════════════════════════════════════════════════ */
#tt-screen-welcome.active { align-items: center; justify-content: center; }
.tt-welcome-inner {
  display: flex; flex-direction: column; align-items: center; gap: 20px;
  text-align: center; padding: 30px 0;
}
.tt-welcome-portal {
  width: 130px; height: 130px;
  display: flex; align-items: center; justify-content: center;
  font-size: 4.5rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(139,92,246,0.3), rgba(34,211,238,0.1));
  animation: tt-portal-spin 6s linear infinite, tt-portal-pulse 2.5s ease-in-out infinite;
  filter: drop-shadow(0 0 30px rgba(139,92,246,0.6));
}
@keyframes tt-portal-spin { to { transform: rotate(360deg); } }
@keyframes tt-portal-pulse { 0%,100% { box-shadow: 0 0 20px rgba(139,92,246,0.4); } 50% { box-shadow: 0 0 50px rgba(34,211,238,0.5); } }

.tt-welcome-title { font-size: 2.4rem; font-weight: 900; line-height: 1.05; letter-spacing: -1px; }
.tt-welcome-tagline {
  font-size: 0.78rem; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase;
  color: var(--accent-gold); background: rgba(251,191,36,0.12); border: 1px solid rgba(251,191,36,0.3);
  padding: 5px 14px; border-radius: 999px; margin-top: -6px;
}
.tt-welcome-title span:first-child { color: var(--text-bright); display: block; }
.tt-gradient {
  background: linear-gradient(135deg, var(--accent-gold) 0%, var(--accent-purple) 50%, var(--accent-cyan) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  display: block;
}
.tt-welcome-sub { font-size: 0.95rem; color: var(--text-soft); max-width: 380px; line-height: 1.55; }

.tt-setup-row { display: flex; gap: 10px; width: 100%; max-width: 360px; }
.tt-setup-row > div { flex: 1; }
#tt-wrap input, #tt-wrap select {
  width: 100%;
  background: var(--card-bg-2);
  border: 2px solid var(--card-border);
  color: var(--text-bright);
  border-radius: 14px; padding: 12px 16px;
  font-size: 0.92rem; font-weight: 700;
  outline: none; -webkit-appearance: none; appearance: none;
  transition: border-color .2s, background .2s;
}
#tt-wrap input::placeholder { color: var(--text-mute); font-weight: 600; }
#tt-wrap input:focus, #tt-wrap select:focus { border-color: var(--accent-gold); background: rgba(251,191,36,0.07); }
#tt-wrap select option {
  color: #1e1b4b;
  background: #fff;
}

.tt-btn {
  cursor: pointer; border: none; font-weight: 800; letter-spacing: .3px;
  transition: transform .12s, box-shadow .15s;
}
.tt-btn:active { transform: scale(0.96); }
.tt-btn-hero {
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-cyan));
  color: #160b2e; font-size: 0.95rem; padding: 16px 38px; border-radius: 999px;
  box-shadow: 0 10px 36px rgba(139,92,246,0.4), inset 0 -3px 0 rgba(0,0,0,0.15);
  text-transform: uppercase;
}
.tt-btn-hero:hover { transform: translateY(-3px); box-shadow: 0 14px 44px rgba(139,92,246,0.55); }

.tt-btn-primary {
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-rose));
  color: #2a0a3a; font-size: 0.92rem; padding: 13px 26px; border-radius: 14px;
  box-shadow: 0 6px 22px rgba(251,191,36,0.3);
}
.tt-btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(251,191,36,0.45); }

.tt-btn-ghost {
  background: var(--card-bg-2); border: 2px solid var(--card-border); color: var(--text-soft);
  font-size: 0.85rem; padding: 11px 20px; border-radius: 12px;
}
.tt-btn-ghost:hover { background: rgba(251,191,36,0.1); border-color: var(--accent-gold); color: var(--text-bright); }

.tt-btn-continue { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; padding: 15px; font-size: 0.95rem; border-radius: 16px; }
.tt-continue-arrow { display: inline-block; background: rgba(0,0,0,0.2); width: 24px; height: 24px; border-radius: 50%; font-size: 0.65rem; line-height: 24px; text-align: center; }

/* ════════════════════════════════════════════════════════════════
   HUD
   ════════════════════════════════════════════════════════════════ */
.tt-hud { display: flex; align-items: center; justify-content: space-between; }
.tt-hud-player { display: flex; align-items: center; gap: 10px; }
.tt-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-cyan));
  display: flex; align-items: center; justify-content: center; font-size: 1.3rem;
  box-shadow: 0 4px 14px rgba(139,92,246,0.35);
}
.tt-hud-info { display: flex; flex-direction: column; gap: 1px; }
.tt-hud-name { font-size: 0.9rem; font-weight: 800; }
.tt-hud-rank { font-size: 0.7rem; color: var(--accent-gold); font-weight: 700; }
.tt-hud-stats { display: flex; align-items: center; gap: 6px; }
.tt-xp-pill, .tt-streak-pill {
  display: inline-flex; align-items: center; gap: 4px;
  border: 1.5px solid var(--card-border); font-weight: 800; font-size: 0.8rem;
  padding: 6px 11px; border-radius: 999px;
}
.tt-xp-pill { background: rgba(251,191,36,0.14); color: var(--accent-gold); }
.tt-streak-pill { background: rgba(244,114,182,0.14); color: var(--accent-rose); border-color: rgba(244,114,182,0.3); }
.tt-icon-btn {
  background: var(--card-bg-2); border: 1.5px solid var(--card-border); color: var(--text-bright);
  width: 36px; height: 36px; border-radius: 11px; font-size: 1rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: background .15s, transform .1s;
}
.tt-icon-btn:hover { background: rgba(251,191,36,0.15); transform: scale(1.05); }
.tt-icon-btn-lb::after { content: "\1F3C6"; font-family: "Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji","Segoe UI Symbol",sans-serif; }
.tt-icon-btn-reset::after { content: "\1F6AA"; font-family: "Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji","Segoe UI Symbol",sans-serif; }

/* ════════════════════════════════════════════════════════════════
   MAP HEADER + RANK TRACK
   ════════════════════════════════════════════════════════════════ */
.tt-map-header { text-align: center; padding: 2px 0; }
.tt-map-title { font-size: 1.3rem; font-weight: 900; margin-bottom: 4px; }
.tt-map-sub { font-size: 0.78rem; color: var(--text-mute); }

.tt-rank-track { position: relative; background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 999px; height: 20px; padding: 0 2px; }
.tt-rank-fill {
  position: absolute; left: 2px; top: 2px; bottom: 2px; width: 0%;
  background: linear-gradient(90deg, var(--accent-purple), var(--accent-gold));
  border-radius: 999px; transition: width .6s cubic-bezier(.4,0,.2,1);
  box-shadow: 0 0 12px rgba(251,191,36,0.5);
}

/* ════════════════════════════════════════════════════════════════
   PATH (journey map)
   ════════════════════════════════════════════════════════════════ */
.tt-path { display: flex; flex-direction: column; padding: 8px 0; flex: 1; }
.tt-path-row { display: flex; align-items: center; gap: 12px; padding: 5px 0; position: relative; }
.tt-path-row.tt-align-right { flex-direction: row-reverse; }
.tt-path-row::before {
  content: ''; position: absolute; left: 50%; top: -6px; width: 2px; height: 12px;
  background-image: linear-gradient(to bottom, rgba(251,191,36,0.35) 50%, transparent 50%);
  background-size: 2px 6px; transform: translateX(-50%);
}
.tt-path-row:first-child::before { display: none; }

.tt-path-node {
  position: relative; width: 60px; height: 60px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; border-radius: 50%;
  cursor: pointer; transition: transform .2s; font-size: 1.8rem;
  background: linear-gradient(135deg, rgba(139,92,246,0.14), rgba(34,211,238,0.08));
}
.tt-path-node:hover { transform: scale(1.08); }
.tt-path-node::before { content: ''; position: absolute; inset: -3px; border-radius: 50%; border: 2px solid transparent; transition: border-color .3s; }

.tt-path-node.tt-locked { cursor: not-allowed; filter: grayscale(85%) brightness(.4); }
.tt-path-node.tt-locked::after {
  content: '🔒'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; background: rgba(22,11,46,0.6); border-radius: 50%;
}
.tt-path-node.tt-completed::before { border-color: var(--accent-cyan); box-shadow: 0 0 18px rgba(34,211,238,0.5); }
.tt-path-node.tt-completed::after {
  content: '✓'; position: absolute; right: -3px; bottom: -3px; width: 22px; height: 22px;
  background: var(--accent-cyan); color: #160b2e; border-radius: 50%; font-size: 0.78rem; font-weight: 900;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 8px rgba(34,211,238,0.6);
}
.tt-path-node.tt-current::before { border-color: var(--accent-gold); box-shadow: 0 0 26px rgba(251,191,36,0.65); animation: tt-cur-pulse 2s ease-in-out infinite; }
@keyframes tt-cur-pulse { 0%,100% { box-shadow: 0 0 16px rgba(251,191,36,0.4); } 50% { box-shadow: 0 0 34px rgba(251,191,36,0.85); } }
.tt-path-node.tt-soon { cursor: default; filter: grayscale(60%) brightness(.55); opacity: .7; }

.tt-path-info { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.tt-path-name { font-size: 0.92rem; font-weight: 800; }
.tt-path-meta { font-size: 0.68rem; color: var(--text-mute); }
.tt-soon-tag { color: var(--accent-rose); font-weight: 800; }
.tt-path-row.tt-align-right .tt-path-info { text-align: right; }

/* ════════════════════════════════════════════════════════════════
   STORY SCREEN
   ════════════════════════════════════════════════════════════════ */
.tt-story-header { display: flex; align-items: center; justify-content: space-between; }
.tt-back-btn {
  background: var(--card-bg-2); border: 1.5px solid var(--card-border); color: var(--text-soft);
  border-radius: 10px; padding: 7px 13px; font-size: 0.78rem; font-weight: 700; cursor: pointer;
  font-family: inherit; transition: background .15s, color .15s;
}
.tt-back-btn:hover { background: rgba(251,191,36,0.15); color: var(--text-bright); }
.tt-story-era-label { font-size: 0.85rem; font-weight: 800; color: var(--accent-gold); }

.tt-story-card {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 22px; text-align: center; padding: 20px 8px;
}
.tt-story-emoji-box {
  width: 110px; height: 110px; border-radius: 50%;
  background: radial-gradient(circle, rgba(139,92,246,0.25), rgba(34,211,238,0.08));
  display: flex; align-items: center; justify-content: center; font-size: 3.6rem;
  animation: tt-story-float 3.5s ease-in-out infinite;
}
@keyframes tt-story-float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.tt-story-text { font-size: 1.08rem; font-weight: 700; line-height: 1.6; color: var(--text-bright); max-width: 460px; }
.tt-story-counter { font-size: 0.75rem; color: var(--text-mute); font-weight: 700; }

/* ════════════════════════════════════════════════════════════════
   MINI-GAME SCREEN
   ════════════════════════════════════════════════════════════════ */
.tt-mg-header { display: flex; align-items: center; justify-content: space-between; }
.tt-mg-instructions { font-size: 0.95rem; font-weight: 700; color: var(--text-bright); text-align: center; padding: 6px 12px; line-height: 1.5; }
#tt-mg-area { flex: 1; display: flex; align-items: center; justify-content: center; padding: 8px 0; }

.tt-sequence-grid { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 380px; }
.tt-sequence-tile, .tt-route-node, .tt-match-tile {
  background: var(--card-bg); border: 2px solid var(--card-border); color: var(--text-bright);
  border-radius: 14px; padding: 14px 16px; font-family: inherit; font-size: 0.92rem; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; gap: 12px; transition: background .15s, border-color .15s, transform .1s;
}
.tt-sequence-tile:hover:not(:disabled), .tt-route-node:hover:not(:disabled), .tt-match-tile:hover:not(:disabled) {
  background: rgba(251,191,36,0.1); border-color: var(--accent-gold); transform: translateY(-2px);
}
.tt-mg-emoji { font-size: 1.4rem; flex-shrink: 0; }
.tt-mg-label { text-align: left; }

.tt-route-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 100%; max-width: 420px; }
.tt-route-node { flex-direction: column; text-align: center; padding: 16px 10px; gap: 6px; }
.tt-route-node .tt-mg-emoji { font-size: 1.8rem; }
.tt-route-node .tt-mg-label { font-size: 0.78rem; text-align: center; }

.tt-mg-done { background: rgba(34,211,238,0.16) !important; border-color: var(--accent-cyan) !important; opacity: 0.75; cursor: default !important; }
.tt-mg-shake { animation: tt-shake .45s ease; border-color: #f87171 !important; background: rgba(248,113,113,0.12) !important; }
@keyframes tt-shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-7px); } 75% { transform: translateX(7px); } }

.tt-match-wrap { display: flex; gap: 14px; width: 100%; max-width: 460px; }
.tt-match-col { flex: 1; display: flex; flex-direction: column; gap: 9px; }
.tt-match-tile { font-size: 1rem; justify-content: center; text-align: center; padding: 14px 10px; }
.tt-match-selected { border-color: var(--accent-purple) !important; background: rgba(139,92,246,0.18) !important; }

/* ════════════════════════════════════════════════════════════════
   QUIZ (shared quiz & boss)
   ════════════════════════════════════════════════════════════════ */
.tt-quiz-progress-wrap { display: flex; flex-direction: column; gap: 6px; }
.tt-quiz-counter { font-size: 0.7rem; font-weight: 800; color: var(--accent-gold); text-transform: uppercase; letter-spacing: 1px; }
.tt-quiz-bar { height: 7px; background: var(--card-bg); border-radius: 999px; overflow: hidden; }
.tt-quiz-bar > div { height: 100%; width: 0%; background: linear-gradient(90deg, var(--accent-purple), var(--accent-gold)); border-radius: 999px; transition: width .45s; }

.tt-quiz-question { font-size: 1.08rem; font-weight: 800; text-align: center; padding: 10px 6px; line-height: 1.45; }
.tt-quiz-options { display: flex; flex-direction: column; gap: 9px; }
.tt-quiz-opt {
  background: var(--card-bg); border: 2px solid var(--card-border); color: var(--text-bright);
  border-radius: 14px; padding: 13px 16px; font-family: inherit; font-size: 0.9rem; font-weight: 700;
  cursor: pointer; text-align: left; display: flex; align-items: center; gap: 11px; transition: background .15s, border-color .15s, transform .1s;
}
.tt-quiz-opt:hover:not(:disabled) { background: rgba(251,191,36,0.1); border-color: var(--accent-gold); transform: translateY(-2px); }
.tt-quiz-opt:disabled { cursor: default; }
.tt-quiz-opt-letter {
  width: 26px; height: 26px; background: rgba(251,191,36,0.18); border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 0.72rem; font-weight: 900;
  color: var(--accent-gold); flex-shrink: 0;
}
.tt-quiz-correct { background: rgba(34,211,238,0.16) !important; border-color: var(--accent-cyan) !important; }
.tt-quiz-correct .tt-quiz-opt-letter { background: var(--accent-cyan); color: #160b2e; }
.tt-quiz-wrong { background: rgba(248,113,113,0.14) !important; border-color: #f87171 !important; animation: tt-shake .4s ease; }
.tt-quiz-wrong .tt-quiz-opt-letter { background: #f87171; color: #160b2e; }

.tt-quiz-feedback { padding: 9px 16px; border-radius: 12px; font-weight: 800; font-size: 0.85rem; text-align: center; }
.tt-fb-good { background: rgba(34,211,238,0.12); color: #a5f3fc; border: 1.5px solid rgba(34,211,238,0.35); }
.tt-fb-bad { background: rgba(248,113,113,0.12); color: #fecaca; border: 1.5px solid rgba(248,113,113,0.35); }

/* ════════════════════════════════════════════════════════════════
   BOSS INTRO
   ════════════════════════════════════════════════════════════════ */
#tt-screen-bossintro.active { align-items: center; justify-content: center; }
.tt-boss-intro-card {
  display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center;
  background: linear-gradient(160deg, rgba(248,113,113,0.12), rgba(139,92,246,0.08));
  border: 2px solid rgba(248,113,113,0.3); border-radius: 24px; padding: 36px 28px; max-width: 420px;
}
.tt-boss-emoji-box { font-size: 4.5rem; animation: tt-boss-shake 1.8s ease-in-out infinite; }
@keyframes tt-boss-shake { 0%,100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
.tt-boss-title { font-size: 0.78rem; font-weight: 800; color: #fca5a5; text-transform: uppercase; letter-spacing: 1.2px; }
.tt-boss-name { font-size: 1.6rem; font-weight: 900; }
.tt-boss-intro-text { font-size: 0.92rem; color: var(--text-soft); line-height: 1.55; }

/* ════════════════════════════════════════════════════════════════
   REFLECTION
   ════════════════════════════════════════════════════════════════ */
#tt-screen-reflection.active { align-items: center; justify-content: center; }
.tt-reflection-card {
  display: flex; flex-direction: column; align-items: center; gap: 18px; text-align: center;
  max-width: 440px;
}
.tt-reflection-icon { font-size: 3rem; }
.tt-reflection-question { font-size: 1.15rem; font-weight: 800; line-height: 1.5; }
.tt-reflection-answer-box {
  background: var(--card-bg); border: 1.5px solid var(--card-border); border-radius: 16px;
  padding: 16px 20px; font-size: 0.9rem; color: var(--text-soft); line-height: 1.6;
  animation: tt-fade-in .4s ease;
}
@keyframes tt-fade-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ════════════════════════════════════════════════════════════════
   OVERLAYS (card unlock / rank up)
   ════════════════════════════════════════════════════════════════ */
.tt-overlay {
  position: absolute; inset: 0; z-index: 100; background: rgba(22,11,46,0.92); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.tt-card-unlock, .tt-rank-card {
  background: linear-gradient(135deg, rgba(139,92,246,0.2), rgba(34,211,238,0.1));
  border: 2px solid var(--accent-gold); border-radius: 24px; padding: 34px 28px; max-width: 380px; width: 100%;
  text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px;
  animation: tt-pop .4s cubic-bezier(.34,1.56,.64,1); position: relative; overflow: hidden;
}
@keyframes tt-pop { from { transform: scale(.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.tt-card-burst, .tt-rank-burst {
  position: absolute; inset: -50%;
  background: conic-gradient(from 0deg, transparent 0deg, rgba(251,191,36,0.3) 20deg, transparent 40deg, rgba(139,92,246,0.3) 90deg, transparent 110deg, rgba(34,211,238,0.3) 180deg, transparent 200deg);
  animation: tt-spin-slow 6s linear infinite; pointer-events: none; z-index: 0;
}
@keyframes tt-spin-slow { to { transform: rotate(360deg); } }
.tt-card-emoji-box, .tt-rank-badge { position: relative; z-index: 1; font-size: 4rem; filter: drop-shadow(0 0 24px rgba(251,191,36,0.55)); }
.tt-card-label, .tt-rank-title {
  position: relative; z-index: 1; font-size: 0.75rem; font-weight: 800; color: var(--accent-gold);
  text-transform: uppercase; letter-spacing: 1.2px;
}
.tt-card-title-text, .tt-rank-name { position: relative; z-index: 1; font-size: 1.4rem; font-weight: 900; }
.tt-card-facts { position: relative; z-index: 1; list-style: none; display: flex; flex-direction: column; gap: 8px; text-align: left; width: 100%; }
.tt-card-facts li {
  font-size: 0.82rem; color: var(--text-soft); line-height: 1.5; padding-left: 18px; position: relative;
}
.tt-card-facts li::before { content: '✦'; position: absolute; left: 0; color: var(--accent-gold); }
.tt-card-unlock .tt-btn, .tt-rank-card .tt-btn { position: relative; z-index: 1; }

/* ════════════════════════════════════════════════════════════════
   LEADERBOARD
   ════════════════════════════════════════════════════════════════ */
.tt-lb-list { list-style: none; display: flex; flex-direction: column; gap: 8px; max-height: 480px; overflow-y: auto; padding-right: 4px; }
.tt-lb-row {
  display: flex; align-items: center; gap: 12px; background: var(--card-bg); border: 1.5px solid var(--card-border);
  border-radius: 14px; padding: 11px 15px;
}
.tt-lb-row:nth-child(1) { background: linear-gradient(135deg, rgba(251,191,36,0.16), rgba(251,191,36,0.06)); border-color: rgba(251,191,36,0.5); }
.tt-lb-row:nth-child(2) { background: linear-gradient(135deg, rgba(203,213,225,0.12), rgba(139,92,246,0.06)); border-color: rgba(203,213,225,0.35); }
.tt-lb-row:nth-child(3) { background: linear-gradient(135deg, rgba(244,114,182,0.14), rgba(244,114,182,0.05)); border-color: rgba(244,114,182,0.35); }
.tt-lb-rank { font-size: 1.2rem; min-width: 30px; text-align: center; font-weight: 900; }
.tt-lb-name { flex: 1; font-weight: 800; font-size: 0.9rem; }
.tt-lb-sub { font-size: 0.68rem; color: var(--text-mute); font-weight: 600; margin-top: 1px; }
.tt-lb-xp { color: var(--accent-gold); font-weight: 900; font-size: 0.85rem; }
.tt-lb-loading { color: var(--text-mute); text-align: center; padding: 28px; font-size: 0.85rem; }

/* ════════════════════════════════════════════════════════════════
   CONFETTI
   ════════════════════════════════════════════════════════════════ */
.tt-confetti { position: absolute; inset: 0; pointer-events: none; z-index: 200; overflow: hidden; }
.tt-confetti-piece { position: absolute; width: 9px; height: 13px; top: -20px; animation: tt-confetti-fall linear forwards; }
@keyframes tt-confetti-fall { to { transform: translateY(700px) rotate(680deg); opacity: 0; } }

/* ════════════════════════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════════════════════════ */
@media (max-width: 500px) {
  #tt-wrap { border-radius: 0; min-height: 100vh; }
  .tt-screen { padding: 16px; min-height: 100vh; }
  .tt-welcome-title { font-size: 1.9rem; }
  .tt-welcome-portal { width: 100px; height: 100px; font-size: 3.5rem; }
  .tt-setup-row { flex-direction: column; max-width: 100%; }
  .tt-path-node { width: 50px; height: 50px; font-size: 1.5rem; }
  .tt-path-name { font-size: 0.82rem; }
  .tt-route-grid { grid-template-columns: repeat(2, 1fr); }
  .tt-match-wrap { gap: 8px; }
  .tt-match-tile { font-size: 0.85rem; padding: 11px 6px; }
}
