:root {
  --bg: #070b16;
  --bg-2: #0e1528;
  --card: #121b33;
  --line: #24304f;
  --text: #e6ecff;
  --muted: #8d9ac0;
  --accent: #4fa3ff;
  --accent-2: #2d7fe0;
  --ok: #3ccf8e;
  --err: #ff6b6b;
  color-scheme: dark;
}

* { box-sizing: border-box; }

/* L'attribut hidden doit toujours gagner sur les display: grid/flex des composants */
[hidden] { display: none !important; }

html, body { margin: 0; min-height: 100%; }

body {
  background: radial-gradient(1200px 600px at 70% -10%, #1b2a55 0%, transparent 60%), var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.shell { max-width: 640px; margin: 0 auto; padding: 48px 16px; }

.brand h1 { margin: 0; font-size: 34px; letter-spacing: .04em; }
.brand p { margin: 4px 0 28px; color: var(--muted); }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px;
}

h2 { margin: 0 0 4px; font-size: 20px; }
.muted { color: var(--muted); }

.tabs { display: flex; gap: 4px; margin-bottom: 20px; border-bottom: 1px solid var(--line); }
.tab {
  background: none; border: 0; color: var(--muted); padding: 8px 12px; cursor: pointer;
  border-bottom: 2px solid transparent; font: inherit;
}
.tab.active { color: var(--text); border-bottom-color: var(--accent); }

.form { display: grid; gap: 14px; }
.form.inline { grid-template-columns: 1fr auto; align-items: end; margin-top: 20px; }
label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
input {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px;
  color: var(--text); padding: 10px 12px; font: inherit; width: 100%;
}
input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

button { font: inherit; cursor: pointer; border-radius: 8px; padding: 10px 16px; }
button:disabled { opacity: .45; cursor: not-allowed; }
.primary { background: var(--accent-2); color: #fff; border: 0; }
.primary:hover:not(:disabled) { background: var(--accent); }
.ghost { background: none; border: 1px solid var(--line); color: var(--text); }

.row { display: flex; gap: 16px; }
.between { justify-content: space-between; align-items: flex-start; }

.planets { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 10px; }
.planet {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px;
}
.planet strong { display: block; }
.planet span { font-size: 13px; }

.notice { border-radius: 8px; padding: 10px 14px; margin-bottom: 16px; }
.notice.error { background: rgba(255, 107, 107, .12); border: 1px solid rgba(255, 107, 107, .4); color: #ffc9c9; }
.notice.ok { background: rgba(60, 207, 142, .12); border: 1px solid rgba(60, 207, 142, .4); color: #bff3da; }

.foot { margin-top: 20px; font-size: 13px; }

body.game { background: #000; overflow: hidden; }
body.game #game, body.game ruffle-player { position: fixed; inset: 0; width: 100vw; height: 100vh; }
body.game #status { position: fixed; top: 16px; left: 16px; right: 16px; z-index: 10; }

@media (max-width: 520px) {
  .shell { padding: 28px 16px; }
  .form.inline { grid-template-columns: 1fr; }
  .row.between { flex-direction: column; }
}
