/* The page's styles: the font faces, the game container, the loading screen
   and the portrait overlay of index.html. Every style of the page is here;
   no HTML page carries a style block or a style attribute. */

/* Cinzel (SIL Open Font License, see assets/fonts/OFL.txt), the two
   subsets Google Fonts serves: Latin, and Latin Extended for the
   Latvian letters. main.js waits for both before creating the game. */
@font-face {
    font-family: 'Cinzel';
    font-style: normal;
    font-weight: 400 900;
    font-display: swap;
    src: url(assets/fonts/cinzel-latin-ext.woff2) format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Cinzel';
    font-style: normal;
    font-weight: 400 900;
    font-display: swap;
    src: url(assets/fonts/cinzel-latin.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    background: #2b2418;
    overflow: hidden;
}
/* The element that goes fullscreen. It wraps the game rather than being it,
   because a browser's own fullscreen rules force the fullscreen element to
   the viewport's size and drop any minimum on it, and the game keeps a
   minimum while the software keyboard is open. */
#stage {
    width: 100%;
    height: 100%;
    overflow: hidden;
}
#game {
    width: 100%;
    height: 100%;
    /* Own formatting context: the centred canvas has a top margin, and
       without this it collapses through the div and shifts the DOM
       element container (which copies the same margin) down twice. */
    display: flow-root;
}
#game input::placeholder {
    color: #a08a6a;
}
canvas {
    display: block;
    touch-action: none;
}
#rotate {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10;
    background: #2b2418;
    color: #f3e9d2;
    font-family: Cinzel, Georgia, serif;
    text-align: center;
    align-items: center;
    justify-content: center;
}
#rotate .icon {
    font-size: 64px;
    line-height: 1;
    margin-bottom: 16px;
}
#rotate .text {
    font-size: 22px;
}
@media (orientation: portrait) {
    body.mobile #rotate {
        display: flex;
    }
}
/* Loading screen: shown from the first paint until the intro scene has
   been created. The bar slides while the font loads and shows the
   loader's progress once Phaser starts fetching the images. */
#loading {
    position: fixed;
    inset: 0;
    z-index: 20;
    background: #2b2418;
    display: flex;
    align-items: center;
    justify-content: center;
}
#loading[hidden] {
    display: none;
}
#loading .track {
    width: min(320px, 60vw);
    height: 10px;
    border: 2px solid #f3e9d2;
    border-radius: 7px;
    overflow: hidden;
}
#loading .fill {
    height: 100%;
    width: 30%;
    background: #f3e9d2;
    animation: loading-slide 1.2s ease-in-out infinite;
}
#loading.progress .fill {
    animation: none;
    transition: width 0.15s linear;
}
@keyframes loading-slide {
    from { transform: translateX(-100%); }
    to { transform: translateX(333%); }
}
