/* Dicky Games — base + hub */
:root {
  --ink: #0c181b;
  --felt: #112126;
  --felt2: #173039;
  --line: #2a4650;
  --bronze: #d4a24c;
  --bronze-d: #8a6a2c;
  --text: #ece6d3;
  --muted: #8ea3a6;
  --ember: #e2674a;
  --ok: #6fcf8f;
  --brown: #9a6a3a;
  --grey: #8a949c;
  --blue: #3f7fcf;
  --yellow: #d6ae3a;
  --red: #c24b3f;
  --green: #4a9a58;
  --guild: #8d5cc0;
  --fd: "Almendra SC", Georgia, serif;
  --fb: "Alegreya Sans", "Segoe UI", system-ui, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body {
  background: radial-gradient(120% 70% at 50% -10%, #17333b 0%, var(--ink) 60%) fixed, var(--ink);
  color: var(--text);
  font: 16px/1.4 var(--fb);
  padding-left: max(8px, env(safe-area-inset-left, 0px));
  padding-right: max(8px, env(safe-area-inset-right, 0px));
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  overscroll-behavior: none;
  user-select: none; -webkit-user-select: none;
}
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible { outline: 2px solid var(--bronze); outline-offset: 2px; }
button:disabled { cursor: default; }

.btn {
  font: 600 1rem var(--fb); padding: .7rem 1rem; border-radius: 10px;
  border: 1px solid var(--line); background: var(--felt2); color: var(--text);
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
}
.btn:active { transform: translateY(1px); }
.btn.gold { background: linear-gradient(#e2b45c, #b98a35); color: #1d1608; border-color: #ecc983; }
.btn.big { padding: .9rem 1rem; font-size: 1.1rem; }
.btn.ghost { background: transparent; }
.btn small { font-weight: 500; opacity: .75; }
.btn:disabled { opacity: .4; }

/* ───────── Hub ───────── */
#app { height: 100%; position: relative; }
.hub { height: 100%; overflow: auto; max-width: 560px; margin: 0 auto; padding: 18px 8px 24px; display: flex; flex-direction: column; gap: 18px; }
.hub header { display: flex; align-items: center; gap: 12px; }
.hub header img { width: 52px; height: 52px; border-radius: 14px; }
.hub h1 { font: 400 2rem/1 var(--fd); letter-spacing: .04em; margin: 0; text-wrap: balance; }
.hub header p { margin: 2px 0 0; color: var(--muted); font-size: .9rem; }
.gcards { display: grid; gap: 14px; }
.gc {
  display: grid; grid-template-columns: 1fr; text-align: left; padding: 0; overflow: hidden;
  background: var(--felt); border: 1px solid var(--line); border-radius: 18px; color: inherit;
}
.gc .art { background: radial-gradient(circle at 50% 60%, #24505b 0%, var(--felt) 70%); display: flex; justify-content: center; padding: 14px 0 4px; }
.gc .art svg { width: 130px; height: 130px; }
.gc .body { padding: 6px 16px 16px; display: grid; gap: 8px; }
.gc h2 { font: 400 1.5rem var(--fd); letter-spacing: .03em; margin: 0; }
.gc p { margin: 0; color: #c8cfc4; }
.gc .meta { display: flex; flex-wrap: wrap; gap: 6px; }
.gc .meta span { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--bronze); border: 1px solid var(--bronze-d); border-radius: 999px; padding: 2px 9px; }
.gc .st { font-size: .85rem; color: var(--muted); }
.gc .go { justify-self: start; margin-top: 4px; }
.gc.soon { border-style: dashed; background: transparent; opacity: .75; }
.gc.soon .body { padding-top: 16px; }
.hub footer { margin-top: auto; text-align: center; font-size: .75rem; color: var(--muted); }
.hub footer a { color: var(--muted); }
#gameHost { position: absolute; inset: 0; background: transparent; }

/* ───────── compte, connexion, fenêtres ───────── */
.hub header .ttl { flex: 1; min-width: 0; }
.chip-acct { max-width: 38%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: var(--felt2); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; font-weight: 600; font-size: .85rem; }
.chip-acct:empty { display: none; }
#auth { position: absolute; inset: 0; overflow: auto; background: var(--ink); z-index: 90; }
#auth[hidden], #modal[hidden] { display: none !important; }
.au { max-width: 420px; margin: 0 auto; padding: 36px 16px 32px; display: grid; gap: 14px; justify-items: center; text-align: center; }
.au-logo { width: 72px; height: 72px; border-radius: 18px; }
.au h1 { font: 400 2.1rem/1.05 var(--fd); letter-spacing: .03em; margin: 0; text-wrap: balance; }
.au-sub { margin: 0; color: #c8cfc4; max-width: 38ch; }
.au-form { display: grid; gap: 12px; width: 100%; text-align: left; margin-top: 6px; }
.fld { display: grid; gap: 4px; }
.fld span { font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
input { font: inherit; color: var(--text); background: #0b171a; border: 1px solid var(--line); border-radius: 10px; padding: .7rem .8rem; width: 100%; user-select: text; -webkit-user-select: text; }
input:focus { outline: 2px solid var(--bronze); outline-offset: 1px; }
.au-err { color: var(--ember); margin: 0; min-height: 1.2em; font-size: .9rem; }
.au-note { color: var(--muted); font-size: .85rem; margin: 0; }
.lnk { background: none; border: 0; color: var(--bronze); text-decoration: underline; padding: 4px; }
.muted { color: var(--muted); font-size: .85rem; margin: 0; }
#modal { position: absolute; inset: 0; z-index: 80; display: flex; align-items: flex-end; justify-content: center; }
.mdl-bg { position: absolute; inset: 0; background: rgba(5, 12, 14, .76); }
.mdl { position: relative; width: 100%; max-width: 520px; max-height: 92%; overflow: auto; background: var(--felt); border: 1px solid var(--line); border-radius: 18px 18px 0 0; padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 10px; align-content: start; }
@media (min-width: 700px) { #modal { align-items: center; } .mdl { border-radius: 18px; } }
.mdl h2 { font: 400 1.5rem var(--fd); margin: 0; }
.mdl h3 { font: 400 1.15rem var(--fd); margin: 6px 0 0; }
.mdl h4 { margin: 6px 0 0; font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; color: var(--bronze); }
.inl { display: flex; gap: 8px; }
.inl input { flex: 1; min-width: 0; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 6px; }
.row3 { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 8px; }
.rowi { display: flex; align-items: center; gap: 8px; }
.rowi span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.rowi .btn { padding: .4rem .7rem; font-size: .85rem; }
.invc { display: grid; gap: 8px; background: #0b171a; border: 1px solid var(--bronze-d); border-radius: 14px; padding: 12px; justify-items: center; text-align: center; }
.qrbox { background: #fff; border-radius: 10px; padding: 6px; width: min(240px, 70vw); }
.qr { display: block; width: 100%; height: auto; }
.lk { font-size: .8rem; }

/* jeux en cadre isolé */
.frgame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: transparent; display: block; }
.fr-msg { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 12px; align-items: center; justify-content: center; color: #ece6d3; text-align: center; padding: 20px; }
.gc .art .emb { width: 130px; height: 130px; border-radius: 28px; }
