@font-face {
    font-family: RammettoOne;
    src: url(fonts/RammettoOne-Regular.ttf);
  }
  @font-face {
    font-family: NunitoSans;
    src: url(fonts/NunitoSans-Regular.ttf);
    font-weight: 400;
  }
  @font-face {
    font-family: NunitoSans;
    src: url(fonts/NunitoSans-Black.ttf);
    font-weight: 900;
  }
  
  
body {
    font-family: 'NunitoSans', sans-serif;
    font-size: 18px;
    line-height: 1.4;
    color: var(--black);
    background: #333;
    margin: 0;
}

h1, h2, p {
    color: white;
}

h1, h2 {
    font-size: 4em;
}

#auth-hint {
    font-size: 2em;
    text-align: center;
}

#auth-section {
    text-align: center;

    button {
        padding: 1em;
        border-radius: 2em;
        border: none;
        background: #F27D5A;
        color: white;
        font-size: 1em;
        cursor: pointer;
    }
}


.score, .round {
    color: white;
    font-weight: 700;
    letter-spacing: .1em;
}
  
#logout-button {
    position: absolute;
    bottom: 1em;
    right: 1em;
    color: rgb(80, 133, 143);
}

/* Game Container Styles */
#game-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    margin-top: 2em;
    text-align: center;
    margin-bottom: 6em;
}

.game-content {
    background: #ffffff25;
    border-radius: 12px;
    padding: 2rem;
    margin-top: 2em;
}

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

/* Audio Controls */
.audio-section {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 2rem auto;
    width: 100%;
    max-width: 400px;
}

.audio-section audio {
    width: 100%;
    margin: 0 auto;
    border-radius: var(--border16);
    outline: none;
}

/* Style the default audio player controls */
audio::-webkit-media-controls-panel {
    background-color: var(--gray1);
}

audio::-webkit-media-controls-play-button {
    background-color: var(--red);
    border-radius: 50%;
}

audio::-webkit-media-controls-play-button:hover {
    background-color: var(--yellow);
}

audio::-webkit-media-controls-current-time-display,
audio::-webkit-media-controls-time-remaining-display {
    color: var(--black);
    font-family: 'NunitoSans', sans-serif;
}

#clone-voice-modal {
    p, h2 {
        color: black;
    }

    h2 {
        font-size: 2em;
    }

    #close-clone-voice-modal {
        position: absolute;
        top: .5em; right: .5em;
        font-size: 2em;
        &:hover {
            cursor: pointer;
        }
    }

    .primary-button, .secondary-button {
        width: 40%;
        font-size: 1em;
        border-radius: 2em;
    }
}

/* Language Options */
.language-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.language-option {
    padding: 1rem;
    margin: 0.5rem;
    border-radius: 2em;
    border: none;
    background: rgba(255, 255, 255, 0.192);
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
    font-size: 1.1rem;
}

.language-option:hover:not(:disabled) {
    border-color: #4CAF50;
    background: #f5f5f5;
}

.language-option.correct {
    background-color: #4CAF50;
    color: white;
    border-color: #4CAF50;
}

.language-option.incorrect {
    background-color: #f44336;
    color: white;
    border-color: #f44336;
}

.language-option:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

/* Game Over Screen */
.game-over {
    text-align: center;
    padding: 2rem;
}

.score-summary {
    margin: 2rem 0;
}

.score-item {
    margin: 1rem 0;
    font-size: 2.2rem;
}

.score-label {
    color: #666;
    margin-right: 1rem;
}

.score-value {
    font-weight: bold;
    color: #4CAF50;
}

/* Voice Selection Styles */

.voice-selection {
    width: 100%;
    padding: 1em;
    padding-bottom: 2em;
    margin-bottom: 20px;
    margin: 0;
    position: absolute;
    top: 0;
    padding-top: 0;
}

.voice-options {
    display: flex;
    justify-content: center;
    gap: 20px;
    max-width: 600px;
    margin: 40px auto;
}

.voice-option {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1em;
    background: rgba(255, 255, 255, 0.515);
    border-radius: 0em 0em 2em 2em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.voice-option:hover {
    border-color: #4CAF50;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    cursor: pointer;
}

.voice-option input[type="radio"] {
    margin-bottom: 10px;
}

.voice-option span {
    font-size: 1.1rem;
    font-weight: 500;
}

/* Hide the radio button but keep it functional */
.voice-option input[type="radio"] {
    position: absolute;
    opacity: 0;
}

/* Style for selected option */
label.voice-option:has(input[type="radio"]:checked) {
    background-color: #fff;
    color: black;
}

.voice-option input[type="radio"]:checked + span::before {
    content: "✓ ";
}

.app-icon {
    width: 5em;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    width: 90%;
    max-width: 600px;
}

.game-modal {
    max-width: 600px;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    border-radius: 12px;
    padding: 2rem;
}

.sample-text {
    background: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    margin: 1.5rem 0;
    font-style: italic;
}

.recording-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0em auto;
    width: 100%;
    gap: 1rem;
}

.record-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1rem 2rem;
    border: 1px solid gray;
    border-radius: 1em;
    cursor: pointer;
    background: var(--gray1);
    transition: all 0.3s;
    width: 100%;
    font-size: 1em;

    &:hover {
        background-color: white;
    }
}

.record-icon {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: red;
}

.record-button.record-on {
    background: red;
    color: white;
}

.record-button.record-on .record-icon {
    background: white;
    animation: pulse 1s infinite;
}

#recordingStatus {
    text-align: center;
    font-family: 'NunitoSans', sans-serif;
}

#game-over h2 {
    margin-bottom: 0;
}

p#completionMessage {
    margin: 2em 0;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.button-group {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin: 2rem 0;
}

.primary-button, .secondary-button {
    color: white;
    width: 40%;
    font-size: 1.5em;
    padding: 1rem 2rem;
    border: none;
    border-radius: 5em;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s;
}

.primary-button {
    background: #F27D5A;
}

.secondary-button {
    background: #2196F3;
}

.primary-button:hover {
    background: #F27D5A;
}

.primary-button:disabled {
    background: #cccccc;
    cursor: not-allowed;
}

.secondary-button:hover {
    background: #1976D2;
}

.privacy-note {
    color: #666;
    font-size: 0.9rem;
    text-align: center;
    margin-top: 2rem;
}

/* Modal Overlay */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

/* Responsive Design */
@media (max-width: 768px) {
    #game-container {
        padding: 1rem;
    }

    .game-content {
        padding: 1rem;
    }

    .language-options {
        grid-template-columns: 1fr;
    }

    .game-modal {
        margin: 1rem;
        padding: 1rem;
    }
}

#game-section {
    min-height: 4vw;
}

/* Loader Styles */
.game-loader {
    position: relative;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 1000;
    margin-top: 4em;
}

.loader-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #F27D5A;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.game-loader p {
    color: white;
    font-size: 1.2rem;
    margin-top: 1rem;
}

#auth-container {
    background-color: #ffffff1c;
    width: 62%;
    margin: 3em auto;
    padding: 1em;
    border-radius: 2em;

    h1 {
        font-size: 1em;
    }

    p {
        font-size: .5em;
    }
}

/* Mobile Responsive Design */
@media (max-width: 768px) {
    .primary-button, .secondary-button {
        width: 80%;  /* Wider buttons on mobile */
        font-size: 1.2em;
        padding: 0.8rem 1.5rem;
        margin-bottom: 1em;
    }

    .button-group {
        flex-direction: column;
        align-items: center;
        gap: 0.8rem;
    }

    #logout-button {
        bottom: 1em;  /* Closer to bottom on mobile */
        right: 1em;   /* Closer to right edge on mobile */
        font-size: 0.9em;
    }

    .record-button {
        width: 80%;  /* Wider record button on mobile */
        padding: 0.8rem 1.5rem;
    }

    .voice-selection {
        padding: 0;
        margin: 0;
    }

    .language-options {
        gap: 0rem;
    }

    #clone-voice-modal {
        .primary-button, .secondary-button {
            width: fit-content;
        }
    }
}

/* Add/modify these base styles */
html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    overflow-x: hidden; /* Prevent horizontal scroll */
}

/* FlaiChat Promo Section */
.flaichat-promo {
    background: linear-gradient(to bottom, #1a1a1a, #333);
    color: white;
    padding: 0rem 2rem;
    width: 100%;
    box-sizing: border-box; /* Include padding in width calculation */
}

.promo-container {
    max-width: 1200px;
    margin: 0 auto;
    box-sizing: border-box; /* Include padding in width calculation */
}

.game-wrapper {
    position: relative;
    z-index: 1;
    width: 100%;
    box-sizing: border-box; /* Include padding in width calculation */
    margin-top: 3em;
}

/* Dynamic positioning based on available space */
@media screen and (max-height: calc(var(--game-height) + var(--promo-height))) {
    .flaichat-promo {
        position: relative;
        margin-top: 4rem;
    }

    .game-wrapper {
        padding-bottom: 2rem;
        margin-top: 0;
    }
}

.promo-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.promo-text {
    text-align: left;
}

.promo-cta {
    text-align: center;
}

.flaichat-promo h2 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    background: linear-gradient(45deg, #F27D5A, #ff9776);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.flaichat-promo p {
    font-size: 1.2rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.flaichat-promo ul {
    list-style: none;
    padding: 0;
    margin: 2rem 0;
}

.flaichat-promo li {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}

.cta-text {
    font-size: 1.4rem;
    font-weight: bold;
    margin: 2rem 0;
}

.store-buttons {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin: 2rem 0;
}

.store-badge {
    height: 3em;
    transition: transform 0.2s;
}

.store-badge:hover {
    transform: scale(1.05);
}

.learn-more {
    font-size: 1rem;
}

.learn-more a {
    color: #F27D5A;
    text-decoration: none;
}

.learn-more a:hover {
    text-decoration: underline;
}

/* Mobile Responsive Design */
@media (max-width: 768px) {
    .flaichat-promo {
        padding: 2rem 1rem;
        position: relative;
    }

    .game-wrapper {
        padding-bottom: 2rem;
    }

    .promo-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .promo-text {
        text-align: center;
    }

    .flaichat-promo h2 {
        font-size: 2rem;
    }

    .flaichat-promo ul {
        max-width: 300px;
        margin: 2rem auto;
    }

    .store-buttons {
        align-items: center;
        gap: 1rem;
    }

    .store-badge {
        height: 45px;
    }

    .flaichat-promo p {
        margin: 0;
    }

    .flaichat-promo .cta-text {
        display: none;
    }

    img.game-image {
        width: 100%;
    }

    #auth-container {
        width: 87%;
    }
}
