* {
  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.72);
  z-index: 0;
}

.topbar,
.roulette-btn {
  position: relative;
  z-index: 5;
}

.menu-main {
  position: relative;
  z-index: 1;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  padding: 22px 24px 0;
  flex-wrap: nowrap;
}

.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.3);
  border-radius: 12px;
  padding: 10px 14px;
  box-shadow: 0 6px 16px rgba(65, 25, 18, 0.10);
  transition: background 0.2s ease, transform 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;
  margin-left: auto;
}

.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;
}

.menu-main {
  position: relative;
  min-height: calc(100vh - 120px);
  padding: 20px 40px 120px;
}

.menu-left {
  width: 100%;
  max-width: 620px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}

.title-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  margin-bottom: 14px;
  width: 100%;
}

.title-wave {
  margin: 0;
  text-align: center;
  font-size: clamp(2.2rem, 5vw, 4rem);
  color: #5b241b;
  text-shadow: 1px 1px 0 rgba(255, 250, 245, 0.7);
  display: inline-block;
  white-space: nowrap;
}

.title-subwave {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0;
  width: 100%;
  margin-top: -6px;
  font-size: clamp(2rem, 4.2vw, 3.2rem);
  font-weight: bold;
  letter-spacing: 0.04em;
  color: #7a2a1d;
  text-align: center;
  text-shadow: 1px 1px 0 rgba(255, 250, 245, 0.7);
}

.title-subwave span {
  display: inline-block;
  animation: flagWave 2.6s ease-in-out infinite;
  will-change: transform;
}

.title-subwave span:nth-child(1) { animation-delay: 0.12s; }
.title-subwave span:nth-child(2) { animation-delay: 0.18s; }
.title-subwave span:nth-child(3) { animation-delay: 0.24s; }

.menu-buttons {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  width: 100%;
  max-width: 360px;
  justify-items: center;
}

.menu-btn {
  width: 100%;
  text-align: center;
  text-decoration: none;
  padding: 18px 24px;
  border-radius: 16px;
  font-size: 1.35rem;
  font-weight: bold;
  letter-spacing: 0.3px;
  color: #fffaf7;
  background: linear-gradient(180deg, #8d3026 0%, #6f2119 100%);
  border: 1px solid rgba(80, 28, 20, 0.35);
  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;
}

.menu-btn:hover {
  filter: brightness(1.04);
  box-shadow: 0 10px 22px rgba(65, 25, 18, 0.22);
}

.menu-btn:active {
  transform: scale(0.97);
  filter: brightness(0.92);
}

.profile-card {
  position: absolute;
  top: 50%;
  right: 42px;
  transform: translateY(-42%);
  width: 228px;
  min-height: 320px;
  padding: 18px 14px;
  border-radius: 24px;
  background: rgba(255, 250, 245, 0.52);
  border: 1px solid rgba(110, 70, 45, 0.16);
  box-shadow: 0 10px 22px rgba(65, 25, 18, 0.08);
  backdrop-filter: blur(2px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  text-align: center;
}

.profile-avatar-shell {
  width: 136px;
  height: 136px;
  padding: 5px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(220, 214, 205, 0.92) 0%, rgba(188, 180, 169, 0.92) 100%);
  box-shadow:
    inset 0 2px 4px rgba(255,255,255,0.40),
    0 6px 14px rgba(60, 30, 18, 0.10);
}

.profile-avatar-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 18px;
  overflow: visible;
  background: rgba(245, 239, 231, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
}

.profile-crown {
  position: absolute;
  top: -42px;
  left: 50%;
  transform: translateX(-50%);
  width: 78px;
  height: auto;
  object-fit: contain;
  pointer-events: none;
  z-index: 3;
}

.profile-crown.hidden {
  display: none;
}

.profile-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.profile-name {
  font-size: 1.28rem;
  font-weight: bold;
  color: #5b241b;
}

.profile-lys {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 1.08rem;
  font-weight: bold;
  color: #7a2a1d;
}

.lys-icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
  display: block;
}

.profile-rank {
  font-size: 1rem;
  font-weight: bold;
  color: #8c5a2d;
}

.roulette-btn {
  position: fixed;
  left: 22px;
  bottom: 22px;
  z-index: 10;
}

.roulette-image-btn {
  background: none;
  border: none;
  box-shadow: none;
  padding: 0;
  text-decoration: none;
}

.roulette-menu-img {
  width: 110px;
  height: 110px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 8px 18px rgba(65, 25, 18, 0.16));
  transition: transform 0.15s ease, filter 0.15s ease;
}

.roulette-image-btn:hover .roulette-menu-img {
  transform: scale(1.03);
  filter: brightness(1.03) drop-shadow(0 10px 22px rgba(65, 25, 18, 0.22));
}

.roulette-image-btn:active .roulette-menu-img {
  transform: scale(0.97);
}

@keyframes wheelPulse {
  0% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.05) rotate(2deg); }
  100% { transform: scale(1) rotate(0deg); }
}

.wheel-available {
  animation: wheelPulse 2s infinite ease-in-out;
}

@keyframes flagWave {
  0%   { transform: translateY(0px) rotate(0deg); }
  20%  { transform: translateY(-4px) rotate(-2deg); }
  40%  { transform: translateY(1px) rotate(1deg); }
  60%  { transform: translateY(5px) rotate(2deg); }
  80%  { transform: translateY(-2px) rotate(-1deg); }
  100% { transform: translateY(0px) rotate(0deg); }
}


.title-wave span {
  display: inline-block;
  animation: flagWave 2s ease-in-out infinite;
  will-change: transform;
}


.title-wave span:nth-child(1)  { animation-delay: 0s; }
.title-wave span:nth-child(2)  { animation-delay: 0.05s; }
.title-wave span:nth-child(3)  { animation-delay: 0.10s; }
.title-wave span:nth-child(4)  { animation-delay: 0.15s; }
.title-wave span:nth-child(5)  { animation-delay: 0.20s; }
.title-wave span:nth-child(6)  { animation-delay: 0.25s; }
.title-wave span:nth-child(7)  { animation-delay: 0.30s; }
.title-wave span:nth-child(8)  { animation-delay: 0.35s; }
.title-wave span:nth-child(9)  { animation-delay: 0.40s; }
.title-wave span:nth-child(10) { animation-delay: 0.45s; }
.title-wave span:nth-child(11) { animation-delay: 0.50s; }
.title-wave span:nth-child(12) { animation-delay: 0.55s; }
.title-wave span:nth-child(13) { animation-delay: 0.60s; }
.title-wave span:nth-child(14) { animation-delay: 0.65s; }
.title-wave span:nth-child(15) { animation-delay: 0.70s; }
.title-wave span:nth-child(16) { animation-delay: 0.75s; }
.title-wave span:nth-child(17) { animation-delay: 0.80s; }
.title-wave span:nth-child(18) { animation-delay: 0.85s; }
.title-wave span:nth-child(19) { animation-delay: 0.90s; }

.title-wave .space {
  width: 0.06em;
}

.tooltip-box {
  position: relative;
  cursor: help;
}

.tooltip-box::after {
  content: attr(data-tooltip);
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 220px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 250, 245, 0.97);
  color: #5b241b;
  font-size: 0.9rem;
  font-weight: normal;
  line-height: 1.3;
  border: 1px solid rgba(110, 70, 45, 0.22);
  box-shadow: 0 10px 24px rgba(65, 25, 18, 0.14);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 30;
}

.tooltip-box:hover::after {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1100px) {
  .profile-card {
    right: 20px;
    width: 210px;
  }
}

@media (max-width: 950px) {
  .topbar {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }

  .ressources {
    justify-content: flex-start;
    margin-left: 0;
  }

  .menu-main {
    padding: 20px 24px 140px;
  }

  .menu-left {
    align-items: center;
    text-align: center;
  }

  .profile-card {
    position: static;
    transform: none;
    width: min(92vw, 300px);
    min-height: 300px;
    margin: 26px auto 0;
  }

  .roulette-menu-img {
    width: 90px;
    height: 90px;
  }
}

.life-timer {
  position: relative;
  z-index: 5;
  margin-left: auto;
  margin-right: 0;
  margin-top: 8px;
  width: fit-content;
  font-size: 0.88rem;
  color: #9b5a54;
  background: rgba(255, 250, 245, 0.72);
  padding: 4px 10px;
  border-radius: 10px;
  border: 1px solid rgba(110, 70, 45, 0.12);
  box-shadow: 0 4px 10px rgba(65, 25, 18, 0.05);
}

@media (max-width: 950px) {
  .life-timer {
    margin-left: 0;
    margin-top: 6px;
  }
}

.resource-life-group{
  position:relative;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:flex-start;
  flex:0 0 auto;
  min-width:78px;
}

.life-timer{
  position:absolute;
  top:100%;
  left:50%;
  transform:translateX(-50%);
  margin-top:4px;
  font-size:0.62rem;
  line-height:1;
  color:#9b5a54;
  background:rgba(255,250,245,.72);
  padding:3px 7px;
  border-radius:10px;
  border:1px solid rgba(110,70,45,.12);
  box-shadow:0 4px 10px rgba(65,25,18,.05);
  white-space:nowrap;
  text-align:center;
  z-index:5;
}

.ressources{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  justify-content:flex-end;
  align-items:flex-start;
  padding-bottom:24px;
}

@media (max-width: 760px){
  .life-timer{
    font-size:0.58rem;
    padding:2px 6px;
    margin-top:3px;
  }

  .ressources{
    padding-bottom:20px;
  }
}

.piece-icon{
  width:24px;
  height:24px;
}

#provinceOverlay {
  backdrop-filter: blur(4px);
}

.reward-card {
  animation: popupAppear 0.3s ease;
}

@keyframes popupAppear {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}
 


#startOverlay {
  position: fixed;
  inset: 0;
  backdrop-filter: blur(10px);
  background: rgba(245, 238, 226, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}


#startBtn {
  padding: 18px 42px;
  border: none;
  border-radius: 18px;
  background: linear-gradient(180deg, #8f4f3c 0%, #6f382d 100%);
  color: #fff8ee;
  font-size: 1.45rem;
  font-weight: 700;
  font-family: Georgia, "Times New Roman", serif;
  cursor: pointer;
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

#startBtn:hover {
  transform: translateY(-2px);
  filter: brightness(1.04);
  box-shadow:
    0 14px 28px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

#startBtn:active {
  transform: translateY(0);
  filter: brightness(0.98);
}

.profile-decoration {
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 60px;
  object-fit: contain;
  pointer-events: none;
  z-index: 4;
  display: none;
}


@media (max-width: 520px) {
  .title-wave {
    font-size: 2.9rem;
    white-space: normal;
    line-height: 1.02;
  }

  .title-subwave {
    font-size: 2.5rem;
    margin-top: 0;
  }

  .title-block {
    margin-bottom: 6px;
  }
}

@media (max-width: 520px) {
  .title-wave {
    white-space: normal;
    line-height: 1.1;
  }

  .title-wave .space {
    display: block;
    height: 6px;
  }
}




















#startOverlay {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 20px;
  text-align: center;
}

#welcome-message p {
  max-width: 700px;
  text-align: center; /* ou left si tu préfères lisible */
  line-height: 1.5;
  white-space: normal;
}

#startBtn {
  display: block;
  margin: 0 auto;
}


#welcome-message p {
  line-height: 1.6;
  text-align: center;
}

#welcome-message {
  background: rgba(255, 211, 172, 0.33);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding: 20px 30px;
  border-radius: 12px;
  max-width: 800px;
  color: black;
}