/* Experience settings, empty states, celebrations, cutscene, snapshot, insight */

:root {
  --bebas: 'Bebas Neue', sans-serif;
  --inter: 'Inter', 'Plus Jakarta Sans', sans-serif;
  --pillar-body: #9B59FF;
  --pillar-fuel: #00C853;
  --pillar-recharge: #4FC3F7;
  --pillar-wealth: #FFD700;
  --pillar-mind: #FF6B6B;
  --pillar-edge: #FF9500;
}

.gfy-cb-deuteranopia {
  --pillar-body: #0077BB;
  --pillar-fuel: #EE7733;
  --pillar-recharge: #33BBEE;
  --pillar-wealth: #CC3311;
  --pillar-mind: #009988;
  --pillar-edge: #EE3377;
}
.gfy-cb-protanopia {
  --pillar-body: #0077BB;
  --pillar-fuel: #EE7733;
  --pillar-recharge: #33BBEE;
  --pillar-wealth: #BBBBBB;
  --pillar-mind: #009988;
  --pillar-edge: #EE3377;
}
.gfy-cb-tritanopia {
  --pillar-body: #CC3311;
  --pillar-fuel: #EE7733;
  --pillar-recharge: #009988;
  --pillar-wealth: #BBBBBB;
  --pillar-mind: #0077BB;
  --pillar-edge: #EE3377;
}
.gfy-cb-monochromacy {
  --pillar-body: #888;
  --pillar-fuel: #666;
  --pillar-recharge: #aaa;
  --pillar-wealth: #555;
  --pillar-mind: #777;
  --pillar-edge: #999;
}

.gfy-high-contrast { --text: #fff; --muted: rgba(255,255,255,0.82); --border: rgba(255,255,255,0.22); }
.gfy-high-contrast .card { border-width: 2px; }
.gfy-large-text { font-size: 120%; }
.gfy-reduce-motion *, .gfy-reduce-motion *::before, .gfy-reduce-motion *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
}

.gfy-starfield-off #starfield-canvas { opacity: 0 !important; pointer-events: none; }
.gfy-ring-static .arc-ring-group { transition: none !important; }

/* Experience settings page */
.exp-page-title {
  font-family: var(--bebas);
  font-size: 32px;
  letter-spacing: 0.04em;
  line-height: 1;
  margin-bottom: 6px;
}
.exp-page-sub {
  font-family: var(--inter);
  font-size: 14px;
  color: #aaa;
  margin-bottom: 18px;
}
.exp-preset-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 18px;
}
.exp-preset-card {
  border: 2px solid var(--border2);
  border-radius: 14px;
  padding: 14px 12px;
  background: var(--surface2);
  cursor: pointer;
  text-align: left;
  color: var(--text);
  font-family: var(--inter);
  transition: border-color 0.2s;
}
.exp-preset-card.active { border-color: var(--purple); box-shadow: 0 0 0 1px rgba(139,131,232,0.35); }
.exp-preset-card .exp-preset-emoji { font-size: 22px; display: block; margin-bottom: 6px; }
.exp-preset-card .exp-preset-name { font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; }
.exp-preset-card .exp-preset-desc { font-size: 11px; color: var(--muted); margin-top: 4px; line-height: 1.4; }
.exp-section-label {
  font-family: var(--bebas);
  font-size: 18px;
  letter-spacing: 0.08em;
  margin: 18px 0 10px;
  color: var(--purple);
}
.exp-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.exp-row:last-child { border-bottom: none; }
.exp-slider { width: 100%; accent-color: var(--purple); }
.exp-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.exp-pill {
  border: 1px solid var(--border2);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.exp-pill.active { background: var(--purple-dim); border-color: var(--purple); color: var(--purple); }
.exp-sub-group { padding-left: 8px; border-left: 2px solid var(--border); margin-top: 8px; }
.exp-select { background: var(--surface2); color: var(--text); border: 1px solid var(--border2); border-radius: 10px; padding: 8px 10px; font-size: 13px; max-width: 220px; }

/* Empty states */
.gfy-empty-state {
  text-align: center;
  padding: 32px 20px;
  animation: gfyEmptyIn 0.3s ease;
}
@keyframes gfyEmptyIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.gfy-empty-icon { width: 48px; height: 48px; margin: 0 auto 14px; display: block; }
.gfy-empty-title { font-family: var(--bebas); font-size: 28px; letter-spacing: 0.04em; margin-bottom: 8px; }
.gfy-empty-body { font-family: var(--inter); font-size: 14px; color: #aaa; line-height: 1.55; max-width: 320px; margin: 0 auto 18px; }
.gfy-empty-btn {
  display: inline-block;
  background: var(--purple-dim);
  border: 1px solid rgba(139,131,232,0.4);
  color: var(--purple);
  font-weight: 700;
  font-size: 13px;
  padding: 12px 18px;
  border-radius: 999px;
  cursor: pointer;
  font-family: var(--inter);
}

/* Micro celebrations */
#gfy-micro-celebrations {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9500;
  width: min(92vw, 380px);
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.gfy-micro-celebration {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(18,18,26,0.96);
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 8px 32px rgba(0,0,0,0.45);
  animation: gfyMicroIn 0.35s ease, gfyMicroOut 0.35s ease 2.15s forwards;
  font-family: var(--inter);
  font-size: 14px;
}
@keyframes gfyMicroIn { from { opacity: 0; transform: translateY(-16px); } to { opacity: 1; transform: none; } }
@keyframes gfyMicroOut { to { opacity: 0; transform: translateY(-8px); } }
.gfy-micro-xp { font-family: var(--mono); font-weight: 700; font-size: 13px; white-space: nowrap; }

/* Rank cutscene */
.gfy-rank-cutscene {
  position: fixed;
  inset: 0;
  z-index: 9800;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.7);
  animation: gfyCutFadeIn 0.3s ease;
}
@keyframes gfyCutFadeIn { from { opacity: 0; } to { opacity: 1; } }
.gfy-rank-cutscene-inner { text-align: center; position: relative; z-index: 2; max-width: 90vw; }
.gfy-rank-cutscene-badge {
  margin: 0 auto 16px;
  animation: gfyRankBadgeIn 0.65s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes gfyRankBadgeIn {
  0% { transform: scale(0); opacity: 0; }
  60% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(1); }
}
.gfy-rank-cutscene-name {
  font-family: var(--bebas);
  font-size: 36px;
  letter-spacing: 0.06em;
  min-height: 44px;
}
.gfy-rank-cutscene-atlas {
  font-family: var(--inter);
  font-size: 14px;
  color: #ccc;
  margin: 16px auto 20px;
  max-width: 280px;
  line-height: 1.5;
}
.gfy-rank-cutscene-go {
  background: var(--purple);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 14px 28px;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  font-family: var(--inter);
}
.gfy-rank-rays {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.gfy-rank-ray {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 4px;
  height: 45vh;
  transform-origin: center top;
  opacity: 0.25;
  animation: gfyRayExpand 0.8s ease-out;
}
@keyframes gfyRayExpand { from { transform: scaleY(0); opacity: 0; } to { transform: scaleY(1); opacity: 0.25; } }
.gfy-rank-flash {
  position: fixed;
  inset: 0;
  pointer-events: none;
  animation: gfyRankFlash 0.5s ease-out;
}
@keyframes gfyRankFlash { 0% { opacity: 0.15; } 100% { opacity: 0; } }
.gfy-rank-cutscene--simple {
  position: fixed;
  top: 72px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9600;
  background: rgba(18,18,26,0.95);
  border: 1px solid var(--purple);
  border-radius: 14px;
  padding: 14px 20px;
  font-family: var(--inter);
  animation: gfyMicroIn 0.3s ease;
}

/* Streak flame */
.gfy-streak-flame-wrap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  vertical-align: middle;
}
.gfy-streak-flame {
  width: 22px;
  height: 28px;
  transform-origin: center bottom;
}
.gfy-streak-flame--1 { opacity: 0.4; transform: scale(0.7); }
.gfy-streak-flame--2 { opacity: 0.6; transform: scale(0.85); }
.gfy-streak-flame--3 { opacity: 0.8; transform: scale(1); filter: drop-shadow(0 0 4px rgba(255,140,0,0.5)); }
.gfy-streak-flame--4 { opacity: 1; transform: scale(1.1); filter: drop-shadow(0 0 8px rgba(255,100,0,0.65)); }
.gfy-streak-flame--5 { opacity: 1; transform: scale(1.2); filter: drop-shadow(0 0 12px rgba(255,80,0,0.8)); animation: gfyFlameRoar 0.35s ease-in-out infinite alternate; }
@keyframes gfyFlameFlicker { 0%,100% { transform: scaleY(1) scaleX(1); } 50% { transform: scaleY(1.08) scaleX(0.94); } }
.gfy-streak-flame:not(.gfy-streak-flame--5) { animation: gfyFlameFlicker 0.5s ease-in-out infinite alternate; }
@keyframes gfyFlameRoar { 0% { transform: scale(1.15) rotate(-2deg); } 100% { transform: scale(1.25) rotate(2deg); } }

/* XP bar spring */
.v3-rank-bar-fill.gfy-xp-spring {
  transition: width 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.v3-rank-bar-fill.gfy-xp-overshoot { transition: width 0.2s ease-in; }
.v3-rank-bar-track::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 8px;
  opacity: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.35));
  pointer-events: none;
}
.v3-rank-bar-track.gfy-xp-ripple::after {
  animation: gfyXpRipple 0.5s ease-out;
}
@keyframes gfyXpRipple { 0% { opacity: 0.7; transform: scaleX(0.5); } 100% { opacity: 0; transform: scaleX(2); } }

/* Weekly snapshot */
.gfy-weekly-snapshot {
  position: fixed;
  inset: 0;
  z-index: 9700;
  background: rgba(5,5,15,0.92);
  display: flex;
  align-items: flex-end;
  animation: gfySnapBg 0.4s ease;
}
@keyframes gfySnapBg { from { opacity: 0; } to { opacity: 1; } }
.gfy-weekly-sheet {
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  background: #0a0a12;
  border-radius: 24px 24px 0 0;
  padding: 28px 20px 32px;
  animation: gfySnapUp 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes gfySnapUp { from { transform: translateY(100%); } to { transform: none; } }
.gfy-weekly-title { font-family: var(--bebas); font-size: 48px; letter-spacing: 0.04em; line-height: 1; }
.gfy-weekly-dates { font-family: var(--inter); font-size: 14px; color: #aaa; margin: 8px 0 20px; }
.gfy-weekly-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}
.gfy-weekly-stat {
  background: var(--surface2);
  border-radius: 14px;
  padding: 14px;
  border: 1px solid var(--border);
}
.gfy-weekly-stat-num { font-family: var(--bebas); font-size: 40px; color: var(--purple); line-height: 1; }
.gfy-weekly-stat-label { font-family: var(--inter); font-size: 12px; color: #aaa; margin-top: 4px; }
.gfy-weekly-delta { font-size: 11px; margin-top: 4px; }
.gfy-weekly-delta.up { color: var(--green); }
.gfy-weekly-delta.down { color: var(--amber); }
.gfy-weekly-atlas {
  font-family: var(--inter);
  font-size: 14px;
  color: #ccc;
  padding: 14px;
  border-left: 3px solid var(--purple);
  background: #12121a;
  border-radius: 0 12px 12px 0;
  margin: 16px 0;
}

/* Daily insight card */
#gfy-daily-insight {
  margin: 0 16px 12px;
  animation: gfyEmptyIn 0.5s ease;
}
.gfy-daily-insight {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: #12121a;
  border-radius: 12px;
  padding: 14px;
  border-left: 3px solid var(--purple);
  cursor: pointer;
  position: relative;
}
.gfy-daily-insight::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--purple);
  border-radius: 12px 0 0 12px;
  animation: gfyInsightPulse 4s ease-in-out infinite;
}
@keyframes gfyInsightPulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }
.gfy-daily-insight-label {
  font-family: var(--bebas);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--purple);
  margin-bottom: 4px;
}
.gfy-daily-insight-text {
  font-family: var(--inter);
  font-size: 14px;
  color: #fff;
  line-height: 1.45;
}

.v3-rank-badge-wrap { position: relative; display: inline-block; }
.v3-rank-num-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  font-size: 10px;
  font-weight: 800;
  background: rgba(0,0,0,0.75);
  color: #fff;
  border-radius: 4px;
  padding: 1px 4px;
  line-height: 1.2;
  z-index: 2;
}
.v3-rank-bar-track { position: relative; overflow: hidden; }
.gfy-cb-monochromacy .v3-rank-bar-fill,
.gfy-cb-monochromacy .stat-bar-fill {
  background-image: repeating-linear-gradient(45deg, transparent, transparent 4px, rgba(255,255,255,0.08) 4px, rgba(255,255,255,0.08) 8px) !important;
}
