@font-face{ 
    font-family: 'lora';
    src: url('third-party/Lora-Regular.ttf');
}

@font-face{ 
    font-family: 'roboto';
    src: url('third-party/Roboto-Regular.ttf');
}

body.game {
    touch-action: none;
    user-select: none;
}

body {
    font-family: 'lora';
    background-color: #fff;
}

body.game {
    height: 100%;
    padding: 0px;
    margin: 0px;
    overflow: hidden;
    -webkit-touch-callout: none;
    -webkit-text-size-adjust: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: rgba(0,0,0,0);
}

div#main-container {
    position: absolute;
    height: 99%;
}

div#board-container {
    padding: 2px;
    position: relative;
}

div#overlay {
    display: none;
    position: absolute;
    width: 280px;
    font-family: 'roboto';
    font-size: 30px;
    padding: 10px;
    background-color: #eee;
    border-radius: 10px;
    border: solid 3px black;
}

board {
    position: relative;
    display: block;
}

tile {
    display: block;
}

board cell {
    position: absolute;

    width: 270px;
    height: 270px;
    padding: 0px;
    text-align: center;
    font-size: 200px;
    margin: 0px;
    display: block;
    background-color: transparent;
}

board cell.selected {
    background-color: #000;
}

board cell tile {
    position: absolute;
    width: 230px;
    height: 230px;
    top: 20px;
    left: 20px;
    line-height: 230px;
    color: #000;
}

arrow {
    position: absolute;
    display: block;
    width: 0;
    height: 0;

    animation-name: pulse;
    animation-duration: 0.8s;
    animation-iteration-count: infinite;
    animation-timing-function: ease;
}

arrow.huge-down {
    border-left: 65px solid transparent;
    border-right: 65px solid transparent;
    border-top: 130px solid #2a2;
    top: -125px;
    left: 80px;
}

tile arrow.huge-down {
    top: -140px;
    left: 15px;
}

arrow.huge-across {
    border-bottom: 65px solid transparent;
    border-top: 65px solid transparent;
    border-right: 130px solid #2a2;
    top: 80px;
    right: -125px;
}

tile arrow.huge-across {
    top: 15px;
    right: -140px;
}

span arrow.huge-across {
    border-bottom: 25px solid transparent;
    border-top: 25px solid transparent;
    border-right: 50px solid #2a2;
    top: 20px;
    right: -50px;
}

action arrow.huge-across {
    border-bottom: 15px solid transparent;
    border-top: 15px solid transparent;
    border-right: 30px solid #2a2;
    top: 7px;
    right: -25px;
}

arrow.bad-down {
    border-left: 25px solid transparent;
    border-right: 25px solid transparent;
    border-top: 50px solid #a22;
    top: -50px;
    left: 115px;
}

arrow.bad-across {
    border-bottom: 25px solid transparent;
    border-top: 25px solid transparent;
    border-left: 50px solid #a22;
    top: 115px;
    left: -50px;
}

div.letter-group arrow.bad-across {
    top: 75px;
    left: -45px;
}

tile.tile-front {
    transition-property: transform;
    transition-duration: 500ms;
    backface-visibility: hidden;
    transform: perpective(600px) rotateY(180deg);
}

tile.tile-back {
    transition-property: transform;
    background-image: repeating-linear-gradient(
        -45deg,
        #b0e0e0,
        #b0e0e0 50px,
        #ffffff 60px
    );
    transition-duration: 500ms;
    backface-visibility: hidden;
}

tile.tile-front span.preview {
    font-size: 33%;
    vertical-align: middle;
    pointer-events: none;
}

tile.letter {
    position: relative;
    width: 150px;
    height: 150px;
    border: solid 5px black;
    text-align: center;
    margin: 0px 10px 0px 10px;
    display: inline-block;
    background-color: #fff;
}

tile.highlight {
    background-color: #ede;
}

tile.blank {
    background-color: #fff;
}

tile.area-a {
    background-color: #F7E26B;
}

tile.area-b {
    background-color: #d4331e;
    color: #fff;
}

tile.area-c {
    background-color: #005784;
    color: #fff;
}

tile.area-d {
    background-color: #EB8931;
}

tile.area-e {
    background-color: #A3CE27;
}

tile.area-f {
    background-color: #802080;
    color: #fff;
}

tile.area-g {
    background-color: #B2DCEF;
}

tile.area-h {
    background-color: #c080c0;
}

tile.area-i {
    background-color: #a46422;
}

tile.area-j {
    background-color: #38891A;
    color: #fff;
}

tile.shade {
    background-color: #e0e0e0;
    color: #000;
}

tile.rotated-back {
    transform: perspective(600px) rotateY(180deg);
}

tile.rotated-front {
    transform: perspective(600px) rotateY(0deg);
}

tile.drag-target {
    transform: scale(1.15);
    transition-duration: 100ms;
}

div.help {
    font-size: 25px;
    margin-left: auto;
    margin-right: auto;
    text-align: left;
}

div.help img {
    width: 50%;
    max-height: 400px;
    object-fit: contain;
    float: right;
}

div.help h2 {
    clear: right;
}

ul {
    padding-left: 2ex;
}

board {
    z-index: 0;
}

div#data-container {
    position: relative;
}

div#data {
    font-size: 140px;
}

div#letters {
    margin: 0px;
    padding: 0px;
    line-height: 160px;

    display: grid ;
    grid-auto-flow: row;
    grid-column-gap: 25px;
    grid-row-gap: 5px;
    grid-template-columns: 825px 825px;
}

div.win {
    text-align: center;
    font-size: 100px;
    padding: 0px 0px 50px 0px;    
    overflow: hidden;
    vertical-align: middle;
}

span#share-url {
    display: none;
}

div#words {
    font-size: 70px;
    height: 215px;
    overflow: hidden;
    white-space: nowrap;
}

div#game-message {
    padding: 15px;
    font-size: 60px;
    min-height: 165px;
    width: 825px;
    font-family: 'roboto';
    padding: 15px;
    background-color: #eee;
    border-radius: 50px;
    border: solid 5px black;
    display: none;
}

div.letter-group {
    position: relative;
    width: 725px;
    background-color: #eee;
    padding: 10px 25px 10px 25px;
    margin: 0px 0px 10px 0px;
    border-radius: 25px;    
    border: 5px solid #444;
    display: inline-block;
}

div.letter-group.selected {
    background-color: #a0a0a0;
}

tile.drag-image {
    width: 230px;
    height: 230px;
    font-size: 230px;
    line-height: 210px;
    position: absolute;
    border: solid 5px black;
    text-align: center;
    margin: 15px;
    display: inline-block;
    background-color: #eee;
    pointer-events: none;
}

word {
    position: relative;
    margin-left: 20px;
    transition-property: margin-left;
    transition-duration: 500ms;
}

word.found {
    color: #262;
}

word.unknown {
    color: #a22;
}

h1 {
    /* Have to hard-code the height, because something is off with the
     * rescaling code seeing the height as too small on initial load
     * otherwise. */
    height: 76px;
    padding: 0px 0px 5px 5px;
    margin: 0px;
    font-size: 50px;
    text-align: center;
    font-variant: small-caps;   
    white-space: nowrap;
}

h2 {
    margin-top: 0px;
    font-size: 40px;
    text-align: center;
}

h3 {
    margin-top: 0px;
    font-size: 30px;
    text-align: center;
}

fp {
    width: 600px;
    margin-left: auto;
    margin-right: auto;
    display: none;
}

menu {
    display: flex;
    justify-content: flex-center;
    flex-direction: column;
    padding: 0px;
    margin: 0px;
}

menu action {
    width: 20ex;
    margin-left: auto;
    margin-right: auto;
}

action {
    display: block;
    height: 50px;
    text-align: center;
    padding: 10px;
    font-family: 'roboto';
    font-size: 50px;
    line-height: 50px;
    border-radius: 25px;
    background-color: #005784;
    color: #eee;
    border: solid 4px #044; 
    margin-top: 20px;
    touch-action: manipulation;
    position: relative;
}

inline-action {
    top: -25;
    padding: 10px 20px 10px 20px;
    margin-top: 0px;
    border-radius: 20px;
    height: 75px;
    font-size: 75px;
    border: none;
    font-family: 'roboto';
    background-color: #005784;
    color: #eee;
    border: solid 5px #044; 
    touch-action: manipulation;
    vertical-align: middle;
    display: inline-block;
}

puzzle-stats {
    display: block;
    padding: 5px 15px 0px 15px;
    font-size: 20px;
}

bar {
    display: flex;
    justify-content: flex-center;
    flex-direction: row;
    padding: 10px 0px 10px 0px;
    max-width: 500px;
    position: relative;
}

bar separator {
    flex: 1;
    width: 10px;
}

bar action {
    padding: 5px 10px 5px 10px;
    margin-top: 0px;
    border-radius: 8px;
    height: 30px;
    line-height: 30px;
    font-size: 25px;
    border: solid 2px #044; 
}

@media not all and (hover: none) {
    action:hover {
        background-color: #09a;
    }

    inline-action:hover {
        background-color: #09a;
    }

    tile.letter:hover {
        background-color: #9dd;
        color: #000;
    }
}

@keyframes firefox_hack {
    from { transform: scale(1); }
    50% { transform: scale(0.999999999999); }
    to { transform: scale(1); }
}

tile.firefox_hack {
    animation-name: pulse;
    animation-duration: 86400s;
    animation-iteration-count: infinite;
    animation-timing-function: ease;
}

@keyframes pulse {
    from { transform: scale(1); }
    50% { transform: scale(0.9); }
    to { transform: scale(1); }
}

@media screen and ((max-width: 600px) or (max-height: 800px)) {
    h1 {
        height: 38px;
        font-size: 25px;
    }

    h2 {
        font-size: 25px;
        margin-bottom: 5px;
    }

    h3 {
        font-size: 25px;
    }

    fp {
        width: 95%;
    }

    div.help {
        font-size: 15px;
    }

    puzzle-stats {
        font-size: 16px;
    }

    action {
        height: 25px;
        padding: 5px;
        font-size: 25px;
        line-height: 25px;
        border-radius: 13px;
        border-width: 2px;
        margin-top: 10px;
    }

    bar {
        padding: 5px 0px 5px 0px;
    }

    bar action {
        height: 25px;
        font-size: 15px;
        line-height: 25px;
        border-radius: 6px;
    }
}

@media screen and ((max-height: 600px)) {
    h2 {
        font-size: 20px;
        margin-bottom: 5px;
    }

    div.help {
        font-size: 15px;
    }

    div.help img {
        height: 200px;
        object-fit: contain;
        float: right;
    }

    action {
        height: 20px;
        padding: 5px;
        font-size: 20px;
        line-height: 20px;
        border-radius: 10px;
        border-width: 2px;
        margin-top: 5px;
    }

    puzzle-stats {
        font-size: 12px;
    }
}
