html {
    font-size: 100%;
}

:root {
    --radius: 0px; /* orig: 5px */
    --padding: 0px;  /* orig: 10px */
    --colourA: #e1a730;
    --colourB: #2879c0;
}

@font-face {
  font-family: "Majiri";
  src: url("Majiri-Regular.woff") format('woff');
}

.container {
    font-family: "Inter", sans-serif;
    font-weight: 800;
    color: white;
    text-transform: uppercase;
    font-size: 1.0rem;
    text-align: center;
    display: grid;
    grid-template-columns: 1fr 28fr 1fr;
    grid-template-rows: 3fr 2fr 13fr 13fr 1fr;
    grid-gap: 0.0rem; /* orig: 0.5rem */
    height: 100svh;
    grid-template-areas:
        "lbr hdr rbr"
        "lbr opt rbr"
        "lbr scn rbr"
        "lbr kbd rbr"
        "lbr ftr rbr";
}

.key {
    background: #cccccc;
    font-family: "Majiri";
    /*font-family: "Inter", sans-serif;*/
    font-weight: 800;
    color: black;
    text-transform: uppercase;
    font-size: 3.0rem;
    text-align: center;
    touch-action: manipulation;
    border-radius: 0.75rem;
}

.editSym {
    font-family: "Inter", sans-serif;
    font-size: 1.75rem;
}

.space {
    font-family: "Inter", sans-serif;
    font-size: 0.75rem;
}

.key > img {
    object-fit: cover;
    width: 100%;
    max-width: 75px;
    max-height: 100%;
}

textarea#screen {
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    font-family: "Inter", sans-serif;
    font-weight: 800;
    color: black;
    text-transform: uppercase;
    font-size: 2.0rem;
}

img.buttonGlyph {
    pointer-events: none;
}

#hdr {
    background: var(--colourA);
    border-radius: var(--radius);
    padding-top: var(--padding);
    grid-area: hdr;
    display: grid;
    grid-template-columns: 8fr 2fr;
    grid-template-rows: 1fr;
    grid-gap: 0.0rem;
    grid-template-areas: "hdrleft hdrright";
    align-items: center;
}

#hdrleft {
    grid-area: hdrleft;
    text-align: left;
    font-size: 2.0rem;
}

#hdrright {
    grid-area: hdrright;
    text-align: right;
}

#opt {
    background: var(--colourA);
    border-radius: var(--radius);
    padding-top: var(--padding);
    grid-area: opt;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: 1fr;
    grid-gap: 0.0rem;
    grid-template-areas: "optScreen optKeyboard";
    align-items: center;
    place-items: center;
}

#optScreen {
    grid-area: optScreen;
    text-align: center;
    font-size: 1.0rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

#optKeyboard {
    grid-area: optKeyboard;
    text-align: center;
    font-size: 1.0rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

#spnScreenLabel {
    align-self: center;
}

#aboutLink:hover, #aboutLink:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

#ftr {
    background: var(--colourA);
    border-radius: var(--radius);
    padding-top: var(--padding);
    grid-area: ftr;
}

#lbr {
    background: var(--colourA);
    border-radius: var(--radius);
    padding-top: var(--padding);
    grid-area: lbr;
}

#rbr {
    background: var(--colourA);
    border-radius: var(--radius);
    padding-top: var(--padding);
    grid-area: rbr;
}

#scn {
    background: var(--colourB);
    border-radius: var(--radius);
    padding-top: var(--padding);
    grid-area: scn;
}

#kbd {
    background: #2879c0;
    border-radius: var(--radius);
    padding-top: var(--padding);
    grid-area: kbd;
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    grid-template-rows: 1fr 1fr 1fr;
    grid-gap: 0.5rem;
    grid-template-areas:
        "q w e r t y u i o p"
        "a s d f g h j k l enter"
        "z x c v b n m space backspace delete";
}


/* --- BEGIN MODAL STYLING --- */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgb(0,0,0); /* Fallback color */
    background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
    font-family: "Inter", sans-serif;
    font-weight: 800;
}

/* Modal content */
.modal-content {
    position: relative;
    background-color: #fefefe;
    margin: auto;
    padding: 0;
    border: 1px solid #888;
    width: 80%;
    box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2),0 6px 20px 0 rgba(0,0,0,0.19);
    animation-name: animatetop;
    animation-duration: 0.4s
}

#credits {
    font-weight: 800;
    font-size: 0.75rem;
}

/* Close button */
.close {
    color: white;
    float: right;
    font-size: 3.0rem;
    font-weight: bold;
}

.close:hover, .close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

/* Modal header */
.modal-header {
    padding: 2px 16px;
    background-color: var(--colourB);
    color: white;
}

/* Modal body */
.modal-body {
    padding: 2px 16px;
    font-size: 1.0rem;
}

/* Modal footer */
.modal-footer {
    padding: 2px 16px;
    background-color: var(--colourB);
    color: white;
}

/* Add animation */
@keyframes animatetop {
    from {top: -300px; opacity: 0}
    to {top: 0; opacity: 1}
}

/* --- END MODAL STYLING --- */


/* --- BEGIN TOGGLE STYLING --- */
/* Based on example 5 at https://www.tutorialstonight.com/css-toggle-switch-with-text?expand_article=1 */

.toggle {
    --width: 80px;
    --height: calc(var(--width) / 3);

    position: relative;
    display: inline-block;
    width: var(--width);
    height: var(--height);
    box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.3);
    cursor: pointer;
}

.toggle input {
    display: none;
}

.toggle .labels {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    font-size: 12px;
    font-family: sans-serif;
    transition: all 0.4s ease-in-out;
    overflow: hidden;
}

.toggle .labels::after {
    content: attr(data-off);
    position: absolute;
    display: flex;
    justify-content: center;
    align-items: center;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    color: #ffffff;
    background-color: #b22222;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.4);
    transition: all 0.4s ease-in-out;
}

.toggle .labels::before {
    content: attr(data-on);
    position: absolute;
    display: flex;
    justify-content: center;
    align-items: center;
    top: 0;
    left: calc(var(--width) * -1);
    height: 100%;
    width: 100%;
    color: #ffffff;
    background-color: #008000;
    text-align: center;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.4);
    transition: all 0.4s ease-in-out;
}

.toggle input:checked~.labels::after {
    transform: translateX(var(--width));
}

.toggle input:checked~.labels::before {
    transform: translateX(var(--width));
}

/* --- END TOGGLE STYLING --- */


