/* =============================================================================
   Pierre Feuille Ciseaux : style harmonisé avec la charte Sacripland
   ============================================================================= */
:root {
  --bg: #F4F5F8;
  --surface: #FFFFFF;
  --fg: #1A1E29;
  --muted: #667085;
  --line: #D6DAE3;
  --accent: #2D5BE3;
  --accent-text: #FFFFFF;
  --ok: #1F8A5B;
  --warn: #E2552B;
  --font: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12151C;
    --surface: #1B2030;
    --fg: #E8EAF0;
    --muted: #98A2B3;
    --line: #2C3345;
    --accent: #7C9BFF;
    --accent-text: #12151C;
    --ok: #5FD3A0;
    --warn: #FF8A65;
  }
}

:root[data-theme="dark"] {
  --bg: #12151C;
  --surface: #1B2030;
  --fg: #E8EAF0;
  --muted: #98A2B3;
  --line: #2C3345;
  --accent: #7C9BFF;
  --accent-text: #12151C;
  --ok: #5FD3A0;
  --warn: #FF8A65;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 16px/1.4 var(--font);
  padding-block: 20px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

.wrap {
  max-width: 400px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

button, a { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3, p { margin: 0; }

.retour {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: .875rem;
}
.retour a { color: var(--muted); text-decoration: none; }
.retour a:hover { color: var(--fg); }
.solde { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--ok); }

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
h1 { font-size: 1.5rem; font-weight: 700; }
.ghost {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: .875rem;
  color: var(--muted);
}
.ghost:hover { color: var(--fg); border-color: var(--muted); }

.carte {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.carte h2 { font-size: 1.125rem; }
.carte p { color: var(--muted); }
.carte[hidden], #jeu[hidden], [hidden] { display: none !important; }

#jeu {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Arène */
.arene {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px 16px;
}
.combattant {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex: 1;
}
.symbole-main {
  font-size: 3.5rem;
  line-height: 1;
  transition: transform 0.2s;
}
.combattant-label {
  font-size: 0.875rem;
  color: var(--muted);
  font-weight: 600;
}
.score-box {
  font-size: 1.5rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.vs {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--muted);
}

/* Choix */
.choix-grille {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.btn-choix {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: all .15s;
}
.btn-choix:hover:not(:disabled) {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.btn-choix:active:not(:disabled) {
  background: var(--line);
}
.btn-choix:disabled {
  opacity: 0.5;
  cursor: default;
}
.choix-icone {
  font-size: 2.2rem;
}
.choix-texte {
  font-size: 0.875rem;
  font-weight: 600;
}

#status { min-height: 1.5em; font-weight: 500; text-align: center; }
.gainline { text-align: center; font-weight: 700; color: var(--ok); margin-top: -6px; }

.actions { display: flex; justify-content: center; }
.primary {
  background: var(--accent);
  color: var(--accent-text);
  border: none;
  border-radius: 10px;
  padding: 10px 24px;
  font-weight: 700;
  font-size: 1rem;
  width: 100%;
}
.primary:hover:not(:disabled) { opacity: .9; }
.primary:disabled { opacity: .5; cursor: default; }

.note { font-size: .8125rem; color: var(--muted); text-align: center; }

.legal {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: .75rem;
  color: var(--muted);
  text-align: center;
}
.legal a { color: var(--muted); margin-inline: 4px; }
