:root {
  --game-green: #142A26;
  --game-yellow: #FFFE96;
  --game-black: #000000;
  --game-white: #FFFFFF;
  --game-red: #dd7e6bff;
  --game-border-radius: 8px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-family: "Noto Sans", sans-serif;
  font-size: 16px;
  width: 100%;
  scroll-behavior: smooth;
}

body {
  font-size: 16px;
  width: 100%;
  background-color: var(--secondary-color);
  color: var(--game-green);
}

body.fade-out {
  animation: fade-out .25s ease-out forwards;
}

/* Hide scrollbar for Chrome, Safari and Opera */
body::-webkit-scrollbar {
  display: none;
}

body.dark-mode {
  color: var(--secondary-color);
  background-color: #495a49;
}

body.dark-mode a {
  color: var(--secondary-color);
}

body.dark-mode .square {
  background-color: var(--secondary-color);
  transition: 0.5s ease-out;
}

main {
  margin: 0 auto;
  position: relative;
}

header {
  .logo-link {
    text-align: left;
    text-decoration: none;
    img {
      max-width: 80px;
      height: auto;
      display: block;
    }
  }
}

footer {
  padding: 2em 0;
}

footer ul {
  display: flex;
  gap: 2rem;
  width: 80vw;
  margin: 0 auto;
  align-items: center;
  justify-content: center;
}

footer {
  svg {
    width: 30px;
    height: 30px;
  }
}

ul,
ol {
  padding: 1rem 0;
  list-style-type: none;
}

ol li,
ul li {
  margin: 0 0.5rem;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: serif;
  color: var(--game-green);
}

h1 {
  margin-bottom: 1rem;
}

h2,
h3,
h4,
h5 {
  margin-bottom: 1rem;
}

h3 {
  font-size: 1.65rem;
  margin-bottom: 0.5rem;
}

p {
  line-height: 1.5;
  margin-bottom: 1rem;
}

hr {
  margin: 1rem 0;
  border-color: var(--game-green);
}

.bold {
  font-weight: bold;
}

.italic {
  font-style: italic;
}

.underline {
  text-decoration: underline;
}

.code {
  font-family: monospace;
}

.title {
  font-family: serif;
  text-transform: uppercase;
  font-style: italic;
  font-weight: 500;
}


/* game page styles */
body.game-page {
  background: #f7f5ed;
  color: var(--game-green);
  font-size: 1rem;
  animation: none;
  scrollbar-width: auto;

  &::-webkit-scrollbar {
    display: block;
  }

  [hidden] {
    display: none !important;
  }

  .game-shell {
    width: min(100% - 2rem, 640px);
    padding: 1rem 0;
    text-align: center;
  }

  h1 {
    font-size: 1.5rem;
    width: 100px;
    line-height: .7;
    margin: 0;
    font-weight: bold;
  }

  h2 {
    &:focus {
      outline: none;
    }
  }

  .game-date {
    margin-bottom: 1.5rem;
  }

  #game-container {
    border: 3px solid var(--game-green);
    background: white;
    padding: clamp(1rem, 4vw, 2rem);
    border-radius: 8px;
    min-height: 400px;
  }

  button,
  input,
  textarea {
    font: inherit;
  }

  button {
    border: 2px solid var(--game-green);
    border-radius: 2rem;
    background: var(--game-green);
    color: var(--game-yellow);
    text-transform: uppercase;
    padding: 5px 1rem;
    cursor: pointer;
    font-style: italic;
    font-weight: 600;
    font-family: 'PT Sans', sans-serif;

    &.simple-button {
      border: none;
      border-radius: 0;
      background: transparent;
      color: var(--game-black);
      text-transform: none;
      padding: 0;
      cursor: pointer;
      font-style: italic;
      font-weight: 300;
      font-family: 'PT Sans', sans-serif;
    }
  }

  button:hover {
    filter: brightness(1.15);
  }

  :focus-visible {
    outline: 3px solid var(--game-yellow);
  }

  .secondary-button {
    background: white;
    color: var(--game-green);
  }


    .give-up-button {
      border-color: var(--game-green);
      color: var(--game-green);
      background: var(--game-red);
    }

  .game-toolbar,
  .game-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
  }

  .game-clock {
    font-variant-numeric: tabular-nums;
  }

  #game-clock {
    background-color: var(--game-green);
    border-radius: var(--game-border-radius);    
    padding: 5px 1rem;
    color: var(--game-yellow);
    font-weight: bold;
    margin-left: 5px;
  }

  label {
    display: block;
    text-align: left;
    margin-bottom: 0.5rem;
  }

  input,
  textarea {
    width: 100%;
    padding: 0.85rem;
    background: #eee;
    color: var(--game-green);
    border: 1px solid #888;
    border-radius: calc(var(--game-border-radius) - 2px);
    outline: none;
  }

  .logo-frame {
    border: 1px solid var(--game-green);
    border-radius: var(--game-border-radius);
    background: white;
    margin-top: 1rem;
    aspect-ratio: 1 / 1;
    padding: 0.5rem;
    display: grid;
    place-items: center;
    max-width: 200px;
    margin: 1rem auto;
  }

  .logo-frame img {
    width: 100%;
    height: 100%;
    min-height: 0;
    object-fit: contain;
  }

  #start-screen {
    padding-top: 1rem;
    h1 {
      text-align: center;
      margin: 0 auto 1rem;
    }
    #start-title {
      font-size: 1.25rem;
      line-height: 1.5;
    }
  }

  .game-progress {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 1rem 0;
  }

  .progress-circle {
    width: 24px;
    height: 24px;
    min-height: 24px;
    padding: 0;
    border-radius: 50%;
    border: 2px solid var(--game-yellow);
    background: var(--game-yellow);
  }

  .progress-circle.is-current {
    border-color: var(--game-green);
  }

  .progress-circle.is-correct {
    border-color: var(--game-green);
    background: var(--game-green);
    cursor: default;
  }

  #result-screen {

  }

  .game-recap {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 0 0 1rem;
  }

  .game-recap li {
    margin: 0;
    padding: 0.75rem;
    overflow-wrap: anywhere;
  }

  .game-recap img {
    height: 110px;
    object-fit: contain;
    margin-bottom: 0.75rem;
    border: 1px solid var(--game-green);
  }

  .game-recap p {
    margin: 0;
  }

  #share-status {
    margin-top: 1rem;
  }

  #share-text {
    min-height: 8rem;
  }

  .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  input.correct {
    border-color: green;
    color: black;
  }
}

/* helpers */
/* Base grid container styles */
.grid-container {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(var(--grid-cols-mobile, 1), 1fr);
}

@media (min-width: 720px) {
  .grid-container {
    grid-template-columns: repeat(var(--grid-cols-tablet), 1fr);
  }
}

/* Media query for desktop */
@media (min-width: 1080px) {
  .grid-container {
    grid-template-columns: repeat(var(--grid-cols-desktop), 1fr);
  }
}

/* Grid column variants with tablet support */
.cols-1-1-1 {
  --grid-cols-mobile: 1;
  --grid-cols-tablet: 1;
  --grid-cols-desktop: 1;
}

.cols-1-2-2 {
  --grid-cols-mobile: 1;
  --grid-cols-tablet: 2;
  --grid-cols-desktop: 2;
}

.cols-1-2-3 {
  --grid-cols-mobile: 1;
  --grid-cols-tablet: 2;
  --grid-cols-desktop: 3;
}

.cols-1-2-4 {
  --grid-cols-mobile: 1;
  --grid-cols-tablet: 2;
  --grid-cols-desktop: 4;
}

.cols-2-3-4 {
  --grid-cols-mobile: 2;
  --grid-cols-tablet: 3;
  --grid-cols-desktop: 4;
}

.cols-2-3-6 {
  --grid-cols-mobile: 2;
  --grid-cols-tablet: 3;
  --grid-cols-desktop: 6;
}

.flex {
  display: flex;
  &.jcsb {
    justify-content: space-between;
  }
}


/* mobile and tablet */


/* animations */
@keyframes fade-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes fade-out {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
  }
}