:root {
    --background-color: #121212;
    --surface-color: #1e1e1e;
    --primary-color: #33ccff;
    --on-background-color: #ffffff;
    --on-surface-color: #e0e0e0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--background-color);
    color: var(--on-background-color);
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    box-sizing: border-box;
}

.container {
    width: 100%;
    max-width: 500px;
    text-align: center;
}

header h1 {
    font-size: 2.5rem;
    color: var(--primary-color);
    text-shadow: 0 0 10px var(--primary-color);
    margin-bottom: 30px;
}

.card {
    background-color: var(--surface-color);
    border-radius: 15px;
    padding: 40px;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
}

#tts-button {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background: transparent;
    border: none;
    color: var(--on-surface-color);
    font-size: 2rem;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

#tts-button:hover {
    opacity: 1;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.7);
}

.term {
    font-size: 2.8rem;
    font-weight: bold;
    line-height: 1.4; /* Add line-height for ruby text */
}

rt {
    font-size: 1.2rem;
    color: var(--on-surface-color);
    opacity: 0.8;
}

.hidden {
    display: none;
}

.category-label {
    margin-top: 15px;
    font-size: 1rem;
    color: var(--on-surface-color);
    opacity: 0.7;
}

#next-button {
    background-color: var(--primary-color);
    color: var(--background-color);
    border: none;
    border-radius: 10px;
    padding: 15px 40px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    margin-top: 30px;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

#next-button:hover {
    background-color: #00aaff;
    transform: scale(1.05);
}

.category-selector-wrapper {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

#category-selector {
    background-color: var(--surface-color);
    color: var(--on-background-color);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 10px 15px;
    font-size: 1rem;
    cursor: pointer;
}

#category-selector:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Responsive Design for smaller screens */
@media (max-width: 600px) {
    body {
        padding: 15px;
    }
    header h1 {
        font-size: 2rem;
    }
    .term {
        font-size: 2.2rem;
    }
    .card {
        padding: 30px;
        min-height: 180px;
    }
    #next-button {
        padding: 12px 35px;
        font-size: 1.1rem;
    }
}