/* =============================================================================
   🌀 GREEK GLYPH SPINE — interactive detail modal CSS

   Per-glyph hue applied via --glyph-hue CSS variable.
   Gold-on-indigo cinematic aesthetic to match the rest of the cockpit.
   ============================================================================= */

/* ── BASE MODAL ─────────────────────────────────────────────────────────── */

.glyph-modal {
    position: fixed;
    inset: 0;
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.glyph-modal[hidden] { display: none; }

.glyph-modal-backdrop {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center,
                rgba(28, 20, 55, 0.55),
                rgba(10, 8, 24, 0.92) 70%);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: glyphBackdropIn 0.25s ease-out both;
}

@keyframes glyphBackdropIn {
    from { opacity: 0; backdrop-filter: blur(0); }
    to   { opacity: 1; backdrop-filter: blur(8px); }
}

/* ── CONTENT PANEL ──────────────────────────────────────────────────────── */

.glyph-modal-content {
    /* Per-glyph hue — set by JS via style.setProperty */
    --glyph-hue: #ffd86b;

    position: relative;
    max-width: 880px;
    width: 100%;
    max-height: 88vh;
    overflow-y: auto;
    background:
        radial-gradient(ellipse at top right,
            color-mix(in srgb, var(--glyph-hue) 14%, transparent),
            transparent 60%),
        radial-gradient(ellipse at bottom left,
            color-mix(in srgb, var(--glyph-hue) 10%, transparent),
            transparent 60%),
        linear-gradient(180deg, rgba(28, 20, 55, 0.96), rgba(10, 8, 24, 0.98));
    border: 1px solid color-mix(in srgb, var(--glyph-hue) 40%, rgba(212, 175, 55, 0.3));
    border-radius: 18px;
    padding: 28px 32px 22px;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.65),
        0 0 60px color-mix(in srgb, var(--glyph-hue) 18%, transparent),
        inset 0 1px 0 color-mix(in srgb, var(--glyph-hue) 18%, transparent);
    animation: glyphContentIn 0.35s cubic-bezier(0.22, 1.2, 0.36, 1) both;
}

@keyframes glyphContentIn {
    from { opacity: 0; transform: scale(0.94) translateY(8px); }
    to   { opacity: 1; transform: scale(1)   translateY(0);   }
}

/* Custom scrollbar inside modal */
.glyph-modal-content::-webkit-scrollbar { width: 6px; }
.glyph-modal-content::-webkit-scrollbar-track { background: transparent; }
.glyph-modal-content::-webkit-scrollbar-thumb {
    background: color-mix(in srgb, var(--glyph-hue) 35%, transparent);
    border-radius: 3px;
}

/* ── CLOSE BUTTON ───────────────────────────────────────────────────────── */

.glyph-modal-close {
    position: absolute;
    top: 14px;
    right: 16px;
    width: 32px;
    height: 32px;
    background: transparent;
    color: #888aa0;
    border: 1px solid rgba(212, 175, 55, 0.22);
    border-radius: 50%;
    font-size: 18px;
    font-family: "Times New Roman", Georgia, serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
    z-index: 2;
}
.glyph-modal-close:hover {
    background: rgba(255, 216, 107, 0.10);
    color: #ffd86b;
    transform: rotate(90deg);
}

/* ── HEADER (rune + title) ──────────────────────────────────────────────── */

.glyph-modal-header {
    display: flex;
    align-items: center;
    gap: 24px;
    padding-bottom: 18px;
    margin-bottom: 18px;
    border-bottom: 1px dashed color-mix(in srgb, var(--glyph-hue) 25%, transparent);
}

.glyph-modal-rune {
    flex-shrink: 0;
    width: 90px;
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: "Times New Roman", Georgia, serif;
    font-size: 64px;
    line-height: 1;
    color: var(--glyph-hue);
    text-shadow:
        0 0 14px color-mix(in srgb, var(--glyph-hue) 55%, transparent),
        0 0 32px color-mix(in srgb, var(--glyph-hue) 28%, transparent);
    border: 1px solid color-mix(in srgb, var(--glyph-hue) 35%, transparent);
    border-radius: 50%;
    background: radial-gradient(circle at center,
                color-mix(in srgb, var(--glyph-hue) 15%, transparent),
                transparent 70%);
    animation: glyphRunePulse 3.5s ease-in-out infinite;
}

@keyframes glyphRunePulse {
    0%, 100% { box-shadow: 0 0 0   color-mix(in srgb, var(--glyph-hue) 40%, transparent); }
    50%      { box-shadow: 0 0 24px color-mix(in srgb, var(--glyph-hue) 40%, transparent); }
}

.glyph-modal-title {
    flex: 1;
    min-width: 0;
}

.glyph-modal-name {
    margin: 0 0 4px;
    font-family: "Times New Roman", Georgia, serif;
    font-size: 26px;
    font-weight: 600;
    color: var(--glyph-hue);
    letter-spacing: 1px;
}

.glyph-modal-tagline {
    margin: 0;
    font-family: "Times New Roman", Georgia, serif;
    font-style: italic;
    font-size: 14px;
    color: #ddc88a;
    letter-spacing: 0.3px;
}

/* ── WARNINGS STRIP ─────────────────────────────────────────────────────── */

.glyph-modal-warnings {
    background: linear-gradient(90deg,
                rgba(255, 123, 157, 0.10),
                rgba(255, 157, 107, 0.06));
    border: 1px solid rgba(255, 123, 157, 0.30);
    border-radius: 10px;
    padding: 10px 16px;
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.glyph-modal-warnings[hidden] { display: none; }

.glyph-modal-warning-item {
    font-family: "Times New Roman", Georgia, serif;
    font-size: 12.5px;
    color: #ff9d6b;
    display: flex;
    gap: 8px;
    align-items: baseline;
}

.glyph-modal-warning-item::before {
    content: "⚠";
    color: #ff7b9d;
    flex-shrink: 0;
}

/* ── METRICS GRID ───────────────────────────────────────────────────────── */

.glyph-modal-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.glyph-metric-card {
    /* Per-card hue set inline */
    --metric-hue: #ddc88a;

    background: linear-gradient(180deg,
                rgba(255, 255, 255, 0.03),
                rgba(10, 8, 24, 0.45));
    border: 1px solid color-mix(in srgb, var(--metric-hue) 25%, rgba(212, 175, 55, 0.10));
    border-radius: 10px;
    padding: 12px 14px;
    position: relative;
    overflow: hidden;
    transition: transform 0.18s ease, border-color 0.18s ease;
}

.glyph-metric-card::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--metric-hue), transparent);
    opacity: 0.55;
}

.glyph-metric-card:hover {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--metric-hue) 50%, transparent);
}

.glyph-metric-label {
    font-family: "Times New Roman", Georgia, serif;
    font-size: 10px;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: #b095f5;
    margin-bottom: 4px;
}

.glyph-metric-value {
    font-family: "Times New Roman", Georgia, serif;
    font-size: 22px;
    font-weight: 600;
    color: var(--metric-hue);
    line-height: 1.1;
    letter-spacing: 0.4px;
    font-variant-numeric: tabular-nums;
    word-break: break-word;
}

.glyph-metric-sub {
    margin-top: 4px;
    font-family: "Times New Roman", Georgia, serif;
    font-size: 10.5px;
    color: #888aa0;
    font-style: italic;
}

/* ── INTERPRETATION + INFLUENCE BLOCKS ─────────────────────────────────── */

.glyph-modal-interpretation,
.glyph-modal-influence {
    background: rgba(10, 8, 24, 0.45);
    border: 1px solid rgba(212, 175, 55, 0.14);
    border-left: 3px solid color-mix(in srgb, var(--glyph-hue) 60%, transparent);
    border-radius: 0 10px 10px 0;
    padding: 12px 16px;
    margin-bottom: 12px;
}

.glyph-modal-label {
    font-family: "Times New Roman", Georgia, serif;
    font-size: 10.5px;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    color: var(--glyph-hue);
    margin-bottom: 5px;
    font-weight: 600;
}

.glyph-modal-interpretation p,
.glyph-modal-influence p {
    margin: 0;
    font-family: "Times New Roman", Georgia, serif;
    font-size: 13.5px;
    line-height: 1.55;
    color: #d4d4e8;
    font-style: italic;
}

/* ── FOOTER ─────────────────────────────────────────────────────────────── */

.glyph-modal-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px dashed rgba(212, 175, 55, 0.14);
    font-family: "Times New Roman", Georgia, serif;
    font-size: 10.5px;
    color: #888aa0;
    letter-spacing: 0.5px;
}

.glyph-modal-foot-hint {
    font-style: italic;
}

.glyph-modal-foot-stamp {
    color: color-mix(in srgb, var(--glyph-hue) 70%, #888aa0);
    font-variant-numeric: tabular-nums;
}

/* ── HOVER / CLICK INDICATORS ON THE GLYPHS THEMSELVES ─────────────────── */

.glyph-cell {
    cursor: pointer;
    transition: transform 0.2s ease, filter 0.2s ease;
}

.glyph-cell:hover {
    transform: scale(1.10);
    filter: drop-shadow(0 0 6px rgba(255, 216, 107, 0.55));
}

.glyph-cell:active {
    transform: scale(0.96);
}

/* Subtle pulse on the active glyph (whichever one was last opened) */
.glyph-cell.glyph-active .glyph-rune {
    fill: #ffd86b;
    filter: drop-shadow(0 0 8px rgba(255, 216, 107, 0.65));
}

/* ── RESPONSIVE ─────────────────────────────────────────────────────────── */

@media (max-width: 720px) {
    .glyph-modal { padding: 12px; }
    .glyph-modal-content { padding: 20px 18px 16px; }
    .glyph-modal-header { flex-direction: column; text-align: center; gap: 14px; }
    .glyph-modal-rune { width: 68px; height: 68px; font-size: 48px; }
    .glyph-modal-name { font-size: 22px; }
    .glyph-modal-metrics { grid-template-columns: repeat(2, 1fr); }
}
