:root {
    --game-board-height: 345px;
    --ui-green: #47bf85;
    --ui-brown: #ce7f54;
    --ui-text: #f3f2c9;
    --ui-red: #f14f52;
}

::placeholder {
    /* Chrome, Firefox, Opera, Safari 10.1+ */
    color: #f3f2c9;
    opacity: 70%; /* Firefox */
}

:-ms-input-placeholder {
    /* Internet Explorer 10-11 */
    color: #f3f2c9;
}

::-ms-input-placeholder {
    /* Microsoft Edge */
    color: #f3f2c9;
}

* {
    text-align: center;
    font-family: 'Luckiest Guy', cursive;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

h1 {
    font-size: 4.5rem;
}

h2 {
    font-size: 2rem;
}

#container {
    display: flex;
    flex-direction: column;
    align-items: center;
    user-select: none;
}

/* ********  COMMON STYLES  ******** */

#start-page,
#game-over-page,
#difficulty-select-page {
    background-image: url(images/start.jpg);
    background-size: cover;
    background-repeat: no-repeat;
    height: 750px;
    width: 100%;
    background-color: #003638;
    color: #f3f2c9;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 100%;
    z-index: 1;
}

#grade-select, #speed-select {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: min(92vw, 420px);
    gap: 0.2rem;
}

#speed-select { display: none; }

.selection-title { margin-top: 0; }
.selection-subtitle { font: 1rem sans-serif; margin: 0 0 0.75rem; }

.button {
    letter-spacing: 5px;
    margin-top: 2rem;
    background-color: #2779c3;
    border-radius: 10px;
    border: 1px solid #566963;
    display: inline-block;
    cursor: pointer;
    color: #f3f2c9;
    font-size: 1.5rem;
    padding: 14px 23px 8px 23px;
    text-decoration: none;
}

.button:active {
    position: relative;
    top: 1px;
}

.blur-background {
    background-color: #2779c3;
    border-radius: 10px;
    padding: 0.5rem 1rem 0.3rem 1rem;
    margin: 1rem;
}

/* ********  START PAGE  ******** */
#start-page {
    display: flex;
}

#game-title {
    width: min(88vw, 700px);
    color: #f3f2c9;
    letter-spacing: 0.12em;
    text-shadow: 0 6px 0 #5b321c;
}

.start-button {
    font-size: 40px;
    width: 20rem;
    height: 5rem;
    padding-top: 25px;
    border: solid #f3f2c9 3px;
}

.start-button:hover {
    box-shadow: none;
    box-shadow: 0px 15px 1px rgba(19, 69, 115, 0.8);
}

.collection-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    margin-top: 1rem;
    padding: 0.5rem 1rem;
    border: 2px solid #f3f2c9;
    border-radius: 12px;
    background: rgba(39, 121, 195, 0.88);
    color: #f3f2c9;
    font: 1.05rem sans-serif;
    text-decoration: none;
    letter-spacing: 0.03em;
}

.collection-link:hover,
.collection-link:focus-visible {
    background: #2779c3;
    outline: 3px solid #f3f2c9;
    outline-offset: 3px;
}

#le {
    font-family: 'Black Ops One', cursive;
    font-size: 4rem;
}

#instructions {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.instructions-header {
    font-family: 'Luckiest Guy', cursive;
    font-weight: 400;
    letter-spacing: 2px;
    padding-top: 0.35em;
    border: 3px solid #f3f2c9;
}

.instructions-paragraph {
    font-family: sans-serif;
    font-size: 1.2rem;
    width: 60%;
    border: 3px solid #f3f2c9;
    padding: 3rem;
    line-height: 1.5;
    letter-spacing: 2px;
    text-align: center;
}

/* ********  GAME-PAGE  ******** */

#game-page {
    width: 100%;
    height: 750px;
    background-image: url(images/start.jpg);
    background-size: cover;
    background-repeat: no-repeat;
    position: absolute;
    display: none;
    flex-direction: column;
    top: 0;
    z-index: 0;
}

#game-board-container {
    padding: 40px 46px;
    width: 80%;
    margin: auto;
}

#game-board {
    background-image: url(images/field.png);
    background-size: 54cm 11cm;
    background-repeat: no-repeat;
    border-radius: 17px;
    display: flex;
    margin: auto;
    background-color: rgb(69, 115, 136);
    height: var(--game-board-height);
    width: 1000px;
    position: relative;
    overflow: hidden;
}

#game-board-menu {
    background-color: var(--ui-green);
    border: 4px solid var(--ui-text);
    border-radius: 17px;
    color: var(--ui-text);
    display: flex;
    margin: 1rem auto;
    font-size: 2rem;
    justify-content: space-around;
    align-items: center;
    width: 1000px;
}

#game-board-menu .button,
#game-timer {
    background-color: var(--ui-brown);
    border: 4px solid var(--ui-text);
    border-radius: 17px;
    font-weight: bold;
    padding: 14px 23px 8px 23px;
    margin: 0.5rem;
}

#game-board-menu .music-button {
    min-width: 5.8rem;
}

#game-board-menu #home-button {
    min-width: 9.5rem;
}

#game-board-menu .button:hover {
    transition: 0.3s ease all;
    box-shadow: none;
    box-shadow: 0px 6px 1px rgba(91, 50, 28, 0.3);
}

#game-timer {
    letter-spacing: 3px;
    background-color: var(--ui-red);
}

#game-score,
#castle-lives,
#castle-lives-header {
    margin-top: 15px;
}

.ui-value {
    margin-left: 0.25em;
}

/* castle styles */
#castle {
    background-image: url(images/castle.png);
    background-size: contain;
    background-repeat: no-repeat;
    width: 137px;
    height: var(--game-board-height);
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1;
}

/* enemy style */
.enemy {
    position: absolute;
    image-rendering: pixelated;
    z-index: 2;
}

.enemy-question {
    font-size: 1.45rem;

    background-color: white;
    border-radius: 0.3rem;

    width: max-content;
    line-height: 30px;
    padding: 0 0.5rem;

    position: absolute;
    left: 50%;
    transform: translate(-50%, 0);
    bottom: 97%;
    z-index: 4;
}

.enemy-question.question-below {
    top: 100%;
    bottom: auto;
    margin-top: 4px;
}

.enemy.selected .enemy-question {
    border: black solid 0.2rem;
    font-size: 1.75rem;
    padding-top: 0.2em;
    bottom: 95%;
}

.not-clickable {
    pointer-events: none;
}

/* Answer form styles */
#answer-form-container {
    display: flex;
    justify-content: center;
}

#answer-feedback {
    min-height: 1.4rem;
    margin: 0.15rem auto 0;
    color: var(--ui-red);
    font: 1rem sans-serif;
}

.answer-wrong {
    background-color: var(--ui-red) !important;
    animation: answer-shake 0.28s ease-in-out;
}

@keyframes answer-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.answer-form {
    width: 900px;
    padding: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

#answer-input {
    color: var(--ui-text);
    background-color: var(--ui-green);
    border: 4px solid var(--ui-text);
    border-radius: 17px;
    margin: 0 auto;
    width: 350px;
    font-size: 1.5rem;
    padding: 1rem 2rem 0.6rem 2rem;
}

#answer-input:focus {
    outline: none;
}

#answer-input:disabled {
    background-color: var(--ui-red);
}

.pause-button {
    width: 12rem;
}

/* Remove number input handles  */
/* Chrome, Safari, Edge, Opera */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Firefox */
input[type='number'] {
    -moz-appearance: textfield;
}

/* ********  GAME-OVER-PAGE  ******** */

#game-over-page {
    display: none;
    justify-content: center;
    align-items: center;
    background-image: url(images/clouds.jpg);
    background-size: cover;
    background-repeat: no-repeat;
}

.gameover-info {
    --border-size: 30px;
    --border-radius: 30px;
    background-color: #774526;
    width: 900px;
    border: var(--border-size) solid #ce7f54;
    border-radius: var(--border-radius);
    position: relative;
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.gameover-info::before {
    --offset: 67px;
    background: none;
    border: 30px solid #774526;
    border-radius: var(--border-radius);
    content: '';
    display: block;
    position: absolute;
    z-index: -1;
    top: calc(var(--border-size) - var(--offset));
    right: calc(var(--border-size) - var(--offset));
    bottom: calc(var(--border-size) - var(--offset));
    left: calc(var(--border-size) - var(--offset));
    pointer-events: none;
}

#game-over-page .title {
    margin-bottom: 10px;
    color: #ce7f54;
    text-shadow: 0px 5px 0px #5b321c;
    -webkit-text-stroke-width: 0.5px;
    -webkit-text-stroke-color: rgba(255, 255, 255, 0.1);
}

#game-over-page .title-score {
    font-size: 2rem;
    color: #ce7f54;
    margin-bottom: 1rem;
    text-shadow: 0px 3px 0px #5b321c;
    -webkit-text-stroke-width: 1px;
    -webkit-text-stroke-color: rgba(255, 255, 255, 0.1);
}

#game-over-page .score {
    font-size: 2rem;
    color: white;
    text-shadow: 0px 4px 0px #5b321c;
    margin-left: 0.1em;
}

#game-over-page .title-question-history {
    margin-bottom: 0;
}

#restart-button {
    background-color: #ce7f54;
    color: white;
    box-shadow: 0px 8px 0px #5b321c;
    border: 2px solid rgba(255, 255, 255, 0.4);
}

.gameover-info .collection-link {
    margin-top: 1rem;
    background: #2779c3;
}

/* ********  DIFFICULTY-SELECT-PAGE  ******** */

#difficulty-select-page {
    display: none;
    background-image: url(images/start.jpg);
    background-size: cover;
    background-repeat: no-repeat;
}

/* ********  Question History Styles  ******** */

#table-container {
    max-height: 300px;
    margin-top: 10px;
    overflow-y: auto;
}

#question-history {
    background-color: #ce7f54;
    color: black;
    min-width: 450px;
}

#question-history tr {
    white-space: nowrap;
}

#question-history,
#question-history th,
#question-history td {
    border-collapse: collapse;
    font-family: sans-serif;
    color: #2e1a0f;
}

#question-history th,
#question-history td {
    padding: 0.75em;
    border: 2px solid #5b321c;
}

.question-history-answer {
    font-family: sans-serif;
    display: inline-block;
    padding: 0 0.5em;
    border-radius: 0.25em;
    min-width: 35px;
    max-height: 35px;
    line-height: 35px;
}

.question-history-answer + .question-history-answer {
    margin-left: 0.5em;
}

.question-history-correct-answer {
    background-color: #2ecc71;
}

.question-history-wrong-answer {
    background-color: #e74c3c;
}

.fa-heart-broken {
    line-height: 35px;
}

#mobile-keypad { display: none; }

@media (max-width: 700px) {
    :root { --game-board-height: min(46vw, 300px); }
    h1 { font-size: 2.5rem; }
    h2 { font-size: 1.4rem; }
    #start-page, #game-over-page, #difficulty-select-page {
        min-height: 100svh; height: auto; overflow-y: auto;
    }
    #game-page { position: fixed; inset: 0; width: 100%; height: 100svh; height: 100dvh; min-height: 0; overflow: hidden; }
    #game-title { width: min(88vw, 500px); }
    .instructions-paragraph { width: 88%; padding: 1rem; font-size: 1rem; }
    .start-button { width: min(80vw, 20rem); height: 4rem; font-size: 1.8rem; padding-top: 16px; }
    .selection-title { font-size: 1.8rem; }
    .selection-subtitle { font-size: .9rem; }
    .collection-link { margin-top: .7rem; font-size: .95rem; }
    #game-board-container { width: 100%; height: 100%; padding: .5rem; margin: 0 auto; display: flex; flex-direction: column; justify-content: flex-start; }
    #game-board-menu { width: 100%; margin: .35rem auto; border-width: 2px; border-radius: 10px; font-size: .9rem; }
    #game-board-menu .button, #game-timer { border-width: 2px; border-radius: 10px; padding: .55rem .4rem .35rem; margin: .25rem; font-size: .85rem; }
    .pause-button { width: auto; }
    #game-board-menu .music-button { width: 2.4rem; min-width: 2.4rem; padding-left: .2rem; padding-right: .2rem; font-size: 0; }
    #game-board-menu .music-button::before { content: '♪'; font-size: 1rem; }
    #game-board-menu .music-button[aria-pressed='false']::before { content: '×'; }
    #game-board { width: 100%; height: var(--game-board-height); border-radius: 10px; background-size: cover; }
    #game-board { flex: 1 1 auto; min-height: 190px; height: auto; }
    #castle { width: 24%; height: 100%; }
    #answer-form-container { width: 100%; }
    .answer-form { display: none; }
    #mobile-keypad { display: block; width: min(100%, 360px); margin: .5rem auto 1rem; }
    #mobile-answer-display { display: block; min-height: 2.6rem; padding: .45rem; margin-bottom: .4rem; border: 2px solid var(--ui-text); border-radius: 10px; background: var(--ui-green); color: var(--ui-text); font: 1.4rem sans-serif; }
    #answer-feedback { font-size: .95rem; }
    .keypad-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .35rem; }
    .keypad-grid button { min-height: 2.8rem; border: 2px solid var(--ui-text); border-radius: 9px; background: var(--ui-brown); color: var(--ui-text); font: 1.2rem 'Luckiest Guy', cursive; touch-action: manipulation; }
    .keypad-grid button[data-action='submit'] { background: var(--ui-green); }
    #game-board-menu #home-button { min-width: 0; }
    .gameover-info { width: 94%; padding: 1rem; border-width: 12px; }
    #question-history { min-width: 0; width: 100%; font-size: .8rem; }
}

/* Product pass: keep the castle readable as a real game on both phone
   orientations. The original desktop canvas was 1000px wide, so a short
   landscape phone otherwise fell back to the desktop 750px layout. */
@media (orientation: portrait) and (max-width: 700px) {
    body { background: #0e5265; }
    #container { width: 100%; min-height: 100svh; }
    #start-page, #difficulty-select-page, #game-over-page {
        min-height: 100svh; height: 100dvh; padding: max(20px, env(safe-area-inset-top)) 16px max(18px, env(safe-area-inset-bottom));
        background-position: center; overflow-y: auto;
    }
    #start-page { justify-content: flex-start; padding-top: max(9vh, 58px); }
    #game-title { margin-bottom: 4vh; font-size: clamp(2.6rem, 13vw, 4rem); text-shadow: 0 4px 0 #5b321c; }
    #instructions { width: min(100%, 420px); }
    .instructions-header { font-size: 1.35rem; margin: 0 0 10px; }
    .instructions-paragraph { width: 100%; padding: 14px 16px; font-size: .95rem; line-height: 1.55; letter-spacing: .03em; border-width: 2px; }
    .start-button { width: min(88vw, 21rem); height: 3.7rem; font-size: 1.65rem; padding-top: 12px; }
    .collection-link { font-size: .9rem; }
    #difficulty-select-page { justify-content: center; }
    .selection-title { font-size: 1.65rem; }
    .selection-subtitle { max-width: 290px; line-height: 1.5; }
    #grade-select, #speed-select { gap: .45rem; }
    #grade-select .start-button, #speed-select .start-button { height: 3.25rem; font-size: 1.35rem; padding-top: 10px; }
    #game-board-container { padding: max(7px, env(safe-area-inset-top)) 8px max(7px, env(safe-area-inset-bottom)); gap: 4px; }
    #game-board-menu { margin: 0 auto 4px; min-height: 58px; flex-wrap: nowrap; font-size: .8rem; }
    #game-board-menu .button, #game-timer { padding: .45rem .35rem .3rem; margin: .2rem; font-size: .74rem; letter-spacing: .06em; }
    #game-board { flex: 1 1 0; min-height: 190px; border: 2px solid #f3f2c9; box-shadow: inset 0 0 0 2px #236a76; }
    #castle { width: 27%; }
    .enemy-question { font-size: 1.25rem; line-height: 27px; }
    .enemy.selected .enemy-question { font-size: 1.45rem; }
    #answer-form-container { flex: 0 0 auto; }
    #mobile-keypad { margin: 3px auto 0; }
    #mobile-answer-display { min-height: 2.25rem; padding: .28rem; margin-bottom: .25rem; font-size: 1.2rem; }
    .keypad-grid { gap: .25rem; }
    .keypad-grid button { min-height: 2.45rem; font-size: 1.08rem; }
    #answer-feedback { min-height: 1.1rem; font-size: .82rem; }
}

@media (orientation: landscape) and (max-height: 700px) {
    body { background: #0e5265; }
    #container { width: 100%; min-height: 100dvh; }
    #start-page, #difficulty-select-page, #game-over-page { height: 100dvh; min-height: 0; padding: 16px 24px; overflow-y: auto; }
    #start-page { justify-content: center; }
    #game-title { font-size: clamp(2.2rem, 8vw, 4rem); margin-bottom: 8px; }
    .instructions-header { margin: 4px 0; font-size: 1.2rem; }
    .instructions-paragraph { width: min(680px, 80vw); padding: 10px 18px; font-size: .88rem; line-height: 1.35; }
    .start-button { height: 3.1rem; width: 17rem; font-size: 1.35rem; padding-top: 10px; }
    .collection-link { margin-top: .5rem; font-size: .82rem; }
    #difficulty-select-page { justify-content: center; }
    .selection-title { font-size: 1.55rem; }
    .selection-subtitle { margin-bottom: .3rem; }
    #grade-select, #speed-select { width: min(430px, 70vw); gap: .2rem; }
    #grade-select .start-button, #speed-select .start-button { height: 2.6rem; font-size: 1.15rem; padding-top: 8px; }
    #game-page { position: fixed; inset: 0; width: 100%; height: 100dvh; min-height: 0; overflow: hidden; background: linear-gradient(145deg,#0d5062,#183c59); }
    #game-board-container { display: grid; grid-template-columns: minmax(0, 1.42fr) minmax(220px, .58fr); grid-template-rows: auto minmax(0, 1fr); align-items: stretch; gap: 6px 10px; width: 100%; height: 100%; padding: 7px max(12px, env(safe-area-inset-right)) 7px max(12px, env(safe-area-inset-left)); margin: 0; }
    #game-board-menu { grid-column: 1 / -1; width: 100%; min-height: 42px; margin: 0; border-width: 2px; border-radius: 12px; font-size: .78rem; }
    #game-board-menu .button, #game-timer { border-width: 2px; border-radius: 9px; padding: .3rem .45rem .22rem; margin: .18rem; font-size: .72rem; letter-spacing: .04em; }
    #game-board-menu #home-button { min-width: 0; }
    #game-board { grid-column: 1; grid-row: 2; width: 100%; height: auto; min-height: 0; margin: 0; border: 2px solid #f3f2c9; border-radius: 12px; background-size: cover; box-shadow: inset 0 0 0 2px #236a76; }
    #castle { width: 26%; height: 100%; }
    .enemy-question { font-size: 1.15rem; line-height: 25px; }
    .enemy.selected .enemy-question { font-size: 1.35rem; }
    #answer-form-container { grid-column: 2; grid-row: 2; width: 100%; min-width: 0; min-height: 0; display: flex; flex-direction: column; justify-content: center; align-items: stretch; padding: 5px; border: 2px solid #f3f2c9; border-radius: 12px; background: #0c6875cc; }
    #mobile-keypad { display: block; width: 100%; margin: 0; }
    #mobile-answer-display { min-height: 2rem; padding: .25rem; margin-bottom: .25rem; font-size: 1.05rem; }
    #mobile-answer-display { display: block; border: 2px solid var(--ui-text); border-radius: 9px; background: var(--ui-green); color: var(--ui-text); font: 1.1rem sans-serif; }
    .keypad-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .3rem; }
    .keypad-grid button { min-height: clamp(2rem, 8vh, 2.65rem); padding: .2rem; border: 2px solid var(--ui-text); border-radius: 8px; background: var(--ui-brown); color: var(--ui-text); font: 1rem 'Luckiest Guy',cursive; touch-action: manipulation; }
    .keypad-grid button[data-action='submit'] { background: var(--ui-green); }
    #answer-feedback { min-height: 1rem; font-size: .76rem; }
    .answer-form { display: none; }
}

@media (orientation: landscape) and (min-width: 701px) {
    #game-page { height: 100dvh; }
    #game-board-container { width: min(1240px, 96vw); padding: 12px 20px; }
    #game-board { width: 100%; }
    #game-board-menu { width: 100%; }
}


/*# sourceMappingURL=main.bundle.css.map*/