@font-face {
    font-family: "Helvetica Monospaced W06 Rg";
    src: url("395410b1fd4cca8cfb17bd78a9c34889.woff2") format("woff2");
}

:root {
    --highlight-color: #FFBC58;
    --victory-color: #589BFF;
    --button-active-color: #dedede;
    --wrong-color: #FF6258;
    font-family: 'Libre Franklin', sans-serif;
}

html {
    height: -webkit-fill-available;
}

body {
    min-height: 100vh;
    /* mobile viewport bug fix */
    min-height: -webkit-fill-available;
}

body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
}

button:focus-visible {
    outline: none;
}

/* header */

header {
    display: flex;
    align-items: center;
    font-size: 21px;
}

header .logo {
    margin-right: 0.5em;
    width: 2em;
    height: 2em;
}

header h1 {
    flex: 1;
    margin: 0;
    line-height: 1em;
    color: var(--highlight-color);
}

header .side-icons {
    margin-left: 1.6em;
    display: flex;
    align-items: center;
}

header .side-icons img {
    display: block;
    height: 2em;
}

header .side-icons * + * {
    margin-left: 0.8em;
}

h1 {
    font-weight: 800;
    user-select: none;
}

.mono {
    font-family: 'Helvetica Monospaced W06 Rg', monospace;
}

/* top menu */

#top-menu-wrapper {
    align-self: stretch;
    display: flex;
    justify-content: center;

    margin: 20px -20px 0 -20px;
    
    border: var(--highlight-color) solid;
    border-width: 1px 0;
}

#top-menu {
    width: 400px;
    display: flex;
}

#top-menu button {
    font-size: 16px;
    padding: 15px 20px;
    color: black;
    text-decoration: none;
    cursor: default;
    background: none;
    border: 0;
}

#top-menu button:hover {
    background: var(--button-active-color);
}

#top-menu *:last-child {
    margin-left: auto;
}

/* phrases navigation */

#phrases-nav {
    display: flex;
    
    height: 50px;
    margin-top: 15px;
    justify-content: space-between;

    width: 400px;
}

@media (max-width:640px) {
    #phrases-nav {
        align-self: stretch;
        width: auto;
    }
}

#phrases-nav > button {
    flex: 1;
}

.phrase-nav {
    border-width: 2px;
    border-style: solid;
    border-color: var(--button-active-color);
    background: white;
    transition: background-color 200ms;
}

.phrase-nav.active, .phrase-nav:hover {
    background-color: var(--button-active-color);
}

.phrase-nav.solved {
    border-color: var(--victory-color);
}
.phrase-nav::before {
    content: url(v.svg);
    opacity: 0;
    transition: opacity 200ms;
}
.phrase-nav.solved:not(.active)::before {
    opacity: 1;
}
.phrase-nav.solved.active, .phrase-nav.solved:hover {
    background-color: var(--victory-color);
}

.phrase-nav:first-child {
    border-top-left-radius: 24px;
    border-bottom-left-radius: 24px;
}
.phrase-nav:last-child {
    border-top-right-radius: 24px;
    border-bottom-right-radius: 24px;
}

/* popups */

.popup {
    position: absolute;    
    pointer-events: none;
    opacity: 0;
    background: var(--highlight-color);
    color: black;
    z-index: 2;
    border-radius: 20px;
    margin: 0 20px;
    padding: 20px;
    width: 280px;
}

.transitions-activated .popup {
    transition: opacity 250ms;
}

.popup.active {
    pointer-events: initial;
    opacity: 1;
}

.popup h1 {
    font-size: 26px;
    font-weight: bold;
    margin: 40px 0 20px 0;
    color: black;
    text-align: center;
}

.popup#popup--how-to-play p {
    font-size: 22px;
    margin: 0;
    line-height: 1.5;
}
.popup#popup--how-to-play p + p {
    margin-top: 20px;
}
.popup#popup--how-to-play p:last-child {
    margin-bottom: 20px;
}

.popup .close-popup-button {
    position: absolute;
    right: 20px;
    top: 20px;
    background: none;
    border: 0;
    padding: 0;
}

#popup-overlay {
    position: absolute;
    background: rgba(255,255,255,0.6);
    left: 0; right:0; bottom:0; top:0;
    z-index: 1;
    pointer-events: none;
    opacity: 0;
}

.transitions-activated #popup-overlay {
    transition: opacity 250ms;
}

#popup-overlay.active {
    pointer-events: initial;
    opacity: 1;
}

.popup #yesterday-phrases {
    margin-bottom: 20px;
}

.popup #yesterday-phrases p {
    text-align: center;    
    text-transform: uppercase;
    font-size: 36px;
    margin: 0.5em 0 0 0;
    padding: 0.5em 0 0 0;
}

.popup #yesterday-phrases p + p {
    border-top: rgba(0,0,0,0.5) solid 1px;
}

/* phrase */

#phrase-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 0.4;
}

@media (max-width:640px) {
    #phrase-wrapper {
        flex: 1;
    }
    header {
        width: 100%;
        font-size: 16px;
    }
    #top-menu {
        width: 100%;
    }
    /* .popup {
        bottom: 20px;
    } */
}

#phrase {
    position: relative;
    font-size: 36px;
    letter-spacing: 0.2em;
    text-align: center;
    line-height: 1.5;
}

#phrase p {
    margin: 0;
}

#solution {
    position: absolute;
    text-transform: uppercase;
    user-select: none;
}

#solution span.bad {
    color: #dedede
}

#phrase.right #solution span {
    color: var(--victory-color);
}
#phrase.right #hint {
    visibility: hidden;
}

#phrase.wrong #solution {
    text-decoration: line-through;
    text-decoration-color: var(--wrong-color);
}

#hint {
    position: relative;
    top: 0.1em;
    user-select: none;
    pointer-events: none;
}

/* bottom area */

#bottom-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

/* bottom buttons */

#buttons * + * {
    margin-left: 8px;
}

#buttons button {
    width: 100px;
    height: 50px;
    background-color: white;
    border: 1px solid black;
    border-radius: 24px;
    font-family: inherit;
    font-size: 16px;
    user-select: none;
}

#buttons button:active {
    background-color: var(--button-active-color);
}

/* hexagons */

#hexagons {
    position: relative;
    width: 300px;
    height: 312px;
    margin-bottom: 25px;
}

@media (max-height:780px) {
    #hexagons {
        width: 202px;
        height: 210px;
    }
}

.hexagon {
    position: absolute;
    top: calc(100% / 3);
    left: 30%;
    width: 40%;
    height: calc(100% / 3);
    pointer-events: none;
    touch-action: none;
}

.hexagon polygon.hexagon-fill {
    fill: #FFBC58;
    transition: all 150ms;
    pointer-events: fill;
    touch-action: none;
}

.hexagon.pointer-down polygon.hexagon-fill {
    transform: scale(0.85);
    transform-origin: center;
}

.hexagon text.hexagon-letter {
    font-weight: 700;
    font-size: 1.875em;
    text-anchor: middle;
    text-transform: uppercase;
    user-select: none;
}

.hexagon:nth-child(1) { transform: translate(0, 100%) }
.hexagon:nth-child(2) { transform: translate(-75%, -50%) }
.hexagon:nth-child(3) { transform: translate(-75%, 50%) }
.hexagon:nth-child(4) { transform: translate(75%, -50%) }
.hexagon:nth-child(5) { transform: translate(75%, 50%) }
.hexagon:nth-child(6) { transform: translate(0, -100%) }
.hexagon:nth-child(7) { transform: translate(0, 0) }
/* .hexagon:nth-child(8) { transform: translate(-150%, 0) }
.hexagon:nth-child(9) { transform: translate(150%, 0) } */

/* phrase solved message (victory / partial) */

.transitions-activated #bottom-area > * {
    transition: opacity 500ms;
}

.phrase-solved-message {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 1;
    height: 100%;
    justify-content: center;
}

.phrase-solved-message h1 {
    font-size: 36px;
    margin: 0;
}

.big-cta-button {
    padding: 15px 20px;
    display: flex;
    align-items: center;
    width: 220px;
    min-height: 80px;
    justify-content: space-around;
    font-size: 28px;
    font-weight: 700;
    border: 0;
    background: var(--highlight-color);
    border-radius: 20px;
}

.phrase-solved-message > .big-cta-button {
    margin-top: auto;
}

/* victory */

#bottom-area:not(.victory) > #victory {
    pointer-events: none;
    opacity: 0;
}

#bottom-area.victory > *:not(#victory) {
    pointer-events: none;
    opacity: 0;
}

#bottom-area.victory > *:not(#victory) * {
    pointer-events: none;
}

#next-phrase {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 34px 0;
}

#next-phrase h2 {
    font-size: 24px;
    margin-block-start: 0;
}

#next-phrase #countdown {
    font-size: 30px;
}

/* partial victory */

#bottom-area:not(.partial-victory) > #partial-victory {
    pointer-events: none;
    opacity: 0;
}

#bottom-area.partial-victory > *:not(#partial-victory) {
    pointer-events: none;
    opacity: 0;
}

#bottom-area.partial-victory > *:not(#partial-victory) * {
    pointer-events: none;
}

#partial-victory > h2 {
    text-align: center;
    font-size: 24px;
}