/* Lobby (Theo, 1 Nov 2026). Shares the table's tokens and buttons from style.css. */
body.lobbypage { height: auto; min-height: 100%; overflow-y: auto;
  background: radial-gradient(90% 50% at 50% -10%, rgba(79, 185, 181, .13), transparent 70%), linear-gradient(180deg, rgba(14, 10, 28, .86), var(--bg) 520px), url(assets/board.png) 50% -260px / 1100px auto no-repeat, var(--bg); }
.lobbypage ::selection { background: var(--amber); color: #1A1204; }
#lobby { max-width: 980px; margin: 0 auto; padding: calc(18px + env(safe-area-inset-top, 0px)) 20px calc(40px + env(safe-area-inset-bottom, 0px)); }

.lhead { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.lbrand { font: 700 24px/1 var(--f-disp); letter-spacing: 4px; text-transform: uppercase; }
.lbrand span { color: var(--amber); letter-spacing: 3px; font-weight: 600; }
.lprofile { display: flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: 999px; background: rgba(30, 23, 56, .9); color: var(--ink); border: 1px solid var(--line); font-weight: 600; }
.lprofile .av { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: #2A2147; box-shadow: 0 0 0 2px var(--fac, var(--line)); font: 700 14px/1 var(--f-num); }
.lprofile .av img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.lprofile .nm { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.lintro { margin: 56px 0 26px; }
.lintro h1 { font: 700 44px/1.05 var(--f-disp); letter-spacing: 1px; text-transform: uppercase; margin: 0 0 8px; }
.lintro > p { color: #D8CDE6; font-size: 16px; margin: 0 0 20px; }
.lactions { display: flex; gap: 12px; flex-wrap: wrap; align-items: stretch; }
.lprimary { height: 48px; padding: 0 22px; border-radius: 12px; background: var(--amber); color: #1A1204; font-size: 16px; box-shadow: 0 8px 22px rgba(242, 196, 109, .22); }
.lghost { height: 48px; padding: 0 18px; border-radius: 12px; background: transparent; color: var(--ink); border: 1px solid var(--line); }
.lcode { display: flex; flex: 1; min-width: 260px; max-width: 420px; }
.lcode input { height: 48px; border-radius: 12px 0 0 12px; border-right: 0; font-size: 15px; padding: 0 14px; background: rgba(14, 10, 28, .85); }
.lcode input:focus, .lfield input:focus, .lfield select:focus { outline: none; border-color: var(--amber); box-shadow: 0 0 0 3px rgba(242, 196, 109, .2); }
.lcode button { height: 48px; border-radius: 0 12px 12px 0; padding: 0 18px; }
.lnote { color: var(--muted); font-size: 13px; margin: 12px 0 0; }
#phonenote { display: none; }

/* game cards */
.lgames { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.lgame { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 16px 16px 14px; border-radius: 16px; background: rgba(30, 23, 56, .92); border: 1px solid var(--line); box-shadow: 0 12px 28px rgba(0, 0, 0, .35); }
.lgame.done { opacity: .78; }
.gtop { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.gtop h2 { margin: 0; font: 700 20px/1.15 var(--f-disp); letter-spacing: .5px; text-transform: uppercase; color: var(--ink); display: block; }
.gstatus { flex: none; font-size: 11px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; padding: 4px 8px; border-radius: 6px; background: #2A2147; color: var(--muted); }
.gstatus.open { color: var(--teal); background: rgba(79, 185, 181, .12); }
.gstatus.live { color: var(--amber); background: rgba(242, 196, 109, .12); }
.gmeta { font-size: 13px; color: var(--muted); }
.gseats { display: flex; align-items: center; gap: 6px; }
.pip { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; border: 1.5px dashed var(--line); font: 700 12px/1 var(--f-num); color: #0E0A1C; }
.pip.on { border: 0; background: var(--c); }
.gfree { margin-left: 4px; font-size: 13px; color: #D8CDE6; }
.grules { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 12px; padding: 4px 8px; border-radius: 6px; background: rgba(242, 196, 109, .1); color: #F4D394; border: 1px solid rgba(242, 196, 109, .25); }
.chip.plain { background: transparent; color: var(--muted); border-color: var(--line); }
.gjoin { margin-top: 4px; display: grid; place-items: center; height: 44px; border-radius: 10px; border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-weight: 700; }
.gjoin.primary { background: var(--teal); color: #0E0A1C; border-color: transparent; }
.gjoin:focus-visible, .lprofile:focus-visible, button:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.lempty { grid-column: 1 / -1; padding: 40px 20px; text-align: center; border: 1px dashed var(--line); border-radius: 16px; color: var(--muted); }
.lempty h2 { display: block; font: 600 18px/1.3 var(--f-body); color: var(--ink); letter-spacing: 0; text-transform: none; margin: 0 0 6px; }
.lempty p { margin: 0; }
.lfoot { display: flex; gap: 8px; justify-content: center; margin-top: 36px; color: var(--muted); font-size: 13px; }
.lfoot a { color: var(--teal); text-underline-offset: 3px; }

/* dialogs */
.ldialog { width: min(640px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); padding: 0; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); color: var(--ink); box-shadow: 0 30px 80px rgba(0, 0, 0, .7); }
.ldialog.lsmall { width: min(420px, calc(100vw - 24px)); }
.ldialog::backdrop { background: rgba(8, 5, 16, .72); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.ldialog form { display: flex; flex-direction: column; gap: 16px; padding: 20px 22px 18px; }
.ldtitle { display: flex; align-items: center; justify-content: space-between; }
.ldtitle h2 { display: block; margin: 0; font: 700 22px/1 var(--f-disp); letter-spacing: 1px; text-transform: uppercase; color: var(--ink); }
.lx { width: 36px; height: 36px; padding: 0; border-radius: 50%; background: transparent; color: var(--muted); font-size: 24px; line-height: 1; }
.lfield { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.lfield > span { font-size: 12px; font-weight: 600; letter-spacing: .5px; text-transform: uppercase; color: var(--muted); }
.lfield input, .lfield select { height: 44px; border-radius: 10px; font-size: 15px; }
.lrow2 { display: flex; gap: 14px; flex-wrap: wrap; }
.lseg { display: flex; padding: 3px; border-radius: 10px; background: #0E0A1C; border: 1px solid var(--line); }
.lseg button { flex: 1; white-space: nowrap; height: 36px; border-radius: 8px; background: transparent; color: var(--muted); font-weight: 600; }
.lseg button.on { background: #3A2E63; color: var(--ink); box-shadow: 0 1px 6px rgba(0, 0, 0, .4); }
.lrules { border-top: 1px solid var(--line); padding-top: 14px; }
.lrhead { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 6px; }
.lrhead h3 { margin: 0; font: 700 16px/1 var(--f-disp); letter-spacing: 1.5px; text-transform: uppercase; color: var(--amber); }
.llink { background: transparent; color: var(--teal); padding: 0; font-weight: 500; font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }
.rgroup h4 { margin: 14px 0 4px; font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.rule { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 9px 0; border-bottom: 1px solid rgba(58, 46, 92, .6); }
.rule .rl { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rule .rl small { color: var(--muted); font-size: 12px; }
.rule.changed .rl span { color: #F4D394; }
.rule.changed .rl span::after { content: "changed"; margin-left: 8px; font-size: 10px; letter-spacing: .6px; text-transform: uppercase; color: var(--amber); }
.rule select { width: auto; max-width: 290px; height: 38px; border-radius: 8px; }
.rule .step { display: flex; flex-direction: row; align-items: center; gap: 4px; border: 0; padding: 0; border-radius: 0; opacity: 1; box-shadow: none; }   /* style.css has a set-up .step too */
.step button { width: 36px; height: 36px; padding: 0; border-radius: 8px; background: #2A2147; color: var(--ink); font-size: 18px; }
.step b { min-width: 30px; text-align: center; font: 700 18px/1 var(--f-num); font-variant-numeric: tabular-nums; }
.switch { position: relative; flex: none; width: 48px; height: 28px; padding: 0; border-radius: 14px; background: #2A2147; border: 1px solid var(--line); }
.switch i { position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--muted); transition: transform .2s cubic-bezier(.16, 1, .3, 1), background .2s; }
.switch.on { background: rgba(242, 196, 109, .25); border-color: var(--amber); }
.switch.on i { transform: translateX(20px); background: var(--amber); }
.discordbtn { display: grid; place-items: center; height: 46px; border-radius: 12px; background: #5865F2; color: #fff; font-weight: 700; text-decoration: none; }
.discordbtn:hover { background: #4752C4; }
.por { text-align: center; color: var(--muted); font-size: 12px; margin-top: 8px; }
.pauth { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: #0E0A1C; border: 1px solid var(--line); font-size: 14px; }
.pauth img { width: 32px; height: 32px; border-radius: 50%; }
.pauth span { flex: 1; }
.pauth a { color: var(--teal); font-size: 13px; text-underline-offset: 3px; }
.ldiff { margin: 10px 0 0; font-size: 13px; color: #D8CDE6; }
.ldfoot { display: flex; justify-content: flex-end; gap: 10px; }

@media (max-width: 760px) {
  .lintro { margin: 32px 0 20px; }
  .lintro h1 { font-size: 34px; }
  .lcode { min-width: 0; max-width: none; width: 100%; }
  .lgames { grid-template-columns: 1fr; }
  /* Hosting from a phone (Theo, 2 Nov): Create game is full width and the dialog fills the screen. */
  .lactions #createbtn { width: 100%; }
  .lbrand { font-size: 20px; letter-spacing: 3px; min-width: 0; }
  .lprofile { flex: none; }
  .lprofile .nm { max-width: 96px; }
  .lseg button { padding: 0 8px; }
  .rule:has(select) { flex-wrap: wrap; }
  .rule select { max-width: none; width: 100%; }
  #createdlg { width: 100vw; max-width: 100vw; max-height: 100dvh; height: 100dvh; margin: 0; border-radius: 0; }
  .ldfoot { position: sticky; bottom: 0; background: var(--panel); padding-bottom: max(12px, env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) { .switch i { transition: none; } }
.presets { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.presets button { font-size: 13px; }

/* ------------------------------------------------ admin (5 Nov 2026) */
#adminbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 14px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--amber, #F2C46D); background: rgba(242, 196, 109, .08); font-size: 14px; }
#adminbar b { font-family: var(--f-disp); letter-spacing: 1.5px; text-transform: uppercase; color: var(--amber, #F2C46D); }
#adminbar span { flex: 1; min-width: 180px; color: var(--muted, #A497C4); }
.gadmin { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line, #3A2E5C); font-size: 12px; color: var(--muted, #A497C4); }
.gclose { background: transparent; color: var(--danger, #EF4444); border: 1px solid var(--danger, #EF4444); border-radius: 8px; padding: 5px 10px; font-weight: 600; font-size: 12px; cursor: pointer; }
.gclose:disabled { opacity: .5; }

/* the two game modes, as large buttons, and the Setup fold (11 Nov 2026) */
.presets { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin: 10px 0 12px; }
.presets[hidden] { display: none; }
.modecard { display: grid; gap: 6px; align-content: start; text-align: left; padding: 16px 16px 18px; min-height: 118px; border-radius: 12px; background: #1A1433; border: 2px solid var(--line); color: var(--ink); cursor: pointer; transition: transform .15s, border-color .15s, background .15s; }
.modecard b { font: 400 17px/1.15 var(--f-disp, sans-serif); letter-spacing: .08em; text-transform: uppercase; }
.modecard span { font-size: 13.5px; line-height: 1.45; color: var(--muted); }
.modecard:hover { transform: translateY(-2px); }
.modecard.on { background: #2B2150; border-color: var(--amber); box-shadow: 0 0 0 1px var(--amber), 0 8px 22px rgba(0, 0, 0, .4); }
.modecard.on span { color: var(--ink); }
.modecard.quickwar.on b { color: var(--amber); }
.modecard.standard.on b { color: #7FD6C8; }
.setupmore { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 8px; }
.setupmore summary { cursor: pointer; padding: 8px 0; font-weight: 700; }
.setupmore summary small { font-weight: 400; color: var(--muted); margin-left: 8px; }
.lseg.locked { opacity: .55; }
/* Teams (20 Nov 2026) */
#cteamsrow[hidden] { display: none; }
#cteamsrow .lhint { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; }
