/* World of TrouveCraft — habillage « carte du monde » par-dessus /trouve/css/style.css.
   Palette prélevée sur le parchemin officiel de la World Map (encre brune, parchemin,
   or du cadre, terre de Sienne, mer voilée). Display : Cinzel ; texte : Crimson Pro. */
:root {
  --wm-ink: #1b1510;
  --wm-ink-2: #2b2016;
  --wm-ink-3: #3d2d1c;
  --wm-parch: #dcc28c;
  --wm-parch-2: #c4a66c;
  --wm-parch-3: #a88a52;
  --wm-gold: #e3b94f;
  --wm-gold-2: #f0d27e;
  --wm-gold-deep: #8d6a22;
  --wm-sienna: #b5651d;
  --wm-sea: #5c8584;
  --wm-red: #b8322a;
  --wm-text: #2a1f12;
  --wm-text-2: #5a4630;
  --font-wm-display: "Cinzel", "Times New Roman", serif;
  --font-wm-body: "Crimson Pro", Georgia, serif;
}

/* ── Fond : encre brune, le parchemin se détache dessus ─────────────────────── */
html.wotc, body.wotc { background: var(--wm-ink); color: var(--wm-parch); font-family: var(--font-wm-body); }
body.wotc { padding-bottom: 0; min-height: 100%; }
.wotc .view { display: none; }
.wotc .view.active { display: block; }
.wotc #view-game.active { display: flex; }

/* ── Accueil ───────────────────────────────────────────────────────────────── */
.wotc .home-wrap { display: block; max-width: 1040px; margin: 0 auto; padding: 36px 16px 24px; }
.wotc .home-top { display: block; text-align: center; margin-bottom: 22px; }
.wotc .home-top h1 {
  font-family: var(--font-wm-display); font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  font-size: clamp(1.5rem, 4.6vw, 2.7rem); line-height: 1.1; color: var(--wm-gold);
  text-shadow: 0 2px 0 #4a3410, 0 0 24px rgba(227,185,79,.25);
}
.wotc .home-top .sub { margin-top: 8px; font-size: clamp(1.05rem, 2.2vw, 1.3rem); color: var(--wm-parch-2); font-style: italic; }
.wotc .home-top .sub strong { color: var(--wm-gold-2); font-style: normal; }

/* Le panneau : parchemin encadré d'or, comme la fenêtre de carte du jeu. */
.wotc .wotc-panel {
  position: relative; background: linear-gradient(180deg, #e2c893 0%, #d2b57c 60%, #c5a56c 100%);
  border: 3px solid var(--wm-gold-deep); border-radius: 6px;
  box-shadow: inset 0 0 0 2px var(--wm-gold), inset 0 0 0 5px #6d521d, 0 24px 60px rgba(0,0,0,.55), 0 0 0 1px #000;
  padding: 10px;
}
/* Aperçu de la carte : la vraie World Map, dans une fenêtre, qui dérive lentement. */
.wotc .wotc-hero {
  position: relative; height: clamp(180px, 34vw, 330px); overflow: hidden; border: 2px solid #6d521d;
  box-shadow: inset 0 0 40px rgba(27,21,16,.45); background: var(--wm-ink);
}
.wotc .wotc-hero img {
  position: absolute; top: 50%; left: 0; width: 160%; max-width: none; transform: translate(0, -50%);
  animation: wm-drift 60s ease-in-out infinite alternate; will-change: transform;
}
@keyframes wm-drift { from { transform: translate(0, -50%); } to { transform: translate(-37.5%, -50%); } }
@media (prefers-reduced-motion: reduce) { .wotc .wotc-hero img { animation: none; transform: translate(-18%, -50%); } }
.wotc .wotc-hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  box-shadow: inset 0 0 60px 10px rgba(27,21,16,.55);
}
.wotc .wotc-hero-tag {
  position: absolute; left: 12px; bottom: 10px; z-index: 2; font-family: var(--font-wm-display); font-size: .72rem;
  letter-spacing: .16em; text-transform: uppercase; color: var(--wm-gold-2); background: rgba(27,21,16,.72);
  padding: 5px 9px; border: 1px solid rgba(227,185,79,.45);
}

.wotc .wotc-dash { display: grid; grid-template-columns: 1fr 1.25fr; gap: 14px; padding: 14px 6px 6px; align-items: stretch; }
.wotc .wotc-dash .card { background: none; border: 0; box-shadow: none; padding: 6px 8px; min-width: 0; text-align: left; }
.wotc .pick-lbl, .wotc .rules-lbl {
  font-family: var(--font-wm-display); font-size: .72rem; letter-spacing: .18em; text-transform: uppercase;
  color: var(--wm-gold-deep); margin-bottom: 10px; text-align: left;
}

/* Difficultés : trois sceaux de cire sur le parchemin. */
.wotc #mode-select { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; width: 100%; min-width: 0; }
.wotc #mode-select .mode-btn {
  width: 100%; min-width: 0; min-height: 0; display: block; padding: 10px 4px 9px; cursor: pointer;
  font: inherit; font-family: var(--font-wm-display); color: var(--wm-parch);
  background: var(--wm-ink-2); border: 2px solid #5a4320; border-radius: 4px;
  box-shadow: inset 0 0 0 1px rgba(227,185,79,.25), 0 2px 0 #000; opacity: .62;
  transition: opacity .12s, box-shadow .12s, transform .07s;
}
.wotc #mode-select .mode-btn:hover { opacity: .9; }
.wotc #mode-select .mode-btn.active { opacity: 1; border-color: var(--wm-gold); box-shadow: inset 0 0 0 1px var(--wm-gold-2), 0 0 14px rgba(227,185,79,.35), 0 2px 0 #000; }
.wotc #mode-select .mode-btn:active { transform: translateY(2px); box-shadow: inset 0 0 0 1px var(--wm-gold-2); }
.wotc #mode-select .mode-btn-name { display: block; font-size: .92rem; font-weight: 700; letter-spacing: .08em; color: var(--wm-gold-2); }
.wotc #mode-select .mode-btn small { display: block; margin-top: 3px; font-family: var(--font-wm-body); font-size: .9rem; color: var(--wm-parch-2); }
.wotc #mode-select .mode-btn[data-mode="facile"] .mode-btn-name::before,
.wotc #mode-select .mode-btn[data-mode="moyen"]  .mode-btn-name::before,
.wotc #mode-select .mode-btn[data-mode="dur"]    .mode-btn-name::before {
  content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 7px; vertical-align: 1px;
  box-shadow: 0 0 0 1px rgba(0,0,0,.5);
}
.wotc #mode-select .mode-btn[data-mode="facile"] .mode-btn-name::before { background: #3f9e5a; }
.wotc #mode-select .mode-btn[data-mode="moyen"]  .mode-btn-name::before { background: var(--wm-gold); }
.wotc #mode-select .mode-btn[data-mode="dur"]    .mode-btn-name::before { background: var(--wm-red); }

.wotc .rules-mini { list-style: none; margin: 0; padding: 0; text-align: left; }
.wotc .rules-mini li { position: relative; padding-left: 18px; margin: 0 0 7px; color: var(--wm-text); font-size: 1.08rem; line-height: 1.35; }
.wotc .rules-mini li::before { content: "◆"; position: absolute; left: 0; top: .15em; font-size: .6em; color: var(--wm-sienna); }
.wotc .rules-mini strong { color: var(--wm-text); }

/* Bouton Jouer : le bouton doré du jeu. */
.wotc .cta { margin-top: 12px; }
.wotc .btn.play {
  display: block; width: 100%; min-height: 54px; padding: 12px 18px; cursor: pointer;
  font-family: var(--font-wm-display); font-weight: 700; font-size: 1.15rem; letter-spacing: .2em; text-transform: uppercase;
  color: #2b1d08; background: linear-gradient(180deg, #f3d987 0%, var(--wm-gold) 55%, #c8992e 100%);
  border: 2px solid #6d521d; border-radius: 4px;
  box-shadow: inset 0 1px 0 #fff3c4, inset 0 0 0 1px #a8832e, 0 3px 0 #3f2d0a, 0 8px 18px rgba(0,0,0,.35);
  text-shadow: 0 1px 0 rgba(255,255,255,.45); transition: transform .07s, box-shadow .1s, filter .1s;
}
.wotc .btn.play:hover { filter: brightness(1.06); }
.wotc .btn.play:active { transform: translateY(3px); box-shadow: inset 0 1px 0 #fff3c4, inset 0 0 0 1px #a8832e, 0 0 0 #3f2d0a; }
.wotc .btn.play:focus-visible, .wotc button:focus-visible { outline: 3px solid var(--wm-gold-2); outline-offset: 2px; }
.wotc .wotc-best { margin-top: 10px; text-align: center; font-size: .98rem; color: var(--wm-text-2); min-height: 1.3em; }
.wotc .wotc-best b { color: var(--wm-text); font-family: var(--font-wm-display); font-size: .9rem; letter-spacing: .06em; }

@media (max-width: 720px) {
  .wotc .home-wrap { padding: 22px 10px 16px; }
  .wotc .wotc-dash { grid-template-columns: 1fr; gap: 6px; }
}

/* ── Jeu : la fenêtre de carte ─────────────────────────────────────────────── */
.wotc #view-game { background: var(--wm-ink); }
.wotc #hud {
  background: linear-gradient(180deg, #2f2416, var(--wm-ink-2)); color: var(--wm-parch);
  box-shadow: 0 2px 0 var(--wm-gold-deep), 0 4px 14px rgba(0,0,0,.5); padding: 9px 14px;
}
.wotc .hud-label { font-family: var(--font-wm-display); font-size: .68rem; letter-spacing: .2em; text-transform: uppercase; color: var(--wm-gold-deep); }
.wotc .hud-target { font-family: var(--font-wm-display); font-weight: 700; color: var(--wm-gold-2); text-shadow: 0 1px 0 #000, 0 0 16px rgba(227,185,79,.25); letter-spacing: .02em; }
.wotc .hud-sub { color: var(--wm-parch-2); font-family: var(--font-wm-body); font-size: 1rem; }
.wotc .hud-score {
  font-family: var(--font-wm-display); background: none; color: var(--wm-gold-2);
  border: 2px solid var(--wm-gold-deep); box-shadow: inset 0 0 0 1px rgba(227,185,79,.35); border-radius: 4px; padding: 6px 14px;
}
.wotc .hud-buttons button {
  background: var(--wm-ink-3); color: var(--wm-gold-2); border: 2px solid #5a4320; border-radius: 4px; box-shadow: 0 2px 0 #000;
  min-height: 38px; min-width: 40px; font-size: 1.05rem;
}
.wotc .hud-buttons button:hover { border-color: var(--wm-gold); }
.wotc #time-bar-wrap { background: #0e0a07; box-shadow: inset 0 1px 0 rgba(0,0,0,.6); height: 12px; }
.wotc #time-bar { box-shadow: inset 0 -3px 0 rgba(0,0,0,.25); }
.wotc #map { background: var(--wm-ink); }
.wotc #map g.land, .wotc #map.zooming g.land { filter: none; }
.wotc #map .wotc-bg { pointer-events: none; }

/* Zones : invisibles au repos (le parchemin se voit), surlignées à la manière de la
   carte du jeu — un halo doré pour l'explorée, la cire rouge pour l'erreur. */
.wotc #map path.commune {
  fill: #fff; fill-opacity: 0; stroke: none; cursor: pointer;
  transform: none !important; filter: none !important; transition: fill-opacity .12s;
}
.wotc #map path.commune:hover { fill: #fff3c4; fill-opacity: .4; }
/* Trouvée : un voile doré léger + un liseré, la carte reste lisible sous les 40 zones. */
.wotc #map path.commune.found { fill: #ffe8a0; fill-opacity: .26; stroke: #6d4f1a; stroke-width: 1.6; vector-effect: non-scaling-stroke; }
.wotc #map path.commune.found.pop { fill-opacity: .7; }
.wotc #map path.commune.wrong { fill: var(--wm-red); fill-opacity: .55; }
.wotc #map path.commune.wrong-tried { stroke: var(--wm-red); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.wotc #map path.commune.reveal { fill: var(--wm-sea); fill-opacity: .6; }
.wotc #map path.commune.zone { fill: var(--wm-gold-2); fill-opacity: .2; }
.wotc #map text.initial { fill: var(--wm-text); font-family: var(--font-wm-display); font-weight: 700; paint-order: stroke; stroke: var(--wm-parch); stroke-width: 3px; }

/* Étiquette au curseur (Facile), décompte, points qui jaillissent. */
.wotc #cursor-hint .ch-line { border-top-color: var(--wm-gold); }
.wotc #cursor-hint .ch-name { background: var(--wm-ink-2); color: var(--wm-gold-2); font-family: var(--font-wm-display); font-size: .82rem; letter-spacing: .04em; border: 1px solid var(--wm-gold-deep); border-radius: 3px; }
.wotc .count-num { font-family: var(--font-wm-display); color: var(--wm-gold-2); text-shadow: 0 4px 18px rgba(0,0,0,.6), 0 0 30px rgba(227,185,79,.35); }
.wotc .count-num.go { color: #ffe9a8; }
.wotc .score-pop { font-family: var(--font-wm-display); color: var(--wm-gold-2); text-shadow: 0 1px 0 #000, 0 0 10px rgba(227,185,79,.6); }
.wotc .score-pop.pop-wrong { color: #ff8d7a; font-family: var(--font-wm-body); font-weight: 700; }

/* Fin de partie : un parchemin. */
.wotc .endcard {
  background: linear-gradient(180deg, #e2c893, #cfb078); color: var(--wm-text);
  border: 3px solid var(--wm-gold-deep); border-radius: 6px;
  box-shadow: inset 0 0 0 2px var(--wm-gold), inset 0 0 0 5px #6d521d, 0 24px 60px rgba(0,0,0,.6);
  padding: 24px 22px 16px;
}
.wotc .endcard h2 { font-family: var(--font-wm-display); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--wm-text); font-size: 1.4rem; }
.wotc .endcard .end-final { font-family: var(--font-wm-display); color: var(--wm-text); }
.wotc .endcard .end-max-wrap { color: var(--wm-text-2); }
.wotc .endcard .muted { color: var(--wm-text-2); font-size: 1.05rem; }
.wotc .endcard #end-record { font-family: var(--font-wm-display); font-size: .85rem; letter-spacing: .1em; color: var(--wm-gold-deep); }
.wotc .endcard button {
  font-family: var(--font-wm-display); letter-spacing: .12em; text-transform: uppercase; font-size: .92rem; border-radius: 4px;
}
.wotc .endcard button.primary { background: linear-gradient(180deg, #f3d987, var(--wm-gold) 55%, #c8992e); color: #2b1d08; border: 2px solid #6d521d; box-shadow: 0 3px 0 #3f2d0a; }
.wotc .endcard button.ghost { background: var(--wm-ink-2); color: var(--wm-gold-2); border: 2px solid #5a4320; box-shadow: 0 3px 0 #000; }

/* Crédit. */
.wotc .wotc-credit { text-align: center; color: var(--wm-parch-3); font-size: .92rem; padding: 16px 12px 28px; }
.wotc .wotc-credit a { color: var(--wm-parch-2); }
