@font-face {
    font-family: 'Atkinson Hyperlegible';
    src: url('fonts/hinted-AtkinsonHyperlegible-Bold.eot');
    src: url('fonts/hinted-AtkinsonHyperlegible-Bold.eot?#iefix') format('embedded-opentype'),
        url('fonts/hinted-AtkinsonHyperlegible-Bold.woff2') format('woff2'),
        url('fonts/hinted-AtkinsonHyperlegible-Bold.woff') format('woff'),
        url('fonts/hinted-AtkinsonHyperlegible-Bold.ttf') format('truetype'),
        url('fonts/hinted-AtkinsonHyperlegible-Bold.svg#AtkinsonHyperlegible-Bold') format('svg');
    font-weight: bold;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Atkinson Hyperlegible';
    src: url('fonts/hinted-AtkinsonHyperlegible-BoldItalic.eot');
    src: url('fonts/hinted-AtkinsonHyperlegible-BoldItalic.eot?#iefix') format('embedded-opentype'),
        url('fonts/hinted-AtkinsonHyperlegible-BoldItalic.woff2') format('woff2'),
        url('fonts/hinted-AtkinsonHyperlegible-BoldItalic.woff') format('woff'),
        url('fonts/hinted-AtkinsonHyperlegible-BoldItalic.ttf') format('truetype'),
        url('fonts/hinted-AtkinsonHyperlegible-BoldItalic.svg#AtkinsonHyperlegible-BoldItalic') format('svg');
    font-weight: bold;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: 'Atkinson Hyperlegible';
    src: url('fonts/hinted-AtkinsonHyperlegible-Italic.eot');
    src: url('fonts/hinted-AtkinsonHyperlegible-Italic.eot?#iefix') format('embedded-opentype'),
        url('fonts/hinted-AtkinsonHyperlegible-Italic.woff2') format('woff2'),
        url('fonts/hinted-AtkinsonHyperlegible-Italic.woff') format('woff'),
        url('fonts/hinted-AtkinsonHyperlegible-Italic.ttf') format('truetype'),
        url('fonts/hinted-AtkinsonHyperlegible-Italic.svg#AtkinsonHyperlegible-Italic') format('svg');
    font-weight: normal;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: 'Atkinson Hyperlegible';
    src: url('fonts/hinted-AtkinsonHyperlegible-Regular.eot');
    src: url('fonts/hinted-AtkinsonHyperlegible-Regular.eot?#iefix') format('embedded-opentype'),
        url('fonts/hinted-AtkinsonHyperlegible-Regular.woff2') format('woff2'),
        url('fonts/hinted-AtkinsonHyperlegible-Regular.woff') format('woff'),
        url('fonts/hinted-AtkinsonHyperlegible-Regular.ttf') format('truetype'),
        url('fonts/hinted-AtkinsonHyperlegible-Regular.svg#AtkinsonHyperlegible-Regular') format('svg');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}



html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;


    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    touch-action: none;
    outline: none;
    display: block;
}

#gameCanvas {
    width: 100%;
    height: 100%;
    display: block;
    touch-action: none;


    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    touch-action: none;
    outline: none;
    display: block;

}

#overlay {
    position: absolute;
    top: 0;
    left: 0;

    width: 100vw;
    height: 100vh;

    background: rgb(5, 4, 45);
    /* visible color */
    opacity: 0;
    /* start hidden */

    pointer-events: none;

    z-index: 99999;
}

.rotate-device-img {
    width: 200px;
}

.rotate-device-text {
    font-size: 25px;
    text-align: center;
    width: 10ch;
}

@keyframes nudge-rotate {

    0%,
    100% {
        transform: rotate(0deg);
    }

    15% {
        transform: rotate(-12deg);
        /* Quick tilt left */
    }

    30% {
        transform: rotate(10deg);
        /* Bounce right */
    }

    45% {
        transform: rotate(-5deg);
        /* Settle left */
    }

    60% {
        transform: rotate(2deg);
        /* Settle right */
    }
}

.rotate-device-img {
    width: 200px;
    animation: nudge-rotate 2s infinite ease-in-out;
    transform-origin: center center;
    display: block;
}

.loader-container {
    position: fixed;
    bottom: 20px;
    right: 40px;
    pointer-events: none;
}

.loader-bounce {
    width: 150px;
    animation: elastic 1.5s infinite cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

@keyframes elastic {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.4) rotate(90deg);
    }

    100% {
        transform: scale(1) rotate(180deg);
    }
}

body {

    background-image: url("./textures/skybox.png");
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    background-color: #1a004c;
    justify-content: center;
    align-items: center;
    display: flex;
}

.dialogue-anchor {
    position: fixed;  
    bottom: 2vh;
    left: 50%;
    transform: translateX(-50%);
    width: 63vh;
    max-width: 95%;
    z-index: 100;
    pointer-events: none;
}

.dialogue-container {
   opacity: 0; /* hide the dialogue by default*/
}

.dialogue-name {
    position: absolute;
    top: -5%; 
    left: 12%;
    margin: 0;
    font-size: 5vh;
    font-weight: bold;
    z-index: 102;  
    white-space: nowrap; 
    color: #ffffff;
    --thickness: 0.7vh; 
    --color: #1D4B96;
    text-shadow: 
         calc(var(--thickness) * 0.00) calc(var(--thickness) * 1.00) 0.5px var(--color),
         calc(var(--thickness) * 0.98) calc(var(--thickness) * 0.21) 0.5px var(--color),
         calc(var(--thickness) * 0.42) calc(var(--thickness) * -0.91) 0.5px var(--color),
         calc(var(--thickness) * -0.80) calc(var(--thickness) * -0.60) 0.5px var(--color),
         calc(var(--thickness) * -0.76) calc(var(--thickness) * 0.65) 0.5px var(--color),
         calc(var(--thickness) * 0.48) calc(var(--thickness) * 0.88) 0.5px var(--color),
         calc(var(--thickness) * 0.96) calc(var(--thickness) * -0.28) 0.5px var(--color),
         calc(var(--thickness) * -0.07) calc(var(--thickness) * -1.00) 0.5px var(--color),
         calc(var(--thickness) * -0.99) calc(var(--thickness) * -0.15) 0.5px var(--color),
         calc(var(--thickness) * -0.35) calc(var(--thickness) * 0.94) 0.5px var(--color),
         calc(var(--thickness) * 0.84) calc(var(--thickness) * 0.54) 0.5px var(--color),
         calc(var(--thickness) * 0.71) calc(var(--thickness) * -0.70) 0.5px var(--color),
         calc(var(--thickness) * -0.54) calc(var(--thickness) * -0.84) 0.5px var(--color),
         calc(var(--thickness) * -0.94) calc(var(--thickness) * 0.35) 0.5px var(--color),
         calc(var(--thickness) * 0.14) calc(var(--thickness) * 0.99) 0.5px var(--color),
         calc(var(--thickness) * 1.00) calc(var(--thickness) * 0.08) 0.5px var(--color);
}

.dialogue-text {
    position: absolute; 
    top: 50%;    
    left: 50%;      
    transform: translate(-50%, -50%); 
    
    width: 80%;     
    margin: 0;
    text-align: center;
    z-index: 101;     
    width: 28ch;
    font-weight: bold;
    font-size: 2.95vh;
    color: #1B508E;
    white-space: pre-wrap;
    opacity: 1;
}

.dialogue-option {
    position: absolute; 
    top: 50%;    
    left: 50%;      
    transform: translate(-50%, -50%); 
    
    width: 80%;     
    margin: 0;
    text-align: left;
    z-index: 105;
    width: 28ch;
    font-weight: bold;
    font-size: 2.8vh;
    color: #1B508E;
    white-space: pre-wrap;
    cursor: pointer;
    pointer-events: auto;
    opacity: 0;
    transition: color 0.2s ease, transform 0.2s ease;
}


.dialogue-option:hover {
    color: #3679A3;
   /* text-shadow: 0px 0px 8px #a5ddfe;*/
}

#dialogue-options-arrow {
    animation: arrow-nudge 0.8s infinite alternate ease-in-out;
    pointer-events: none;
}

@keyframes arrow-nudge {
    from { transform: translateX(0); }
    to { transform: translateX(-0.8vh); }
}


#dialogue-option-1 { transform: translate(-40%, -150%); }
#dialogue-option-2 { transform: translate(-40%, -20%); }
#dialogue-option-3 {  transform: translate(-40%, 110%); }

/*
option 1 pos 34% 
option 2 pos 48% 
option 3 pos 63% 
*/

#dialogue-options-arrow {
    position: absolute;
    top: 34%; 
    left: 10%;
    z-index: 110; 
    width: 2.8vh; 
    height: auto;
    opacity: 0;
}

#dialogue-options-arrow {
    animation: arrow-bounce 0.8s infinite alternate ease-in-out;
}

@keyframes arrow-bounce {
    from { transform: translateX(0); }
    to { transform: translateX(-0.6vh); }
}

#speechbubble-left {
    width: 100%;     
    height: auto;
    display: block;
    position: relative; 
    z-index: 1;
    left: -1.9vh;
    top: 0.5vh;
    opacity: 1;
}

#speechbubble-right {
    width: 100%;     
    height: auto;
    position: absolute; 
    top: 0;
    left: 0;
    z-index: 2; 
    left: 1.9vh;
    top: 0.5vh;
    opacity: 1;
}

@keyframes shake-anim {
    0%   { transform: translate(0vh, 0vh); }
    20%  { transform: translate(-0.05vh, 0.05vh); }
    40%  { transform: translate(-0.05vh, -0.05vh); }
    60%  { transform: translate(0.05vh, 0.05vh); }
    80%  { transform: translate(0.05vh, -0.05vh); }
    100% { transform: translate(0vh, 0vh); }
}


.char-shake-alt {
    animation: shake-anim-2 0.12s linear infinite;
}

@keyframes shake-anim-2 {
    0%   { transform: translate(0vh, 0vh); }
    50%  { transform: translate(0.065vh, -0.06vh); }
    100% { transform: translate(-0.065vh, 0.06vh); }
}

.char-span {
    display: inline-block;
    vertical-align: bottom;
}

.char-shake {
    animation: shake-anim 0.15s linear infinite;
}

.char-wobble {
    animation: wobble-anim 0.5s ease-in-out infinite alternate;
}

@keyframes wobble-anim {
    from { transform: translateY(0vh); }
    to { transform: translateY(-0.5vh); }
}

.centered img {
    width: 50px;
    max-width: 20vw;
    height: auto;
    display: block;
}

#playButton {
    user-select: none;
    -webkit-user-drag: none;
    -moz-user-select: none;
    -ms-user-select: none;
    pointer-events: auto;
}

/* Show a warning only when in portrait */
#portrait-warning {
    display: none;
}

@media screen and (orientation: portrait) {
    #portrait-warning {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgb(5, 4, 45);
        color: white;
        pointer-events: block;
        z-index: 9999999;
    }
}

* {
    font-family: 'Atkinson Hyperlegible', sans-serif;
    -webkit-user-drag: none; 
    user-drag: none;
    -moz-user-select: none; 
    user-select: none; 
}

