@import url("https://fonts.googleapis.com/css2?family=UnifrakturMaguntia&family=Zalando+Sans:ital,wght@0,200..900;1,200..900&display=swap");

:root {
  --bg: #f7f7f7;
  --card-bg: #ffffff;
  --text: #1a1a1a;
  --text-secondary: #555555;
  --accent: #3a7afe;
  --accent-2: #34c759;
  --border: #dddddd;
  --title: #ffcf30;
  --green: #226d68;
  --red: #c23028;
  --blue: #55d5e0;
  --orange: #f26619;
  --pink: #deabaf;
}

/* === Mode sombre === */
.darkmode {
  --bg: #0d1117;
  --card-bg: #161b22;
  --text: #e6e6e6;
  --text-secondary: #a4a4a4;
  --accent: #388bff;
  --accent-2: #3ddc84;
  --border: #2c313a;
  --title: #ffcf30;
  --green: #18534f;
  --red: #77021d;
  --blue: #335f8a;
  --orange: #d7572b;
  --pink: #b384a7;
}

body {
  background-color: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: left;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  color: var(--text-secondary);
  font-family: "Zalando Sans", sans-serif;
  font-optical-sizing: auto;
  font-weight: normal;
  font-style: normal;
  font-variation-settings: "wdth" 100;
}

h1 {
  font-size: 5vh;
}

#profile-image {
  width: 100px;
  height: 100px;
}

#theme-switch {
  height: 100;
  width: 100;
  padding: 0;
  border-radius: 50%;
  background-color: var(--card-bg);
  display: flex;
  justify-content: center;
  align-items: center;
  position: fixed;
  top: 20px;
  right: 20px;
}

svg {
  fill: var(--text);
}

#theme-switch svg:last-child {
  display: none;
}

.darkmode #theme-switch svg:last-child {
  display: block;
}

.darkmode #theme-switch svg:first-child {
  display: none;
}

.left-section {
  width: 300px;
  height: 95vh;
  border-radius: 25px;
  background-color: var(--card-bg);
  margin-left: 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.left-section img {
  border-radius: 100px;
}

#menu {
  width: 100vw;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}

#menu img {
  width: 200px;
  height: 200px;
  border-radius: 100px;
  /* animation: rotate 2s infinite; */
}

@keyframes rotate {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

#rules-link {
  position: absolute;
  bottom: 10px;
  right: 10px;
  display: flex;
  flex-direction: row;
  align-items: center;
}

.input-container {
  margin: 10px 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 400px;
}

.input-container input {
  padding: 5px;
  width: 200px;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background-color: var(--bg);
  color: var(--text);
}

#game-button-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}

#game-button-container button {
  background-color: var(--card-bg);
  color: var(--text);
  width: 150px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 15px;
  transition: all 0.3s ease-out;
  font-weight: 700;
}

#game-button-container button:hover {
  cursor: pointer;
  background-color: var(--accent);
  color: #ffffff;
  border: none;
  transition: all 0.3s ease;
}

.title {
  font-family: "UnifrakturMaguntia", cursive;
  font-weight: 400;
  color: var(--title);
  font-size: 100px;
}

.loader {
  font-size: 20px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dots span {
  display: inline-block;
  opacity: 0;
  animation: waitingAnimation 1.5s infinite;
  will-change: opacity, transform;
}

.dots span:nth-child(1) {
  animation-delay: 0s;
}

.dots span:nth-child(2) {
  animation-delay: 0.3s;
}

.dots span:nth-child(3) {
  animation-delay: 0.6s;
}

@keyframes waitingAnimation {
  0% {
    opacity: 0;
  }

  50% {
    opacity: 1;
  }

  100% {
    opacity: 0;
  }
}

#pseudo-input-container {
  width: 450px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  margin-left: 50px;
}

#pseudo-input-container button {
  background-color: var(--bg);
  color: var(--text);
  height: 40px;
  width: 40px;
  border: none;
  border-radius: 15px;
  transition: all 0.3s ease-out;
  font-weight: 700;
}

#pseudo-input-container button > svg {
  transition: 0.3s ease-in-out;
}

#pseudo-input-container button:hover > svg {
  fill: var(--text-secondary);
  cursor: pointer;
  transition: 0.3s ease-in-out;
}

.rotate {
  animation: rotation 0.5s ease;
}

@keyframes rotation {
  0% {
    transform: rotate(0);
  }

  50% {
    transform: rotate(360deg);
  }

  100% {
    transform: rotate(720deg);
  }
}

.orange-text {
  color: orange;
  font-weight: bold;
}

.green-text {
  color: var(--accent-2);
  font-weight: bold;
}

.not-displayed {
  display: none;
}

#ready-button {
  margin-top: 5vh;
  background-color: var(--card-bg);
  color: var(--text);
  width: 150px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 15px;
  transition: all 0.3s ease-out;
  font-weight: 700;
}

#ready-button:hover {
  cursor: pointer;
  background-color: var(--accent);
  color: #ffffff;
  border: none;
  transition: all 0.3s ease;
}

#already-ready {
  margin-top: 5vh;
  background-color: var(--accent-2);
  color: white;
  width: 150px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 15px;
  transition: all 0.3s ease-out;
  font-weight: 700;
}

.card-value {
  font-size: 5vw;
  font-weight: bold;
  color: var(--card-bg);
  font-family: "UnifrakturMaguntia", cursive;
}

.card-container {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;

  width: 100%;
  height: 64%;
  padding-left: 2vw;
}

.card {
  position: relative;
  min-width: 9vw;
  width: 9vw;
  height: 12vw;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 15px;
  transition: 0.3s ease-in-out;
  box-shadow: inset 0 0 0 6px var(--border);
  overflow: hidden;

  margin-left: -2vw;
}

.card::before {
  content: "";
  position: absolute;
  top: 15%;
  left: 15%;
  width: 70%;
  height: 70%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.3;
  z-index: 0;
  border-radius: 10px;
}

.orange {
  background-color: var(--orange);
}

.bleu {
  background-color: var(--blue);
}

.rouge {
  background-color: var(--red);
}

.vert {
  background-color: var(--green);
}

.rose {
  background-color: var(--pink);
}

.marron {
  background-color: var(--title);
}

.orange::before {
  background-image: url("./assets/cards/shield.svg");
}

.bleu::before {
  background-image: url("./assets/cards/phishing.svg");
}

.rouge::before {
  background-image: url("./assets/cards/sun.svg");
}

.vert::before {
  background-image: url("./assets/cards/wand.svg");
}

.rose::before {
  background-image: url("./assets/cards/sword.svg");
}

.marron::before {
  background-image: url("./assets/cards/bolt.svg");
}

.card > * {
  position: relative;
  z-index: 1;
}

.card-button-container {
  position: relative;
  width: 60vw;
  display: flex;
  flex-direction: row;
  height: 100px;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.selected {
  transform: translateY(-50px);
  transition: 0.3s ease-in-out;
}

.card-button {
  background-color: var(--card-bg);
  color: var(--text);
  width: 150px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 15px;
  transition: all 0.3s ease-out;
  font-weight: 700;
}

.card-button:hover {
  cursor: pointer;
  background-color: var(--accent);
  color: #ffffff;
  border: none;
  transition: all 0.3s ease;
}

.selected-to-choose {
  transform: translateY(50px);
  transition: 0.3s ease-in-out;
}

.board-container {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 50%;
  width: 100vw;
}

/* .board-container .card {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  transition: 0.3s ease-in-out;
} */

.play-button-container {
  display: flex;
  flex-direction: row;
  margin-top: 3vh;
  gap: 20px;
}

.score {
  top: 20px;
  left: 50%;
  z-index: 1000;
  min-width: 200px;

  background-color: var(--card-bg);
  color: var(--text);
  border-radius: 30px;
  border: 2px solid var(--border);
  padding: 20px 25px;
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.4);
  margin-bottom: 20px;
}

.score h3 {
  margin: 0 0 15px 0;
  font-size: 1.3em;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.score ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.score li {
  margin-bottom: 12px;
  font-size: 1.1em;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.score li.active-turn {
  color: var(--accent-2);
}

.score li.active-turn::before {
  margin-right: 5px;
}

.score li strong {
  font-size: 1.2em;
  background-color: rgba(255, 255, 255, 0.1);
  padding: 2px 10px;
  border-radius: 10px;
}

.result {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--card-bg);
  color: var(--text);
  padding: 40px;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  max-width: 500px;
  margin: 50px auto;
  text-align: center;
  font-family: "Zalando Sans", sans-serif;

  animation: fadeIn 0.5s ease-out;
}

.result-title {
  font-size: 2.5em;
  margin-bottom: 10px;
  color: var(--accent-2);
  text-transform: uppercase;
  letter-spacing: 2px;
}

.winner {
  font-size: 1.5em;
  margin-bottom: 30px;
  color: var(--title);
}

.leaderboard {
  width: 100%;
  margin-bottom: 30px;
  border-collapse: collapse;
}

.leaderboard th {
  text-align: left;
  padding: 10px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  font-size: 0.9em;
}

.leaderboard td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--border);
  font-size: 1.1em;
  color: var(--text);
}

.winner-text {
  color: var(--title) !important;
  font-weight: bold;
  border-bottom: 1px solid var(--title);
}

.lobby-button {
  background-color: var(--card-bg);
  color: var(--text);
  width: 150px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 15px;
  transition: all 0.3s ease-out;
  font-weight: 700;
}

.lobby-button:hover {
  cursor: pointer;
  background-color: var(--accent);
  color: #ffffff;
  border: none;
  transition: all 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.game-container {
  height: 100vh;
  width: 100vw;
  display: flex;
  flex-direction: column;
}

.game-top-container {
  width: 100%;
  height: 66%;
  display: flex;
  flex-direction: row;
}

.game-bottom-container {
  height: 34%;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

#opponent1 {
  width: 33%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

#opponent1 .reversed-cards {
  top: 200px;
  left: 50px;
  transform: rotate(-45deg);
}
.reversed-cards {
  position: absolute;
  width: 400px; /* taille du paquet */
  height: 120px;
  display: flex;
  flex-direction: row;
  justify-content: flex-start;
  align-items: center;
}

.card-reversed {
  width: 60px;
  height: 80px;
  background-color: var(--card-bg);
  border-radius: 8px;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.4);
  border: 2px solid var(--border);
  margin-left: -10px; /* overlap */
  display: flex;
  align-items: center;
  justify-content: center;
}

#opponent2 {
  width: 33%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

#opponent2 h3 {
  position: absolute;
  right: 50px;
  top: 100px;
}

#opponent1 h3 {
  position: absolute;
  left: 50px;
  top: 100px;
}

#opponent2 .reversed-cards {
  top: 200px;
  right: 50px;
  transform: rotate(45deg);
}

.mid-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 34%;
}

.buttons {
  width: 50%;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  align-items: center;
}

.buttons div {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
}

.mid-container h2 {
  height: 10%;
}
.card-reversed h2 {
  font-family: "UnifrakturMaguntia", cursive;
  font-size: 3vw;
  color: var(--border);
}

#copy {
  all: unset;
  color: var(--accent-2);
  transition: 0.4s ease;
}

#copy:hover {
  color: var(--green);
  cursor: pointer;
  transition: 0.4s ease;
}

.swal2-modal {
  background-color: var(--bg);
}
