/* Misskiwize : Devine la chanson — styles.
   Couleurs du logo : vert kiwi, mauve, rose. Aucun coin carré, jamais. */

:root {
  --green: #79c94f;
  --green-dark: #4e9b2e;
  --purple: #8b5cf6;
  --purple-deep: #5b21b6;
  --pink: #ff5da2;
  --pink-dark: #e83e8c;
  --ink: #2b2140;
  --paper: #f7f3ff;
  --card: #ffffff;
  --radius: 24px;
}

* { box-sizing: border-box; }

/* L'attribut hidden gagne toujours, même sur les éléments en flex. */
[hidden] { display: none !important; }

html, body { margin: 0; padding: 0; }

body {
  font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: #241047;
}

button, input, select, textarea { font: inherit; }

/* ---------- Boutons et champs ---------- */
.btn {
  display: inline-block;
  border: none;
  cursor: pointer;
  background: var(--purple);
  color: #fff;
  font-weight: 700;
  padding: 0.7em 1.3em;
  border-radius: 999px;
  text-decoration: none;
  text-align: center;
  box-shadow: 0 4px 14px rgba(43, 16, 87, 0.35);
  transition: transform 0.08s ease, filter 0.15s ease;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: scale(0.97); }
.btn-pink { background: var(--pink); }
.btn-green { background: var(--green-dark); }
.btn-small { padding: 0.45em 1em; font-size: 0.92rem; }
.btn-big { font-size: 1.15rem; padding: 0.85em 1.6em; width: 100%; }
.btn-round {
  width: 3rem; height: 3rem; padding: 0;
  font-size: 1.5rem; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
}
.file-btn { cursor: pointer; }
.file-btn input { display: none; }

input[type="text"], input[type="search"], input[type="password"],
input[type="number"], select, textarea {
  border: 2px solid #d9cdf5;
  border-radius: 16px;
  padding: 0.6em 0.9em;
  background: #fff;
  color: var(--ink);
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--purple);
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.2);
}
textarea { resize: vertical; }

.field { display: flex; flex-direction: column; gap: 0.35em; font-weight: 600; }
.field.grow { flex: 1 1 12rem; }
fieldset.field { border: none; padding: 0; margin: 0; }
fieldset.field legend { font-weight: 600; margin-bottom: 0.35em; }

.row { display: flex; flex-wrap: wrap; gap: 0.8rem; align-items: flex-end; margin: 0.6rem 0; }
.hint { color: #6d6390; font-size: 0.95rem; margin: 0.4rem 0; }
.msg { color: #b00040; font-weight: 600; min-height: 1.2em; margin: 0.4rem 0; }
.msg.ok { color: var(--green-dark); }
.checkline { display: flex; gap: 0.5em; align-items: center; font-weight: 600; margin: 0.4rem 0; }

/* ---------- Verrou ---------- */
#gate {
  min-height: 100dvh;
  display: flex; align-items: center; justify-content: center;
  padding: 1.2rem;
  background: linear-gradient(160deg, #2b1055 0%, #5b21b6 55%, #1d2b64 100%);
}
.gate-card {
  background: var(--paper);
  border-radius: 36px;
  padding: 2rem 1.8rem;
  max-width: 26rem; width: 100%;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}
.gate-logo { width: 10rem; height: 10rem; object-fit: contain; border-radius: 50%; }
.gate-card h1 { font-size: 1.5rem; margin: 0.6rem 0 0.3rem; color: var(--purple-deep); }
.gate-card p { margin: 0.3rem 0 1rem; }
.gate-card form { display: flex; flex-direction: column; gap: 0.9rem; text-align: left; }
.gate-card label { display: flex; flex-direction: column; gap: 0.35em; font-weight: 600; }
.gate-card.shake { animation: shake 0.4s ease; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-10px); }
  75% { transform: translateX(10px); }
}

/* ---------- Vue spectacle ---------- */
.view-show {
  position: relative;
  min-height: 100dvh;
  overflow: hidden;
  background: linear-gradient(165deg, #2b1055 0%, #5b21b6 48%, #274690 100%);
  color: #fff;
}
.show-curves {
  position: absolute; inset: 0; width: 100%; height: 100%;
  fill: none; stroke: rgba(255, 255, 255, 0.16); stroke-width: 0.5;
}
.show-inner {
  position: relative;
  min-height: 100dvh;
  display: flex; flex-direction: column; align-items: center;
  padding: 3vmin 4vmin 4vmin;
  text-align: center;
}
.show-logo {
  width: 17vmin; height: 17vmin; object-fit: contain;
  border-radius: 50%;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.4));
}
.show-title {
  font-size: 6.2vmin; margin: 1vmin 0 0;
  color: #fff; letter-spacing: 0.01em;
  text-shadow: 0 4px 22px rgba(0, 0, 0, 0.45);
}
.show-level {
  font-size: 9vmin; font-weight: 800; line-height: 1.05; margin-top: 2vmin;
  color: var(--green);
  text-shadow: 0 4px 22px rgba(0, 0, 0, 0.45);
}
.show-clue {
  font-size: 6vmin; font-weight: 700; line-height: 1.1;
  color: #ffd7ea;
  text-shadow: 0 4px 22px rgba(0, 0, 0, 0.45);
}
.show-rules {
  list-style: none; margin: 2vmin 0 0; padding: 0;
  font-size: 2.6vmin; color: rgba(255, 255, 255, 0.85);
}
.show-rules li::before { content: "• "; color: var(--pink); font-weight: 800; }

.show-card {
  margin-top: 3.5vmin;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-radius: 4vmin;
  padding: 3.5vmin 4vmin;
  width: min(92%, 60rem);
  backdrop-filter: blur(3px);
}
.show-idle-text { font-size: 4.5vmin; font-weight: 700; margin: 0; }
.show-idle-notes { font-size: 5vmin; color: var(--green); margin: 1vmin 0 0; letter-spacing: 0.4em; }

.acr-top {
  display: flex; justify-content: center; align-items: center; gap: 1.2rem; flex-wrap: wrap;
}
.acr-label { font-size: 3.4vmin; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; color: #ffd7ea; }
.acr-decade {
  font-size: 3vmin; font-weight: 800;
  background: var(--pink); color: #fff;
  border-radius: 999px; padding: 0.25em 0.9em;
}
.acr-letters {
  margin-top: 2vmin;
  font-size: 6.8vmin; font-weight: 800;
  letter-spacing: 0.14em; line-height: 1.5;
  word-break: break-word;
  text-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
}
.acr-letters .acr-line { display: block; }

.rev-badge {
  display: inline-block;
  font-size: 3.4vmin; font-weight: 800;
  background: var(--green-dark); color: #fff;
  border-radius: 999px; padding: 0.25em 1.1em;
}
.rev-lines { margin-top: 2vmin; font-size: 4.2vmin; font-weight: 600; line-height: 1.45; }
.rev-lines .rev-line { display: block; }
.rev-title { margin-top: 2.2vmin; font-size: 6vmin; font-weight: 800; color: var(--green); }
.rev-artist { font-size: 4vmin; color: #ffd7ea; font-weight: 700; }
.show-card.pop { animation: pop 0.6s ease; }
@keyframes pop {
  0% { transform: scale(0.92); }
  55% { transform: scale(1.04); }
  100% { transform: scale(1); }
}

.show-audioreveal {
  margin-top: 3vmin;
  font-size: 4.6vmin; font-weight: 800;
  background: var(--pink); color: #fff;
  border-radius: 999px; padding: 0.4em 1.2em;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}
.show-winners {
  margin-top: auto; padding-top: 3vmin;
  font-size: 3.6vmin; font-weight: 700; color: #fff;
}
.show-winners .win-label { color: var(--green); }

#confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.confetti-piece {
  position: absolute; top: -4vh;
  border-radius: 40%;
  animation-name: confetti-fall;
  animation-timing-function: ease-in;
  animation-fill-mode: forwards;
}
@keyframes confetti-fall {
  to { transform: translateY(112vh) rotate(640deg); opacity: 0.9; }
}

.show-corner {
  position: absolute; right: 1rem; bottom: 0.8rem;
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.85rem; text-decoration: none;
  padding: 0.4em 0.9em; border-radius: 999px;
}
.show-corner:hover { color: #fff; background: rgba(255, 255, 255, 0.15); }

/* ---------- Panneaux (animatrice + réglages) ---------- */
.view-panel {
  min-height: 100dvh;
  background: linear-gradient(170deg, #efe9ff 0%, #fdeef7 100%);
  padding: 0 1rem 3rem;
}
.bar {
  max-width: 62rem; margin: 0 auto;
  display: flex; align-items: center; gap: 0.9rem; flex-wrap: wrap;
  padding: 1rem 0 0.4rem;
}
.bar-logo { width: 3.4rem; height: 3.4rem; object-fit: contain; border-radius: 50%; }
.bar-title { font-size: 1.45rem; font-weight: 800; color: var(--purple-deep); flex: 1 1 auto; }
.bar-nav { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.panel-note { max-width: 62rem; margin: 0.3rem auto 1rem; color: #6d6390; }

.card {
  max-width: 62rem; margin: 0 auto 1.2rem;
  background: var(--card);
  border-radius: var(--radius);
  padding: 1.3rem 1.4rem 1.5rem;
  box-shadow: 0 10px 30px rgba(91, 33, 182, 0.12);
}
.card h2 { margin: 0 0 0.5rem; color: var(--purple-deep); font-size: 1.3rem; }

.level-input { width: 6rem !important; text-align: center; font-size: 1.3rem; font-weight: 800; }

.deck-list { display: flex; flex-direction: column; gap: 0.55rem; margin: 0.8rem 0; max-height: 22rem; overflow: auto; padding-right: 0.2rem; }
.deck-item {
  display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap;
  background: var(--paper); border-radius: 18px; padding: 0.65rem 0.9rem;
}
.deck-item.active { outline: 3px solid var(--green); }
.deck-info { flex: 1 1 14rem; }
.deck-title { font-weight: 800; }
.deck-meta { color: #6d6390; font-size: 0.9rem; }
.audio-dot { color: var(--green-dark); font-weight: 700; font-size: 0.85rem; }
.current-line { font-weight: 700; color: var(--purple-deep); }

.clue-picker { display: flex; flex-wrap: wrap; gap: 0.55rem; margin: 0.6rem 0; border: none; padding: 0; }
.clue-pill {
  display: inline-flex; align-items: center; gap: 0.4em;
  background: var(--paper); border: 2px solid #d9cdf5;
  border-radius: 999px; padding: 0.45em 1em; cursor: pointer; font-weight: 700;
}
.clue-pill:has(input:checked) { background: var(--purple); border-color: var(--purple); color: #fff; }
.clue-pill input { accent-color: var(--pink); }
.lang-field .clue-pill { margin-right: 0.4rem; }

.winners-row .field { flex: 1 1 10rem; }

.set-list { display: flex; flex-direction: column; gap: 0.55rem; }
.set-item {
  display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap;
  background: var(--paper); border-radius: 18px; padding: 0.6rem 0.9rem;
}
.set-item .deck-info { flex: 1 1 12rem; }
.btn-danger { background: #c21847; }

/* ---------- Interrupteurs (Réglages) ---------- */
.toggle-row {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.55rem 0;
  border-bottom: 2px solid #efe9ff;
}
.toggle-label { font-weight: 600; flex: 1 1 auto; }
.switch { position: relative; display: inline-block; flex: 0 0 auto; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track {
  display: block; width: 3.6rem; height: 2rem;
  background: #cfc4ea; border-radius: 999px;
  transition: background 0.18s ease;
  position: relative;
}
.switch .track::after {
  content: ""; position: absolute; top: 0.25rem; left: 0.25rem;
  width: 1.5rem; height: 1.5rem; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 6px rgba(43, 16, 87, 0.35);
  transition: left 0.18s ease;
}
.switch input:checked + .track { background: var(--green-dark); }
.switch input:checked + .track::after { left: 1.85rem; }
.switch input:focus-visible + .track { box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.35); }
.subhead { color: var(--purple-deep); margin: 1.1rem 0 0.3rem; font-size: 1.05rem; }

/* ---------- Minuteur (vue spectacle) ---------- */
.show-timer {
  margin-top: 2vmin;
  font-size: 5vmin; font-weight: 800;
  background: rgba(255, 255, 255, 0.14);
  border: 2px solid rgba(255, 255, 255, 0.35);
  color: #fff; border-radius: 999px; padding: 0.15em 0.9em;
}
.show-timer.done { background: var(--pink); border-color: var(--pink); }

/* ---------- Grosseur du texte (vue spectacle) ---------- */
#view-show.text-grand .show-title { font-size: 7.8vmin; }
#view-show.text-grand .show-level { font-size: 11.3vmin; }
#view-show.text-grand .show-clue { font-size: 7.5vmin; }
#view-show.text-grand .show-rules { font-size: 3.3vmin; }
#view-show.text-grand .show-idle-text { font-size: 5.6vmin; }
#view-show.text-grand .show-idle-notes { font-size: 6.3vmin; }
#view-show.text-grand .acr-label { font-size: 4.3vmin; }
#view-show.text-grand .acr-decade { font-size: 3.8vmin; }
#view-show.text-grand .acr-letters { font-size: 8.5vmin; }
#view-show.text-grand .rev-badge { font-size: 4.3vmin; }
#view-show.text-grand .rev-lines { font-size: 5.3vmin; }
#view-show.text-grand .rev-title { font-size: 7.5vmin; }
#view-show.text-grand .rev-artist { font-size: 5vmin; }
#view-show.text-grand .show-audioreveal { font-size: 5.8vmin; }
#view-show.text-grand .show-winners { font-size: 4.5vmin; }
#view-show.text-grand .show-timer { font-size: 6.3vmin; }

#view-show.text-tres .show-title { font-size: 9.3vmin; }
#view-show.text-tres .show-level { font-size: 13.5vmin; }
#view-show.text-tres .show-clue { font-size: 9vmin; }
#view-show.text-tres .show-rules { font-size: 3.9vmin; }
#view-show.text-tres .show-idle-text { font-size: 6.8vmin; }
#view-show.text-tres .show-idle-notes { font-size: 7.5vmin; }
#view-show.text-tres .acr-label { font-size: 5.1vmin; }
#view-show.text-tres .acr-decade { font-size: 4.5vmin; }
#view-show.text-tres .acr-letters { font-size: 10.2vmin; }
#view-show.text-tres .rev-badge { font-size: 5.1vmin; }
#view-show.text-tres .rev-lines { font-size: 6.3vmin; }
#view-show.text-tres .rev-title { font-size: 9vmin; }
#view-show.text-tres .rev-artist { font-size: 6vmin; }
#view-show.text-tres .show-audioreveal { font-size: 6.9vmin; }
#view-show.text-tres .show-winners { font-size: 5.4vmin; }
#view-show.text-tres .show-timer { font-size: 7.5vmin; }

/* ---------- Timbre « Made by Misskiwize » (bas des Réglages) ---------- */
.stamp {
  max-width: 62rem; margin: 1.8rem auto 0;
  text-align: center;
}
.stamp-img {
  width: 140px; max-width: 60vw; height: auto;
  border-radius: 20px;
  transform: rotate(-2deg);
  filter: drop-shadow(0 8px 18px rgba(91, 33, 182, 0.3));
}
