/* Beefy Magic — sign-in, lobby and account pages. Plain CSS, phone-first.
   Same palette as the game table: the five colours of Magic plus colourless silver, on dark. */
:root {
  --w: #f3ecc8; --u: #3f8fd8; --b: #6d5a80; --r: #de5236; --g: #33a162; --c: #b9c0ca;
  --bg: #14161b; --bg2: #1c1f26; --bg3: #232833; --line: #313640; --ink: #e8eaee; --dim: #9aa1ad;
  --silver: #c9ced6; --glow: #ffd45e; --ok: #46c98b; --bad: #ef6a5b;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; color: var(--ink);
  background: radial-gradient(120% 90% at 50% 0%, #232733 0%, var(--bg) 70%) fixed;
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
a { color: var(--silver); }
#top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 10px 16px; border-bottom: 1px solid var(--line); background: rgba(20, 22, 27, .85);
}
.brand { font-weight: 750; letter-spacing: .02em; color: var(--ink); text-decoration: none; white-space: nowrap; }
.pips { display: inline-flex; gap: 3px; margin-left: 6px; vertical-align: middle; }
.pips i { width: 9px; height: 9px; border-radius: 50%; display: block; }
.pips .w { background: var(--w); } .pips .u { background: var(--u); } .pips .b { background: var(--b); }
.pips .r { background: var(--r); } .pips .g { background: var(--g); } .pips .c { background: var(--c); }
#nav { display: flex; align-items: center; gap: 14px; }
#nav a { text-decoration: none; color: var(--dim); }
#nav a.here { color: var(--ink); font-weight: 600; }
main { max-width: 760px; margin: 0 auto; padding: 20px 16px 60px; }
h1 { font-size: 1.5rem; margin: 6px 0 14px; }
h2 { font-size: 1.1rem; margin: 26px 0 10px; }
p.dim, .dim { color: var(--dim); }
.card {
  background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin: 12px 0;
}
.card.narrow { max-width: 420px; margin: 24px auto; }
button, select, input {
  font: inherit; color: var(--ink); background: var(--bg3); border: 1px solid var(--line);
  border-radius: 9px; padding: 9px 14px; min-height: 44px;
}
button { cursor: pointer; }
button:hover:not(:disabled), select:hover { border-color: var(--silver); }
button:disabled { opacity: .5; cursor: default; }
button.primary { background: linear-gradient(#e9edf3, #b9c0ca); color: #14161b; border-color: #fff; font-weight: 650; }
button.danger { color: var(--bad); }
button.link { background: none; border: none; color: var(--silver); text-decoration: underline; padding: 6px 0; min-height: 0; }
button:focus-visible, select:focus-visible, input:focus-visible, a:focus-visible { outline: 2px solid var(--glow); outline-offset: 2px; }
input { width: 100%; }
label { display: block; margin: 12px 0 4px; color: var(--dim); font-size: .92rem; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 14px; }
.row.end { justify-content: flex-end; }
.stack > * + * { margin-top: 10px; }
.wide { width: 100%; }
.err { color: var(--bad); margin: 10px 0 0; }
.ok { color: var(--ok); }
.qr { background: #fff; padding: 10px; border-radius: 10px; width: 210px; height: 210px; margin: 10px auto; }
.qr svg { width: 100%; height: 100%; display: block; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: .03em; word-break: break-all; }
.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 18px; margin: 10px 0; }
.list { list-style: none; padding: 0; margin: 0; }
.list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  padding: 10px 0; border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; }
.tag { font-size: .78rem; color: var(--dim); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; margin-left: 6px; }
.tag.on { color: var(--ok); border-color: var(--ok); }
.tag.warn { color: var(--glow); border-color: var(--glow); }

/* lobby */
.tables { display: grid; gap: 14px; }
.table-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.table-head h3 { margin: 0; font-size: 1.1rem; }
.seats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 12px 0 4px; }
.seat { border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; min-height: 58px; background: var(--bg); }
.seat.me { border-color: var(--silver); }
.seat .who { font-weight: 600; }
.seat .state { font-size: .85rem; color: var(--dim); }
.seat .state.ready { color: var(--ok); }
.seat.empty .who { color: var(--dim); font-weight: 400; }
.seat button { margin-top: 6px; min-height: 36px; padding: 5px 10px; }
.create { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.create label { margin-top: 0; }
@media (max-width: 480px) { .create { grid-template-columns: 1fr; } }

/* card pictures (Scryfall), with the name showing until the picture arrives */
.cardimg { position: relative; display: inline-flex; align-items: center; justify-content: center; text-align: center;
  aspect-ratio: 488 / 680; border-radius: 4.5% / 3.3%; background: var(--bg3); border: 1px solid var(--line);
  overflow: hidden; color: var(--dim); font-size: .7rem; line-height: 1.2; padding: 4px; vertical-align: middle; }
.cardimg img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .2s; }
.cardimg.has img { opacity: 1; }
.cardimg.has .cardimg-name { visibility: hidden; }
.cardimg.cmdr { width: 64px; }
.cardimg.thumb { width: 52px; }
.cardimg.cmdr-big { width: min(46vw, 220px); font-size: .9rem; }
.cardimg.pimg { width: 100%; }
.cmdrs { display: flex; gap: 6px; flex-wrap: wrap; }
.cmdrs.big { margin-bottom: 12px; }
.seat-deck { margin-top: 8px; display: grid; gap: 5px; }
.seat-deck .cmdr-name { font-size: .82rem; }
.seat-deck select { min-height: 36px; padding: 5px 8px; width: 100%; font-size: .9rem; }
.small { font-size: .85rem; }
.pre { white-space: pre-line; }
.seat-deck .err { margin: 2px 0 0; }
.tag.bad { color: var(--bad); border-color: var(--bad); }

/* decks */
.decks { display: grid; gap: 10px; }
.deck-row { display: flex; gap: 12px; align-items: center; text-decoration: none; color: var(--ink); margin: 0; padding: 10px 12px; }
.deck-row:hover { border-color: var(--silver); }
.deck-info { display: grid; gap: 2px; min-width: 0; }
.deck-info .pips { margin-left: 0; }
textarea { font: .92rem/1.4 ui-monospace, "SF Mono", Menlo, Consolas, monospace; width: 100%; color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; resize: vertical; min-height: 220px; }
textarea:focus-visible { outline: 2px solid var(--glow); outline-offset: 2px; }
.summary { border-radius: 12px; padding: 12px 16px; margin: 14px 0; border: 1px solid var(--line); background: var(--bg2); }
.summary.good { border-color: var(--ok); } .summary.good strong { color: var(--ok); }
.summary.warn { border-color: var(--glow); } .summary.warn strong { color: var(--glow); }
.summary.bad { border-color: var(--bad); } .summary.bad strong { color: var(--bad); }
.summary .pips { margin-left: 0; }
.bad-box { border-color: var(--bad); }
.row.tight { gap: 6px; margin-top: 0; }
button.small-btn { min-height: 34px; padding: 4px 10px; font-size: .88rem; }
.checks { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.checks li { padding-left: 26px; position: relative; }
.checks li::before { position: absolute; left: 0; top: 0; font-weight: 700; }
.checks li.no::before { content: "\2717"; color: var(--bad); }
.checks li.yes::before { content: "\2713"; color: var(--ok); }
.checks li.note { color: var(--dim); font-size: .9rem; }
.checks li.note::before { content: "i"; font-style: italic; color: var(--dim); left: 6px; }
h3.group { font-size: .95rem; margin: 18px 0 6px; color: var(--dim); }
.cards { list-style: none; padding: 0; margin: 0; }
.cards li { display: grid; grid-template-columns: 2.2em 1fr auto; align-items: center; gap: 8px; padding: 3px 0; border-top: 1px solid var(--line); }
.cards li:first-child { border-top: 0; }
.cards .n { color: var(--dim); text-align: right; }
.cards .cname { min-width: 0; overflow-wrap: anywhere; }
button.printing { min-height: 32px; padding: 3px 9px; font: .8rem ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
button.printing:disabled { opacity: .6; border-color: transparent; background: none; }
details.card summary { cursor: pointer; color: var(--dim); }
dialog.picker { width: min(92vw, 860px); max-height: 88vh; color: var(--ink); background: var(--bg2); border: 1px solid var(--line);
  border-radius: 14px; padding: 16px; }
dialog.picker::backdrop { background: rgba(0, 0, 0, .65); }
dialog.picker h2 { margin: 0; }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; margin-top: 12px; }
.ptile { display: grid; gap: 3px; align-content: start; text-align: left; padding: 6px; min-height: 0; border-radius: 10px; }
.ptile.here { border-color: var(--glow); box-shadow: 0 0 0 1px var(--glow); }

#toast {
  position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--bg3); border: 1px solid var(--silver); border-radius: 10px; padding: 10px 16px; margin: 0;
  max-width: calc(100vw - 32px); box-shadow: 0 8px 30px rgba(0, 0, 0, .5);
}
#toast.bad { border-color: var(--bad); color: var(--bad); }
