@font-face {
    font-family: 'Comic Sans MS Custom';
    src: url('/ComicSansMS3.ttf') format('truetype');
}

body {
    margin: 0;
    background-color: black;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    overflow: hidden;
    font-family: 'Comic Sans MS Custom', cursive;
}

#app-container {
    position: relative;
    background-color: #f0f0f0; /* A light grey background to see the container */
    aspect-ratio: 9 / 16;
    height: 100vh;
    max-width: 100vw;
    box-sizing: border-box;
    background-color: white;
    font-family: 'Comic Sans MS Custom', cursive;
}

#splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 100;
    padding: 2rem;
    box-sizing: border-box;
    text-align: center;
    background-color: white;
    color: black;
    font-family: 'Comic Sans MS Custom', cursive, sans-serif;
}

#splash-screen.hidden {
    display: none !important;
}

#splash-screen img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

#start-screen, #explanation-screen {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    padding: 2rem;
    box-sizing: border-box;
    text-align: center;
    background-color: #f0f0f0;
}

#start-screen {
    gap: 1rem;
}

#loading-screen {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    box-sizing: border-box;
    text-align: center;
    background-color: white;
    color: black;
    font-family: "Comic Sans MS", cursive, sans-serif;
}

.spinner {
    border: 8px solid #f3f3f3; /* Light grey */
    border-top: 8px solid #3498db; /* Blue */
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 2s linear infinite;
    margin-bottom: 20px;
}

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

#loading-text {
    font-size: 1.5rem;
    font-weight: 700;
}

.hidden {
    display: none !important;
}

/* On wider screens, height is the constraint */
@media (min-aspect-ratio: 9/16) {
    #app-container {
        height: 100vh;
        width: calc(100vh * 9 / 16);
    }
}

/* On taller screens, width is the constraint */
@media (max-aspect-ratio: 9/16) {
    #app-container {
        width: 100vw;
        height: calc(100vw * 16 / 9);
    }
}

#start-button, #radio-button {
    font-family: 'Comic Sans MS Custom', cursive, sans-serif;
    font-size: 2.5rem;
    padding: 1rem 2rem;
    border: 3px solid black;
    background-color: #fff;
    color: black;
    cursor: pointer;
    text-transform: uppercase;
    border-radius: 10px;
    box-shadow: none;
    text-shadow: none;
    transition: background-color 0.2s;
    font-weight: 700;
    width: 80%;
}

#radio-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 80%;
    gap: 0.75rem;
    margin-top: 1rem;
    padding: 1rem;
    border: 2px dashed #ccc;
    border-radius: 10px;
    background-color: #f8f9fa;
}

#radio-theme-input {
    font-family: 'Comic Sans MS Custom', cursive, sans-serif;
    font-size: 1.1rem;
    width: 100%;
    padding: 0.5rem;
    border: 3px solid black;
    border-radius: 10px;
    box-sizing: border-box;
    font-weight: 700;
    text-align: center;
}

#radio-button {
    width: 100%;
    font-size: 2rem;
    padding: 0.8rem 1rem;
}

#start-button:hover, #radio-button:hover {
    background-color: #f0f0f0;
}

#start-button:active, #radio-button:active {
    background-color: #e0e0e0;
    transform: translateY(2px);
}

#example-section {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    width: 80%;
    gap: 0.5rem;
    margin-top: 1rem;
    padding: 1rem;
    border: 2px dashed #ccc;
    border-radius: 10px;
    background-color: #f8f9fa;
}

#example-section p {
    font-family: 'Comic Sans MS Custom', cursive, sans-serif;
    font-size: 1.1rem;
    margin: 0 0 0.5rem 0;
    color: #333;
    font-weight: 700;
}

.example-button {
    font-family: 'Comic Sans MS Custom', cursive, sans-serif;
    font-size: 1rem;
    padding: 0.5rem 0.8rem;
    border: 2px solid black;
    background-color: #e9ecef;
    color: black;
    cursor: pointer;
    border-radius: 8px;
    font-weight: 700;
    transition: background-color 0.2s, transform 0.1s;
}

.example-button:hover {
    background-color: #dde2e6;
}

.example-button:active {
    transform: translateY(1px);
}

#explanation-screen label {
    font-family: 'Comic Sans MS Custom', cursive, sans-serif;
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    color: black;
    font-weight: 700;
}

#topic-input {
    font-family: 'Comic Sans MS Custom', cursive, sans-serif;
    font-size: 1.2rem;
    width: 90%;
    padding: 0.75rem;
    border: 3px solid black;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    resize: none;
    box-sizing: border-box;
    font-weight: 700;
}

#go-button {
    font-family: 'Comic Sans MS Custom', cursive, sans-serif;
    font-size: 2rem;
    padding: 0.8rem 1.8rem;
    border: 3px solid black;
    background-color: #fff;
    color: black;
    cursor: pointer;
    text-transform: uppercase;
    border-radius: 10px;
    box-shadow: none;
    text-shadow: none;
    transition: background-color 0.2s;
    font-weight: 700;
}

#go-button:hover {
    background-color: #f0f0f0;
}

#go-button:active {
    background-color: #e0e0e0;
    transform: translateY(2px);
}

#meme-screen {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    height: 100%;
    padding: 3rem 1rem;
    box-sizing: border-box;
    background: white;
}

#ai-explanation-screen {
    width: 100%;
    height: 100%;
    background-color: white;
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

#duck-scene {
    position: relative;
    width: 100%;
    height: 80%;
    bottom: -10%;
    /* background-color: rgba(255, 0, 0, 0.1); */ /* for debugging layout */
}

#duck-scene img {
    position: absolute;
    height: 25%; /* Slightly larger characters */
    transition: transform 0.2s ease-in-out;
}

#duck-scene img.speaking {
    transform: scale(1.1);
    animation: bounce 0.5s infinite;
}

#duck-scene #goose.speaking {
    /* Override the generic speaking animation with one that keeps the goose flipped */
    animation-name: goose-bounce;
}

@keyframes bounce {
  0%, 100% {
    transform: scale(1.1);
  }
  50% {
    transform: scale(1.15);
  }
}

@keyframes goose-bounce {
  0%, 100% {
    transform: scaleX(-1) scale(1.1);
  }
  50% {
    transform: scaleX(-1) scale(1.15);
  }
}

#dialogue-container {
    position: absolute;
    top: 5%;
    left: 5%;
    right: 5%;
    background: transparent;
    border-radius: 15px;
    padding: 1rem;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
}

#subtitles {
    font-family: 'Comic Sans MS Custom', cursive, sans-serif;
    color: black;
    font-size: 1.5rem;
    text-align: center;
    margin: 0;
    min-height: 4.5rem; /* for 3 lines */
    font-weight: 700;
}

#feedback-screen {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    box-sizing: border-box;
    text-align: center;
    background-color: white;
}

#feedback-screen h2 {
    font-family: 'Comic Sans MS Custom', cursive, sans-serif;
    font-size: 2rem;
    margin-bottom: 1rem;
    color: black;
    font-weight: 700;
}

#feedback-screen p {
    font-family: 'Comic Sans MS Custom', cursive, sans-serif;
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    color: #333;
}

#follow-up-container {
    width: 90%;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background-color: #f8f9fa;
    border: 2px dashed #ccc;
    border-radius: 10px;
}

#follow-up-container h3 {
    font-family: 'Comic Sans MS Custom', cursive, sans-serif;
    font-size: 1.3rem;
    margin-top: 0;
    margin-bottom: 1rem;
    color: #333;
}

#follow-up-questions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.follow-up-button {
    font-family: 'Comic Sans MS Custom', cursive, sans-serif;
    font-size: 1.1rem;
    padding: 0.6rem 1rem;
    border: 2px solid black;
    background-color: #e9ecef;
    color: black;
    cursor: pointer;
    border-radius: 8px;
    font-weight: 700;
    width: 100%;
    transition: background-color 0.2s, transform 0.1s;
}

.follow-up-button:hover {
    background-color: #dde2e6;
}

.follow-up-button:active {
    transform: translateY(1px);
}

#feedback-screen #comment-button {
    background-color: #d4edda; /* A light green color */
}

#feedback-screen #comment-button:hover {
    background-color: #c3e6cb;
}

#feedback-screen #download-video-button {
    background-color: #cce5ff; /* A light blue color */
}

#feedback-screen #download-video-button:hover {
    background-color: #b8daff;
}

#continue-button {
    font-family: 'Comic Sans MS Custom', cursive, sans-serif;
    font-size: 1.2rem;
    padding: 0.5rem 1rem;
    border: 2px solid white;
    background-color: rgba(0,0,0,0.5);
    color: white;
    cursor: pointer;
    border-radius: 10px;
    margin-top: 1rem;
    display: block;
    margin-left: auto;
    margin-right: auto;
    font-weight: 700;
}

#top-text, #bottom-text {
    font-family: 'Comic Sans MS Custom', cursive, sans-serif;
    color: black;
    text-align: center;
}

#top-text {
    font-size: 2.5rem;
    font-weight: bold;
}

#bottom-text {
    font-size: 1.8rem;
    font-weight: 700;
}

#duck-image {
    max-width: 90%;
    flex-grow: 1;
    object-fit: contain;
    min-height: 0;
    display: block;
    margin: 1rem 0;
}

#quit-radio-button {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1000;
    font-family: 'Comic Sans MS Custom', cursive, sans-serif;
    font-size: 1rem;
    padding: 0.5rem 1rem;
    border: 3px solid black;
    background-color: #ffdddd;
    color: black;
    cursor: pointer;
    border-radius: 10px;
    font-weight: 700;
}

#quit-radio-button:hover {
    background-color: #ffcccc;
}

#youtube-link-button {
    text-decoration: none;
    box-sizing: border-box;
    display: inline-block;
    text-align: center;
    background-color: #ff0000; /* YouTube red */
    color: white;
    border-color: #c00;
}

#youtube-link-button:hover {
    background-color: #e60000;
}

#youtube-link-button:active {
    transform: translateY(2px);
}

#youtube-link-button-start {
    font-size: 1.2rem;
    padding: 0.6rem 1rem;
    width: auto;
}

.button-like {
    font-family: 'Comic Sans MS Custom', cursive, sans-serif;
    font-size: 1.5rem;
    padding: 0.8rem 1.5rem;
    border: 3px solid black;
    background-color: #fff;
    color: black;
    cursor: pointer;
    border-radius: 10px;
    margin-top: 1rem;
    font-weight: 700;
    width: 80%;
    transition: background-color 0.2s, transform 0.1s;
    text-decoration: none;
    box-sizing: border-box;
    display: inline-block;
    text-align: center;
}

.button-like:hover {
    background-color: #f0f0f0;
}

.button-like:active {
    transform: translateY(2px);
}