
:root {
    --clr-dark: 15, 0, 30;
    --clr-dark-accent: 30, 0, 60;
    --clr-dark-button: 45, 0, 90;
    --clr-light:  200, 200, 200;
    --clr-title:  200, 200, 50;
    --clr-correct: 30, 180, 40;
    --clr-shuffled: 200, 100, 200; 

    --clr-available-yes: 150, 80, 20; 
    --clr-available-yes-bg: 255, 230, 160; 
    --clr-available-no: 150, 150, 150;
    --clr-available-no-bg: 150, 150, 150;

     /* font-sizes */
    --fs-900: 9.375rem;
    --fs-800: 6.25rem;
    --fs-750: 4.5rem;
    --fs-700: 3.5rem;
    --fs-600: 2rem;
    --fs-500: 1.75rem;
    --fs-450: 1.5rem;
    --fs-400: 1.3rem;
    --fs-300: 1rem;
    --fs-200: 0.875rem;
    
    /* font-families */
    --ff-serif: 'EB Garamond', serif;
    --ff-sans: 'Lato', sans-serif;

    --flow-space:  0.5rem;

    --tile-border: 5px;
}

/* set up the body */
body {
    font-family: var(--ff-sans);
    font-size: var(--fs-400);
    color: rgb(var(--clr-light));
    /*background-color: darkgrey;*/
    background-color: black;
    line-height: 1.5;
    
    display: grid;
    grid-template-rows: min-content 1fr;
    
    overflow-x: hidden;
}

h1 {
    font-size:  var(--fs-700);
    text-decoration: underline;
    font-family: var(--ff-serif);
}

h1,
h2,
h3,
h4,
h5,
h6,
p {
    font-weight: 400;
}


/* ------------------- */
/* Reset               */
/* ------------------- */

/* https://piccalil.li/blog/a-modern-css-reset/ */

/* Box sizing */
*,
*::before,
*::after {
    box-sizing: border-box;
}

/* Reset margins */
body,
h1,
h2,
h3,
h4,
h5,
p,
figure,
picture {
    margin: 0; 
}


/* make images easier to work with */
img,
picutre {
    max-width: 100%;
    display: block;
    object-fit: contain;
}

/* make form elements easier to work with */
input,
button,
textarea,
select {
    font: inherit;
}

/* remove animations for people who've turned them off */
@media (prefers-reduced-motion: reduce) {  
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ------------------- */
/* Utility classes     */
/* ------------------- */

/* general */

.flex {
    display: flex;
    gap: var(--gap, 1rem);
}

.grid {
    display: grid;
    gap: var(--gap, 1rem);
}

.flow > *:not(:first-child) {
    margin-top: var(--flow-space, 1rem);
    /*outline: 1px solid red;*/
}

.container {
    padding-inline: 2rem;
    max-width: 200rem;
    margin-inline: auto;
    min-height: 100vh;
}

/* For screen reader */
.sr-only {
  position: absolute; 
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px; 
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap; /* added line */
  border: 0;
}

.hidden {
    visibility: hidden;
}

/* Colors */
.bg-dark {background-color: rgb(var(--clr-dark)); }
.bg-dark-accent {background-color: rgb(var(--clr-dark-accent)); }
.bg-dark-button {background-color: rgb(var(--clr-dark-button)); }
.bg-correct {background-color: rgb(var(--clr-correct)); }
.bg-shuffled {background-color: rgb(var(--clr-shuffled)); }
.bg-title {background-color: rgb(var(--clr-title)); }
.bg-light {background-color: rgb(var(--clr-light)); }

.text-dark {color: rgb(var(--clr-dark)); }
.text-correct {color: rgb(var(--clr-correct)); }
.text-shuffled {color: rgb(var(--clr-shuffled)); }
.text-title {color: rgb(var(--clr-title)); }
.text-light {color: rgb(var(--clr-light)); }

.border-dark {border: var(--tile-border) solid rgb(var(--clr-dark)); }
.border-correct {border: var(--tile-border) solid rgb(var(--clr-correct)); }
.border-shuffled {border: var(--tile-border) solid rgb(var(--clr-shuffled)); }
.border-title {border: var(--tile-border) solid rgb(var(--clr-title)); }
.border-light {border: var(--tile-border) solid rgb(var(--clr-light)); }

.uppercase { text-transform: uppercase; }

/* Fonts */
.fs-900 { font-size: var(--fs-900); }
.fs-800 { font-size: var(--fs-800); }
.fs-700 { font-size: var(--fs-700); }
.fs-600 { font-size: var(--fs-600); }
.fs-500 { font-size: var(--fs-500); }
.fs-450 { font-size: var(--fs-450); }
.fs-400 { font-size: var(--fs-400); }
.fs-300 { font-size: var(--fs-300); }
.fs-200 { font-size: var(--fs-200); }

.ff-serif { font-family: var(--ff-serif); } 
.ff-sans { font-family: var(--ff-sans); } 


/* Examples */
.example-transparent { background-color: rgba(var(--clr-correct), 0.5); }
.numbered-title {
    color: rgb(var(--clr-title));
    font-size: var(--fs-600);
    padding-top: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.1rem;
    margin-bottom: 1rem;
}

.numbered-title span {
    color: rgba(var(--clr-light), 0.5);
    margin-right: .5em;
}


/* --------------------------------------------*/
/* Components                                  */
/* --------------------------------------------*/

.large-button {
    color: rgb(var(--clr-light));

    position: relative;
    display:  flex;
    border-radius: 0.6em;
    padding: 0.3em;
    text-decoration: none;
    aspect-ratio: 2;
    z-index: 1;

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

    border-style: outset;
    border-width: 0.5rem;
    border-color: rgb(var(--clr-light));

    background-color: rgb(var(--clr-dark-button));
}

/*
.large-button:hover {
    border: 0.7em solid white;
}*/


.large-button::after {
    content:  '';
    position: absolute;
    background: rgba(var(--clr-shuffled), 0.9);
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: inherit;
    padding: 0.6em;
    z-index: -1;
    opacity: 0;
    transition: opacity 500ms ease-out, transform 500ms ease-out;
}

 /* NOTE: Animate on transforms, not width and height to avoid page reflow */
.large-button:hover::after {
    opacity: 0.5;
    transform: scale(1.5); 
}


.primary-navigation {
    list-style: none;
    padding:  0;
    margin: 0;
    --gap: 4rem;
}

.primary-navigation a {
    text-decoration: none;
    text-transform: uppercase;
}

.underline-indicators {
}

.underline-indicators > * {
    padding:  0.5em 0;
    border-bottom: .2rem solid rgb(var(--clr-light));
}

.underline-indicators > *:hover {
    border-color:  rgb(var(--clr-shuffled));
}

.underline-indicators > *.active {
    border-color: rgb(var(--clr-correct));
}

/* --------------------------------------------*/
/* Moojestic                                   */
/* --------------------------------------------*/
button.large-button {
    padding: 0em 3rem;
    border-radius: 20%;
    border-width: 8px;
    border: 10px solid rgb(--clr-title);
}

#answer-input {
    background-color: rgb(var(--clr-dark-accent));
    padding: 1rem;
    color:  rgb(var(--clr-title));
    border: 0.2em solid rgb(var(--clr-title));
    border-radius: 1em;
    font-size: var(--fs-600);
    font-family: var(--ff-serif);
    text-transform: uppercase;
    letter-spacing: 1.5rem;
    min-width: 12em;
    text-align: center;
}

#answer-input.solved {
    color:  rgb(var(--clr-correct));
    border: 0.2em solid rgb(var(--clr-correct));
}

.answer-box {
    background-color: rgb(var(--clr-dark-accent));
    color:  rgb(var(--clr-title));
    border: 0.1em solid rgb(var(--clr-title));
    border-radius: 0.25em;

    width: 1.25em;
    height: 1.5em;
    vertical-align: middle;
    text-align: center;

    font-size: var(--fs-700);
    font-family: var(--ff-serif);
    text-transform: uppercase;

    padding: 0;//Or letters don't show up on safari!
}

.solved > .answer-box {
    color:  rgb(var(--clr-correct));
    border: 0.1em solid rgb(var(--clr-correct));
}

h1 {
    font-size: var(--fs-800);
}

p#feedback {
    font-size: var(--fs-600);
}



h1, h2, h3 {
    color:  rgb(var(--clr-title));    
    font-family: var(--ff-serif);
}

h2 {
    font-size: var(--fs-700);
}

.tile-font { 
    font-size: var(--fs-500); 
    font-family: var(--ff-serif);
}

.letter {
    position: relative;
    font-size: var(--fs-700);
    font-family: var(--ff-serif);
    text-transform: uppercase;
}

.tile {
    color: rgb(var(--clr-dark));
    border-radius: 0.25em;
    width: 1.25em;
    height: 1.5em;
    vertical-align: middle;
    text-align: center;
}

.word {
    display: flex;
    margin: 0.9em 0.5em;
}

.answer-grid {
    --gap: 0.0em;
}

.answer-row {
    --gap: 0.25em;
}

.answer {
    border-radius: 0.25em;
    font-weight: bolder;
}

.correct {
    background-color: rgb(var(--clr-correct));
}

.shuffled {
    background-color: rgb(var(--clr-shuffled));
}

.letter > .answer {
    position: absolute;
    font-size: var(--fs-400);
    top: calc(var(--tile-border) * -1);
    left: calc(var(--tile-border) * -1);
    vertical-align: middle;
    padding: 0.1em;
}

.margin-in {
    margin: 1rem 5rem;
}

.margin-top {
    margin-top: 5rem;
}

.top-nav {
    margin: 1rem;
}



.title-bar {
    /*outline: 1px solid yellow;*/
}

#date {
    margin-top: 0em;
}

#puzzle {
    --gap: 1.0rem;
    /*zoom: 0.7;*/ /*Desktop - Landscape*/
    /*zoom: 1.3;*/ /*Phone*/
}

.demo {
    font-family: var(--ff-serif);
    font-size: 1.4em;
    font-weight: bolder;
}

.demo.single {
   border: 1px solid rgb(var(--clr-light)); 
   padding: 0.05em;
   background-color: rgb(var(--clr-dark-accent));
}

.error {
    background-color: rgba(255, 0, 0, 0.3) !important;
}

    @media screen and (orientation: portrait) {
        body {
            zoom: 1.4;
        }
        p {
            font-size: var(--fs-400);
        }
      }

    @media screen and (orientation: landscape) {
        body {
            zoom: 0.7;
        }
        p {
            font-size: var(--fs-600);
        }
    }

#date {
    /*border-bottom: .2rem solid rgb(var(--clr-light));*/
    text-decoration: underline;
}    


#available-area {
    right:  20px;
    margin-top: 30px;
    /*position: fixed;*/
}

.available-yes,
.available-no {
    border-radius: 0.35em;
    border: solid red 3px;
    padding: 0.15em;
    aspect-ratio: 2;
    margin: 0.1em;
    text-transform: uppercase;

    vertical-align: middle;
    text-align: center;
}

.available-yes {
    border-color: rgb(var(--clr-available-yes));
    background-color: rgb(var(--clr-available-yes-bg));
    color:  rgb(var(--clr-available-yes));
}

.available-no {
    border-color: rgb(var(--clr-available-no));
    background-color: rgb(var(--clr-available-no-bg));
    color: rgb(var(--clr-available-no));
}

.available-area-on {
}

.available-area-off {
    visibility: hidden;
}

/**  Difficulty  */
.star {
    color:  rgb(var(--clr-title));
    font-size: var(--fs-700);
    /*content:  &#9733;*/
    content: "*";
}

/* Mark the puzzle area and answer area as relative, so we can try to put a canvas over it! */
#game-area {
    position: relative;
}



#victory-canvas {
    position: absolute;
    bottom: 0px;
    left: 0px;
    pointer-events: none;
}

#victory-canvas.show-victory {
    width: 100%;
    height: 100%;
}