/* Bubble Pop Game Styles */

:root {
    --font-main: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: var(--font-main);
    background: #1a1a2e;
    color: #fff;
}

.game-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}

#canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.ui-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 10;
}

.content {
    text-align: center;
    padding: 2rem;
    max-width: 90%;
    pointer-events: auto;
}

.title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.controls-inline {
    margin-bottom: 1rem;
}

.control-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    font-size: 0.9rem;
}

.touch {
    width: 20px;
    height: 20px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M9 11.24V7.5a2.5 2.5 0 0 1 5 0v3.74c1.21-.81 2-2.18 2-3.74a5 5 0 0 0-10 0c0 1.56.79 2.93 2 3.74zm9.84 4.63l-4.54-2.26c-.17-.07-.35-.11-.54-.11H13v-6a1.5 1.5 0 0 0-3 0v10.74l-3.43-.72c-.08-.01-.15-.03-.24-.03-.31 0-.59.13-.79.33l-.79.8 4.94 4.94c.27.27.65.44 1.06.44h6.79c.75 0 1.33-.55 1.44-1.28l.75-5.27c.01-.07.02-.14.02-.2 0-.62-.38-1.16-.91-1.38z'/%3E%3C/svg%3E") no-repeat center;
    background-size: contain;
}

.instruction {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: rgba(255, 255, 255, 0.7);
}

.score {
    font-size: 4rem;
    font-weight: 700;
    margin: 1rem 0;
    line-height: 1.2;
}

.best-score {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0.5rem;
}

.hint {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 1.5rem;
}

.home-link {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    text-decoration: none;
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    transition: background 0.2s;
    z-index: 20;
    pointer-events: auto;
}

.home-link:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Hide UI during gameplay */
.state-playing .ui-overlay {
    display: none;
}

/* HUD during play */
.hud {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 15;
    pointer-events: none;
}

.hud-score {
    font-size: 2rem;
    font-weight: 700;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.hud-timer {
    font-size: 1.5rem;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

/* Result state */
.state-result .ui-overlay {
    background: rgba(0, 0, 0, 0.7);
}

.state-result .controls-inline,
.state-result .instruction {
    display: none;
}

/* New best celebration */
.state-result.new-best .title {
    color: #FFD93D;
    animation: glow 1s ease-in-out infinite alternate;
}

@keyframes glow {
    from { text-shadow: 0 0 20px rgba(255, 217, 61, 0.5); }
    to { text-shadow: 0 0 40px rgba(255, 217, 61, 0.8); }
}

/* Responsive */
@media (max-width: 600px) {
    .title {
        font-size: 1.75rem;
    }

    .score {
        font-size: 3rem;
    }
}

/* How to play section */
.how-to-play,
.related-games {
    margin-top: 2rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    text-align: left;
}

.how-to-play h2,
.related-games h3 {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    color: rgba(255, 255, 255, 0.85);
}

.how-to-play p,
.how-to-play li {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.6;
}

.how-to-play ol {
    padding-left: 1.25rem;
    margin: 0.75rem 0;
}

.how-to-play li {
    margin-bottom: 0.5rem;
}

.related-games-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.related-game-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.4rem 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.85rem;
    transition: background 0.2s;
}

.related-game-link:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Prevent text selection during gameplay */
.game-container * {
    user-select: none;
    -webkit-user-select: none;
}
