/* ----------------------------------------------------------------------------
   URF Watch — habillage League of Legends / Hextech
   Palette et codes visuels repris du client LoL : bleu nuit profond, cadres
   dorés biseautés, typo serif dorée métallique, accent cyan hextech quand actif.
---------------------------------------------------------------------------- */

:root {
  /* Or hextech (couleurs réelles du client LoL) */
  --gold-light: #F0E6D2;
  --gold:       #C8AA6E;
  --gold-deep:  #785A28;
  /* Bleu / cyan hextech */
  --teal:       #0AC8B9;
  --teal-deep:  #005A82;
  /* Fonds & texte */
  --ink:        #010A13;
  --navy:       #0A1428;
  --text:       #A09B8C;
  --text-bright:#F0E6D2;
  --text-dim:   #5B5A56;

  --sans: "Spiegel", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --serif: "Cinzel", "Times New Roman", serif;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  /* Accent contextuel (par défaut : or). */
  --accent: var(--gold);
  --accent-deep: var(--gold-deep);
}

/* URF actif → bascule sur le cyan hextech. */
body[data-state="active"] {
  --accent: var(--teal);
  --accent-deep: var(--teal-deep);
}

/* Statut inconnu → accent éteint. */
body[data-state="unknown"] {
  --accent: #8A8678;
  --accent-deep: #3A382F;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  min-height: 100svh;
  display: grid;
  place-items: center;
  /* Marges qui respectent les encoches (env safe-area) sur mobile. */
  padding:
    max(6vh, env(safe-area-inset-top)) max(4vw, env(safe-area-inset-right))
    max(6vh, env(safe-area-inset-bottom)) max(4vw, env(safe-area-inset-left));
  background: var(--ink);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: hidden;
}

/* ---- Décor de fond : voûte sombre + halos discrets + texture fine ---- */
.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(1100px 620px at 50% -8%, rgba(200, 170, 110, 0.10), transparent 58%),
    radial-gradient(1000px 760px at 50% 116%, rgba(10, 200, 185, 0.05), transparent 60%),
    linear-gradient(180deg, #0A1428 0%, #04101D 55%, #010A13 100%);
}
.bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(200, 170, 110, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(200, 170, 110, 0.022) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(circle at 50% 42%, #000 0%, transparent 78%);
  -webkit-mask-image: radial-gradient(circle at 50% 42%, #000 0%, transparent 78%);
}

/* ---- Cadre principal (frame hextech doré, coins biseautés) ---- */
.stage { width: 100%; display: grid; place-items: center; }

.panel {
  --chamfer: 18px;
  position: relative;
  width: min(680px, 94vw);
  padding: 2px; /* épaisseur du liseré doré */
  background: linear-gradient(150deg, var(--gold-light) 0%, var(--gold) 38%, var(--gold-deep) 100%);
  clip-path: polygon(
    var(--chamfer) 0, 100% 0,
    100% calc(100% - var(--chamfer)),
    calc(100% - var(--chamfer)) 100%,
    0 100%, 0 var(--chamfer)
  );
  box-shadow: 0 32px 90px -24px rgba(0, 0, 0, 0.9);
  animation: reveal 0.85s var(--ease) both;
  transition: box-shadow 0.6s var(--ease);
}
body[data-state="active"] .panel {
  box-shadow:
    0 0 56px -12px rgba(10, 200, 185, 0.45),
    0 32px 90px -24px rgba(0, 0, 0, 0.9);
}

.panel__inner {
  position: relative;
  clip-path: polygon(
    var(--chamfer) 0, 100% 0,
    100% calc(100% - var(--chamfer)),
    calc(100% - var(--chamfer)) 100%,
    0 100%, 0 var(--chamfer)
  );
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(200, 170, 110, 0.07), transparent 60%),
    linear-gradient(180deg, rgba(10, 20, 40, 0.97), rgba(1, 10, 19, 0.98));
  padding: clamp(2.4rem, 6vw, 4rem) clamp(1.5rem, 6vw, 3.4rem) clamp(2rem, 5vw, 3rem);
  text-align: center;
  overflow: hidden;
}
/* Filet doré intérieur (détail hextech « double trait »). */
.panel__inner::before {
  content: "";
  position: absolute;
  inset: 9px;
  border: 1px solid rgba(200, 170, 110, 0.22);
  clip-path: polygon(11px 0, 100% 0, 100% calc(100% - 11px), calc(100% - 11px) 100%, 0 100%, 0 11px);
  pointer-events: none;
}

/* ---- Sur-titre + séparateur ---- */
.eyebrow {
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--accent);
  padding-left: 0.42em;
  transition: color 0.6s var(--ease);
}

.divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  margin: 0.85rem 0 1.4rem;
  font-size: 0.55rem;
  color: var(--accent);
  transition: color 0.6s var(--ease);
}
.divider span {
  height: 1px;
  width: min(90px, 20vw);
  background: linear-gradient(90deg, transparent, var(--accent));
}
.divider span:last-child { background: linear-gradient(90deg, var(--accent), transparent); }

/* ---- Question + verdict ---- */
.question {
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  color: var(--text);
}

.verdict {
  font-family: var(--serif);
  font-weight: 900;
  font-size: clamp(3rem, 13vw, 5.6rem);
  line-height: 1.0;
  letter-spacing: 0.015em;
  margin: 0.45rem 0 0.25rem;
  background: linear-gradient(180deg, #F5ECDA 0%, #E3CF9F 28%, #C8AA6E 52%, #A07F46 78%, #6E5024 100%);
  background-size: 100% 230%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 3px 14px rgba(0, 0, 0, 0.55));
  animation: sheen 7s ease-in-out infinite;
}
body[data-state="active"] .verdict {
  filter: drop-shadow(0 0 22px rgba(10, 200, 185, 0.4)) drop-shadow(0 3px 12px rgba(0, 0, 0, 0.5));
}

.subline {
  font-size: clamp(0.96rem, 2.5vw, 1.1rem);
  line-height: 1.55;
  color: var(--text);
  max-width: 42ch;
  margin: 0.5rem auto 0;
}

/* ---- Compte à rebours (tuiles hextech) ---- */
.timer {
  margin-top: clamp(1.8rem, 4vw, 2.6rem);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.timer-label {
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--accent);
  padding-left: 0.34em;
  transition: color 0.6s var(--ease);
}

.countdown {
  display: flex;
  justify-content: center;
  gap: clamp(0.5rem, 2vw, 1rem);
  margin-top: 1.1rem;
}

.unit {
  --c: 9px;
  position: relative;
  min-width: clamp(3.7rem, 16vw, 5.2rem);
  padding: 0.95rem 0.4rem 0.65rem;
  background: linear-gradient(180deg, rgba(200, 170, 110, 0.55), rgba(120, 90, 40, 0.4));
  clip-path: polygon(var(--c) 0, 100% 0, 100% calc(100% - var(--c)), calc(100% - var(--c)) 100%, 0 100%, 0 var(--c));
  transition: background 0.6s var(--ease);
}
.unit::before {
  content: "";
  position: absolute;
  inset: 1px;
  background: linear-gradient(180deg, rgba(13, 26, 47, 0.96), rgba(3, 12, 22, 0.97));
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}
body[data-state="active"] .unit {
  background: linear-gradient(180deg, rgba(10, 200, 185, 0.55), rgba(0, 90, 130, 0.4));
}

.num {
  position: relative;
  display: block;
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(1.7rem, 7.5vw, 2.7rem);
  line-height: 1;
  color: var(--text-bright);
  font-variant-numeric: tabular-nums;
}
body[data-state="active"] .num { color: #D7F7F2; }

.lbl {
  position: relative;
  display: block;
  margin-top: 0.55rem;
  font-weight: 600;
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-dim);
}

/* ---- Badge de fiabilité (étiquette angulaire) ---- */
.confidence {
  display: inline-flex;
  align-items: center;
  gap: 0.7ch;
  margin-top: 1.5rem;
  padding: 0.5rem 1.05rem;
  font-weight: 600;
  font-size: 0.72rem;
  line-height: 1.4;
  letter-spacing: 0.05em;
  color: var(--gold-light);
  background: rgba(200, 170, 110, 0.07);
  border: 1px solid rgba(200, 170, 110, 0.35);
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
  max-width: 46ch;
}
.confidence::before {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  transform: rotate(45deg);
  background: var(--accent);
  box-shadow: 0 0 9px var(--accent);
}

/* ---- Pied de page ---- */
.meta {
  margin-top: clamp(1.8rem, 4vw, 2.4rem);
  font-size: 0.76rem;
  line-height: 1.5;
  color: var(--text-dim);
}
.meta a {
  color: var(--gold);
  text-decoration: none;
  border-bottom: 1px solid rgba(200, 170, 110, 0.3);
}
.meta a:hover { color: var(--gold-light); border-color: var(--gold-light); }
.disclaimer { margin-top: 0.45rem; font-size: 0.68rem; color: #3F3E3A; }

[hidden] { display: none !important; }

/* ---- Animations ---- */
@keyframes reveal {
  from { opacity: 0; transform: translateY(16px) scale(0.99); }
  to   { opacity: 1; transform: none; }
}
@keyframes sheen {
  0%, 100% { background-position: 50% 0%; }
  50%      { background-position: 50% 100%; }
}

/* ---- Téléphones étroits : on resserre l'espacement et on répartit les tuiles
   du compte à rebours en flex pour qu'il ne déborde jamais (≤ ~360px). ---- */
@media (max-width: 430px) {
  .panel__inner { padding-left: 1.15rem; padding-right: 1.15rem; }
  .eyebrow { letter-spacing: 0.3em; }
  .verdict { font-size: clamp(2.5rem, 12vw, 5.6rem); }
  .countdown { width: 100%; gap: 0.45rem; }
  .unit {
    flex: 1 1 0;
    min-width: 0;
    padding-left: 0.25rem;
    padding-right: 0.25rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, .panel, .verdict { animation: none !important; transition: none !important; }
}
