@import './colors.css';

@font-face {
  font-family: 'SofiaSans';
  src: url('fonts/SofiaSans-VariableFont_wght.ttf') format('truetype');
  font-weight: 100 900;
  font-stretch: 75% 125%;
}

* {
  box-sizing: border-box;
}

/* Breakpoints
~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
:root {
 --bp-tab: 768px;
 --bp-desk: 1024px;
}

/* Typography
~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
body {
  --font-xs: 0.875rem;
  --font-sm: 1rem;
  --font-md: 1.125rem;
  --font-lg: 1.333rem;
  --font-xl: 1.75rem;
  --font-2xl: 2rem;
  --font-3xl: 3rem;
}

/* Setup
~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/

body {
  font-size: 10px;
  font-family: 'SofiaSans', 'Helvetica', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  background-color: var(--main-background-color);
  height: 100vh;
}

main {
  /* display: flex; */
  /* flex-direction: column; */
  margin: 0 auto;
}

.logo__wrapper {
  text-align: center;
  margin: 0 auto;

  @media screen and (min-width: 768px) {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
  }

}

.logo {
  max-width: 328px;
}

.logo path {
  fill: var(--primary-700);

}

.tagline {
  color: var(--primary-500);
  font-size: var(--font-md);
  font-weight: 300;
  margin: -0.5rem auto 0.75rem;
  text-transform: uppercase;

  @media screen and (min-width: 768px) {
    margin-bottom: 0;
  }
}

main {
  position: relative;
}


button {
  background-color: var(--button-bg);
  border: 2px solid var(--button-border-color);
  /* border: 0; */
  border-radius: 0.2em;
  color: var(--button-text-color);
  font-family: 'SofiaSans';
  font-size: var(--font-sm);
  font-weight: 300;
  padding: .75em 0.8em;
  width: 6.4rem;

  @media screen and (min-width: 480px) {
    font-size: var(--font-md);
    padding: 1em 1.2em;
    min-width: 7.6em;
  }
}

button:hover {
  background-color: var(--button-bg-hover);
  color: var(--main-background-color);
}

button:active {
  background-color: var(--button-bg-active);
  border-color: var(--button-bg-active);
}


h2 {
  font-size: var(--font-xl);
}

.sr-only {
  position:absolute;
  left:-10000px;
  top:auto;
  font-size: 1px;
}

.container {
  max-width: fit-content;
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin: 0 auto;
}

.scoreboard {
  display: flex;
  flex-wrap: wrap;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--scoreboard-border-color);
  border-radius: .25rem;
  font-family: 'SofiaSans';
  padding: 0.8rem 1rem;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 1.5rem;
  gap: .5rem;
  width: 100%;
  max-width: 348px;

  @media (min-width: 480px) {
    max-width: 460px;
  }

  @media (min-width: 640px) {
    flex-direction: row;
    margin: auto auto 2.4rem auto;
    padding: 0.8rem 1.6rem;
    max-width: 624px;
  }

}

.scoreboard__item {
  display: flex;

  @media (min-width: 640px) {
    display: block;
  }
}

.scoreboard__item:nth-of-type(2) {
  text-align: center;
  flex-grow: 1;
}

.scoreboard__item:nth-of-type(3) {
  text-align: right;
}

.scoreboard__label {
  font-size: var(--font-md);
  font-weight: 400;
  margin: 0;
}

.scoreboard__value {
  font-size: var(--font-md);
  margin-top: 0;
  margin-bottom: 0;
  font-weight: 200;

  @media screen and (min-width: 640px) {
    font-size: var(--font-xl);
  }
}

.scoreboard__score .scoreboard__value {
  display: inline-block;
  width: 6ch;
}

.scoreboard__label {
  color: var(--scoreboard-label-color);
}

.scoreboard__value {
  color: var(--scoreboard-value-color);

  @media screen and (min-width:480px) {
    transition: transform 500ms ease;
  }
}

.scoreboard__colon {
  padding-right: 0.25rem;

  @media screen and (min-width: 640px) {
    display: none;
  }
}

.scoreboard__value__container {
  @media screen and (min-width: 640px) {
    min-height: 2rem;
    overflow: hidden;
    position: relative;
    display: flex;
  }
}

.container--center {
  @media screen and (min-width: 640px) {
    justify-content: center;
  }
}

.container--right {
  @media screen and (min-width: 640px) {
    justify-content: right;
    min-width: 3ch;
  }
}

.scoreboard__value__container  .scoreboard__value{
  position: absolute;
}

.value--current {
  transform: translate(0);
}

.slide-out--up {
  @media screen and (min-width:480px) {
    transform: translateY(100%);
  }
}

.slide-in--up {
  @media screen and (min-width:480px) {
    transform: translateY(-100%);
  }
}

.slide-out--left {
  @media screen and (min-width:480px) {
    transform: translateX(100%);
  }
}

.slide-in--left {
  @media screen and (min-width:480px) {
    transform: translateX(-130%);
  }
}

.board {
  position: relative;
  transition: transform 500ms ease-in-out;

  width: 100%;

  display: grid;
  grid-template-columns: repeat(3, auto);
  justify-content: center;
  gap: 1.2rem;

  @media screen and (min-width:480px) {
    gap: 1.6rem;
  }

  @media screen and (min-width:640px) {
    grid-template-columns: repeat(4, auto);
  }
}

.board button:last-of-type {
  display: none;

  @media screen and (min-width:640px) {
    display: block;
  }
}

.composite-transform {
  --translateX: 0%;
  --translateY: 0%;
  --scale-factor: 100%;
  --rotate-angle: 0deg;
  transform:
    translate(var(--translateX), var(--translateY))
    scale(var(--scale-factor))
    rotate(var(--rotate-angle))
}

.row {
  max-width: max-content;
}

.absolute {
  position: absolute;
}

.boardTranslate {
  transform: translate(50%) scale(-1);
}

/* Mode Helpers
~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/

body:has(.cursorless),
.cursorless
.cursorless button {
  cursor: none;
}

.transition--500 {
  transition: all 500ms ease
}

.poof {
  /* transform: scale(0); */
  --scale-factor: 0;
  opacity: 0;
}

.focus-container {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  transfrom: translateY(-3%);
}

.scatter {
  --translateX: 0%;
  --translateY: -25%;
  justify-content: space-around;
  align-items: center;
  height: 100vh;
}

.timer {
  flex-basis: 100%;
  text-align: center;
  margin-bottom: 1rem;
}

.timer p {
  font-size: var(--font-md);
  color: var(--main-background-color);
  background-color: var(--grey-800);
  max-width: max-content;
  margin: 0 auto;
  padding: 1rem;
  /* border: 0.25rem solid; */
  border-radius: 3rem;
  border: 2px solid #90d7c9;
  /* border-image: linear-gradient(90deg, green 50%, red 50%, red 100%) 0.25rem; */
}


/* Modes
~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
.alice button:first-of-type {
  background-color: var(--alice-red-1);
  border-color: var(--alice-red-1);
  margin-right: 1rem;
}

.alice button:first-of-type:hover {
  background-color: var(--alice-red-2);
  border-color: var(--alice-red-2);
}

.alice button:first-of-type:active {
  background-color: var(--alice-red-3);
  border-color: var(--alice-red-3);
}

.alice button:last-of-type {
  background-color: var(--alice-blue-1);
  border-color: var(--alice-blue-1);
}

.alice button:last-of-type:hover {
  background-color: var(--alice-blue-2);
  border-color: var(--alice-blue-2);
}

.alice button:last-of-type:active {
  background-color: var(--alice-blue-3);
  border-color: var(--alice-blue-3);
}


body:has(.disco) {
  background-color: #FFEADB;
  overflow: hidden;
}

.disco {
  --rotate-angle: 0;
  --transformX: 0;
  --transformY: 0;
}

.discoball {
  position: fixed;
  top: 0;
  left: 85%;
  background: url("./images/DiscoBallChain.svg") transparent;
  background-repeat: no-repeat;
  background-size: 30%;
  width: 50%;
  height: 50%;
  z-index: -99;
}

.disco button {
 border-color: transparent;
}

.disco.disco button:nth-child(12n + 1) {
  background-color: var(--disco-orange-1);
}

.disco button:nth-child(12n + 2) {
  background-color: var(--disco-orange-2);
}

.disco button:nth-child(12n + 3) {
  background-color: var(--disco-orange-3);
}

.disco button:nth-child(12n + 4) {
  background-color:var(--disco-red-1);
}

.disco button:nth-child(12n + 5) {
  background-color: var(--disco-yellow-1);
}

.disco button:nth-child(12n + 6) {
  background-color: var(--disco-yellow-2);
}

.disco button:nth-child(12n + 7) {
  background-color: var(--disco-blue-1);
}

.disco button:nth-child(12n + 8) {
  background-color: var(--disco-blue-2);
}

.disco button:nth-child(12n + 9) {
  background-color: var(--disco-blue-3);
}

.disco button:nth-child(12n + 10) {
  background-color: var(--disco-brown-1);
}

.disco button:nth-child(12n + 11) {
  background-color: var(--disco-brown-2);
}

.disco button:nth-child(12n + 12) {
  background-color: var(--disco-brown-3);
}

.disco button:hover {
  background-color: var(--button-bg-hover);
  color: var(--main-background-color);
}

.disco button:active {
  background-color: var(--button-bg-active);
  border-color: var(--button-bg-active);
}



.customCursor {
  background: url("./images/cursor_flip.svg") transparent;
  height: 24px;
  width: 24px;
  border-radius: 50%;
  position: abosolute;
  z-index: 500;
}

.flashlight {
  background-color: black;
  position: fixed;
  top: 0;
  left: 0;
  width: 300vw;
  height: 300vh;
  z-index: 1000;
  pointer-events:none;
  mask-image: radial-gradient(
    circle,
    transparent 2%,
    rgba(0, 0, 0, 0.45) 4%,
    rgba(0, 0, 0, 0.65) 5%,
    rgba(0, 0, 0, 0.95) 6%,
    black 9%
    );
}

.cursors {
  background: url("./images/cursors.svg");
  width: 500vw;
  height: 500vh;
  position: fixed;
  z-index: 1000;
  pointer-events:none;
}

.huge {
  --scale-factor: 500%;
  /* --translateX: 50%; */
  /* --translateY: 200%; */
  transform-origin: top left;
  margin: 0;
  justify-content: start;
}

.mini {
  --scale-factor: 9%;
  transform-origin: 53% top;
  margin: 0;
  justify-content: start;
}

.mini button {
  margin: 1.2rem;
}

.rotated {
  --rotate-angle: var(--random-angle);
}

.stack {
  --button-border-color: var(--main-background-color);
}

.stack button {
  transition: transform 500ms ease-in-out;

}

.party button {
  background-color: var(--party-1);
  border-color: var(--party-1);
  animation: partycolors 2.5s infinite;
  animation-iteration-count: 2;
}

.party button:hover {
  background-color: var(--button-bg-hover);
}


@keyframes partycolors {
  0% {
    background-color: var(--party-1);
    border-color: var(--party-1);
  }

  12.5% {
    background-color: var(--party-2);
    border-color: var(--party-2);
  }

  25% {
    background-color: var(--party-3);
    border-color: var(--party-3);
  }

  37.5% {
    background-color: var(--party-4);
    border-color: var(--party-4);
  }

  50% {
    background-color: var(--party-5);
    border-color: var(--party-5);
  }

  62.5% {
    background-color: var(--party-6);
    border-color: var(--party-6);
  }

  75% {
    background-color: var(--party-7);
    border-color: var(--party-7);
  }

  87.5% {
    background-color: var(--party-8);
    border-color: var(--party-8);
  }

  100% {
    background-color: var(--party-1);
    border-color: var(--party-1);
  }

}

.very-light button {
  border: rgba(252, 252, 252, .5);
  /* background-color: var(--main-background-color); */
  background-color: rgba(250, 250, 250, .75);
  color: rgba(252, 252, 252, .5);
  opacity: 0.35;
  transition: opacity 400ms ease;
}

.very-light .very-light--focused,
.very-light button:hover {
  border: rgba(240, 240, 240, .5);
  background-color: rgba(250, 250, 250, .75);
  color: rgba(200, 200, 200, .5);
  opacity: 0.9;
}

.forest .very-light button {
  background-color: rgba(252, 252, 252, .38);
}


.scroll__outer {
  width: 360px;
  height: 50vh;
  border: 1px solid #DA1A81;
  border-radius: 8px;
  overflow-y: scroll;
}

.scroll__inner {
  /* background: repeating-linear-gradient(45deg, #606dbc, #606dbc 10px, #465298 10px, #465298 20px); */
  /* background: repeating-linear-gradient( */
  /* #b393d3 0px, */
  /* #b393d3 200px, */
  /* #301934 200px, */
  /* #301934 205px, */
  /* #b393d3 205px, */
  /* #b393d3 405px */
  /* ); */
  background:
    repeating-linear-gradient(
    to bottom,
    #333333 0px,
    #333333 5px,
    transparent 5px,
    transparent 255px
    ),
    linear-gradient(
    to bottom,
    #F864D6 0%,
    #FA7F7F 25%,
    #48DEFD 75%,
    #FFC711 100%
    );
  height: 8000vh;
}

.fortune__board {
  --square-size: 50px;

  @media screen and (min-width: 768px) {
    --square-size: 80px;
  }

  display: grid;
  grid-template-columns: repeat(6, var(--square-size));
  grid-template-rows: repeat(5, var(--square-size));
  grid-gap: 4px;

}

.fortune__square {
  width: var(--square-size);
  height: var(--square-size);
  background-color: var(--primary-800);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  font-size: 1.125rem;
}

.fortune__square--focus {
  background-color: var(--primary-500);
  border: 4px dotted var(--primary-400);
  box-shadow: 1px 1px 8px 2px var(--primary-500)

}

.fortune__button {
  box-sizing: border-box;
  /* width: 100px; */
  /* height: auto; */
  padding: 1.25rem;
  background-color: rgba(170, 21, 21, 1);
  border-color: rgba(170, 21, 21, 1);
  grid-area: 3 / 3 / span 1 / span 2;
  justify-self: center;
  margin: 0;
  align-self: center;
  box-shadow: 2px 2px 8px rgba(145, 15, 15, 0.37);
  border-radius: 50%;
}

@media screen and (min-width: 768px) {
  .fortune__button {
    padding: 2.25rem;
  }
}

.fortune__button:focus,
.fortune__button:hover {
  background-color: rgba(160, 20, 20, 1);
  border-color: rgba(160, 20, 20, 1);
  box-shadow: 3px 3px 12px rgba(170, 21, 21, 0.25);
}

.fortune__button:active {
  background-color: rgba(140, 15, 15, 1);
  border-color: rgba(140, 15, 15, 1);
  box-shadow: 0px 0px 0px rgba(170, 21, 21, 0.0);
}

.reset-transform {
  --translateX: 0%;
  --translateY: 0%;
  --scale-factor: 100%;
  --rotate-angle: 0deg;
}

.webdings button {
  font-family: "Webdings";
  font-size: 0.9rem;
}


/* Game Over
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/

.gameover-overlay {
  position: fixed;
  background-color: rgba(0, 0, 0, .95);
  display:flex;
  z-index: 9999;
  height: 100svh;
  width: 100vw;
  justify-content: center;
  align-items: center;
  top: -1000px;
  opacity: 0;
  transition: top 600ms, opacity 600ms;
  transition-behavior: allow-discrete;
}

.gameover__main {
  font-size: var(--font-lg);
  min-width: 360px;
  max-width: 420px;
  background-color: var(--main-background-color);
  border: 0.25rem solid var(--primary-700);
  border-radius: 1.0rem;
  padding: 1.5rem;
  font-weight: 300;
  color: var(--grey-800);
}

.gameover__title {
  font-size: var(--font-3xl);
  color: var(--primary-800);
  margin: 0;
}

.gameover__reason {
  margin-bottom: 1rem;
}

.gameover__score {
  font-weight: 500;
  font-size: var(--font-2xl);
  color: var(--primary-600);
  margin-top: 0;
  margin-bottom: 1rem;
}

.gameover__main h3 {
  color: var(--primary-800);
  font-size: var(--font-lg);
  font-weight: 500;
  margin-top: 0;
  margin-bottom: 0.75rem;
}

.gameover__subtitle {
  border-top: 2px var(--primary-800) dotted;
  padding-top: 0.75rem;
  margin-bottom: 0.75rem;
}

.gameover__subtitle--noborder {
  border: 0;
}

.gameover__modelist__count {
  font-weight: 500;
  color: var(--primary-600);
}

.gameover__modename {
  margin-bottom: 2px;
  break-inside: avoid-column;
}

.gameover__close-btn {
  margin: 1rem 0 ;
  padding: .8rem 1rem;
}

/* @starting-style { */
/*  .gameover-overlay { */
/*     top: -1000px; */
/*     opacity: 0; */
/*     /* display: none; */ */
/*   } */
/* } */

.gameover-overlay[aria-hidden="true"] {
  top: -1000px;
  opacity: 0;
  /* display: none; */
}

.gameover-overlay[aria-hidden="false"] {
  top: 0;
  opacity: 1;
  display: flex;
}

.gameover__list {
  padding-left: 1.25rem;
  margin-top: 0;
  font-size: var(--font-md);
}

.gameover__scoring {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.gameover__superScore {
  background: radial-gradient(circle, var(--primary-500) 40%, var(--primary-800));
  color: var(--main-background-color);
  font-size: var(--font-lg);
  margin-top: 0;
  margin-bottom: 1rem;
  padding: 0.125rem 0.5rem;
  text-align: center;
}

.gameover__leaderboard__scores {
  display: flex;
  gap: 1.5rem;
}

.gameover__leaderboard__scores ol {
  flex: 1;
  margin: 0;
}

.gameover__leaderboard__scores li {
  margin-bottom: 0.25rem;
}

.gameover__leaderboard__scores li::marker {
  color: var(--primary-500);
  font-size: 1rem;
  font-weight: 500;
}

.no-transition {
  transition: none;
}


/* Utilities
~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
.hidden {
  display: none;
}

.opacity-0 {
  opacity: 0;
}

.opacity-1 {
  opacity: 1;
}

.gameover__modelist__title {
  margin-bottom: 0.25rem;
}

.ball {
  position: absolute;
  top: 90px;
  left: 90px;
  width: 20px;
  height: 20px;
  background: green;
  border-radius: 100%;
}

.two-column {
  columns: 2;
  column-gap: 2rem;
}

.no-margin-bottom.no-margin-bottom {
  margin-bottom: 0;
}

.bold {
  font-weight: 700;
}
