* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Helvetica Neue', sans-serif;
}

body {
  background: #2d1a11;
  color: white;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  touch-action: manipulation;
}

/* PLAYER CARDS */
.player-card {
  flex: 1;
  width: 100%;
  background-color: black;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
  display: flex;
  align-items: stretch;
  justify-content: center;
  transition: background-image 0.3s ease;
  border-top-left-radius: 50px;
  border-top-right-radius: 50px;
  overflow: hidden;
}

/* TOP CARD */
.player-card.top {
  transform: rotate(180deg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.player-card.top .overlay,
.player-card.top .life-counter {
  transform: rotate(180deg);
}

/* TOKEN ROWS */
.token-row {
  display: flex;
  justify-content: space-around;
  padding: 1rem;
  z-index: 3;
}

.token {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: #4a1c1c;
  background-image: url('/assets/ressource.png');
  background-size: cover;
  background-position: center;
  opacity: 0.4;
  transition: opacity 0.2s ease;
  cursor: pointer;
}

.token.active {
  opacity: 1;
}

/* LIFE COUNTERS */
.life-counter {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 5.5rem;
  padding: 0.5rem;
  border-radius: 20px;
  margin: 0.5rem;
  color: white;
  width: calc(100% - 1rem);
  text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.7);
}

/* BUTTONS */
.btn {
  background: transparent;
  border: none;
  color: white;
  font-size: 4rem;
  cursor: pointer;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

/* CENTER PANEL */
.center-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 1rem;
  background: #2d1a11;
  position: relative;
  z-index: 5;
}

.life-icon-wrapper {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: #2d1a11;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 6;
  cursor: pointer;
}

.life-icon {
  width: 90px;
  height: 90px;
}

.timer {
  font-size: 2rem;
  min-width: 60px;
  text-align: center;
}

.mirrored {
  transform: rotate(180deg);
}

#reset-btn,
#settings-btn {
  background: none;
  border: 2px solid white;
  border-radius: 50%;
  padding: 0.5rem;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 6;
}

#reset-btn i,
#settings-btn i {
  color: white;
  font-size: 1.5rem;
}

/* MODALS */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  background-color: rgba(0, 0, 0, 0.75);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 99;
}

.modal-content {
  background: #222;
  padding: 2rem;
  border-radius: 10px;
  text-align: center;
  color: white;
  width: 90%;
  max-width: 400px;
}

.form-group {
  margin-bottom: 1rem;
}

.modal input,
.modal select {
  width: 100%;
  font-size: 1.25rem;
  text-align: center;
  border-radius: 5px;
  border: none;
  padding: 0.5rem;
}

.timer-inputs {
  display: flex;
  gap: 0.5rem;
}

.form-group.buttons {
  display: flex;
  justify-content: space-around;
}

.modal button {
  margin-top: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 1rem;
  cursor: pointer;
}

.hidden {
  display: none;
}

/* LANDSCAPE MODE */
body.landscape {
  flex-direction: row;
  height: 100vh;
}

body.landscape .player-card {
  flex: 1;
  width: 50%;
  border-radius: 0;
}

body.landscape .player-card.top {
  transform: rotate(0deg);
}

body.landscape .player-card.bottom {
  transform: rotate(0deg);
}

body.landscape .player-card.bottom.flipped {
  transform: rotate(180deg);
}

body.landscape .center-panel {
  flex: 0 0 120px;
  width: 120px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

body.landscape .timer.mirrored {
  transform: rotate(180deg);
}

.landscape-only {
  display: none;
}

body.landscape .landscape-only {
  display: block;
}
