/* MetisRicerca - CSS "ABSOLUTE RESTORATION" */

:root {
  --bg-color: #0b0c10;
  --header-bg: rgba(11, 12, 16, 0.98);
  --text-primary: #66fcf1;
  --text-dim: #c5c6c7;
  --accent-color: #45a29e;
  --highlight-color: #fbdf5b;
  --glass-bg: rgba(31, 40, 51, 0.4);
  --glass-border: rgba(69, 162, 158, 0.3);
  --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.8);
  --tooltip-bg: #fbdf5b;
  --home-bg-grad: radial-gradient(circle at center, #1f2833 0%, #0b0c10 100%);
  --safe-color: #66fcf1;
  --warn-color: #fbdf5b;
  --danger-color: #ff5f5f;
}

body.theme-light {
  --bg-color: #24292e;
  --header-bg: rgba(36, 41, 46, 0.98);
  --text-primary: #e1e4e8;
  --text-dim: #959da5;
  --accent-color: #0366d6;
  --highlight-color: #f66a0a;
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.1);
  --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
  --tooltip-bg: #f66a0a;
  --home-bg-grad: radial-gradient(circle at center, #2f363d 0%, #24292e 100%);
  --safe-color: #28a745;
  --warn-color: #ffd33d;
  --danger-color: #d73a49;
}

body.theme-eyes {
  --bg-color: #2b211e;
  --header-bg: rgba(43, 33, 30, 0.95);
  --text-primary: #f2e3c6;
  --text-dim: #cca88b;
  --accent-color: #d97743;
  --highlight-color: #8caba1;
  --glass-bg: rgba(64, 48, 43, 0.6);
  --glass-border: rgba(217, 119, 67, 0.3);
  --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
  --tooltip-bg: #8caba1;
  --home-bg-grad: radial-gradient(circle at center, #40302b 0%, #2b211e 100%);
  --safe-color: #8caba1;
  --warn-color: #d97743;
  --danger-color: #b05a41;
}

body.theme-contrast {
  --bg-color: #000000;
  --header-bg: #000000;
  --text-primary: #ffffff;
  --text-dim: #ffff00;
  --accent-color: #00ffff;
  --highlight-color: #ff00ff;
  --glass-bg: #000000;
  --glass-border: #ffffff;
  --shadow: none;
  --tooltip-bg: #ffffff;
  --home-bg-grad: #000000;
  --safe-color: #00ffff;
  --warn-color: #ffff00;
  --danger-color: #ff0000;
}

body.theme-metis {
  --bg-color: #030a16;
  --header-bg: rgba(3, 10, 22, 0.98);
  --text-primary: #b0e0e6;
  --text-dim: #7ba6b5;
  --accent-color: #6a0dad;
  --highlight-color: #ffd700;
  --glass-bg: rgba(13, 31, 61, 0.6);
  --glass-border: rgba(106, 13, 173, 0.4);
  --shadow: 0 8px 32px 0 rgba(0, 5, 15, 0.9);
  --tooltip-bg: #ffd700;
  --home-bg-grad: radial-gradient(circle at center, #091a38 0%, #030a16 100%);
  --safe-color: #49D1CF;
  --warn-color: #ffd700;
  --danger-color: #ff5f5f;
}

body.theme-teal {
  --bg-color: #071212;
  --header-bg: rgba(15, 92, 102, 0.98);
  --text-primary: #49D1CF;
  --text-dim: #a0c4cc;
  --accent-color: #1F7A8C;
  --highlight-color: #8A7450;
  --glass-bg: rgba(15, 92, 102, 0.15);
  --glass-border: rgba(73, 209, 207, 0.2);
  --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.9);
  --tooltip-bg: #8A7450;
  --home-bg-grad: radial-gradient(circle at center, #0F5C66 0%, #071212 100%);
  --safe-color: #49D1CF;
  --warn-color: #8A7450;
  --danger-color: #e67e22;
}

#metis-search-view *, #results-view *, .modal * { box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-dim);
  min-height: 100vh;
  width: 100%;
  overflow-x: hidden;
  line-height: 1.6;
}

body.home-active {
    overflow: hidden !important;
    height: 100vh;
}

/* --- `[x]` Fix Emergenza Layout (Pulsanti sicuri su Laptop)
- `[x]` Creazione `editor.php` (Interfaccia Dashboard Premium)
- `[x]` Implementazione Motore PHP (Salvataggio persistente in `style.css`)
- `[x]` Logica Live Preview (Iniezione CSS in real-time)
- `[x]` Aggiunta Tasto "Copia Log / CSS" 
- `[x]` Verifica finale di coerenza e stabilità */

/* --- HOME SEARCH VIEW (Centratura e Logo) --- */
#metis-search-view {
  display: flex;
  flex-direction: column;
  justify-content: space-between; /* Distribuisce logo sopra e ricerca sotto */
  align-items: center;
  height: 100vh;
  padding: 40px 20px;
  background: var(--home-bg-grad);
  overflow: hidden;
}

.logo {
  flex: 1; /* Occupa lo spazio superiore */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center; /* Centra il logo perfettamente nel top-half */
  font-size: 3.5rem;
  font-weight: 900;
  letter-spacing: -2px;
  background: linear-gradient(90deg, var(--text-primary), var(--accent-color));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  gap: 15px;
}

.main-logo-img {
    height: auto;
    max-height: 35vh;
    max-width: 450px;
    filter: drop-shadow(0 0 20px var(--accent-color));
    cursor: pointer;
    transition: transform 0.3s ease, max-height 0.3s ease;
}

.search-container {
    width: 100%;
    max-width: 650px;
    position: relative;
    z-index: 10;
    margin-bottom: 20px; /* Distanza fissa e sicura dal fondo per i bottoni */
}

#metis-search-view .search-box, #results-view .search-box {
  width: 100%;
  padding: 20px 30px;
  padding-right: 120px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 35px;
  color: var(--text-primary);
  font-size: 1.2rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  outline: none;
}

.search-buttons {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  gap: 8px;
}

.search-btn {
  background: var(--text-primary);
  color: #1f2833;
  border: none;
  border-radius: 20px;
  padding: 8px 18px;
  font-weight: 700;
  cursor: pointer;
}

.tool-belt {
  margin-top: 35px;
  display: flex;
  flex-direction: row; 
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.05);
  padding: 10px 20px;
  border-radius: 40px;
  border: 1px solid var(--glass-border);
  width: 100%;
}

.tool-item {
  color: var(--accent-color);
  font-size: 1.3rem;
  cursor: pointer;
  position: relative;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
}

.tool-item:hover, .tool-item.active {
    color: var(--highlight-color);
}

.tool-item.active {
    background: radial-gradient(circle, rgba(251, 223, 91, 0.3) 0%, transparent 80%);
    box-shadow: 0 0 15px rgba(251, 223, 91, 0.4);
    border: 1px solid rgba(251, 223, 91, 0.5);
}

#metis-hint {
    position: absolute;
    bottom: -35px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--highlight-color);
    font-size: 0.85rem;
    font-weight: 700;
    opacity: 0;
    transition: opacity 0.3s;
    white-space: nowrap;
    text-shadow: 0 4px 10px rgba(0,0,0,1);
    background: rgba(11, 12, 16, 0.9);
    padding: 4px 12px;
    border-radius: 12px;
    border: 1px solid var(--highlight-color);
    pointer-events: none;
}

/* --- THEME OVERLAY MENU --- */
.theme-menu {
    position: absolute;
    bottom: 60px;
    right: 0;
    background: var(--header-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 15px;
    padding: 15px;
    display: none;
    flex-direction: column;
    gap: 10px;
    box-shadow: var(--shadow);
    z-index: 1000;
    min-width: 180px;
}

.theme-menu.active {
    display: flex;
    animation: fadeInScale 0.2s ease-out;
}

@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.9) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.theme-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 15px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-dim);
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid transparent;
}

.theme-option:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border-color: var(--glass-border);
}

.theme-option.selected {
    background: var(--glass-bg);
    color: var(--highlight-color);
    border-color: var(--highlight-color);
}

.theme-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.2);
}

/* Specific dots */
.dot-default { background: linear-gradient(135deg, #0b0c10, #66fcf1); }
.dot-light { background: linear-gradient(135deg, #24292e, #e1e4e8); }
.dot-eyes { background: linear-gradient(135deg, #2b211e, #f2e3c6); }
.dot-contrast { background: linear-gradient(135deg, #000, #fff); }
.dot-metis { background: linear-gradient(135deg, #030a16, #ffd700); }
.dot-teal { background: linear-gradient(135deg, #0F5C66, #49D1CF); }

/* Risposizione Header Results */
.results-header .theme-menu {
    bottom: auto;
    top: 60px;
}

.tool-item.theme-btn.active {
    color: var(--highlight-color);
    background: var(--glass-bg);
}
#results-view { display: none; flex-direction: column; min-height: 100vh; }

.results-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(15px);
  padding: 10px 40px;
  display: flex;
  align-items: center;
  gap: 30px;
  border-bottom: 1px solid var(--glass-border);
}

.logo-small {
  display: flex;
  align-items: center;
  gap: 0;
  cursor: pointer;
  transition: transform 0.2s;
}

.logo-small:hover { transform: scale(1.02); }

.small-logo-img {
  height: 120px;
  margin: -40px -10px -40px -10px; /* Compensa la trasparenza mostruosa orizzontale e verticale */
  filter: drop-shadow(0 0 10px rgba(102, 252, 241, 0.4));
}

.logo-text {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -1px;
}

.search-bar-results {
  display: flex;
  align-items: center;
  gap: 15px;
  flex-grow: 1;
  max-width: 1100px;
}

#tool-belt-results {
  padding: 6px 15px;
  border-radius: 12px;
  gap: 10px;
  margin: 0;
}

.results-layout { display: flex; padding: 20px 40px; gap: 40px; max-width: 1400px; margin: 0 auto; }
#results-container { flex: 3; }
.infobox-sidebar { flex: 1; position: sticky; top: 100px; height: fit-content; background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: 15px; padding: 25px; }
.infobox-title { color: var(--highlight-color); font-size: 1rem; font-weight: 800; margin-bottom: 15px; text-transform: uppercase; letter-spacing: 1px; }
.infobox-content { color: #fff; font-size: 0.95rem; line-height: 1.6; margin-bottom: 25px; }

/* Brainstorm Links */
.infobox-brainstorm { border-top: 1px solid var(--glass-border); padding-top: 20px; }
.brainstorm-q { display: block; font-size: 0.95rem; color: var(--text-primary); margin-bottom: 10px; font-style: italic; cursor: pointer; padding: 8px 12px; border-radius: 8px; background: rgba(102, 252, 241, 0.05); transition: all 0.3s; border: 1px solid transparent; }
.brainstorm-q:hover { background: var(--text-primary); color: var(--bg-color); transform: translateX(5px); font-weight: 600; font-style: normal; }

/* --- BADGES (STILE ORIGINALE BELLO) --- */

.result-item { margin-bottom: 40px; position: relative; }
.result-item-archive { border-left: 3px solid var(--highlight-color); padding-left: 20px; background: linear-gradient(90deg, rgba(251, 223, 91, 0.03) 0%, transparent 100%); }

.result-title { display: block; font-size: 1.3rem; color: var(--text-primary); text-decoration: none; font-weight: 600; margin-bottom: 8px; transition: opacity 0.2s; }
.result-title:hover { opacity: 0.8; }
.result-snippet { font-size: 0.95rem; color: var(--text-dim); }

.censorship-container { display: flex; align-items: center; gap: 15px; margin: 10px 0; position: relative; }
.censorship-label { font-size: 0.75rem; color: var(--text-dim); text-transform: uppercase; font-weight: 700; }
.censorship-bar { flex-grow: 1; max-width: 200px; height: 4px; background: rgba(255,255,255,0.1); border-radius: 2px; overflow: hidden; }
.censorship-fill { height: 100%; transition: width 0.5s ease; }

.privacy-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(102, 252, 241, 0.05); /* TRASPARENTE */
  border: 1px solid var(--accent-color); /* BORDO NEON */
  color: var(--text-primary);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  margin-top: 10px;
  margin-right: 10px;
  cursor: help;
  position: relative;
}

.privacy-badge[onclick*="openSpark"] { 
    color: var(--highlight-color); 
    border-color: var(--highlight-color); 
    background: rgba(251, 223, 91, 0.05); 
}

/* --- TOOLTIP (OVERLAY MOUSE) - FIX LEGGIBILITÀ --- */

.privacy-badge::after, .censorship-container::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 140%;
  left: 0;
  background: rgba(11, 12, 16, 0.95) !important;
  color: var(--text-dim) !important;
  padding: 10px 15px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 500;
  width: 260px;
  text-align: left;
  pointer-events: none;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s;
  z-index: 99999;
  box-shadow: 0 5px 20px rgba(0,0,0,0.8);
  border: 1px solid var(--highlight-color);
  line-height: 1.5;
}

.privacy-badge:hover::after, .censorship-container:hover::after {
  opacity: 1;
  transform: translateY(0);
}

/* --- MODALS & STATS --- */
.results-stats { padding: 10px 40px; color: var(--accent-color); font-size: 13px; font-weight: 500; }
.modal { display: none; position: fixed; z-index: 100000; width: 100%; height: 100%; top: 0; left: 0; background: rgba(11,12,16,0.98); backdrop-filter: blur(10px); }
.modal-content { 
    background: #0b0c10; 
    margin: 5vh auto; 
    width: 90%; 
    max-width: 900px;
    height: auto; 
    max-height: 90vh; 
    border-radius: 20px; 
    border: 1px solid var(--glass-border); 
    position: relative; 
    overflow-y: auto; /* Permette lo scroll interno */
    scrollbar-width: thin;
    scrollbar-color: var(--highlight-color) transparent;
}
.close-modal { position: absolute; right: 25px; top: 15px; color: #fff; font-size: 40px; cursor: pointer; z-index: 100001; }
#spark-frame { width: 100%; height: 100%; border: none; }

/* Manifesto Styling */
.manifesto-content { padding: 40px 20px; overflow-y: auto; text-align: center; height: 90vh; }
.manifesto-title { font-size: 2.5rem; color: var(--text-primary); margin-top: 20px; margin-bottom: 5px; text-shadow: 0 0 15px rgba(102, 252, 241, 0.5); }
.manifesto-subtitle { font-size: 1.2rem; color: var(--accent-color); font-weight: 300; margin-bottom: 40px; letter-spacing: 3px; text-transform: uppercase; }
.manifesto-text { max-width: 800px; margin: 0 auto; }
.manifesto-text p { font-size: 1.1rem; line-height: 1.9; margin-bottom: 30px; color: var(--text-dim); }
.manifesto-text p.manifesto-footer { font-size: 0.95rem; font-style: italic; color: var(--highlight-color); margin-top: 50px; text-shadow: 0 0 10px rgba(251, 223, 91, 0.3); opacity: 0.9; }

/* Philosophy modal specific */
.philosophy-content {
    background: linear-gradient(180deg, #0b0c10 0%, #1f2833 100%);
    border: 1px solid var(--highlight-color);
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.9);
    padding: 60px 40px;
}

.philosophy-content h2 {
    color: var(--highlight-color);
    margin-bottom: 25px;
    font-size: 2.2rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.philosophy-content h3 {
    color: var(--text-primary);
    margin-bottom: 15px;
    font-size: 1.4rem;
}

.philosophy-content p {
    text-align: left;
    margin-bottom: 20px;
    border-left: 2px solid rgba(251, 223, 91, 0.3);
    padding-left: 20px;
}

.info-btn:hover {
    transform: scale(1.2);
    color: var(--highlight-color);
    text-shadow: 0 0 10px var(--highlight-color);
}

.pagination-nav { display: flex; justify-content: center; gap: 12px; margin: 40px 0; padding-bottom: 60px; }
.page-num { width: 40px; height: 40px; border: 1px solid var(--accent-color); display: flex; align-items: center; justify-content: center; border-radius: 50%; color: var(--accent-color); cursor: pointer; transition: 0.3s; }
.page-num.active { background: var(--accent-color); color: #000; box-shadow: 0 0 15px var(--accent-color); }

/* Results layout specialization */
.result-item.video-result {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.video-thumbnail {
    width: 200px;
    height: 120px;
    background-size: cover;
    background-position: center;
    border-radius: 12px;
    box-shadow: var(--shadow);
    flex-shrink: 0;
    position: relative;
    border: 1px solid var(--glass-border);
}

.video-thumbnail::after {
    content: '▶';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 2rem;
    opacity: 0.8;
}

.file-badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: 10px;
    font-weight: 900;
    background: #ff5f5f;
    color: white;
    border-radius: 4px;
    margin-right: 10px;
    vertical-align: middle;
}

/* --- MOBILE & RESPONSIVE ADAPTATION --- */
@media (max-width: 768px) {
    body, html { width: 100%; max-width: 100%; overflow-x: hidden; min-height: 100dvh; }
    
    #home-view { position: fixed; top: 0; left: 0; width: 100vw; height: 100dvh; min-height: unset; overflow: hidden; padding: 0 10px; }
    
    .logo { font-size: 3.5rem; margin-bottom: 25px; line-height: 1.1; text-align: center; }
    .main-logo-img { height: 200px; }
    
    .search-container { width: 100%; padding: 0; display: flex; flex-direction: column; align-items: center; }
    .search-box { font-size: 1rem; padding: 15px 20px; border-radius: 30px; }
    .search-buttons { right: 10px; }
    
    .tool-belt {
        padding: 12px 15px;
        gap: 10px;
        border-radius: 30px;
        width: 100%;
        max-width: 380px;
        margin: 25px auto 0 auto;
    }
    .tool-item { font-size: 1.3rem; width: 38px; height: 38px; }
    .tool-separator { margin: 0 3px; }
    .lang-select-mini { font-size: 0.9rem; }
    
    .results-header { padding: 15px 10px; flex-direction: column; gap: 15px; align-items: stretch; }
    .logo-small { justify-content: center; }
    .small-logo-img { height: 100px; margin: -30px -10px; }
    .logo-text { font-size: 1.4rem; }
    .search-bar-results { flex-direction: column; width: 100%; gap: 12px; align-items: stretch; }
    #tool-belt-results { justify-content: center; padding: 10px; border-radius: 20px; flex-wrap: wrap; }
    
    .results-layout { flex-direction: column; padding: 10px; gap: 20px; }
    .infobox-sidebar { position: static; width: 100%; }
    
    .result-item.video-result { flex-direction: column; align-items: center; }
    .video-thumbnail { width: 100%; height: 180px; }
    .result-title { font-size: 1.1rem; word-break: break-all; }
    .result-snippet { font-size: 0.85rem; }
    
    .censorship-bar { max-width: 100%; }
    .privacy-badge::after, .censorship-container::after { width: 90vw; left: 5px; transform: translateX(0); }
}

/* --- SPIRIT OF METIS: NEON SPIRIT PRO --- */
#metis-spirit-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    filter: drop-shadow(0 0 10px rgba(251, 223, 91, 0.3));
}

.main-logo-img {
    height: auto;
    max-height: 40vh; /* Dinamico per schermi bassi */
    max-width: 450px;
    width: auto;
    cursor: pointer;
    transition: transform 0.3s ease, filter 0.3s ease, max-height 0.3s ease;
    filter: drop-shadow(0 0 10px rgba(251, 223, 91, 0.1));
}

.logo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

#metis-owl {
    width: 140px;
    height: 140px;
    position: absolute;
    z-index: 10000;
}

.owl-part {
    fill: none;
    stroke: #fbdf5b;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 0 5px #fbdf5b);
}

.filament-1 {
    stroke-width: 1.5;
    opacity: 0.8;
    stroke-dasharray: 40 160;
    animation: stroke-flow 3s linear infinite;
}

.filament-2 {
    stroke-width: 0.8;
    opacity: 0.4;
    stroke-dasharray: 20 80;
    animation: stroke-flow 2s linear infinite reverse;
}

@keyframes stroke-flow {
    from { stroke-dashoffset: 200; }
    to { stroke-dashoffset: 0; }
}

.wing-l-spirit { 
    stroke-width: 1.2;
    animation: flap-spirit-l 1.2s ease-in-out infinite alternate; 
    transform-origin: 25px 55px; 
}
.wing-r-spirit { 
    stroke-width: 1.2;
    animation: flap-spirit-r 1.2s ease-in-out infinite alternate; 
    transform-origin: 72px 55px; 
}

@keyframes flap-spirit-l { 
    0% { transform: rotate(-8deg); } 
    100% { transform: rotate(15deg) scaleX(1.1); } 
}
@keyframes flap-spirit-r { 
    0% { transform: rotate(8deg); } 
    100% { transform: rotate(-15deg) scaleX(1.1); } 
}

.eye-glow {
    fill: #fbdf5b;
    opacity: 0.3;
    filter: blur(4px);
    animation: eye-pulse 2s ease-in-out infinite;
}

.eye-soul {
    fill: #fff;
    filter: drop-shadow(0 0 3px #fff);
}

@keyframes eye-pulse {
    0%, 100% { transform: scale(1); opacity: 0.3; }
    50% { transform: scale(1.2); opacity: 0.6; }
}

.beak-spirit {
    fill: #fbdf5b;
    stroke: none;
}

.wisdom-sparkle {
    position: absolute;
    width: 3px;
    height: 3px;
    background: #fff;
    border-radius: 50%;
    pointer-events: none;
    box-shadow: 0 0 10px #fbdf5b, 0 0 5px #fff;
    animation: sparkle-ethereal 1.5s ease-out forwards;
}

@keyframes sparkle-ethereal {
    0% { transform: scale(1) translateY(0); opacity: 1; }
    100% { transform: scale(0) translateY(-20px) rotate(45deg); opacity: 0; }
}

/* --- METIS SPIRIT MODEL B (PIXAR) --- */
.pixar-blink {
    transform-origin: center bottom;
    animation: blink-anim 4s infinite;
}
@keyframes blink-anim {
    0%, 96%, 100% { transform: scaleY(0); }
    98% { transform: scaleY(1); }
}

.wing-flap-l {
    transform-origin: top right;
    animation: flap-l 0.3s ease-in-out infinite alternate;
}
.wing-flap-r {
    transform-origin: top left;
    animation: flap-r 0.3s ease-in-out infinite alternate;
}
@keyframes flap-l {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(-25deg); }
}
@keyframes flap-r {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(25deg); }
}

/* --- METIS PET ENGINE (TAMAGOTCHI) --- */
.pet-feedback {
    position: fixed;
    color: #e74c3c;
    font-size: 1.5rem;
    font-weight: bold;
    pointer-events: none;
    animation: floatUp 2s forwards;
    z-index: 10000;
}
@keyframes floatUp {
    0% { transform: translateY(0) scale(1); opacity: 1; }
    100% { transform: translateY(-50px) scale(1.5); opacity: 0; }
}

.pet-sad .eye-white { fill: #aaaaaa; }
.pet-sad .owl-beak { transform: translateY(2px); }

.pet-sleepy .pixar-blink { transform: scaleY(1) !important; animation: none; }
.pet-sleepy.owl-body { animation: breathe 3s infinite alternate; }

@keyframes breathe {
    from { transform: scaleY(1); }
    to { transform: scaleY(1.05); }
}

/* Eclipse e Pulse Logo */
body.spirit-eclipse::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0.6) 100%);
    z-index: 9998;
    pointer-events: none;
    animation: fadeInSpirit 2.5s forwards;
}

.main-logo-img.spirit-pulse {
    animation: logo-glow-pulse 3s ease-in-out infinite;
}

@keyframes logo-glow-pulse {
    0%, 100% { filter: drop-shadow(0 0 20px rgba(251,223,91,0.2)); transform: scale(1); }
    50% { filter: drop-shadow(0 0 40px rgba(251,223,91,0.5)); transform: scale(1.01); }
}

/* --- METIS ARCHITECT BLOCK START --- */
.main-logo-img {
  top: 4.58vh !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  position: fixed !important;
  margin: 0 !important;
}
.logo {
  top: 39.75vh !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  position: fixed !important;
  margin: 0 !important;
}
.search-container {
  top: 54.63vh !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  position: fixed !important;
  margin: 0 !important;
}
/* --- METIS ARCHITECT BLOCK END --- */
