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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0a0a2e, #16213e, #1a1a3e);
    color: #ffffff;
    min-height: 100vh;
    overflow: hidden;
    position: relative;
}

#gameContainer {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.4);
    padding: 1rem;
    text-align: center;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    z-index: 100;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
    background: linear-gradient(45deg, #ffd700, #dc143c, #00ced1, #4169e1, #87ceeb, #32cd32, #9370db, #ff69b4);
    background-size: 400% 400%;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: titleColorCycle 8s ease-in-out infinite;
}

#difficultySelector {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.difficulty-btn {
    padding: 0.5rem 1rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.difficulty-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

.difficulty-btn.active {
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    color: #000;
    border-color: #ffd700;
}

#gameArea {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

#starImageContainer {
    position: absolute;
    top: 120px;
    right: 20px;
    width: 300px;
    min-height: 150px;
    max-height: calc(100vh - 200px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    overflow: hidden;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.7);
    z-index: 200;
    padding: 10px;
    transition: height 0.3s ease;
}

#starImageContent {
    flex-direction: column;
    align-items: center;
    flex: 1;
    width: 100%;
}

#starImageContent.hidden {
    display: none;
}

#starImageContainer.no-star-selected {
    justify-content: center;
}

#starImage {
    width: 100%;
    max-height: 350px;
    object-fit: contain;
    border-radius: 13px;
    transition: opacity 0.5s ease;
    flex-shrink: 0;
    margin-top: 1rem;
}

#starImageContent #starName {
    color: #ffd700;
    font-size: 1.2rem;
    font-weight: bold;
    text-align: center;
    margin: 10px 0 5px 0;
    padding: 0 10px;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

#starImageContent #starMeaning {
    color: #e0e0e0;
    font-size: 0.9rem;
    text-align: center;
    margin: 0;
    padding: 0 10px;
    line-height: 1.4;
}

#starCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(ellipse at center, #1a1a3e 0%, #0a0a2e 100%);
    cursor: crosshair;
    z-index: 1;
}

#culturalPanel {
    position: absolute;
    top: 120px;
    left: 20px;
    width: 350px;
    min-height: 150px;
    max-height: calc(100vh - 200px);
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    padding: 1.5rem;
    backdrop-filter: blur(20px);
    z-index: 50;
    overflow: visible;
}

.panel h3 {
    color: #ffd700;
    margin-bottom: 1rem;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}


.panel p {
    line-height: 1.6;
    margin-bottom: 1rem;
    color: #e0e0e0;
}

.hidden {
    display: none;
}

#starInfo {
    margin-top: 0;
}

#starStory {
    margin-top: 0;
}

#starCultural {
    margin-top: 1rem;
}

#starStory h4, #starCultural h4 {
    color: #ffd700;
    margin-bottom: 0.75rem;
    font-size: 1rem;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

#starStory p, #starCultural p {
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0;
    color: #e8e8e8;
}


#progressTracker {
    margin-top: 1.5rem;
    width: 100%;
    padding: 0 15px;
}

.find-text {
    font-weight: normal;
    font-style: italic;
}

#progressBar {
    width: 100%;
    height: 10px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    overflow: hidden;
    margin: 0.5rem 0;
}

#progressFill {
    height: 100%;
    background: linear-gradient(90deg, #ffd700, #ffed4e);
    width: 0%;
    transition: width 0.5s ease;
    border-radius: 5px;
}

#progressText {
    font-size: 0.9rem;
    color: #ccc;
}

#hintBtn {
    background: linear-gradient(45deg, #ffd700, #dc143c, #00ced1, #4169e1, #87ceeb, #32cd32, #9370db, #ff69b4);
    background-size: 400% 400%;
    border: none;
    color: #000;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    margin-top: 0.75rem;
    margin-bottom: 1.5rem;
    margin-left: auto;
    display: block;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    animation: titleColorCycle 8s ease-in-out infinite;
}

#hintBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
}

#hintBtn:disabled {
    background: rgba(255, 255, 255, 0.2);
    color: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

#completionPanel {
    text-align: center;
    padding: 1.5rem;
    border-radius: 10px;
    margin-top: 1rem;
}

#celebrateBtn, #resetBtn {
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    border: none;
    color: #000;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
    margin: 0.5rem;
    transition: all 0.3s ease;
}

#celebrateBtn:hover, #resetBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
}

footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.4);
    padding: 1rem;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
    color: #ccc;
    backdrop-filter: blur(10px);
    z-index: 100;
}

@keyframes titleColorCycle {
    0% { background-position: 0% 50%; }
    25% { background-position: 100% 50%; }
    50% { background-position: 100% 100%; }
    75% { background-position: 0% 100%; }
    100% { background-position: 0% 50%; }
}

@keyframes twinkle {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

@keyframes celebration {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.celebrating {
    animation: celebration 0.5s ease-in-out;
}

@media (max-width: 768px) {
    body {
        overflow: auto;
    }
    
    #gameContainer {
        height: auto;
        min-height: 100vh;
        overflow: visible;
    }
    
    #gameArea {
        height: auto;
        min-height: 100vh;
        overflow: visible;
        position: relative;
    }
    
    #starCanvas {
        height: 100vh;
    }
    
    #starImageContainer {
        position: relative;
        top: auto;
        bottom: auto;
        left: 10px;
        right: 10px;
        width: auto;
        min-height: 120px;
        margin: 20px 0;
        z-index: 100;
    }
    
    #culturalPanel {
        position: relative;
        top: auto;
        bottom: auto;
        left: 10px;
        right: 10px;
        width: auto;
        min-height: 100px;
        padding: 1rem;
        margin: 20px 0;
        z-index: 100;
    }
    
    header {
        padding: 0.5rem;
    }
    
    header h1 {
        font-size: 1.8rem;
        margin-bottom: 0.5rem;
    }
    
    footer {
        font-size: 0.8rem;
        padding: 0.5rem;
    }
}