:root {
  --bg: #14121f;
  --surface: #1f1c2e;
  --surface-2: #2a2640;
  --border: #36314f;
  --text: #f2f0fa;
  --muted: #a39fb8;
  --accent: #f5c518;
  --accent-text: #1a1500;
  --danger: #ff6b6b;
  --success: #4ade80;
  --radius: 14px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

[hidden] { display: none !important; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(env(safe-area-inset-top) + 10px) 16px 10px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.brand img { width: 30px; height: 30px; border-radius: 8px; }

main {
  max-width: 560px;
  margin: 0 auto;
  padding: 16px 16px calc(env(safe-area-inset-bottom) + 24px);
}

h1 { font-size: 1.6rem; line-height: 1.2; margin: 12px 0 8px; }
h2 { font-size: 1.2rem; margin: 0; }
h3 { font-size: 1.1rem; margin: 0; }
.muted { color: var(--muted); }
.center { text-align: center; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin: 16px 0;
}
.hint { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.hint button { margin-top: 12px; width: 100%; }

.form { display: flex; flex-direction: column; gap: 14px; }
label { display: flex; flex-direction: column; gap: 6px; font-size: .9rem; color: var(--muted); }
input, select {
  font: inherit;
  font-size: 16px; /* évite le zoom auto d'iOS */
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  width: 100%;
}
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

button {
  font: inherit;
  font-weight: 600;
  border: 0;
  border-radius: 10px;
  padding: 12px 16px;
  cursor: pointer;
  color: var(--text);
  background: var(--surface-2);
}
button.primary { background: var(--accent); color: var(--accent-text); }
button.ghost { background: transparent; border: 1px solid var(--border); }
button.small { padding: 8px 12px; font-size: .9rem; }
button.icon { padding: 8px 10px; background: transparent; color: var(--muted); }
button:disabled { opacity: .6; }

.error { color: var(--danger); margin: 0; font-size: .9rem; }

.section-head { display: flex; align-items: center; justify-content: space-between; margin: 20px 0 12px; }

.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }

.alert-card, .result {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
}
.alert-card.hit { border-color: var(--success); }
.alert-card.off { opacity: .55; }
.result { width: 100%; text-align: left; font-weight: 400; }

.thumb {
  width: 56px;
  height: 56px;
  flex: none;
  border-radius: 10px;
  background: var(--surface-2);
  object-fit: contain;
}
.info { flex: 1; min-width: 0; }
.name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta { font-size: .85rem; color: var(--muted); }
.meta b { color: var(--text); }
.chip {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 8px;
  border-radius: 99px;
  font-size: .75rem;
  font-weight: 600;
  background: color-mix(in srgb, var(--success) 20%, transparent);
  color: var(--success);
}
.actions { display: flex; align-items: center; gap: 2px; flex: none; }

.switch { position: relative; display: inline-block; width: 44px; height: 26px; margin-right: 4px; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span {
  position: absolute;
  inset: 0;
  border-radius: 99px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  transition: background .15s;
}
.switch span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform .15s, background .15s;
}
.switch input:checked + span { background: color-mix(in srgb, var(--accent) 35%, var(--surface-2)); }
.switch input:checked + span::after { transform: translateX(18px); background: var(--accent); }

.footer-actions { display: flex; justify-content: center; margin-top: 28px; }

.backdrop { position: fixed; inset: 0; z-index: 10; background: rgb(0 0 0 / .55); }
.sheet {
  position: fixed;
  z-index: 11;
  left: 0;
  right: 0;
  bottom: 0;
  max-width: 560px;
  margin: 0 auto;
  max-height: 88dvh;
  overflow-y: auto;
  background: var(--bg);
  border: 1px solid var(--border);
  border-bottom: 0;
  border-radius: 20px 20px 0 0;
  padding: 16px 16px calc(env(safe-area-inset-bottom) + 20px);
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.results { margin-top: 12px; }
.item-row { display: flex; align-items: center; gap: 12px; }

.toast {
  position: fixed;
  z-index: 20;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom) + 20px);
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  box-shadow: 0 6px 24px rgb(0 0 0 / .4);
}

.small-text { font-size: .85rem; }
.stack { display: flex; flex-direction: column; gap: 10px; margin: 12px 0; }
.stack button { width: 100%; }
.account-summary { margin-top: 0; }
button.danger { background: var(--danger); color: #1a0000; }
.danger-text { color: var(--danger); }

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-top: 20px;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.tab { background: transparent; color: var(--muted); padding: 10px; }
.tab.active { background: var(--surface-2); color: var(--text); }
.tabs + .card { margin-top: 12px; }
.tabs.three { grid-template-columns: repeat(3, 1fr); margin-top: 0; }
.tabs.three .tab { padding: 8px 4px; font-size: .85rem; }

/* Guide d'installation */
.steps { list-style: none; counter-reset: step; margin: 16px 0 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.steps li { counter-increment: step; position: relative; padding-left: 40px; line-height: 1.5; }
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -1px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: .9rem;
  background: var(--accent);
  color: var(--accent-text);
}
.ico { width: 1.25em; height: 1.25em; vertical-align: -0.28em; color: #4ea1ff; }
.key {
  display: inline-block;
  min-width: 1.5em;
  padding: 0 4px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-2);
  text-align: center;
}
#install-alert { margin: 14px 0 0; }

.success { color: var(--success); margin: 0; font-size: .9rem; }
.row { display: flex; gap: 10px; margin-top: 12px; }
.row button { flex: 1; }
.hint .row button { margin-top: 0; }
.invite-code {
  font: 700 1.6rem/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .12em;
  color: var(--accent);
  margin: 4px 0;
}
button.link {
  background: none;
  border: 0;
  padding: 4px 0;
  color: var(--accent);
  font-weight: 500;
  font-size: .9rem;
  text-align: left;
}
.form button.link { align-self: center; }
.quota { font-size: .85rem; font-weight: 500; color: var(--muted); margin-left: 4px; }
.quota.full { color: var(--danger); }
.badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 99px;
  font-size: .75rem;
  font-weight: 600;
  background: color-mix(in srgb, var(--accent) 22%, transparent);
  color: var(--accent);
}
.badge.warn { background: color-mix(in srgb, var(--danger) 20%, transparent); color: var(--danger); }
.badge.ok { background: color-mix(in srgb, var(--success) 20%, transparent); color: var(--success); }
#account-email, #account-plan { font-weight: 600; margin: 2px 0 6px; overflow-wrap: anywhere; }

/* Page « ouvrir dans Roblox » (go.html) */
a.brand { color: inherit; text-decoration: none; }
.go { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; padding-top: 12px; }
.go h1 { margin: 0; }
.go-thumb { width: 150px; height: 150px; border-radius: 20px; background: var(--surface); object-fit: contain; }
.go-price { margin: 0; font-size: 1.6rem; font-weight: 700; color: var(--accent); }
a.button {
  display: block;
  width: 100%;
  padding: 12px 16px;
  border-radius: 10px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  color: var(--text);
  background: var(--surface-2);
}
a.button.primary { background: var(--accent); color: var(--accent-text); }
a.button.ghost { background: transparent; border: 1px solid var(--border); }
a.button.link { background: none; color: var(--accent); font-weight: 500; }
a.button.big { padding: 18px; font-size: 1.15rem; }
