html {
    height: var(--mc-vvh, 100svh);
    max-height: var(--mc-vvh, 100svh);
    overflow: hidden;
    overscroll-behavior: none;
}

body {
    font-family: Arial, sans-serif;
    text-align: center;
    margin: 0;
    background-color: #ffffff;
    color: #000000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: var(--mc-vvh, 100svh);
    max-height: var(--mc-vvh, 100svh);
    overflow: hidden;
}

.container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 100%;
    max-width: 44rem;
    padding: 16px 20px;
    gap: 10px;
}

.title-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
    margin-bottom: 20px;
}

.subtitle {
    font-size: 10pt;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin: 0;
    color: #000000;
}

.title {
    font-family: 'Dancing Script', cursive;
    font-weight: 700;
    color: #000000;
    font-size: 3em;
    margin: 0;
    line-height: 1.1;
}

.lede {
    margin: 12px 0 0;
    font-size: 0.95rem;
    color: #000000;
}

.sentence {
    font-size: clamp(1.35rem, 3.4vw, 2.15rem);
    font-family: 'Instrument Serif', serif;
    color: #000000;
    text-align: center;
    margin: 0 0 28px;
    line-height: 1.2;
    min-height: 3.4em;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.blank-line {
    display: inline-block;
    box-shadow: inset 0 -3px 0 0 #000000;
    width: 140px;
    margin: 0 8px;
    min-height: 1em;
    vertical-align: baseline;
}

.blank-filled {
    font-weight: 700;
}

.blank-filled--premiere { color: #5B8DEF; }
.blank-filled--premier { color: #F46C3F; }

.animate-in {
    animation: fadeInUp 0.45s ease-out forwards;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.choices {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    min-height: 4.5rem;
}

.choice-button {
    box-sizing: border-box;
    min-width: 10.5rem;
    padding: 1rem 1.75rem;
    border: none;
    border-radius: 999px;
    color: #fff;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    touch-action: manipulation;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.16);
    scale: 1;
    transition: scale 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.25s, opacity 0.25s;
}

.choice-button--premiere {
    background-color: #5B8DEF;
    transform: rotate(-3deg);
}

.choice-button--premier {
    background-color: #F46C3F;
    transform: rotate(3deg);
}

@media (hover: hover) and (pointer: fine) {
    .choice-button:hover:not(:disabled) {
        scale: 1.08;
    }
}

.choice-button:active:not(:disabled) {
    scale: 0.96;
}

.choice-button:disabled {
    cursor: default;
}

.choice-button.is-wrong {
    filter: grayscale(1);
    opacity: 0.35;
    box-shadow: none;
}

.choice-button.is-right {
    scale: 1.06;
}

.shake {
    animation: shake 0.4s cubic-bezier(.36, .07, .19, .97) both;
}

@keyframes shake {
    10%, 90% { transform: rotate(-3deg) translate3d(-1px, 0, 0); }
    20%, 80% { transform: rotate(-3deg) translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: rotate(-3deg) translate3d(-4px, 0, 0); }
    40%, 60% { transform: rotate(-3deg) translate3d(4px, 0, 0); }
}

.choice-button--premier.shake {
    animation-name: shake-premier;
}

@keyframes shake-premier {
    10%, 90% { transform: rotate(3deg) translate3d(-1px, 0, 0); }
    20%, 80% { transform: rotate(3deg) translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: rotate(3deg) translate3d(-4px, 0, 0); }
    40%, 60% { transform: rotate(3deg) translate3d(4px, 0, 0); }
}

#result {
    margin: 1rem 0 0;
    min-height: 1.4em;
    font-size: 1rem;
    font-weight: 700;
    color: #000000;
}

#nextButton {
    box-sizing: border-box;
    margin-top: 0.75rem;
    padding: 0.65rem 1.25rem;
    border: 2px solid #000000;
    border-radius: 5px;
    background: #ffffff;
    color: #000000;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease, background-color 0.2s, color 0.2s;
}

#nextButton.show {
    visibility: visible;
    opacity: 1;
}

#nextButton:hover {
    background: #000000;
    color: #ffffff;
}

.overlay {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
    background: rgba(0, 0, 0, 0.45);
}

.overlay.hidden {
    display: none;
}

.vl-modal {
    position: relative;
    box-sizing: border-box;
    width: min(100%, 22rem);
    padding: 1.5rem 1.35rem 1.25rem;
    border: 2px solid #000000;
    border-radius: 12px;
    background: #ffffff;
    color: #000000;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
}

.vl-modal__title {
    margin: 0;
    text-align: center;
    font-family: 'Dancing Script', cursive;
    font-size: 2rem;
    font-weight: 700;
    color: #000000;
}

.vl-modal__body {
    margin-top: 0.85rem;
    text-align: left;
    font-size: 0.95rem;
    line-height: 1.5;
}

.vl-modal__btn {
    display: block;
    width: 100%;
    margin-top: 1.1rem;
    padding: 0.65rem 0.75rem;
    border: 2px solid #000000;
    border-radius: 5px;
    background: #ffffff;
    color: #000000;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
}

.vl-modal__btn:hover {
    background: #000000;
    color: #ffffff;
}

@media screen and (max-width: 767px) {
    .container {
        padding: max(12px, env(safe-area-inset-top)) 20px max(12px, env(safe-area-inset-bottom));
    }
    .subtitle { font-size: 8pt; }
    .title { font-size: 2em; }
    .title-container { margin-bottom: 12px; }
    .lede { font-size: 0.85rem; }
    .sentence { min-height: 2.8em; margin-bottom: 20px; }
    .blank-line { width: 100px; }
    .choice-button {
        min-width: 8.5rem;
        padding: 0.85rem 1.25rem;
        font-size: 1.05rem;
    }
    .vl-modal__btn { min-height: 44px; }
}
