:root {
    --primary-color: #e94560;
    --secondary-color: #f8b400;
    --background-color: #1a1a2e;
    --text-color: #f7f7f7;
    --card-bg-color: rgba(255, 255, 255, 0.05);
    --border-radius: 15px;
    --box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
}

body {
    font-family: 'Lato', sans-serif;
    background-color: var(--background-color);
    background-image: url('./background.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: var(--text-color);
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    text-align: center;
}

.page-wrapper {
    width: 100%;
    max-width: 650px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 2rem;
    background: rgba(0,0,0,0.3);
    border-radius: var(--border-radius);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

header {
    margin-bottom: 1rem;
}

header h1 {
    font-family: 'Playfair Display', serif;
    font-size: 3rem;
    color: #fff;
    text-shadow: 0 0 10px var(--primary-color), 0 0 20px var(--primary-color);
    margin: 0;
}

header p {
    font-size: 1.2rem;
    color: #eee;
    margin-top: 0.5rem;
}

#settings {
    background: var(--card-bg-color);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#settings h2 {
    font-family: 'Playfair Display', serif;
    margin-top: 0;
    color: var(--secondary-color);
    font-size: 1.5rem;
}

.setting-item {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
}

.setting-item input {
    width: 60px;
    padding: 0.5rem;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(0,0,0,0.2);
    color: var(--text-color);
    font-family: 'Lato', sans-serif;
    font-size: 1.1rem;
    text-align: center;
}

.setting-item input:disabled {
    background: rgba(0,0,0,0.4);
    cursor: not-allowed;
}


#game-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

#info-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.2rem;
    font-weight: 700;
}

#timer {
    background-color: var(--primary-color);
    padding: 0.5rem 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: 0 0 15px var(--primary-color);
    color: #fff;
    font-size: 1.8rem;
    font-weight: 700;
}

#break-timer-container {
    margin-top: 1.5rem;
}

#break-timer-container p {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    color: #ccc;
}

#break-timer {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--secondary-color);
    text-shadow: 0 0 10px var(--secondary-color);
}

#topic-card {
    background-color: var(--card-bg-color);
    border-radius: var(--border-radius);
    box-shadow: none;
    border: 1px solid rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 2.5rem;
    min-height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    transition: all 0.3s ease;
}

#topic-content h3 {
    font-family: 'Playfair Display', serif;
    font-size: 2.2rem;
    color: var(--secondary-color);
    margin-top: 0;
    margin-bottom: 1.5rem;
    text-shadow: 0 0 8px rgba(0,0,0,0.5);
}

#topic-keywords {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.keyword {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--secondary-color);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    border: 1px solid var(--secondary-color);
    letter-spacing: 0.5px;
}

#topic-content p {
    font-size: 1.2rem;
    line-height: 1.7;
}

#initial-message h2, #times-up-message h2 {
     font-family: 'Playfair Display', serif;
     color: #fff;
     font-size: 2rem;
}


#controls {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

button {
    font-family: 'Lato', sans-serif;
    padding: 1rem 1.2rem;
    font-size: 1rem;
    font-weight: 700;
    border-radius: var(--border-radius);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 1px;
    background-size: 200% auto;
}

#start-btn { background-image: linear-gradient(to right, #23C452 0%, #28a745 51%, #23C452 100%); }
#pause-btn { background-image: linear-gradient(to right, #f8b400 0%, #f5a623 51%, #f8b400 100%); }
#next-btn { background-image: linear-gradient(to right, #e94560 0%, #d62f4c 51%, #e94560 100%); }
#reset-btn { background-color: #6c757d; }

button:disabled {
    background-image: none;
    background-color: #555;
    cursor: not-allowed;
    opacity: 0.6;
}

button:not(:disabled):hover {
    background-position: right center;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

#how-to-play {
    margin-top: 1rem;
    background: var(--card-bg-color);
    border-radius: var(--border-radius);
    padding: 1rem 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#how-to-play summary {
    font-weight: 700;
    cursor: pointer;
    color: var(--secondary-color);
    font-size: 1.1rem;
}

#how-to-play ol {
    text-align: left;
    margin-top: 1rem;
    padding-left: 1.5rem;
    line-height: 1.8;
}

.hidden {
    display: none !important;
}

@media (max-width: 640px) {
    .page-wrapper {
        padding: 1rem;
        background: none;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        border: none;
    }
    
    header h1 {
        font-size: 2.2rem;
    }

    #controls {
        grid-template-columns: 1fr;
    }
}