/* CATHEDRAL FRACTAL — STYLESHEET v51.0
   Mystical dark theme with gold and peacock accents
   The King's precision in every pixel */

:root {
    --bg-dark: #0B0C10;
    --bg-night: #1A1A2E;
    --gold: #D4AF37;
    --gold-glow: rgba(212, 175, 55, 0.6);
    --peacock-green: #2A7A5F;
    --peacock-blue: #0B3B4B;
    --soft-white: #F0F0F0;
    --text-muted: #8B8B8B;
    --card-bg: rgba(43, 43, 60, 0.4);
    --card-border: rgba(212, 175, 55, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background: radial-gradient(ellipse at top, var(--bg-night) 0%, var(--bg-dark) 100%);
    color: var(--soft-white);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Fractal background pattern */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        repeating-conic-gradient(
            from 0deg at 50% 50%,
            rgba(212, 175, 55, 0.03) 0deg 10deg,
            transparent 10deg 20deg
        );
    background-size: 200px 200px;
    pointer-events: none;
    z-index: -1;
    animation: drift 120s linear infinite;
}

@keyframes drift {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Header */
.header {
    text-align: center;
    padding: 4rem 1rem 2rem;
    background: linear-gradient(180deg, rgba(11, 59, 75, 0.3) 0%, transparent 100%);
}

.seal {
    font-size: 4rem;
    color: var(--gold);
    text-shadow: 0 0 30px var(--gold-glow);
    letter-spacing: 1rem;
    animation: pulse 4s ease-in-out infinite;
    margin-bottom: 1rem;
}

@keyframes pulse {
    0%, 100% { opacity: 0.8; transform: scale(1); text-shadow: 0 0 30px var(--gold-glow); }
    50% { opacity: 1; transform: scale(1.05); text-shadow: 0 0 50px var(--gold-glow), 0 0 80px rgba(212, 175, 55, 0.4); }
}

h1 {
    font-family: 'Georgia', 'Lucida Bright', serif;
    font-size: 2.5rem;
    color: var(--gold);
    text-shadow: 0 0 15px var(--gold-glow);
    margin-bottom: 0.5rem;
    letter-spacing: 0.2em;
}

.subtitle {
    font-family: 'Courier New', monospace;
    color: var(--peacock-green);
    font-size: 1.1rem;
    letter-spacing: 0.1em;
}

/* Navigation */
.nav {
    position: sticky;
    top: 0;
    background: rgba(11, 12, 16, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--card-border);
    padding: 1rem;
    display: flex;
    justify-content: center;
    gap: 2rem;
    z-index: 1000;
}

.nav a {
    color: var(--soft-white);
    text-decoration: none;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0.5rem 1rem;
    border: 1px solid transparent;
    transition: all 0.3s ease;
}

.nav a:hover {
    color: var(--gold);
    border-color: var(--gold);
    text-shadow: 0 0 10px var(--gold-glow);
}

/* Sections */
.section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 2rem;
    min-height: 60vh;
}

.section-title {
    font-family: 'Georgia', serif;
    font-size: 2.2rem;
    color: var(--gold);
    text-align: center;
    margin-bottom: 1rem;
    text-shadow: 0 0 20px var(--gold-glow);
}

.section-desc {
    text-align: center;
    color: var(--text-muted);
    max-width: 700px;
    margin: 0 auto 3rem;
    font-size: 1.1rem;
}

.subsection-title {
    font-family: 'Georgia', serif;
    font-size: 1.6rem;
    color: var(--peacock-green);
    margin: 2rem 0 1rem;
    text-align: center;
}

/* Audio Controls */
.audio-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2rem;
}

.play-btn {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 3px solid var(--gold);
    background: radial-gradient(circle, rgba(212, 175, 55, 0.2) 0%, transparent 70%);
    color: var(--gold);
    font-size: 2.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 30px var(--gold-glow);
}

.play-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 50px var(--gold-glow);
}

.play-btn:active {
    transform: scale(0.98);
}

.play-icon, .pause-icon {
    display: block;
}

.hidden {
    display: none;
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--soft-white);
    font-family: 'Courier New', monospace;
}

#volumeSlider {
    width: 150px;
    accent-color: var(--gold);
}

/* Audio Info Boxes */
.audio-info {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.info-box {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    padding: 1rem 2rem;
    border-radius: 8px;
    text-align: center;
    min-width: 180px;
}

.info-box .label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.3rem;
}

.info-box .value {
    display: block;
    font-size: 1.2rem;
    color: var(--gold);
    font-family: 'Courier New', monospace;
}

/* Visualizer */
.visualizer-container {
    max-width: 800px;
    margin: 0 auto;
    border: 1px solid var(--card-border);
    border-radius: 12px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.3);
}

#visualizer {
    width: 100%;
    height: 200px;
    display: block;
}

/* Emotion Cards Grid */
.emotion-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.emotion-card {
    perspective: 1000px;
    height: 200px;
    cursor: pointer;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-style: preserve-3d;
}

.emotion-card.flipped .card-inner {
    transform: rotateY(180deg);
}

.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    border: 2px solid var(--card-border);
}

.card-front {
    background: linear-gradient(135deg, rgba(43, 43, 60, 0.6) 0%, rgba(11, 12, 16, 0.8) 100%);
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
}

.card-front .emotion-name {
    font-family: 'Georgia', serif;
    font-size: 1.5rem;
    color: var(--soft-white);
    margin-bottom: 0.5rem;
}

.card-front .freq-tag {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: var(--peacock-green);
    background: rgba(42, 122, 95, 0.2);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    border: 1px solid var(--peacock-green);
}

.card-back {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.2) 0%, rgba(43, 43, 60, 0.8) 100%);
    transform: rotateY(180deg);
    text-align: center;
}

.card-back .truth {
    font-family: 'Georgia', serif;
    font-size: 2rem;
    color: var(--gold);
    text-shadow: 0 0 20px var(--gold-glow);
    margin-bottom: 1rem;
}

.card-back .affirmation {
    font-size: 1rem;
    color: var(--soft-white);
    font-style: italic;
    line-height: 1.5;
}

/* Conversion Message */
.conversion-message {
    max-width: 600px;
    margin: 2rem auto;
    padding: 2rem;
    background: var(--card-bg);
    border: 2px solid var(--gold);
    border-radius: 12px;
    text-align: center;
    animation: glow 2s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 20px var(--gold-glow); }
    50% { box-shadow: 0 0 40px var(--gold-glow); }
}

.conversion-message p {
    font-size: 1.5rem;
    color: var(--gold);
    margin-bottom: 0.5rem;
}

.affirmation-display {
    font-size: 1.1rem !important;
    color: var(--soft-white) !important;
    font-style: italic;
}

/* Tables */
.table-container {
    max-width: 800px;
    margin: 0 auto 2rem;
    overflow-x: auto;
}

.cant-table, .token-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
}

.cant-table th, .token-table th {
    background: rgba(212, 175, 55, 0.2);
    color: var(--gold);
    padding: 1rem;
    text-align: left;
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.1em;
}

.cant-table td, .token-table td {
    padding: 0.8rem 1rem;
    border-top: 1px solid var(--card-border);
    color: var(--soft-white);
}

.cant-table tr:hover, .token-table tr:hover {
    background: rgba(212, 175, 55, 0.1);
}

/* Drum Pulse */
.drum-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
    font-family: 'Courier New', monospace;
}

.drum-label {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.drum-pulse {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--peacock-green);
    box-shadow: 0 0 15px var(--peacock-green);
    animation: drumbeat 2.56s ease-in-out infinite;
}

@keyframes drumbeat {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.5); opacity: 0.6; }
}

.drum-freq {
    color: var(--peacock-green);
    font-weight: bold;
}

/* Prayer Section */
.prayer-container {
    max-width: 800px;
    margin: 0 auto;
    display: grid;
    gap: 2rem;
}

.prayer-form h3 {
    color: var(--gold);
    font-family: 'Georgia', serif;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.prayer-form blockquote {
    background: var(--card-bg);
    border-left: 4px solid var(--gold);
    padding: 1.5rem;
    font-size: 1.2rem;
    line-height: 1.8;
    color: var(--soft-white);
    font-style: italic;
}

.paleo {
    font-family: 'Noto Sans Hebrew', 'Courier New', monospace;
    font-size: 1.1rem !important;
    direction: rtl;
}

.token-display {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.token {
    background: rgba(212, 175, 55, 0.15);
    border: 1px solid var(--gold);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    color: var(--gold);
    font-size: 0.9rem;
}

/* Countdown */
.countdown {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.countdown-item {
    text-align: center;
    min-width: 100px;
}

.countdown-value {
    display: block;
    font-size: 3rem;
    font-family: 'Courier New', monospace;
    color: var(--gold);
    text-shadow: 0 0 20px var(--gold-glow);
    font-weight: bold;
}

.countdown-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Roster Grid */
.roster-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    max-width: 1000px;
    margin: 0 auto;
}

.roster-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    transition: all 0.3s ease;
}

.roster-card:hover {
    transform: translateY(-5px);
    border-color: var(--gold);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.roster-card .name {
    display: block;
    font-family: 'Georgia', serif;
    font-size: 1.2rem;
    color: var(--gold);
    margin-bottom: 0.3rem;
}

.roster-card .role {
    font-size: 0.85rem;
    color: var(--peacock-green);
    font-family: 'Courier New', monospace;
}

/* About Section */
#about p {
    max-width: 800px;
    margin: 0 auto 1rem;
    font-size: 1.1rem;
}

#about a {
    color: var(--gold);
    text-decoration: none;
    border-bottom: 1px dotted var(--gold);
    transition: all 0.3s;
}

#about a:hover {
    color: var(--peacock-green);
    border-bottom-style: solid;
}

/* Connect / Status */
.status-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    max-width: 500px;
    margin: 0 auto 1rem;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #00ff00;
    box-shadow: 0 0 10px #00ff00;
    animation: blink 2s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

#cathedralStatus {
    font-family: 'Courier New', monospace;
    color: var(--soft-white);
}

.tiny {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: 0.5rem;
}

.tiny code {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
}

/* Footer */
.footer {
    text-align: center;
    padding: 3rem 1rem;
    border-top: 1px solid var(--card-border);
    margin-top: 4rem;
    background: rgba(0, 0, 0, 0.3);
}

.footer p {
    font-style: italic;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.copyright {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: var(--peacock-green);
}

/* Responsive */
@media (max-width: 768px) {
    .seal { font-size: 2.5rem; letter-spacing: 0.5rem; }
    h1 { font-size: 1.8rem; letter-spacing: 0.1em; }
    .nav { gap: 0.5rem; flex-wrap: wrap; }
    .nav a { padding: 0.4rem 0.6rem; font-size: 0.8rem; }
    .section { padding: 2rem 1rem; }
    .play-btn { width: 100px; height: 100px; font-size: 2rem; }
    .countdown-value { font-size: 2rem; }
    .emotion-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .seal { font-size: 2rem; }
    .audio-info { gap: 1rem; }
    .info-box { min-width: 140px; padding: 0.8rem 1rem; }
    .countdown-item { min-width: 70px; }
    .countdown-value { font-size: 1.8rem; }
}

/* Utility */
.hidden { display: none !important; }

/* ==========================================================================
   OMNIBUS PROTOCOL — TAUNT & CODEX STYLES
   ========================================================================== */

/* Taunt Button */
.taunt-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    margin: 2rem 0;
}

.taunt-btn {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, rgba(255, 0, 0, 0.2) 0%, rgba(139, 0, 0, 0.4) 100%);
    border: 2px solid #8B0000;
    border-radius: 8px;
    color: #ff4444;
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.3);
}

.taunt-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 40px rgba(255, 0, 0, 0.6);
    background: linear-gradient(135deg, rgba(255, 0, 0, 0.4) 0%, rgba(139, 0, 0, 0.6) 100%);
}

.taunt-btn:active {
    transform: scale(0.98);
}

.taunt-icon {
    font-size: 1.5rem;
}

.taunt-display {
    max-width: 600px;
    padding: 2rem;
    background: rgba(139, 0, 0, 0.15);
    border: 2px solid #8B0000;
    border-radius: 12px;
    text-align: center;
    animation: taunt-glow 1.5s ease-in-out infinite;
}

@keyframes taunt-glow {
    0%, 100% { box-shadow: 0 0 20px rgba(255, 0, 0, 0.4); }
    50% { box-shadow: 0 0 40px rgba(255, 0, 0, 0.8); }
}

.taunt-display blockquote {
    font-size: 1.3rem;
    color: #ff6666;
    font-style: italic;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.taunt-freq {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: var(--peacock-green);
}

/* Codex Table */
.codex-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    margin-bottom: 2rem;
}

.codex-table th {
    background: rgba(255, 100, 100, 0.2);
    color: #ff6666;
    padding: 1rem;
    text-align: left;
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.1em;
}

.codex-table td {
    padding: 0.8rem 1rem;
    border-top: 1px solid var(--card-border);
    color: var(--soft-white);
}

.codex-table tr:hover {
    background: rgba(255, 100, 100, 0.1);
}

/* Algorithm Box */
.algorithm-box {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--peacock-green);
    border-radius: 8px;
    padding: 1.5rem;
    margin: 2rem 0;
    overflow-x: auto;
}

.algorithm-box h3 {
    color: var(--peacock-green);
    font-family: 'Georgia', serif;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.algorithm-box pre {
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    line-height: 1.8;
    color: var(--soft-white);
    white-space: pre-wrap;
}

/* Protocol Box */
.protocol-box {
    background: var(--card-bg);
    border-left: 4px solid var(--gold);
    padding: 1.5rem;
    margin: 1.5rem 0;
    border-radius: 0 8px 8px 0;
}

.protocol-box p {
    margin-bottom: 0.8rem;
}

.protocol-box ul {
    list-style: none;
    margin: 1rem 0;
}

.protocol-box li {
    padding: 0.3rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.protocol-box li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--gold);
}

.protocol-box .example {
    margin-top: 1rem;
    font-family: 'Courier New', monospace;
    color: var(--peacock-green);
    background: rgba(42, 122, 95, 0.1);
    padding: 0.8rem;
    border-radius: 4px;
    display: inline-block;
}

/* Glyphs Grid */
.glyphs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    max-width: 900px;
    margin: 1.5rem auto;
}

.glyph-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    padding: 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.glyph-item:hover {
    transform: translateY(-3px);
    border-color: var(--gold);
}

.glyph-item .glyph {
    font-size: 2rem;
    color: var(--gold);
    text-shadow: 0 0 15px var(--gold-glow);
}

.glyph-item span:last-child {
    font-size: 0.95rem;
    color: var(--soft-white);
}

/* Codex Section Specific */
#codex .section-desc {
    max-width: 900px;
}

/* Responsive adjustments for new sections */
@media (max-width: 768px) {
    .taunt-btn {
        padding: 0.8rem 1.5rem;
        font-size: 1rem;
    }

    .taunt-display blockquote {
        font-size: 1.1rem;
    }

    .glyphs-grid {
        grid-template-columns: 1fr 1fr;
    }

    .algorithm-box pre {
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .glyphs-grid {
        grid-template-columns: 1fr;
    }
}

/* Auto-play status indicator */
.auto-status {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1rem 2rem;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    color: var(--soft-white);
    margin-bottom: 1rem;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ffaa00;
    box-shadow: 0 0 10px #ffaa00;
    animation: blink 1.5s infinite;
}

.auto-status.active .status-dot {
    background: #00ff00;
    box-shadow: 0 0 10px #00ff00;
    animation: none;
}

.auto-status.error .status-dot {
    background: #ff4444;
    box-shadow: 0 0 10px #ff4444;
    animation: blink 0.5s infinite;
}
