/* 8 Eternal C's - Self-Demonstrating App */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'SF Mono', 'Menlo', 'Monaco', monospace;
    background: #0a0a0a;
    color: #fff;
    min-height: 100vh;
    overflow-x: hidden;
}

body.dec8-mode {
    background: #1a0800;
}

body.pulse {
    animation: pulse-bg 0.2s ease-in-out;
}

@keyframes pulse-bg {
    0%, 100% { background: #1a0800; }
    50% { background: #3a1800; }
}

.app {
    display: grid;
    grid-template-columns: 1fr 280px;
    grid-template-rows: 1fr auto auto;
    gap: 16px;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
    min-height: 100vh;
}

/* Visualization */
.viz-container {
    grid-column: 1;
    grid-row: 1;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 300px;
}

/* Title above dial */
.dial-title {
    font-size: 24px;
    font-weight: bold;
    color: #FF6B35;
    margin: 0 0 16px 0;
    letter-spacing: 1px;
    text-align: center;
}

/* Consciousness label below dial */
.consciousness-label {
    grid-column: 1;
    grid-row: 2;
    text-align: center;
    font-size: 14px;
    color: #666;
    letter-spacing: 8px;
    text-transform: uppercase;
    padding: 12px 0;
}

/* Wrapper for scaling canvas + overlays together */
.canvas-wrapper {
    position: relative;
    width: 600px;
    height: 600px;
    transform-origin: center center;
}

#eternals {
    background: transparent;
    display: block;
}

.center-hub {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FF6B35 0%, #FF8C42 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 0 30px rgba(255, 107, 53, 0.5);
}

.center-hub:hover {
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: 0 0 50px rgba(255, 107, 53, 0.8);
}

.hub-text {
    font-size: 12px;
    font-weight: bold;
    color: #fff;
}

.hub-sub {
    font-size: 24px;
    color: #fff;
    opacity: 0.8;
}

/* The Ghost */
.ghost {
    position: absolute;
    font-size: 24px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 2s ease-in-out, transform 4s ease-in-out;
}

.ghost.visible {
    opacity: 0.6;
}

/* The 8-Ball */
.eight-ball {
    position: absolute;
    bottom: 8px;
    right: 8px;
    font-size: 32px;
    cursor: pointer;
    transition: transform 0.3s ease;
    z-index: 10;
}

.eight-ball:hover {
    transform: scale(1.2);
}

.eight-ball.spin {
    animation: spin-ball 1s ease-in-out;
}

@keyframes spin-ball {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(360deg) scale(1.3); }
    100% { transform: rotate(720deg) scale(1); }
}

.eight-ball-fact {
    position: absolute;
    bottom: 50px;
    right: 8px;
    max-width: 280px;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.9);
    border: 1px solid #FF6B35;
    border-radius: 8px;
    font-size: 12px;
    line-height: 1.5;
    color: #fff;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none;
    z-index: 10;
}

.eight-ball-fact.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Side Panel */
.side-panel {
    grid-column: 2;
    grid-row: 1 / 3;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Info box - current C and description */
.info-box {
    background: #111;
    border-radius: 12px;
    padding: 16px;
    border: 1px solid #222;
}

.info-current {
    font-size: 18px;
    font-weight: bold;
    color: #FF6B35;
    margin-bottom: 8px;
}

.info-description {
    font-size: 12px;
    line-height: 1.5;
    color: #aaa;
    min-height: 90px; /* Fixed height for longest description (CACHE) */
}

/* Stats row */
.stats-row {
    display: flex;
    gap: 8px;
}

.stat-mini {
    flex: 1;
    background: #111;
    border-radius: 8px;
    padding: 10px;
    border: 1px solid #222;
    text-align: center;
}

.stat-label {
    display: block;
    color: #666;
    font-size: 9px;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 14px;
    font-weight: bold;
    color: #FF6B35;
}

.speed-clickable {
    cursor: pointer;
}

.speed-clickable:hover {
    text-decoration: underline;
}

/* Controls row */
.controls-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.controls-row input[type="range"] {
    flex: 1;
    height: 6px;
    -webkit-appearance: none;
    background: #333;
    border-radius: 3px;
    outline: none;
}

.controls-row input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: #FF6B35;
    border-radius: 50%;
    cursor: pointer;
}

.controls-row button {
    padding: 8px 16px;
    background: #222;
    border: 1px solid #333;
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    transition: background 0.2s;
}

.controls-row button:hover {
    background: #333;
}

/* FAF box - live state in side panel */
.faf-box {
    background: #0a0a0a;
    border-radius: 8px;
    padding: 12px;
    border: 1px solid #222;
    flex: 1;
    overflow: auto;
}

.faf-title {
    font-size: 11px;
    font-weight: bold;
    color: #FF6B35;
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.faf-box pre {
    font-family: 'SF Mono', 'Menlo', 'Monaco', monospace;
    font-size: 11px;
    line-height: 1.5;
    color: #888;
    margin: 0;
    white-space: pre-wrap;
}


/* Dec 8 Overlay */
.dec8-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(26, 8, 0, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fade-in 0.5s ease-out;
}

.dec8-overlay.hidden {
    display: none;
}

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.dec8-content {
    text-align: center;
    animation: scale-in 0.5s ease-out;
}

@keyframes scale-in {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.dec8-timestamp {
    font-size: 24px;
    color: #FF6B35;
    margin-bottom: 20px;
}

.dec8-message {
    font-size: 18px;
    color: #fff;
    line-height: 1.6;
    margin-bottom: 30px;
}

.dec8-dedication {
    font-size: 32px;
    color: #FF6B35;
}

/* Footer */
.app-footer {
    grid-column: 1 / -1;
    text-align: center;
    padding: 30px 20px;
    border-top: 1px solid #222;
    margin-top: 20px;
}

.footer-memorial {
    font-size: 14px;
    color: #ccc;
    margin-bottom: 8px;
}

.footer-tagline {
    font-size: 12px;
    color: #00D4D4;
    font-style: italic;
    margin-bottom: 4px;
}

.footer-observed {
    font-size: 11px;
    color: #FF6B35;
    margin-bottom: 4px;
}

.footer-date {
    font-size: 11px;
    color: #666;
    margin-bottom: 12px;
}

.footer-copyright {
    font-size: 11px;
    color: #444;
}

.footer-link {
    display: inline-block;
    margin-top: 12px;
    font-size: 11px;
    color: #00D4D4;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-link:hover {
    color: #FF6B35;
}

/* Responsive - Tablet */
@media (max-width: 900px) {
    .app {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto auto;
        padding: 12px;
        gap: 12px;
    }

    .dial-title {
        font-size: 20px;
    }

    .viz-container {
        grid-column: 1;
        grid-row: 1;
        min-height: 350px;
    }

    .consciousness-label {
        grid-column: 1;
        grid-row: 2;
        font-size: 12px;
        letter-spacing: 6px;
    }

    .side-panel {
        grid-column: 1;
        grid-row: 3;
    }

    .app-footer {
        grid-column: 1;
        grid-row: 4;
    }
}

/* Responsive - Mobile */
@media (max-width: 500px) {
    .app {
        padding: 8px;
        gap: 8px;
    }

    .dial-title {
        font-size: 16px;
        margin-bottom: 12px;
    }

    .consciousness-label {
        font-size: 10px;
        letter-spacing: 4px;
    }

    .viz-container {
        min-height: 280px;
    }

    /* Larger touch targets */
    .controls-row button {
        padding: 12px 20px;
        font-size: 16px;
        min-height: 44px;
    }

    .controls-row input[type="range"] {
        height: 10px;
    }

    .controls-row input[type="range"]::-webkit-slider-thumb {
        width: 24px;
        height: 24px;
    }

    /* Adjust stats for smaller screens */
    .stats-row {
        gap: 4px;
    }

    .stat-mini {
        padding: 8px 4px;
    }

    .stat-label {
        font-size: 8px;
    }

    .stat-value {
        font-size: 12px;
    }

    /* Smaller FAF box */
    .faf-box {
        max-height: 150px;
    }

    .faf-box pre {
        font-size: 10px;
    }

    /* Compact footer */
    .app-footer {
        padding: 20px 10px;
    }

    .footer-memorial {
        font-size: 12px;
    }

    .footer-tagline,
    .footer-observed,
    .footer-date {
        font-size: 10px;
    }

    /* 8-ball adjustments */
    .eight-ball {
        font-size: 28px;
    }

    .eight-ball-fact {
        max-width: 200px;
        font-size: 11px;
        right: 4px;
        bottom: 45px;
    }
}
