/* /arcade v2 — accounts, levels, fullscreen, leaderboards and the newer games (js/arcade.js) */
.acct { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 16px; padding: 12px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); font-size: 12.5px; color: var(--muted); }
.acct b { color: #fff; }
.acct-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); flex: none; }
.acct-dot.on { background: var(--green); box-shadow: 0 0 10px var(--green); }
.acct-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.stage-actions { flex-wrap: wrap; }
.term-btn.on { border-color: var(--red); color: #fff; }
.stage-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin: -4px 0 18px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.stage-bar .opt { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.stage-bar .opt > span { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; }
.stage-bar .seg button { padding: 6px 12px; font-size: 12.5px; }
.opt-rank { margin-left: auto; font-size: 11.5px; color: var(--dim); }
.stage-main { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.stage-main:has(.board-panel:not([hidden])) { grid-template-columns: minmax(0, 1fr) 280px; }
.board-panel { border: 1px solid var(--line-2); border-radius: 16px; padding: 16px; background: rgba(255,255,255,.02); align-self: start; }
.board-panel[hidden] { display: none; }
.board-panel h3 { margin: 0 0 12px; font-size: 15px; }
.board-panel p { margin: 0; font-size: 13px; }
.board { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 4px; }
.board li { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 2px 8px; align-items: baseline; padding: 7px 8px; border-radius: 8px; font-size: 13px; }
.board li:nth-child(-n+3) span:first-child { color: #ffb547; }
.board li.me { background: rgba(255,45,85,.12); }
.board li b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board li .dim { grid-column: 2 / -1; font-size: 10.5px; }
.rank-line { min-height: 1.2em; margin: 6px 0 0; font-size: 12.5px; color: #c3c8d2; }
.rank-line b { color: #ffb547; }
.dim { color: var(--dim); }

/* fullscreen: the real API, or a fixed overlay where it isn't available */
.stage:fullscreen, .stage.fs { margin: 0; border-radius: 0; border: 0; overflow: auto; padding: 18px clamp(14px, 3vw, 32px); width: 100%; height: 100%; }
.stage.fs { position: fixed; inset: 0; z-index: 400; }
html.arcade-fs { overflow: hidden; }
.stage:fullscreen .pm-grid, .stage.fs .pm-grid { width: min(980px, 100%); }
.stage:fullscreen .stage-hint, .stage.fs .stage-hint { display: none; }

/* port match: bigger boards */
.pm-grid { grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); }
.pm-grid.c6 { width: min(760px, 100%); }
.pm-grid.c6 .pm-face { font-size: clamp(10px, 1.7vw, 14px); padding: 2px; text-align: center; overflow-wrap: anywhere; }

/* vuln sweeper */
.sw { display: grid; justify-items: center; gap: 12px; }
.sw-hud { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.sw-hud b { color: #fff; }
.sw-mode { font: 12px var(--mono); color: var(--muted); border: 1px solid var(--line-2); border-radius: 999px; padding: 6px 12px; }
.sw-mode.on { color: #fff; border-color: var(--red); background: rgba(255,45,85,.15); }
.sw-scroll { max-width: 100%; overflow-x: auto; padding-bottom: 4px; }
.sw-grid { display: grid; grid-template-columns: repeat(var(--w), 30px); gap: 2px; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.sw-c { width: 30px; height: 30px; border-radius: 5px; background: #222632; border: 1px solid #2f3442; font: 700 14px var(--mono); color: #fff; display: grid; place-items: center; padding: 0; }
.sw-c:hover:not(.open) { background: #2c3140; }
.sw-c.open { background: #0d0f15; border-color: #171a22; cursor: default; }
.sw-c.flag { font-size: 13px; }
.sw-c.boom { background: var(--red); }
.sw-c.n1 { color: #36a0ff; } .sw-c.n2 { color: #3dff9a; } .sw-c.n3 { color: #ff2d55; } .sw-c.n4 { color: #b18cff; }
.sw-c.n5 { color: #ffb547; } .sw-c.n6 { color: #22d3ee; } .sw-c.n7 { color: #fff; } .sw-c.n8 { color: #9aa1ad; }
.sw-msg { font-size: 14px; text-align: center; display: grid; justify-items: center; gap: 8px; }
.stage:fullscreen .sw-c, .stage.fs .sw-c { width: 34px; height: 34px; }
.stage:fullscreen .sw-grid, .stage.fs .sw-grid { grid-template-columns: repeat(var(--w), 34px); }
.art-sweeper { grid-template-columns: repeat(3, 28px); gap: 4px; }
.art-sweeper b { width: 28px; height: 28px; border-radius: 5px; background: #0d0f15; display: grid; place-items: center; font-size: 12px; color: #36a0ff; }
.art-sweeper b.o { background: #222632; }

/* cipher crack */
.cc { display: grid; gap: 12px; max-width: 720px; }
.cc-kind { margin: 0; font-size: 12px; color: var(--red); letter-spacing: .1em; text-transform: uppercase; }
.cc-ct { margin: 0; padding: 16px; border-radius: 12px; background: #050806; border: 1px solid rgba(61,255,154,.25); color: #3dff9a; font-size: 15px; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 220px; overflow: auto; }
.cc-form { display: flex; gap: 8px; flex-wrap: wrap; }
.cc-in { flex: 1 1 220px; font-size: 16px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line-2); background: #07080b; color: #fff; text-transform: uppercase; }
.cc-in:focus { outline: none; border-color: var(--red); }
.cc-msg { margin: 0; font-size: 14px; color: #c3c8d2; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.art-cipher { font-size: 13px; line-height: 1.8; color: #3dff9a; text-align: center; background: #050806; }
.art-cipher b { color: #fff; }

/* cyberdle */
.dle { display: grid; justify-items: center; gap: 14px; }
.dle-sub { margin: 0; font-size: 11.5px; color: var(--dim); }
.dle-grid { display: grid; gap: 6px; }
.dle-row { display: grid; grid-template-columns: repeat(var(--len), 52px); gap: 6px; }
.dle-row span { height: 52px; border-radius: 8px; border: 1px solid var(--line-2); display: grid; place-items: center; font: 700 22px var(--mono); }
.dle-row span.typed { border-color: rgba(255,255,255,.4); }
.dle-row span.g, .dle-kb button.g { background: #1f9d55; border-color: #1f9d55; color: #fff; }
.dle-row span.y, .dle-kb button.y { background: #c99a1e; border-color: #c99a1e; color: #fff; }
.dle-row span.x { background: #2a2e38; border-color: #2a2e38; color: #9aa1ad; }
.dle-kb button.x { background: #15171d; color: #4b5160; }
.dle-msg { margin: 0; min-height: 1.4em; font-size: 14px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: center; }
.dle-kb { display: grid; gap: 6px; width: min(520px, 100%); }
.dle-kb div { display: flex; gap: 5px; justify-content: center; }
.dle-kb button { flex: 1; max-width: 44px; height: 48px; border-radius: 7px; background: #2a2e38; color: #fff; font: 600 13px var(--mono); text-transform: uppercase; }
.dle-kb button.wide { max-width: 70px; flex: 1.6; font-size: 11px; }
.art-dle { grid-template-columns: repeat(5, 30px); gap: 4px; }
.art-dle b { height: 34px; border-radius: 6px; display: grid; place-items: center; background: #2a2e38; font-size: 15px; }
.art-dle b.g { background: #1f9d55; }
.art-dle b.y { background: #c99a1e; }

/* sign-in dialog */
.acct-dlg { width: min(420px, calc(100vw - 32px)); border: 1px solid var(--line-2); border-radius: 20px; padding: 24px; background: #0e1015; color: var(--text); }
.acct-dlg::backdrop { background: rgba(0,0,0,.65); backdrop-filter: blur(4px); }
.dlg-x { position: absolute; right: 12px; top: 12px; }
.dlg-step { display: grid; gap: 14px; }
.dlg-step h3 { margin: 0; font-family: var(--display); font-size: 22px; padding-right: 40px; }
.dlg-step p { margin: 0; color: var(--muted); font-size: 14px; }
.dlg-step label { display: grid; gap: 6px; font-size: 12px; color: var(--muted); font-family: var(--mono); }
.dlg-step input { font: 16px var(--sans); padding: 11px 13px; border-radius: 10px; border: 1px solid var(--line-2); background: #07080b; color: #fff; }
.dlg-step input:focus { outline: none; border-color: var(--red); }
.dlg-step .btn { justify-content: center; }
.dlg-msg { color: var(--red) !important; min-height: 1em; font-size: 13px !important; }

@media (max-width: 760px) {
  .stage-main:has(.board-panel:not([hidden])) { grid-template-columns: minmax(0, 1fr); }
  .opt-rank { margin-left: 0; }
  .sw-c { width: 28px; height: 28px; font-size: 13px; }
  .sw-grid { grid-template-columns: repeat(var(--w), 28px); }
  .dle-row { grid-template-columns: repeat(var(--len), 44px); }
  .dle-row span { height: 44px; font-size: 19px; }
  .acct-actions { margin-left: 0; }
}
@media (max-width: 560px) {
  .pm-grid.c6 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .pm-grid.c6 .pm-face { font-size: 11px; }
}
