/* GUILD by ITERA — charte ITERA CLAUDE v2 (coque commune des apps ITERA, 2026-10-29).
   Palette ITERA uniquement (aucun gris, rouge ou orange), fond crème, barre latérale teal,
   une seule carte forte par écran, titres de slide (capitales teal + trait jaune).
   Polices hébergées dans l'app (aucun CDN). */

@font-face { font-family: "Bebas Neue"; font-weight: 400; font-display: swap; src: url("/assets/fonts/bebas-neue-400.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-weight: 400; font-display: swap; src: url("/assets/fonts/montserrat-400.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-weight: 500; font-display: swap; src: url("/assets/fonts/montserrat-500.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-weight: 600; font-display: swap; src: url("/assets/fonts/montserrat-600.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-weight: 700; font-display: swap; src: url("/assets/fonts/montserrat-700.woff2") format("woff2"); }

:root {
  --teal: #009da9; --petrol: #2097b0; --aqua: #8edadd; --aqua-2: #93cfd6; --green: #4db4a1;
  --yellow: #e8ba29; --yellow-2: #edc955; --cream: #f5f5dc; --mint: #cef1e4;
  --white: #ffffff; --ink: #1d1d1b;
  --font: "Montserrat", system-ui, sans-serif; --display: "Bebas Neue", system-ui, sans-serif;
  --r-card: 26px; --r-sm: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
body { font-family: var(--font); font-size: 15.5px; color: var(--ink); background: var(--cream); line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; color: inherit; }
b, strong { font-weight: 700; }
img { max-width: 100%; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--yellow); color: var(--ink); padding: 8px 14px; border-radius: 8px; z-index: 50; font-weight: 700; }
.skip:focus { left: 12px; }
.todo { color: var(--petrol); font-weight: 700; }

/* ─── Titres ─── */
.slide-t { font-weight: 700; text-transform: uppercase; color: var(--teal); font-size: 28px; line-height: 1.1; display: inline-block; padding-bottom: 10px; border-bottom: 2.5px solid var(--yellow); }
.card-t { font-weight: 700; text-transform: uppercase; color: var(--teal); font-size: 14px; }
.sec-t { font-weight: 700; font-size: 19px; color: var(--teal); }

/* ─── Boutons ─── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 700; font-size: 14px; border-radius: 11px; padding: 12px 18px; border: 1.5px solid transparent; background: none; color: var(--ink); }
.btn-teal { background: var(--teal); color: var(--white); }
.btn-teal:hover { background: var(--petrol); }
.btn-out { background: var(--white); border-color: var(--teal); color: var(--teal); }
.btn-out:hover { background: var(--mint); }
.btn-sm { padding: 7px 13px; font-size: 13px; }
.btn-full { width: 100%; }
.link { background: none; border: 0; color: var(--teal); font-weight: 700; text-decoration: underline; padding: 0; }

/* ─── Écran couverture (avant connexion) ─── */
.login { display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; }
.cover { background: var(--teal); position: relative; overflow: hidden; padding: 56px 64px; display: flex; flex-direction: column; }
.cover-logo { width: 200px; }
.cover h1 { margin-top: auto; font-weight: 700; font-size: 58px; line-height: 1.04; text-transform: uppercase; color: var(--cream); }
.cover p { color: var(--white); font-size: 19px; margin: 14px 0 auto; max-width: 460px; }
.cover .blob { position: absolute; left: -120px; bottom: -140px; width: 520px; color: var(--aqua); }
.cover .iteros { position: absolute; right: 70px; bottom: 0; display: flex; align-items: flex-end; gap: 16px; }
.pane { display: grid; place-items: center; padding: 40px; }
.form { width: min(420px, 100%); }
.app-id { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.app-id img { width: 48px; border-radius: 12px; }
.app-id b { font-family: var(--display); font-weight: 400; font-size: 36px; letter-spacing: .04em; line-height: 1; display: block; }
.app-id small { display: block; font-size: 12px; }
.form h2 { font-size: 24px; font-weight: 700; margin-bottom: 6px; }
.form > p { margin-bottom: 22px; }
.field { margin-bottom: 16px; border: 0; }
.field label, .field legend { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.field input, .field select { width: 100%; padding: 12px 14px; border-radius: 11px; border: 1px solid var(--aqua-2); background: var(--white); font: 400 15px var(--font); color: var(--ink); }
.field input:focus, .field select:focus { outline: none; border-color: var(--teal); }
.choix { display: flex; gap: 8px; flex-wrap: wrap; }
.choix label { display: flex; align-items: center; gap: 6px; margin: 0; padding: 8px 12px; border-radius: 11px; background: var(--white); font-weight: 500; cursor: pointer; }
.choix input { accent-color: var(--teal); }
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; margin: 6px 0 18px; padding: 12px 14px; border-radius: 0 14px 14px 0; border-left: 3px solid var(--yellow); background: var(--white); }
.consent input { margin-top: 3px; width: 18px; height: 18px; flex: none; accent-color: var(--teal); }
.form-error { color: var(--petrol); font-weight: 700; font-size: 14px; min-height: 22px; margin-bottom: 8px; }
.foot { margin-top: 16px; font-size: 13px; }
.actions { display: grid; gap: 10px; margin-top: 6px; }
.commandes { margin-top: 26px; display: grid; gap: 8px; font-size: 13.5px; }
.commandes div { display: flex; align-items: center; gap: 10px; }
kbd { display: inline-block; min-width: 26px; padding: 2px 7px; border-radius: 7px; background: var(--white); border: 1.5px solid var(--aqua-2); font: 700 12px var(--font); color: var(--teal); text-align: center; }

/* ─── Coque connectée : barre latérale teal + barre du haut sur le crème ─── */
.app { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.side { background: var(--teal); color: var(--white); position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; overflow: hidden; }
.side-logo { padding: 30px 26px 26px; }
.side-logo img { height: 50px; width: auto; }
.side nav { padding: 4px 16px; display: flex; flex-direction: column; gap: 4px; position: relative; z-index: 1; }
.side nav a { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: var(--r-sm); font-weight: 500; font-size: 14.5px; color: rgba(255, 255, 255, .92); position: relative; }
.side nav a svg { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.side nav a:hover { background: rgba(255, 255, 255, .10); }
.side nav a[aria-current] { background: rgba(255, 255, 255, .14); color: var(--white); font-weight: 700; }
.side nav a[aria-current]::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: var(--yellow); }
.side nav a[aria-pressed="true"] { opacity: .6; }
.side nav .sep { height: 1px; background: var(--aqua); opacity: .35; margin: 12px 14px; }
.side-id { margin-top: auto; padding: 0 26px 28px; position: relative; z-index: 1; }
.side-id b { display: block; font-family: var(--display); font-weight: 400; font-size: 34px; letter-spacing: .05em; line-height: 1; }
.side-id span { font-size: 12px; opacity: .9; }
.side .corner { position: absolute; left: 0; bottom: 0; width: 130px; opacity: .55; transform: scaleY(-1); pointer-events: none; }
.content { min-width: 0; display: flex; flex-direction: column; }
.top { height: 78px; display: flex; align-items: center; gap: 14px; padding: 0 40px; }
.top .who { margin-left: auto; display: flex; align-items: center; gap: 14px; font-size: 14px; }
.top .who a { color: var(--teal); font-weight: 700; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--aqua); display: grid; place-items: center; font-weight: 700; font-size: 13px; }
main { padding: 6px 40px 48px; outline: none; flex: 1; display: flex; flex-direction: column; }
#contenu:focus, #contenu:focus-visible { outline: none; }
.page-h { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.page-h p { margin-top: 12px; }
.page-h p b { color: var(--teal); }

/* Une seule carte forte par écran */
.card { background: var(--white); border-radius: var(--r-card); padding: 26px 28px; border: 1.5px solid var(--teal); box-shadow: 3px 4px 0 var(--aqua); }
.tile { background: var(--cream); border-radius: 16px; padding: 14px 16px; }
.item { background: var(--white); border-radius: 18px; padding: 16px; display: flex; gap: 14px; align-items: center; }
.pastille { width: 52px; height: 52px; border-radius: 50%; flex: none; display: grid; place-items: center; font-family: var(--display); font-size: 22px; line-height: 1; background: var(--mint); color: var(--ink); }
.pastille.jaune { background: var(--yellow); }
.pastille.aqua { background: var(--aqua); }
.pastille.vert { background: var(--green); color: var(--white); }

/* ─── Côté joueur : uniquement l'interface de jeu (plein écran) ─── */
.app.joueur { grid-template-columns: 1fr; }
.app.joueur .side, .app.joueur .top, .app.joueur .page-h { display: none; }
.app.joueur main { padding: 0; }
.app.joueur .game-card { border: 0; border-radius: 0; box-shadow: none; min-height: 100vh; }

/* ─── Jeu : la carte forte de la page ─── */
#stage { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.game-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; flex: 1; min-height: 520px; }
.game-head { display: flex; align-items: center; gap: 18px; padding: 12px 22px; border-bottom: 1.5px solid var(--aqua); background: var(--white); }
#hud-hearts { display: flex; gap: 4px; }
.heart { width: 21px; height: 18px; display: inline-block; background-size: contain; background-repeat: no-repeat; image-rendering: pixelated; }
.heart.h2 { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 7 6' shape-rendering='crispEdges'%3E%3Cpath fill='%23e8ba29' d='M1 0h2v1H1zM4 0h2v1H4zM0 1h7v2H0zM1 3h5v1H1zM2 4h3v1H2zM3 5h1v1H3z'/%3E%3C/svg%3E"); }
.heart.h1 { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 7 6' shape-rendering='crispEdges'%3E%3Cpath fill='%23cef1e4' d='M1 0h2v1H1zM4 0h2v1H4zM0 1h7v2H0zM1 3h5v1H1zM2 4h3v1H2zM3 5h1v1H3z'/%3E%3Cpath fill='%23e8ba29' d='M1 0h2v1H1zM0 1h3.5v2H0zM1 3h2.5v1H1zM2 4h1.5v1H2zM3 5h.5v1H3z'/%3E%3C/svg%3E"); }
.heart.h0 { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 7 6' shape-rendering='crispEdges'%3E%3Cpath fill='%23cef1e4' d='M1 0h2v1H1zM4 0h2v1H4zM0 1h7v2H0zM1 3h5v1H1zM2 4h3v1H2zM3 5h1v1H3z'/%3E%3C/svg%3E"); }
#hud-eclats { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 14px; color: var(--teal); }
.gem { width: 12px; height: 12px; display: inline-block; background: var(--yellow); transform: rotate(45deg); }
#hud-place { font-family: var(--display); font-size: 24px; letter-spacing: .05em; color: var(--teal); line-height: 1; }
#hud-obj { flex: 1; text-align: right; font-size: 14px; }
#hud-timer { font-family: var(--display); font-size: 26px; min-width: 64px; height: 44px; padding: 0 10px; border-radius: 22px; display: grid; place-items: center; background: var(--mint); line-height: 1; }
#hud-timer.low { background: var(--yellow); }
.game-view { position: relative; flex: 1; min-height: 0; background: var(--teal); }
#game { position: absolute; inset: 0; }
#game canvas { image-rendering: pixelated; image-rendering: crisp-edges; }

/* Bandeau d'entrée de zone */
#title-card { position: absolute; top: 14%; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 14px; padding: 12px 24px; background: var(--cream); border-radius: var(--r-sm); pointer-events: none; opacity: 0; }
#title-card.show { animation: titleCard 2.6s ease both; }
#title-card img { height: 32px; }
#title-card span { font-weight: 700; text-transform: uppercase; font-size: 22px; color: var(--teal); padding-bottom: 4px; border-bottom: 2.5px solid var(--yellow); }
@keyframes titleCard { 0% { opacity: 0; transform: translate(-50%, -8px); } 15%, 78% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; } }

/* Invite d'interaction */
#prompt { position: absolute; left: 50%; bottom: 20px; transform: translateX(-50%); padding: 8px 14px; border-radius: 11px; background: var(--white); color: var(--ink); font-size: 14px; font-weight: 600; pointer-events: none; white-space: nowrap; }
#prompt b { display: inline-block; min-width: 22px; padding: 0 6px; margin-right: 6px; border-radius: 6px; background: var(--teal); color: var(--white); text-align: center; }

/* Dialogue : carte blanche ITERA */
#dialog { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); width: min(860px, calc(100% - 32px)); padding: 18px 24px; border-radius: 20px; cursor: pointer; background: var(--white); border: 1.5px solid var(--teal); box-shadow: 3px 4px 0 var(--aqua); animation: dlgIn .2s ease both; }
@keyframes dlgIn { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }
.dlg-speaker { display: inline-block; font-weight: 700; text-transform: uppercase; color: var(--teal); font-size: 14px; padding-bottom: 4px; border-bottom: 2px solid var(--yellow); margin-bottom: 10px; }
.dlg-text { font-size: 16.5px; min-height: 50px; }
.dlg-hint { display: flex; justify-content: space-between; margin-top: 10px; font-size: 12.5px; color: var(--petrol); font-weight: 600; }
.blink { animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.dlg-choices { display: grid; gap: 8px; margin-top: 12px; }
.dlg-choice { text-align: left; padding: 11px 14px; border-radius: 14px; border: 0; background: var(--cream); font-size: 15px; }
.dlg-choice:hover, .dlg-choice.on { background: var(--mint); color: var(--ink); font-weight: 600; }
.tag-todo { color: var(--petrol); font-weight: 700; font-size: .85em; }

/* Panneaux (moniteur, pause, révélation) */
#panel { position: absolute; inset: 0; display: flex; flex-direction: column; padding: 20px; background: rgba(245, 245, 220, .82); overflow-y: auto; }
.panel-inner { margin: auto; width: min(560px, 100%); padding: 26px 28px; border-radius: var(--r-card); background: var(--white); border: 1.5px solid var(--teal); box-shadow: 3px 4px 0 var(--aqua); }
#panel.wide .panel-inner { width: min(840px, 100%); }
.panel-inner h2 { margin-bottom: 10px; }
.panel-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 20px; }
.logs { margin: 14px 0; padding: 14px 16px; border-radius: 16px; background: var(--cream); font: 500 13px ui-monospace, "SF Mono", Menlo, monospace; display: grid; gap: 4px; }
.logs .alerte { font-weight: 700; color: var(--teal); }
.logs .alerte::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--yellow); margin-right: 8px; }

/* Révélation */
.reveal { text-align: center; }
.medal { width: 140px; height: 140px; margin: 4px auto 14px; border-radius: 50%; display: grid; place-items: center; background: var(--mint); border: 5px solid var(--medal, var(--yellow)); }
.medal img { width: 92px; animation: medal .9s cubic-bezier(.2, .9, .3, 1.3) both; }
@keyframes medal { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
.medal.aspirant { --medal: var(--green); }
.medal.noble { --medal: var(--aqua-2); }
.medal.souverain { --medal: var(--yellow); }
.reveal .slide-t { font-size: 40px; }
.reveal .lead { margin: 14px auto 4px; max-width: 560px; }
.code-guild { display: inline-flex; align-items: center; gap: 12px; margin: 14px 0 20px; padding: 10px 16px; border-radius: 16px; background: var(--cream); flex-wrap: wrap; justify-content: center; }
.code-guild strong { font-family: var(--display); font-size: 28px; letter-spacing: .06em; color: var(--teal); font-weight: 400; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; text-align: left; }
.grid2 .tile p { font-size: 14px; margin-top: 4px; }

/* ─── Espace recruteur ─── */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 22px; }
.filters { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.filters label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; }
.filters select { padding: 9px 12px; border-radius: 11px; border: 1px solid var(--aqua-2); background: var(--white); font: 500 14px var(--font); }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12.5px; font-weight: 700; text-transform: uppercase; color: var(--teal); padding: 10px; border-bottom: 1.5px solid var(--aqua); }
.table td { padding: 12px 10px; border-bottom: 1px solid var(--mint); }
.table code { font-family: var(--display); font-size: 18px; letter-spacing: .05em; color: var(--teal); }
.palier { font-weight: 700; font-size: 13px; padding: 3px 10px; border-radius: 8px; }
.palier.souverain { background: var(--yellow); }
.palier.noble { background: var(--aqua); }
.palier.aspirant { background: var(--mint); }

/* Toast */
#toast { position: fixed; left: 50%; top: 20px; transform: translate(-50%, -16px); opacity: 0; background: var(--white); border: 1.5px solid var(--teal); box-shadow: 3px 4px 0 var(--aqua); padding: 10px 18px; border-radius: var(--r-sm); transition: all .3s; z-index: 60; pointer-events: none; font-weight: 600; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ─── Petits écrans ─── */
@media (max-width: 900px) {
  .login { grid-template-columns: 1fr; }
  .cover { min-height: 300px; padding: 32px; }
  .cover h1 { font-size: 40px; }
  .cover .iteros { right: 24px; transform: scale(.7); transform-origin: bottom right; }
  .app { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; align-items: center; flex-wrap: wrap; }
  .side-logo { padding: 14px 18px; }
  .side-logo img { height: 34px; }
  .side nav { flex-direction: row; padding: 8px; }
  .side nav .sep, .side-id, .side .corner { display: none; }
  .top, main { padding-left: 16px; padding-right: 16px; }
  .kpis, .grid2 { grid-template-columns: 1fr 1fr; }
  #hud-obj { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* Énigmes des donjons : code, courbe, notes, jauge de sprint */
#panel pre.code { margin: 10px 0 14px; padding: 12px 14px; border-radius: 10px; background: var(--cream); color: var(--ink); font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; text-align: left; white-space: pre-wrap; overflow-x: auto; }
#panel svg.chart { display: block; width: 100%; max-width: 520px; height: auto; margin: 8px auto 12px; }
#panel ul.notes { margin: 6px 0 12px; padding-left: 18px; text-align: left; font-size: 13px; line-height: 1.5; }
#panel .sprint-jauge { margin: 8px 0; font-size: 14px; }
#panel .sprint-jauge b { font-family: var(--display); font-size: 26px; color: var(--teal); font-weight: 400; }
