/* ============================================================
   FLASH OF INSIGHT — Minigame Styles
   ============================================================ */

/* ── NAV TRIGGER ─────────────────────────────────────────── */
.fi-trigger {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  margin-left: 1rem;
  padding: 4px 6px;
  opacity: 0.8;
  transition: drop-shadow(0 0 7px rgba(51,170,238,1)), filter 1s;
  animation: fi-idle 5s ease-in-out infinite;
  flex-shrink: 0;
}
.fi-trigger:hover {
  opacity: 1;
  filter: drop-shadow(0 0 7px rgba(51,170,238,1));
  animation: none;
}
@keyframes fi-idle {
  0%, 82%, 100% { opacity: 0.45; filter: none; }
  88%           { opacity: 0.9;  filter: drop-shadow(0 0 5px rgba(51,170,238,0.5)); }
}
/* On mobile, ⚡ follows CTA (which owns margin-left:auto) */
@media (max-width: 980px) {
  .fi-trigger { margin-left: .5rem; margin-right: 6px; }
}

/* ── OVERLAY ─────────────────────────────────────────────── */
#fi-overlay[hidden] { display: none !important; }
#fi-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(4, 10, 18, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.fi-wrap {
  position: relative;
  background: #060F1A;
  border: 1px solid #1A5080;
  border-radius: 6px;
  width: min(540px, 96vw);
  max-height: 95svh;
  overflow-y: auto;
  overflow-x: hidden;
  box-shadow:
    0 0 0 1px rgba(51,170,238,0.06),
    0 0 50px rgba(51,170,238,0.1),
    0 24px 80px rgba(0,0,0,0.6);
}

.fi-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 20;
  width: 30px;
  height: 30px;
  background: transparent;
  border: 1px solid #1A5080;
  border-radius: 4px;
  color: #5A88AA;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s, color 0.2s;
  line-height: 1;
}
.fi-close:hover { border-color: #F47744; color: #F47744; }

/* ── SHARED SCREEN BASE ──────────────────────────────────── */
.fi-screen { padding: 44px 32px 32px; }
.fi-screen h3 {
  font-family: var(--fb, monospace);
  font-size: 18px;
  font-weight: 700;
  color: #F47744;
  text-align: center;
  letter-spacing: 5px;
  text-transform: uppercase;
  margin: 0 0 24px;
  text-shadow: 0 0 18px rgba(244,119,68,0.4);
}

/* ── SHARED BUTTONS ──────────────────────────────────────── */
.fi-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--fb, monospace);
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.18s;
  padding: 9px 18px;
  background: transparent;
  border: 1px solid #1A5080;
  color: #6A99BB;
}

.fi-btn-group-lb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 16px;
  padding: 12px 28px; 

}

.fi-btn:hover { border-color: #33AAEE; color: #33AAEE; }
.fi-btn:disabled { opacity: 0.4; cursor: default; }

.fi-btn-primary {
  background: #33AAEE;
  border-color: #33AAEE;
  color: #060F1A;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 3px;
  padding: 12px 28px;
}
.fi-btn-primary:hover { background: #55CCFF; border-color: #55CCFF; color: #060F1A; box-shadow: 0 0 18px rgba(51,170,238,0.35); }



/* ── MENU SCREEN ─────────────────────────────────────────── */
#fi-menu { text-align: center; }
.fi-logo-icon {
  font-size: 44px;
  margin-bottom: 6px;
  display: block;
  filter: drop-shadow(0 0 14px rgba(51,170,238,0.7));
  animation: fi-logo-pulse 2.5s ease-in-out infinite;
}
@keyframes fi-logo-pulse {
  0%, 100% { filter: drop-shadow(0 0 10px rgba(51,170,238,0.5)); }
  50%       { filter: drop-shadow(0 0 22px rgba(51,170,238,0.9)); }
}
.fi-game-title {
  font-family: var(--fb, monospace);
  font-size: 26px;
  font-weight: 700;
  color: #33AAEE;
  text-transform: uppercase;
  letter-spacing: 7px;
  margin: 0 0 6px;
  text-shadow: 0 0 24px rgba(51,170,238,0.45);
}
.fi-tagline {
  font-family: var(--fb, monospace);
  font-size: 15px;
  color: #3388cc;
  margin: 0 0 28px;
}
.fi-diff-row {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 24px;
}
.fi-diff-btn {
  flex: 1;
  max-width: 110px;
  padding: 9px 0;
  background: transparent;
  border: 1px solid #1A5080;
  color: #3A6A8A;
  font-family: var(--fb, monospace);
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.18s;
}
.fi-diff-btn:hover,
.fi-diff-btn.active {
  border-color: #33AAEE;
  color: #33AAEE;
  background: rgba(51,170,238,0.07);
}
.fi-diff-btn.active { background: rgba(51,170,238,0.12); }
.fi-menu-start {
  display: block;
  width: 100%;
  max-width: 150px;
  margin: 0 auto 16px;
}
.fi-hint {
  font-family: var(--fb, monospace);
  font-size: 12px;
  color: #3388cc;
  letter-spacing: 1px;
  margin: 0 0 20px;
}
.fi-menu-lb {
  display: inline-block;
  margin-bottom: 16px;
}
.fi-personal-best {
  font-family: var(--fb, monospace);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  color: #ad6713;
  letter-spacing: 1px;
  min-height: 18px;
}

/* ── GAME SCREEN ─────────────────────────────────────────── */
#fi-game { padding: 14px 16px 14px; }
.fi-hud {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 14px;
  padding: 0 2px 10px;
  font-family: var(--fb, monospace);
  font-size: 11px;
  color: #3A6A8A;
  letter-spacing: 1px;
}
.fi-hud strong { color: #33AAEE; }
.fi-hud-timer {
  font-size: 13px;
  font-weight: 700;
  color: #33AAEE;
  letter-spacing: 2px;
}
/* HUD burst indicators (✶) */
.fi-hud-bur     { color: #3A6A8A; font-size: 13px; display: inline-block; }
.fi-hud-bur.got { color: #33AAEE; }
/* HUD bulb indicators (💡) */
.fi-hud-bulb     { display: inline-block; font-size: 14px; filter: grayscale(1) brightness(0.35) opacity(0.5); }
.fi-hud-bulb.lit { filter: none; }
#fi-canvas {
  display: block;
  margin: 0 auto;
  border: 1px solid #1A5080;
  border-radius: 2px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  max-width: 100%;
}
.fi-game-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 2px 0;
}
.fi-icon-btn {
  width: 30px;
  height: 30px;
  background: transparent;
  border: 1px solid #1A5080;
  border-radius: 4px;
  color: #3A6A8A;
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s;
  flex-shrink: 0;
  line-height: 1;
}
.fi-icon-btn:hover { border-color: #33AAEE; color: #33AAEE; }

.fi-hint-sm {
  font-family: var(--fb, monospace);
  font-size: 9px;
  color: #33AAEE;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.fi-next-btn {
  display: block;
  width: fit-content;
  white-space: nowrap;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 8px;
}


/* ── SOUND CONTROLS ──────────────────────────────────────── */
.fi-sound-controls {
  display: flex;
  align-items: center;
  gap: 5px;
}
.fi-snd-btn {
  position: relative;
  overflow: hidden;
  background: transparent;
  border: 1px solid #1A5080;
  border-radius: 3px;
  color: #3A6A8A;
  font-family: var(--fb, monospace);
  font-size: 12px;
  letter-spacing: 1px;
  padding: 3px 5px;
  cursor: pointer;
  transition: all 0.18s;
  line-height: 1;
  flex-shrink: 0;
}
.fi-snd-btn:hover,
.fi-snd-btn.active { border-color: #33AAEE; color: #33AAEE; }
/* Diagonal slash when off (no .active class) — CSS transform for clean anti-aliasing */
.fi-snd-btn:not(.active)::after {
  content: '';
  position: absolute;
  top: 50%; left: 0;
  width: 100%; height: 1.5px;
  background: currentColor;
  transform: translateY(-50%) rotate(-45deg);
  transform-origin: center center;
  opacity: 0.72;
  pointer-events: none;
}
.fi-vol-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 40px;
  height: 3px;
  background: #1A3A50;
  border-radius: 2px;
  outline: none;
  cursor: pointer;
  flex-shrink: 0;
}
.fi-vol-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #33AAEE;
  cursor: pointer;
}
.fi-vol-slider::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #33AAEE;
  border: none;
  cursor: pointer;
}

/* ── PAUSE OVERLAY ───────────────────────────────────────── */
#fi-pause[hidden] { display: none !important; }
#fi-pause {
  position: absolute;
  inset: 0;
  z-index: 15;
  background: rgba(4,10,18,0.82);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  border-radius: 6px;
}
.fi-pause-label {
  font-family: var(--fb, monospace);
  font-size: 22px;
  font-weight: 700;
  color: #33AAEE;
  letter-spacing: 8px;
  text-shadow: 0 0 20px rgba(51,170,238,0.5);
}

/* ── LEVEL COMPLETE ──────────────────────────────────────── */
.fi-breakdown {
  background: rgba(51,170,238,0.04);
  border: 1px solid #1A5080;
  border-radius: 4px;
  padding: 14px 16px;
  margin-bottom: 24px;
}
.fi-row {
  display: flex;
  justify-content: space-between;
  font-family: var(--fb, monospace);
  font-size: 12px;
  color: #33AAEE;
  padding: 6px 0;
  border-bottom: 1px solid rgba(26,80,128,0.3);
}

.fi-row:last-child { border-bottom: none; }
/* Remove border-bottom from the row immediately before level-score — bright border-top on level-score is the separator */
.fi-row:has(+ .fi-row.level-score) { border-bottom: none; }

.fi-row.mult {
	font-style:italic;
}

.fi-row.time { 
  font-weight: 600;
  font-size: 12px;
  border-bottom: 1px solid #1A5080;
  margin-bottom: 4px;
  padding-bottom: 10px;
}

.fi-row.level-score {
  font-weight: 600;
  border-top: 1px solid #1A5080;
  border-bottom: none;
  margin-top: 4px;
  padding-top: 10px;
}
.fi-row.total {
  color: #F47744;
  font-weight: 700;
  font-size: 15px;
}
.fi-btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 16px;
}
/* Submit Score card: groups AAA input + submit button */
.fi-submit-card {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  padding: 8px 12px;
  margin-bottom: 6px;
}
/* Leaderboard link row — below submit card */
.fi-lb-link-row {
  text-align: center;
  margin-bottom: 10px;
}
/* Personal best line on level-complete screen */
.fi-lc-pb-line {
  text-align: center;
  margin-bottom: 10px;
  margin-top: 0;
}
.fi-initials-input {
  width: 80px;
  background: transparent;
  border: 1px solid #ad6713;
  border-radius: 4px;
  color: #F47744;
  font-family: var(--fb, monospace);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 5px;
  text-transform: uppercase;
  text-align: center;
  padding: 9px 6px;
  outline: none;
  transition: border-color 0.18s;
}
.fi-initials-input:focus { border-color: #33AAEE; }
.fi-initials-input::placeholder { color: #1A3A50; letter-spacing: 3px; font-size: 14px; }
.fi-submit-confirm {
  font-family: var(--fb, monospace);
  font-size: 11px;
  color: #ad6713;
  text-align: center;
  letter-spacing: 2px;
  margin-top: 8px;
}
.fi-lc-sound,
.fi-menu-sound {
  justify-content: center;
  margin-top: 14px;
}

/* ── LEADERBOARD ─────────────────────────────────────────── */
.fi-lb-list { margin-bottom: 20px; }
.fi-lb-row {
  display: grid;
  grid-template-columns: 22px 44px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 9px 4px;
  font-family: var(--fb, monospace);
  font-size: 12px;
  color: #3A6A8A;
  border-bottom: 1px solid rgba(26,80,128,0.25);
}
.fi-lb-row:last-child { border-bottom: none; }
.fi-lb-gold { color: #F47744; }
.fi-lb-n    { color: #33AAEE; font-size: 10px; }
.fi-lb-ini  { color: #33AAEE; font-weight: 700; font-size: 14px; }
.fi-lb-gold .fi-lb-ini { color: #F47744; }
.fi-lb-meta { font-size: 10px; color: #33AAEE; }
.fi-lb-score { color: #33AAEE; font-weight: 700; text-align: right; white-space: nowrap; }
.fi-lb-gold .fi-lb-score { color: #F47744; }
.fi-loading, .fi-empty {
  font-family: var(--fb, monospace);
  font-size: 11px;
  color: #1A4060;
  text-align: center;
  letter-spacing: 1px;
  padding: 20px 0;
}

/* ── LEVEL COMPLETE BUTTON LAYOUT ────────────────────────── */
/* Middle row: difficulty toggles + menu */
.fi-lc-mid-row {
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
  margin-bottom: 8px;
}
/* Small button variant */
.fi-btn-sm {
  font-size: 10px;
  letter-spacing: 1.5px;
  padding: 7px 14px;
}
/* Submit Score button */
.fi-btn.submit-score {
  color: #ad6713;
}
.fi-btn.submit-score:hover,
.fi-btn.submit-score:active {
  border-color: #F47744;
}

/* Level-complete difficulty toggle buttons */
.fi-lc-diff {
  flex: 1;
  max-width: 88px;
  padding: 7px 0;
  background: transparent;
  border: 1px solid #1A5080;
  color: #3A6A8A;
  font-family: var(--fb, monospace);
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.18s;
}
.fi-lc-diff:hover,
.fi-lc-diff.active {
  border-color: #33AAEE;
  color: #33AAEE;
  background: rgba(51,170,238,0.07);
}
.fi-lc-diff.active { background: rgba(51,170,238,0.12); }

/* Hide ⚡ easter egg trigger on touch-only devices (no keyboard for gameplay) */
@media(hover:none) and (pointer:coarse){
  .fi-trigger{display:none}
}
