@font-face {
  font-display: swap;
  font-family: NanumPenScript;
  src: url('assets/fonts/NanumPenScript.woff2') format('woff2');
}

:root {
  --primary: #00366f;
  --secondary: #fbf8f6;
  --tertiary: #efecea;
  --toggle: #b7b5b3;
  --secret: #007111;
  --dk-primary: #e5e2e0;
  --dk-secondary: #1e1e1d;
  --dk-tertiary: #2a2a29;
  --dk-toggle: #626261;
  --dk-secret: #d642bd;
  --victory: #059900;
  --defeat: #990002;

  font-family: NanumPenScript, cursive;
  scroll-behavior: smooth;
  accent-color: var(--primary);
  background: var(--secondary);
  color: var(--primary);
  width: 100%;
  margin: 0;
}

body {
  margin: 0;
  display: flex;
  text-align: center;
  box-sizing: border-box;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100svh;
  user-select: none;

  & main {
    flex: 1;
    display: inherit;
    align-items: center;
    flex-direction: column;
    justify-content: center;
  }
}

button {
  font-family: NanumPenScript, cursive;
  font-weight: bold;
  outline: none;
  border: 0;
}

header {
  display: inherit;
  flex-direction: column;
  align-items: center;
  margin-top: 1em;

  & h1 {
    font-size: 4em;
    line-height: 0;
  }
}

section {
  display: inherit;
  flex-direction: row;
  gap: 1em;
}

h1 > span, #switch > p,
#game-rules > span, .ls {
  color: var(--secret) !important;
}

.gesture:hover, .restart:hover, .settings-btn:hover,
footer > a:hover, label:not(#slider):hover {
  filter: saturate(3);
  cursor: pointer;
}

.gesture:active, .restart:active,
footer > a:active {
  filter: grayscale(.75);
}

/* Color Theme */
.dark {
  --primary: var(--dk-primary);
  --secondary: var(--dk-secondary);
  --tertiary: var(--dk-tertiary);
  --toggle: var(--dk-toggle);
  --secret: var(--dk-secret);
}

.white {
  filter: contrast(0) brightness(1.6) !important;
}

.white:not(img):hover {
  filter: contrast(0) brightness(2) !important;
}

.white:not(img, .settings-btn):active {
  filter: contrast(0) brightness(.8) !important;
}

.pink {
  filter: hue-rotate(88deg) saturate(.75) brightness(2.1);
}

.green {
  filter: hue-rotate(-81deg) brightness(1.59);
}

.hide {
  position: absolute;
  visibility: hidden;
  width: 0;
  height: 0;
}

/* Dropdown */
.drop {
  width: 2em;
  height: 2em;
  display: inherit;
  align-items: center;
  padding-bottom: 1.5em;
  justify-content: center;
}

.drop-btn, .settings-btn {
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: none;
}

.drop:hover .drop-btn {
  background: var(--tertiary);
}

.drop-btn > img,
#theme-img, #volume-img {
  font-size: 22px;
  width: 1em;
  height: 1em;
}

.drop > span {
  width: 0;
  height: 0;
  visibility: hidden;
}

.drop:hover #game-rules,
.drop:hover #settings {
  visibility: visible;
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  top: 9em;
  width: 9.125rem;
  height: min-content;
  padding: 1rem 12px;
  border-radius: 1em;
  font-size: 17px;
  font-weight: bold;
  line-height: 22px;
  box-shadow: 0 0 2px var(--primary);
  background: var(--tertiary);
  opacity: 0.98;
  z-index: 1;
}

/* Settings */
.drop:hover #settings {
  width: fit-content;
}

#settings > span:nth-child(1) {
  display: inherit;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
  width: 100%;
  gap: 1rem;
}

#settings > span:nth-child(2) {
  width: 100%;
  font-size: 20px;
  text-align: left;
  line-height: 28px;
  margin-bottom: 1rem;
  margin-right: -.25rem;

  & input {
    cursor: pointer;
  }
}

/* Switch */
#switch {
  font-size: 24px;
  cursor: default;
  display: flex;
  align-items: center;
  width: fit-content;
  height: 1em;
  gap: 6px;
}

#toggle {
  position: absolute;
  visibility: hidden;
}

#slider {
  width: 2em;
  height: 24px;
  cursor: pointer;
  position: relative;
  border-radius: 12px;
  background: var(--toggle);
}

#slider::after {
  content: '';
  top: 4px;
  left: 4px;
  width: 1rem;
  height: 1rem;
  position: absolute;
  border-radius: 1rem;
  background: var(--secondary);
  transition: left .2s, transform .2s;
}

#slider:hover::after {
  background: var(--primary);
}

#toggle:checked + #slider::after {
  left: calc(100% - 4px);
  transform: translateX(-100%);
}

/* Score */
h2 {
  font-size: 2em;
  margin-top: 1rem;
  line-height: 0;
}

h3 {
  font-size: 26px;
}

#score {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: -1em;
  width: 100%;
}

figure {
  font-size: 21px;
  font-weight: bold;
  display: inherit;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: max-content;
  height: fit-content;
  padding: 6px;
  border-radius: 1em;
  gap: 12px;
}

.score-img {
  width: 5rem;
  height: 5rem;
}

/* Gesture Menu */
#gestures {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  width: 22.5em;
  gap: 12px;
}

.gesture {
  font-size: 24px;
  display: inherit;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 4em;
  padding: 6px 1em;
  border-radius: 1em;
  background: none;
  color: inherit;
}

.gesture-img {
  width: 4rem;
  height: 4rem;
}

/* Restart */
.restart {
  width: 5em;
  height: 2em;
  margin-top: 1rem;
  font-size: 20px;
  border-radius: 6px;
  color: var(--primary);
  background: none;
}

.restart > img {
  width: 20px;
  height: 20px;
  vertical-align: top;
}

footer {
  font-size: 18px;
  margin-top: 1em;
  margin-bottom: 1em;
}

footer > a {
  color: inherit;
}

/* Endgame Modal */
#modal {
  visibility: hidden;
  display: flex;
  position: fixed;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
  padding: 100%;
  background: #101010bf;
  z-index: 2;
}

#modal > span {
  user-select: none;
  position: inherit;
  top: calc(50% - 6rem);
  left: calc(50% - 7.5rem);
  display: inherit;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  cursor: default;
  font-size: 44px;
  font-weight: bold;
  width: 9rem;
  height: 8rem;
  padding: 2rem 3rem;
  border-radius: 1rem;
  background: var(--tertiary);
  box-shadow: 0 0 1px 1px var(--primary);
  opacity: 0.98;
}

#modal > span > button {
  font-size: 28px;
}

#modal > span > button > img {
  vertical-align: baseline;
}

@media (hover: none) {
  footer > a:hover,
  label:not(#slider):hover,
  .white:not(img):hover {
    filter: none;
  }

  #slider:hover::after {
    background: var(--secondary);
  }
}
