* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: radial-gradient(120% 120% at 50% 0%, #1c2a5e 0%, #101a3d 45%, #070b1e 100%);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
  touch-action: manipulation;
}

#app {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(2.5rem, 5vh, 4.5rem);
  padding: 6vh 6vw;
  text-align: center;
}

/* ---------- Titre ---------- */

#title {
  color: #fff;
  font-weight: 700;
  line-height: 1.2;
  font-size: clamp(2.6rem, 6.2vw, 5.4rem);
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.35);
  transition: font-size 0.6s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.5s ease;
  max-width: 90vw;
}

body.state-rating #title {
  font-size: clamp(1.3rem, 3vw, 2.1rem);
  opacity: 0.78;
  font-weight: 600;
}

body.state-thanks #title {
  display: none;
}

/* ---------- Panneau de notation ---------- */

#rating-panel {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: clamp(1.2rem, 3vh, 2rem);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

body.state-rating #rating-panel {
  display: flex;
}

#rating-panel.show {
  opacity: 1;
  transform: translateY(0);
}

#stars {
  display: flex;
  gap: clamp(0.4rem, 1.6vw, 1.1rem);
  line-height: 1;
}

.star {
  position: relative;
  display: inline-block;
  font-size: clamp(3.4rem, 8vw, 6.4rem);
  width: 1em;
  height: 1em;
  cursor: pointer;
}

.star-empty,
.star-filled {
  position: absolute;
  inset: 0;
  white-space: nowrap;
  line-height: 1;
}

.star-empty {
  color: rgba(255, 255, 255, 0.22);
}

.star-filled {
  color: #ffc84a;
  width: var(--fill, 0%);
  overflow: hidden;
  text-shadow: 0 0 18px rgba(255, 200, 74, 0.55);
  transition: width 0.12s ease-out;
}

#rating-value {
  color: rgba(255, 255, 255, 0.75);
  font-size: clamp(1rem, 2vw, 1.3rem);
  font-variant-numeric: tabular-nums;
  min-height: 1.4em;
}

#submit-btn {
  appearance: none;
  border: none;
  border-radius: 999px;
  padding: clamp(0.9rem, 2vh, 1.2rem) clamp(2.6rem, 6vw, 4rem);
  font-size: clamp(1.1rem, 2.2vw, 1.5rem);
  font-weight: 600;
  font-family: inherit;
  color: #0b1330;
  background: #ffc84a;
  box-shadow: 0 8px 24px rgba(255, 200, 74, 0.25);
  transition: opacity 0.25s ease, transform 0.15s ease;
}

#submit-btn:disabled {
  opacity: 0.32;
  box-shadow: none;
}

#submit-btn:not(:disabled):active {
  transform: scale(0.96);
}

/* ---------- Panneau de remerciement ---------- */

#thanks-panel {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: clamp(1rem, 3vh, 1.6rem);
}

body.state-thanks #thanks-panel {
  display: flex;
}

#thanks-icon {
  width: clamp(4.5rem, 10vw, 6.5rem);
  height: clamp(4.5rem, 10vw, 6.5rem);
  border-radius: 50%;
  background: #ffc84a;
  color: #0b1330;
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 28px rgba(255, 200, 74, 0.3);
}

#thanks-text {
  color: #fff;
  font-weight: 700;
  font-size: clamp(2.4rem, 5.6vw, 4.2rem);
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.35);
}

#restart-btn {
  appearance: none;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 999px;
  padding: clamp(0.8rem, 1.8vh, 1rem) clamp(2.2rem, 5vw, 3.4rem);
  font-size: clamp(1rem, 2vw, 1.3rem);
  font-weight: 600;
  font-family: inherit;
  color: #fff;
  background: transparent;
  transition: background 0.2s ease, transform 0.15s ease;
}

#restart-btn:active {
  background: rgba(255, 255, 255, 0.12);
  transform: scale(0.96);
}
