* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: Georgia, "Times New Roman", serif;
  color: #3f2417;
}

body {
  position: relative;
  background: url("../images/vieuxpapier.jpg") center center / cover no-repeat fixed;
}

.page-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 248, 238, 0.52);
  z-index: 0;
}

.topbar,
.roulette-main {
  position: relative;
  z-index: 1;
}

/* Haut */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  padding: 20px 24px 0;
  flex-wrap: wrap;
}

.retour-site {
  text-decoration: none;
  color: #5b241b;
  font-weight: bold;
  font-size: 1rem;
  background: rgba(255, 250, 245, 0.88);
  border: 1px solid rgba(110, 70, 45, 0.28);
  border-radius: 14px;
  padding: 10px 15px;
  box-shadow: 0 6px 16px rgba(65, 25, 18, 0.10);
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.retour-site:hover {
  background: rgba(255, 250, 245, 0.97);
  box-shadow: 0 8px 18px rgba(65, 25, 18, 0.15);
}

.retour-site:active {
  transform: scale(0.97);
}

.ressources {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.ressource-box {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 78px;
  padding: 7px 11px;
  border-radius: 14px;
  background: rgba(255, 250, 245, 0.88);
  border: 1px solid rgba(110, 70, 45, 0.24);
  box-shadow: 0 6px 16px rgba(65, 25, 18, 0.08);
}

.ressource-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
  display: block;
  mix-blend-mode: multiply;
}

.piece-icon {
  width: 27px;
  height: 27px;
}

.ressource-value {
  font-size: 0.98rem;
  font-weight: bold;
  color: #611f16;
  line-height: 1;
}

/* Centre */
.roulette-main {
  min-height: calc(100vh - 70px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 4px 20px 20px;
}

.roulette-main h1 {
  margin: 4px 0 4px;
  text-align: center;
  font-size: clamp(1.9rem, 4vw, 3rem);
  color: #5b241b;
  text-shadow: 1px 1px 0 rgba(255, 250, 245, 0.7);
}

.roulette-zone {
  position: relative;
  width: min(62vw, 430px);
  height: min(62vw, 430px);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 6px;
}

.wheel-wrapper {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wheel {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  transform: rotate(0deg);
  transform-origin: center center;
  transition: transform 4.9s cubic-bezier(0.12, 0.85, 0.16, 1);
  filter: drop-shadow(0 12px 24px rgba(68, 34, 18, 0.16));
}

.wheel-pointer {
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  width: 82px;
  height: auto;
  z-index: 5;
  pointer-events: none;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.18));
}

/* Actions */
.roulette-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-top: 2px;
}

.spin-btn {
  border: none;
  cursor: pointer;
  padding: 14px 26px;
  border-radius: 16px;
  font-size: 1.05rem;
  font-weight: bold;
  color: #fffaf7;
  background: linear-gradient(180deg, #8d3026 0%, #6f2119 100%);
  box-shadow: 0 8px 18px rgba(65, 25, 18, 0.16);
  transition: transform 0.15s ease, filter 0.15s ease, box-shadow 0.15s ease;
}

.spin-btn:hover:not(:disabled) {
  filter: brightness(1.04);
  box-shadow: 0 10px 22px rgba(65, 25, 18, 0.22);
}

.spin-btn:active:not(:disabled) {
  transform: scale(0.97);
  filter: brightness(0.92);
}

.spin-btn:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.status-text {
  min-height: 24px;
  text-align: center;
  font-size: 0.98rem;
  color: #5a3424;
  background: rgba(255, 250, 245, 0.72);
  padding: 8px 14px;
  border-radius: 12px;
}

/* Pop-up */
.reward-popup {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transform: scale(0.7);
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 6;
}

.reward-popup.show {
  opacity: 1;
  transform: scale(1);
}

.reward-popup.hidden {
  opacity: 0;
  transform: scale(0.7);
}

.reward-popup-content {
  background: rgba(255, 251, 243, 0.97);
  border: 2px solid rgba(125, 65, 42, 0.32);
  border-radius: 18px;
  padding: 18px 24px;
  box-shadow: 0 14px 30px rgba(61, 28, 15, 0.18);
  font-size: 1.2rem;
  font-weight: bold;
  color: #7b1f19;
  text-align: center;
}

@media (max-width: 700px) {
  .topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .ressources {
    justify-content: flex-start;
  }

  .roulette-zone {
    width: min(82vw, 340px);
    height: min(82vw, 340px);
  }

  .wheel-pointer {
    width: 66px;
    top: -14px;
  }

  .reward-popup-content {
    font-size: 1.05rem;
    padding: 14px 18px;
  }
}

/* POPUP UNLOCK */

.unlock-popup {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  opacity: 0;
  transform: scale(0.7);
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 10;
}

.unlock-popup.show {
  opacity: 1;
  transform: scale(1);
}

.unlock-popup.hidden {
  opacity: 0;
  transform: scale(0.7);
}

.unlock-popup-content {
  background: rgba(255, 251, 243, 0.98);
  border: 2px solid rgba(125, 65, 42, 0.35);
  border-radius: 20px;
  padding: 20px 26px;
  box-shadow: 0 18px 40px rgba(61, 28, 15, 0.25);
  text-align: center;
  max-width: 260px;
}

.unlock-title {
  font-weight: bold;
  font-size: 1.1rem;
  color: #7b1f19;
  margin-bottom: 10px;
}

.unlock-image {
  width: 90px;
  height: auto;
  margin: 10px 0;
}

.unlock-name {
  font-size: 1rem;
  margin-bottom: 12px;
}

.unlock-btn {
  border: none;
  cursor: pointer;
  padding: 10px 18px;
  border-radius: 12px;
  font-weight: bold;
  color: #fffaf7;
  background: linear-gradient(180deg, #8d3026 0%, #6f2119 100%);
}
