﻿body {
    margin: 0;
    padding: 0;
    font-family: 'Press Start 2P', 'Courier New', monospace;
    background: #000011;
    color: #ffffff;
    min-height: 100vh;
    overflow-x: hidden;
}

canvas#starfield {
    position: fixed;
    inset: 0;
    z-index: 0;
}

.app-shell {
    position: relative;
    z-index: 2;
    min-height: 100vh;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 1100px;
    margin: 0 auto;
    box-sizing: border-box;
}

.app-nav {
    display: flex;
    justify-content: flex-end;
    z-index: 3;
}

.hero {
    text-align: left;
    margin-top: 2rem;
}

.eyebrow {
    font-size: 0.65rem;
    letter-spacing: 0.4rem;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
}

.hero h1 {
    margin: 0.35rem 0;
    font-size: 1.8rem;
    line-height: 1.2;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.65);
}

.subhead {
    margin: 0;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
}

.today-line {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.6);
}

.today-line .today-date {
    color: #00e676;
    font-weight: bold;
    letter-spacing: 0.08rem;
}

main {
    flex: 1;
}

.zodiac-panel {
    background: rgba(5, 5, 15, 0.9);
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 1.5rem;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(12px);
}

.panel-header h2 {
    margin: 0;
    font-size: 1rem;
    letter-spacing: 0.08rem;
}

.panel-header p {
    margin: 0.25rem 0 1rem;
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.6);
}

.zodiac-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(120px, 1fr));
    gap: 1rem;
}

.zodiac-button {
    border-radius: 14px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.04);
    padding: 1.2rem;
    min-height: 72px;
    font-size: 0.65rem;
    letter-spacing: 0.16rem;
    text-transform: uppercase;
    color: #fff;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.zodiac-button.selected {
    border-color: #00e676;
    background: rgba(0, 230, 118, 0.08);
    box-shadow: 0 0 16px rgba(0, 230, 118, 0.5);
    transform: translateY(-2px) scale(1.02);
}

.control-row {
    margin-top: 1.1rem;
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.control-row button {
    border: 2px solid rgba(255, 255, 255, 0.9);
    background: #111;
    color: #fff;
    border-radius: 8px;
    padding: 0.9rem 1.6rem;
    font-size: 0.65rem;
    letter-spacing: 0.12rem;
    cursor: pointer;
    transition: background 0.3s ease;
}

.control-row button:disabled {
    border-color: rgba(255, 255, 255, 0.3);
    opacity: 0.5;
    cursor: not-allowed;
}

.control-hint {
    font-size: 0.58rem;
    color: rgba(255, 255, 255, 0.6);
}

.result-panel {
    margin-top: 1.5rem;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 1.25rem;
    background: rgba(0, 0, 0, 0.8);
    box-shadow: inset 0 0 30px rgba(255, 255, 255, 0.03), 0 0 20px rgba(0, 0, 0, 0.8);
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.result-header h3 {
    margin: 0;
    font-size: 1rem;
    letter-spacing: 0.08rem;
}

.selected-sign {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.7);
}

.horoscope-output {
    min-height: 220px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 10px;
    padding: 1rem;
    font-size: 0.68rem;
    line-height: 1.8;
    background: rgba(255, 255, 255, 0.02);
    word-break: break-word;
}

.share-area {
    margin-top: 1rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
}

.share-label {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.7);
}

.share-btn {
    border: 1px solid rgba(255, 255, 255, 0.45);
    background: transparent;
    color: #fff;
    padding: 0.5rem 0.8rem;
    border-radius: 6px;
    font-size: 0.55rem;
    letter-spacing: 0.12rem;
    cursor: pointer;
    transition: border-color 0.3s ease, background 0.3s ease;
}

.share-btn:hover {
    border-color: #fff;
    background: rgba(255, 255, 255, 0.15);
}

.publish-btn {
    background: rgba(255, 255, 255, 0.05);
}

.publish-status {
    font-size: 0.55rem;
    color: #00e676;
    margin-left: 0.6rem;
}

.loading,
.error {
    display: none;
    margin-top: 1rem;
    border-radius: 10px;
    padding: 1rem;
    font-size: 0.65rem;
    letter-spacing: 0.08rem;
}

.loading {
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.02);
}

.loading-bar {
    margin-top: 0.5rem;
    height: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.15);
    overflow: hidden;
}

.loading-progress {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, rgba(0, 230, 118, 0), rgba(0, 230, 118, 0.7), rgba(0, 230, 118, 0));
    animation: pulse 1.8s linear infinite;
}

.error {
    border: 1px solid rgba(244, 67, 54, 0.8);
    background: rgba(244, 67, 54, 0.08);
    color: #ff6b6b;
}

.published-link.floating {
    position: fixed;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 4;
    padding: 0.5rem 1.4rem;
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.8);
    background: rgba(3, 3, 10, 0.95);
    font-size: 0.6rem;
    letter-spacing: 0.15rem;
    color: #fff;
    text-transform: uppercase;
    transition: border-color 0.3s ease, transform 0.3s ease;
}

.published-link.floating:hover {
    border-color: #00b0ff;
    transform: translateX(-50%) translateY(-4px);
}

.published-link.back-link {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    margin-top: 1.5rem;
    padding: 0.4rem 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 8px;
    text-transform: uppercase;
    letter-spacing: 0.12rem;
    color: #fff;
    background: rgba(3, 3, 10, 0.9);
}

.back-to-home-row {
    display: flex;
    justify-content: center;
}

.home-button {
    position: relative;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    padding: 0.2rem;
    border-radius: 0.4rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    text-decoration: none;
    gap: 0.2rem;
}

.home-button:hover .home-tooltip {
    opacity: 1;
}

.home-crystal {
    width: 44px;
    height: 44px;
}

.home-tooltip {
    position: absolute;
    bottom: 120%;
    background: rgba(0, 0, 0, 0.9);
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    font-size: 0.55rem;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.home-url {
    font-size: 0.55rem;
    color: rgba(255, 255, 255, 0.7);
}

.published-entry {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.02);
    line-height: 1.6;
}

.published-entry header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.published-entry .entry-symbol {
    font-size: 0.65rem;
    letter-spacing: 0.18rem;
    color: rgba(0, 230, 118, 0.8);
}

.published-entry time {
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.6);
}

.published-entry .entry-full {
    font-size: 0.65rem;
    margin: 0 0 0.5rem;
}

.published-entry .entry-description {
    font-size: 0.55rem;
    color: rgba(255, 255, 255, 0.6);
}

@keyframes pulse {
    0% {
        transform: translateX(-100%);
        opacity: 0;
    }
    50% {
        transform: translateX(0);
        opacity: 1;
    }
    100% {
        transform: translateX(100%);
        opacity: 0;
    }
}

@media (max-width: 1024px) {
    .zodiac-grid {
        grid-template-columns: repeat(3, minmax(140px, 1fr));
    }
}

@media (max-width: 768px) {
    .app-shell {
        padding: 1rem;
    }

    .control-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .zodiac-grid {
        grid-template-columns: repeat(2, minmax(140px, 1fr));
    }
}

@media (max-width: 480px) {
    .zodiac-panel {
        padding: 1.25rem;
    }

    .zodiac-grid {
        grid-template-columns: repeat(1, minmax(120px, 1fr));
    }

    .published-link.floating {
        font-size: 0.5rem;
        padding: 0.4rem 1.1rem;
    }
}
