:root {
  --bg-from: #ff7b00;
  --bg-to: orange;
  --fg: #fff;
  --button-bg: #fff;
  --button-fg: var(--bg-from);
  --button-bg-active: #222;
  --button-fg-active: var(--fg);
  --positive-color: #34d400;
  --negative-color: #de0048;
  --playlist-outline: #38a9fa;

  --round-next: rgba(255, 255, 255, 0.4);
  --round-current: yellow;
  --round-current-outline: black;
  --round-previous: black;
}

[hidden] {
  display: none !important;
}

[data-theme="0"] {
  --bg-from: #ff7b00;
  --bg-to: orange;
}

[data-theme="1"] {
  --bg-from: #03468b;
  --bg-to: #0094ff;
  --playlist-outline: yellow;
}

[data-theme="2"] {
  --bg-from: #50137b;
  --bg-to: #af53d4;
}

[data-theme="3"] {
  --bg-from: #3f4246;
  --bg-to: #6e6771;
}

[data-theme="4"] {
  --bg-from: #14725a;
  --bg-to: #83c5aa;
}

[data-theme="5"] {
  --bg-from: #ae441b;
  --bg-to: #cb6060;
  --positive-color: #2ea500;
  --negative-color: #842200;
}

@keyframes pop-in {
  95% {
    transform: scale(1.1);
  }

  100% {
    transform: scale(1);
  }
}

/* Reset ============ */
* {
  margin: 0;
  box-sizing: border-box;
  -webkit-user-select: none;
  user-select: none;
}

input {
  -webkit-user-select: text;
  user-select: text;
}

audio {
  position: absolute;
  left: -9999px;
  top: -9999px;
}

hr {
  margin: 50px auto;
  width: 50%;
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.4);
}

#app {
  max-width: 800px;
  margin: 0 auto;
}

.error {
  font-size: 18px;
}

.error:before {
  content: "⚠️";
}

.heading {
  text-transform: uppercase;
  font-size: 36px;
  font-weight: 900;
  text-align: center;
  padding: 10px 0;
}

.subheading {
  font-size: 18px;
  margin-top: 20px;
}

p {
  margin-top: 15px;
}

.m0 {
  margin: 0;
}

.mt0 {
  margin-top: 0;
}

.mb0 {
  margin-bottom: 0;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg-from) linear-gradient(var(--bg-from), var(--bg-to))
    no-repeat fixed !important;
}

html {
  min-height: 100vh;
}

body {
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Oxygen,
    Ubuntu,
    Cantarell,
    "Open Sans",
    "Helvetica Neue",
    sans-serif;
  color: var(--fg);
  min-height: 100vh;
}

#app {
  padding: 30px;
  padding-bottom: 150px;
  min-height: 100vh;
}

@media screen and (hover: none) {
  html,
  body,
  #app {
    min-height: -webkit-fill-available;
  }
}

@media screen and (orientation: landscape) and (hover: none) {
  #app {
    padding: max(30px, env(safe-area-inset-top)) env(safe-area-inset-right)
      max(60px, env(safe-area-inset-bottom)) env(safe-area-inset-left);
  }
}

h1 {
  font-size: 70px;
  font-weight: 900;
  text-transform: uppercase;
}

p {
  font-size: 24px;
}

/* Avatar =================== */
.avatar--button {
  border: 0;
  padding: 2px;
  background: 0;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  position: relative;
}

.avatar--detail {
  position: absolute;
  bottom: 0;
  right: 0;
}

/* Players =========================== */
.players {
  display: flex;
  margin-bottom: 10px;
  scroll-snap-type: y mandatory;
}

.player {
  scroll-snap-align: start;
}

@media screen and (orientation: landscape) and (hover: none) {
  .players {
    zoom: 0.7;
  }
}

.player .avatar {
  width: 60px;
  height: 60px;
}

.player--avatar-wrapper {
  position: relative;
  margin-top: 25px;
}

.player {
  display: inline-block;
  position: relative;
}

.player--container {
  display: flex;
  flex-direction: row;
  align-items: center;
}

.player--name {
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100px;
  line-height: 1.1;
}

.player--score {
  font-weight: 600;
  font-size: 30px;
  line-height: 1;
}

.player--info {
  margin-top: 25px;
  margin-left: 10px;
}

.player--tag {
  position: relative;
  display: inline-block;
  width: 55px;
  margin-top: 5px;
  height: 27px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.player--crown {
  position: absolute;
  top: -16px;
  left: 16px;
  width: 30px;
  height: 25px;
}

.player--tag:after {
  animation: 0.3s ease-in-out pop-in forwards;
  transform: scale(0);
}

.player--tag[data-time]:after,
.player--tag[data-score]:after {
  display: block;
  padding: 5px;
  border-radius: 5px;
  font-size: 14px;
  font-weight: bold;
  width: 100%;
  text-align: center;
}

.player--tag[data-time]:after {
  content: attr(data-time);
  background: var(--positive-color);
}

.player--tag[data-score]:after {
  content: attr(data-score);
  background: var(--positive-color);
}

.player--tag[data-score="0"]:after {
  background: var(--negative-color);
  content: "×";
}

/* Copy button ==================== */
.copy-button {
  border: none;
  background: none;
  cursor: pointer;
  color: #888;
}

.copy-button + span {
  font-size: 14px;
}

/* Playlist ====================== */
.playlist {
  width: 150px;
}

.playlist + .playlist {
  margin-left: 10px;
}

.playlist * {
  cursor: pointer;
}

.category + .category {
  margin-top: 25px;
}

.playlist--count {
  font-size: 10px;
  text-align: center;
  font-weight: normal;
  color: rgba(255, 255, 255, 0.6);
}

.playlist--name {
  font-size: 11px;
  text-align: center;
  padding: 5px 0;
  font-weight: normal;
  margin-top: 0;
}

.playlist--button {
  background: none;
  border: none;
  background-size: cover;
  width: 150px;
  height: 150px;
  border-radius: 10px;
  position: relative;
}

.playlist--overlay {
  -webkit-backdrop-filter: saturate(0);
  backdrop-filter: saturate(0);
  border-radius: 10px;
  position: absolute;
  bottom: 0;
  top: 0;
  left: 0;
  right: 0;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.playlist:hover .playlist--overlay,
.playlist[data-selected="true"] .playlist--overlay {
  -webkit-backdrop-filter: saturate(1);
  backdrop-filter: saturate(1);
  border-radius: 10px;
}

.playlist[data-selected="true"] .playlist--overlay {
  background-color: transparent;
}

.playlist-selector {
  margin-top: 30px;
}

.playlist-selector h1 {
  font-size: 20px;
  margin-bottom: 5px;
}

.playlist-selector .horizontal-scroll {
  display: flex;
  flex-direction: row;
  max-width: 800px;
  scroll-snap-type: x mandatory;
}

.playlist-selector .horizontal-scroll::-webkit-scrollbar {
  display: unset;
}

.playlist-selector .playlist {
  scroll-snap-align: start;
}

.playlist[data-selected="true"] .playlist--button,
.playlist:hover .playlist--button {
  outline: 3px solid var(--playlist-outline);
  outline-offset: -3px;
  box-shadow: rgba(0, 0, 255, 0.5) 10px;
}

/* Round ========================================== */
.round-progress {
  text-align: center;
  margin: 0;
}

[data-round] span {
  display: inline-block;
  width: 15px;
  height: 15px;
  background: var(--round-next);
  border-radius: 50%;
  margin: 0 2px;
}

[data-round="1"] span:nth-child(1) {
  background: var(--round-current);
  outline: 5px solid var(--round-current-outline);
}

[data-round="2"] span:nth-child(2) {
  background: var(--round-current);
  outline: 5px solid var(--round-current-outline);
}

[data-round="2"] span:nth-child(-n + 1) {
  background: var(--round-previous);
}

[data-round="3"] span:nth-child(3) {
  background: var(--round-current);
  outline: 5px solid var(--round-current-outline);
}

[data-round="3"] span:nth-child(-n + 2) {
  background: var(--round-previous);
}

[data-round="4"] span:nth-child(4) {
  background: var(--round-current);
  outline: 5px solid var(--round-current-outline);
}

[data-round="4"] span:nth-child(-n + 3) {
  background: var(--round-previous);
}

[data-round="5"] span:nth-child(5) {
  background: var(--round-current);
  outline: 5px solid var(--round-current-outline);
}

[data-round="5"] span:nth-child(-n + 4) {
  background: var(--round-previous);
}

[data-round="6"] span:nth-child(6) {
  background: var(--round-current);
  outline: 5px solid var(--round-current-outline);
}

[data-round="6"] span:nth-child(-n + 5) {
  background: var(--round-previous);
}

[data-round="7"] span:nth-child(7) {
  background: var(--round-current);
  outline: 5px solid var(--round-current-outline);
}

[data-round="7"] span:nth-child(-n + 6) {
  background: var(--round-previous);
}

[data-round="8"] span:nth-child(8) {
  background: var(--round-current);
  outline: 5px solid var(--round-current-outline);
}

[data-round="8"] span:nth-child(-n + 7) {
  background: var(--round-previous);
}

[data-round="9"] span:nth-child(9) {
  background: var(--round-current);
  outline: 5px solid var(--round-current-outline);
}

[data-round="9"] span:nth-child(-n + 8) {
  background: var(--round-previous);
}

[data-round="10"] span:nth-child(10) {
  background: var(--round-current);
  outline: 5px solid var(--round-current-outline);
}

[data-round="10"] span:nth-child(-n + 9) {
  background: var(--round-previous);
}

/* Answers ======================== */
.answers {
  display: grid;
  grid-auto-rows: 1fr;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

@media screen and (orientation: portrait) {
  .answers {
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }
}

.answer-button {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: inherit;
  position: relative;
  font-family: inherit;
  min-height: 76px;
  width: 100%;
}

.answer-button:active:not(:disabled) .answer-button--container {
  background: var(--button-bg-active);
  color: var(--button-fg-active);
}

.answer-button--container {
  border-radius: 10px;
  font-weight: 500;
  color: var(--button-fg);
  background: var(--button-bg);
  padding: 20px 40px;
  display: flex;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  box-shadow: rgba(0, 0, 0, 0.2) 3px 3px 0;
}

.answer-button-players {
  position: absolute;
  bottom: -15px;
  left: 20px;
}

.answer-button-players img {
  border-radius: 50%;
  transform: scale(0);
  animation: 0.3s ease-in-out pop-in forwards;
}

.answer-button-players img:nth-child(2) {
  animation-delay: 0.1s;
}

.answer-button-players img:nth-child(3) {
  animation-delay: 0.2s;
}

.answer-button-players img:nth-child(4) {
  animation-delay: 0.3s;
}

.answer-button-players img:nth-child(5) {
  animation-delay: 0.4s;
}

.answer-button-players img:nth-child(6) {
  animation-delay: 0.5s;
}

.answer-button-players img:nth-child(7) {
  animation-delay: 0.6s;
}

.answer-button-players img + img {
  margin-left: 5px;
}

.answer-button-players img:nth-child(n + 7) {
  display: none;
}

[data-target="answer-button"]:disabled {
  cursor: default;
}

[data-target="answer-button"]:disabled .answer-button--container {
  opacity: 0.2;
}

[data-selected="true"]:disabled .answer-button--container {
  opacity: 1;
}

[data-correct="true"]:disabled .answer-button--container {
  opacity: 1;
  background: var(--positive-color);
  color: #fff;
}

/* Button ===================== */
.button {
  background: var(--button-bg);
  color: var(--button-fg);
  cursor: pointer;
  border: none;
  font-size: 28px;
  padding: 10px 20px;
  border-radius: 10px;
  display: block;
  width: 100%;
  max-width: 325px;
  margin: 0 auto;
  box-shadow: rgba(0, 0, 0, 0.2) 3px 3px 0;
}

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

@media screen and (max-width: 650px) {
  .button {
    font-size: 20px;
  }
}

.actions .button {
  margin-top: 15px;
}

/* Utils ======================== */
.center {
  text-align: center;
}

/* Countdown =================== */
.countdown {
  font-size: 125px;
  font-weight: 900;
  text-align: center;
}

progress {
  width: 100%;
  border: none;
  appearance: none;
}

progress[value]::-webkit-progress-bar {
  background-color: rgba(0, 0, 0, 0.1);
  height: 3px;
  width: 100%;
  border-radius: 5px;
}

progress[value]::-webkit-progress-value {
  background-color: #fff;
  border-radius: 5px;
}

/* Theme ======================= */
#themes {
  position: fixed;
  right: 10px;
  bottom: 10px;
}

@media screen and (display-mode: standalone) {
  #themes {
    bottom: 30px;
    right: 30px;
  }
}

.theme-button {
  width: 20px;
  height: 20px;
  background: currentColor;
  border: 2px solid rgba(255, 255, 255, 0.3);
  cursor: pointer;
}

[data-theme="0"] .theme-button[data-value="0"],
[data-theme="1"] .theme-button[data-value="1"],
[data-theme="2"] .theme-button[data-value="2"],
[data-theme="3"] .theme-button[data-value="3"],
[data-theme="4"] .theme-button[data-value="4"],
[data-theme="5"] .theme-button[data-value="5"] {
  border-color: #fff;
}

.theme-button[data-value="0"] {
  color: #ff7b00;
}

.theme-button[data-value="1"] {
  color: #0094ff;
}

.theme-button[data-value="2"] {
  color: #af53d4;
}

.theme-button[data-value="3"] {
  color: #3f4246;
}

.theme-button[data-value="4"] {
  color: #14725a;
}

.theme-button[data-value="5"] {
  color: #ae441b;
}

/* Volume ================= */
#volume {
  position: fixed;
  bottom: 10px;
  left: 10px;
}

@media screen and (display-mode: standalone) {
  #volume {
    bottom: 30px;
    left: 30px;
  }
}

.mobile #volume {
  display: none;
}

/* Scrolling */
.horizontal-scroll {
  overflow-x: scroll;
  padding-bottom: 5px;
}

body:not(.mobile) .scrollbar::-webkit-scrollbar {
  height: 5px;
  width: 5px;
}

body:not(.mobile) .scrollbar::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.3);
  width: 10px;
  height: 5px;
  border-radius: 10px;
}

.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.no-scrollbar::-webkit-scrollbar {
  display: none;
}

/* Route ====================== */
[data-route="Home"] #app,
[data-route="Interaction"] #app,
[data-route="Loading"] #app {
  display: flex;
  flex-direction: column;
  flex: 1;
  align-items: center;
  justify-content: center;
}

/* Temporary hack */
[data-action="restart"] {
  margin: 50px auto;
}

pre,
code {
  font-size: 12px;
  word-break: break-all;
}

/* Interaction ========================= */
.description {
  font-size: 16px;
  max-width: 350px;
  text-align: center;
}

/* Home ================================== */
[data-route="Home"] input {
  font-size: inherit;
  font-family: inherit;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #fff;
  text-align: center;
  padding: 10px 20px;
  border-radius: 10px;
}

[data-route="Home"] input[name="code"] {
  text-transform: uppercase;
}

/* Setup ============================ */
[data-route="Setup"] .join-url {
  font-size: 12px;
  margin-top: 5px;
  background: rgba(0, 0, 0, 0.3);
  padding: 10px;
  border-radius: 5px;
}

/* Logo ============================ */
.logo {
  width: 100%;
  max-width: 325px;
}

/* Playlist preview ================== */
.playlist-preview {
  text-align: center;
  margin-bottom: 25px;
}

.playlist-preview--cover {
  width: 150px;
  height: 150px;
}

.current-playlist {
  text-align: center;
  font-size: 11px;
}

/* Current track */
@keyframes current-track {
  0% {
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

.current-track {
  position: fixed;
  top: 20px;
  right: 20px;
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.8);
  padding: 10px;
  font-size: 12px;
  border-radius: 10px;
  width: 250px;
  opacity: 0;
  animation: 4s current-track forwards;
}

.current-track--cover {
  width: 50px;
  height: 50px;
  margin-right: 10px;
}

.current-track--album {
  display: none;
}

.current-track--title {
  font-weight: bold;
  font-size: 14px;
}

.current-track--artist {
  opacity: 0.8;
}

/* Podium */
.podiums {
  display: flex;
  gap: 50px;
  align-items: flex-end;
  height: 400px;
  justify-content: center;
}

.podium {
  display: flex;
  flex-direction: column;
  align-items: center;
  width:;
}

@keyframes podium-1 {
  0% {
    height: 0;
  }

  100% {
    height: 300px;
  }
}

@keyframes podium-2 {
  0% {
    height: 0;
  }

  100% {
    height: 250px;
  }
}

@keyframes podium-3 {
  0% {
    height: 0;
  }

  100% {
    height: 200px;
  }
}

.podium--info {
  padding: 5px;
  flex-grow: 1;
  margin-top: 10px;
  width: 200px;
  text-align: center;
  height: 0;
  overflow: hidden;
  background: #fed92f;
}

.podium:nth-child(1) .podium--info {
  animation-delay: 0s;
  animation: 1s podium-1 ease-in-out forwards;
}

.podium:nth-child(2) .podium--info {
  animation: 1s podium-2 ease-in-out forwards 0.1s;
}

.podium:nth-child(3) .podium--info {
  animation: 1s podium-3 ease-in-out forwards 0.2s;
}

.podium--place:after {
  content: "";
  background: rgba(0, 0, 0, 0.3);
  border-radius: 10px;
  padding: 5px;
  font-weight: bold;
  flex-basis: 0;
  width: 50px;
  display: block;
  margin: 10px auto;
}

.podium:nth-child(1) .podium--place:after {
  content: "1st";
}

.podium:nth-child(2) .podium--place:after {
  content: "2nd";
}

.podium:nth-child(3) .podium--place:after {
  content: "3rd";
}

.podium--score {
  font-weight: 900;
  font-size: 36px;
  color: black;
}

.podium--name {
  color: rgba(0, 0, 0, 0.4);
  font-size: 13px;
}

@media screen and (max-width: 500px) {
  .podiums {
    gap: 25px;
  }

  .podium--info {
    width: 95px;
  }

  .podium--score {
    font-size: 24px;
  }
}

/* QRCODE */
.qrcode {
  margin-top: 15px;
}

.qrcode img {
  padding: 10px;
  background: #fff;
}

/* Toolbar */
.toolbar {
  position: fixed;
  z-index: 10;
  top: 10px;
  left: 10px;
  right: 10px;
  top: max(10px, safe-area-inset-top);
  left: max(10px, safe-area-inset-left);
  right: max(10px, safe-area-inset-right);
  font-size: 12px;
  display: flex;
  justify-content: space-between;
}

.continue-layer {
  position: fixed;
  background: rgba(0, 0, 0, 0.5);
  bottom: 0;
  bottom: max(0, safe-area-inset-top);
  left: 0;
  right: 0;
  padding: 10px 200px;
  backdrop-filter: blur(10px);
  display: flex;
  gap: 20px;
  justify-content: center;
}
