/*
These fonts are licensed under the OFL.  The text of the OFL,
and their copyright notices, can be found at https://middlesgame.com/OFL.txt
*/

@font-face {
    font-family: caps;
    src: url(BebasNeue-Regular.ttf);
}

@font-face {
    font-family: body;
    src: url(Montserrat-Regular.ttf);
}


body {
    box-sizing:border-box;
    font-family: body;
}

@media (prefers-color-scheme: dark) {
    body {
        background-color: #111122;
        color: #ffffff;
    }

}


h1 {
    text-align: center;
}

h2 {
    text-align: center;
}

#game {
    display:flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

}

#score {
    text-align: center;
    font-size: 24px;
}

#wordbox {
    position: relative;
    width:360px;
}

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

#result_body {
    margin-bottom: 10px;
}

#result_header {
    padding-top: 10px;
}

#word,#result_word {
    cursor: default;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* letters of the word, not keys */
.letter {
    font-family: caps;
    font-size: 18px;
    border-radius: 2px;
    background: #dcdcec;
    padding: 5px 4px 4px;
    width: 13px;
    height: 20px;
    margin: 3px;
    line-height: 1;
    text-align: center;
    flex-grow: 0;
    flex-shrink: 0;

    display: flex;
    justify-content: center;
    align-items: center;

    user-select: none;
}


@media (prefers-color-scheme: dark) {
    .letter {
        color: #000;
    }
}


/* overrides letter */
.space {
    background: #ffffcc;
    color: rgba(0, 0, 0, 0);
    position: relative;
    border: 0.1em solid black;
}

.space.selected {
    border: 0.2em solid black;
}

@media (prefers-color-scheme: dark) {
    .space.selected {
        border: 0.2em solid white;
    }
}

.solved {
    background: #ddddff;
}

/* letters not in the middle */
.user {
    background: #ddffdd;
}


@keyframes fadeText {
 0% { color: black; }
 50% { color: rgba(0, 0 , 0, 0); }
 100% { color: black; }
}

.selected {
 animation: fadeText 1.5s ease-in-out infinite;
}

.help_circle {
    color: #fff;
    background-color: #000;
    font-family: caps;
    font-size: 32px;
    margin-top: -4px;
    position: absolute;
    cursor: pointer;
    right: 10px;

    width: 40px;
    height: 40px;
    text-align: center;

    border-radius: 50%;
    display: inline-block;
}

@media (prefers-color-scheme: dark) {
    .help_circle {
        color: #111122;
        background: #fff;
    }
}

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

.row {
    display: flex;
    flex-direction: row;
}

.key {
    font-family: caps;
    font-size: 24px;
    border-radius: 9px;
    background: #dcdcec;
    padding: 3.5px;
    width: 24px;
    height: 28px;
    margin: 3px;
    cursor: pointer;
    line-height: 1;
    text-align: center;

    flex-grow: 0;
    flex-shrink: 0;

    display: flex;
    justify-content: center;
    align-items: center;

    user-select: none;
}

@media (prefers-color-scheme: dark) {
    .key {
        color: #000;
    }
}


.hidden {
    color: rgba(0, 0, 0, 0.0);
}

.screen {
    display: none;

    align-items: center;
    justify-content: center;

    flex-flow: column nowrap;
}

.narrow_body {
    max-width: min(min(80vw, 80vh), 400px);
    max-height: 80vh;
    margin: 0px 20px 20px 20px;
}

.scrollable {
    overflow: scroll;
    margin-bottom: 2vh;
}

.used {
    text-decoration: line-through;
    text-decoration-thickness: 4px;
    color: rgb(64, 0, 0, 0.4);
    font-size: 22px;
    font-family: caps;
}

.strike {
    font-size: 22px;
    font-family: caps;
    color: rgb(0.0, 0, 0);
    font-weight:normal;
}

#sharebox2 {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;

    margin-bottom:20px;
}

#share {
    border: 1px solid #888;
    border-radius: 5px;
    background-color: #fcc;
    font-weight: bold;
    padding: 6px;
    margin-left: 10px;
    cursor: pointer;

    flex-grow: 0;
    flex-shrink: 0;
    text-align: center;
}


@media (prefers-color-scheme: dark) {
    #share {
        background-color: #f88;
        color: #000;
    }
}


.bar {
    width: 265px;
    height: 17px;
    border: 1px solid #ccc;
    position: relative;
    margin-bottom: 10px;
    margin-left: 25px;
}

.bar-bar {
    background-color: #ddd;
    height: 100%;
    position: absolute;
}

.bar-bar.today {
   background-color: #ccffcc;
}


@media (prefers-color-scheme: dark) {
    .bar-bar.today {
        background-color: #262;
    }
    .bar-count {
        color: #fff;
        font-weight: bold;
    }
}


.bar-label {
    position: absolute;
    left: -30px;
    white-space: nowrap;
    font-size: 14px;
    line-height: 17px;
    padding-left: 5px;
}

.bar-count {
    position: absolute;
    right: 5px;
    white-space: nowrap;
    font-size: 14px;
    line-height: 17px;
    padding-left: 5px;
}

#chart {
    margin-bottom: 28px;
}


#streak {
    max-width: 300px;
    margin-bottom: 20px;
}


/* The following notice applies to the .used selector and all of its related
selectors (.used.left, etc).

Copyright (c) 2023 by Mark Boots (https://codepen.io/MarkBoots/pen/RwLPXgJ)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
*/

.used {
    --bbArrowSize: 1.5rem;
    --bbBorderRadius: 0.25rem;
    --bbPadding: 1.5rem;
    --bbColor: #ffcccc;
    background: var(--bbColor);
    border-radius: var(--bbBorderRadius);
    padding: 0.5rem 1.0rem 0.5rem;
    position: absolute;
    top:75px;
    margin-top: var(--bbArrowSize);
    margin: 0;
    filter: drop-shadow(0px 0px 0.2rem black);
    transition: transform 0.25s ease
}

.used.left {
    left: 0px;
}

.used.right {
    right: 0px;
}

.used::before{
  content: ''; 
  position: absolute;
  background: var(--bbColor);
  bottom: calc(100% - 2px);
}

.used.left::before {
    left: 5px;
    clip-path: polygon(0 100%, 100% 0, 75% 100%);
}

.used.right::before {
    right: 5px;
    clip-path: polygon(100% 100%, 0 0, 25% 100%);
}

.used::before{
  --width: calc(var(--bbArrowSize) / 2 * 3);
  height: var(--bbArrowSize);
  width: var(--width);
}

#newpuzzle {
    max-width: 200px;
}

#bydavidturner {
    text-align: left;
}

#privacylink {
    font-size: 12px;
    text-align:right;
}

#close {
    font-size: 18px;
}


@media (prefers-color-scheme: dark) {
    a {
        color: #ddddff;
    }
}

.button {
    border: 1px solid #888;
    border-radius: 5px;
    background: #dcdcec;
    font-weight: bold;
    padding:8px;
    margin-bottom: 20px;
    cursor: pointer;
}

@media (prefers-color-scheme: dark) {
    .button {
        color: #000;
    }
}

#error {
    color: #f00;
}
