/* Arcade HQ: MN Digital Services house style (near-black, off-white, MN red) */
@font-face { font-family: 'Montserrat'; src: url('montserrat.woff2') format('woff2'); font-weight: 400 900; font-display: swap; }

:root {
  --bg: #0a0a0a;
  --panel: #141414;
  --panel2: #1b1b1b;
  --line: #262626;
  --text: #fafafa;
  --muted: #9a9a9a;
  --red: #e11d2e;
  --green: #22c55e;
  --amber: #f59e0b;
  --display: 'Montserrat', system-ui, sans-serif;
  --body: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 var(--body); }
a { color: inherit; }
button { font: inherit; cursor: pointer; }
.boot { padding: 40px; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 12px; }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--panel2); color: var(--text); border-radius: 8px; padding: 7px 12px; font-weight: 600; font-size: 13px; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: #3a3a3a; background: #222; }
.btn.red { background: var(--red); border-color: var(--red); }
.btn.red:hover { background: #c81827; }
.btn.ghost { background: transparent; }
.btn.danger { color: #ff8a8a; }
.btn[disabled] { opacity: .5; cursor: default; }

/* login */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login form { width: 100%; max-width: 380px; background: var(--panel); border: 1px solid var(--line); border-top: 4px solid var(--red); border-radius: 14px; padding: 32px 28px; }
.login img { width: 120px; display: block; margin-bottom: 22px; }
.login h1 { font: 800 22px var(--display); margin: 0 0 4px; }
.login p { margin: 0 0 20px; color: var(--muted); }
label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin: 12px 0 5px; }
input, select { width: 100%; background: var(--bg); border: 1px solid var(--line); color: var(--text); border-radius: 8px; padding: 10px 12px; font: inherit; }
input:focus, select:focus { outline: 2px solid var(--red); outline-offset: 1px; }
.login .btn { width: 100%; justify-content: center; margin-top: 20px; padding: 11px; font-size: 15px; }
.error { color: #ff8a8a; margin-top: 10px; min-height: 20px; font-size: 13px; }

/* top bar */
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 20px; padding: 12px 24px; background: rgba(10, 10, 10, .92); border-bottom: 1px solid var(--line); backdrop-filter: blur(8px); }
.top img { height: 30px; }
.top .title { font: 800 16px var(--display); letter-spacing: .5px; }
.top .title b { color: var(--red); }
.top nav { display: flex; gap: 4px; margin-left: 12px; }
.top nav button { background: none; border: 0; color: var(--muted); padding: 8px 12px; border-radius: 8px; font-weight: 600; }
.top nav button.on { color: var(--text); background: var(--panel2); }
.top .me { margin-left: auto; display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }

main { max-width: 1360px; margin: 0 auto; padding: 24px; }
.head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.head h2 { font: 800 26px var(--display); margin: 0; }
.head .right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

/* totals */
.totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 22px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.tile .v { font: 800 26px/1.1 var(--display); }
.tile .l { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .6px; margin-top: 4px; }
.tile .s { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* customer cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(560px, 1fr)); gap: 18px; }
@media (max-width: 640px) { .cards { grid-template-columns: 1fr; } main { padding: 14px; } .top { padding: 10px 14px; gap: 10px; flex-wrap: wrap; } .top nav { margin-left: 0; } }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.card .ch { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.logo { width: 92px; height: 52px; flex: none; border-radius: 8px; background: #000; display: flex; align-items: center; justify-content: center; padding: 6px 8px; border-bottom: 3px solid var(--red); }
.logo img { max-width: 100%; max-height: 100%; }
.card h3 { font: 800 18px var(--display); margin: 0; }
.card .host { font-size: 12px; color: var(--muted); text-decoration: none; }
.card .ch > div:nth-child(2) { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 640px) { .card .ch { flex-wrap: wrap; } .card .pills { width: 100%; margin-left: 0; justify-content: flex-start; } .card .cf .info { margin-left: 0; text-align: left; width: 100%; } }
.card .host:hover { color: var(--text); }
.pills { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.pill { font-size: 11px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; border-radius: 99px; padding: 3px 9px; border: 1px solid; white-space: nowrap; }
.pill.ok { color: var(--green); border-color: rgba(34, 197, 94, .4); }
.pill.bad { color: #ff8a8a; border-color: rgba(255, 138, 138, .4); }
.pill.off { color: var(--muted); border-color: var(--line); }
.pill.test { color: var(--amber); border-color: rgba(245, 158, 11, .45); }
.pill.live { color: #fff; background: var(--red); border-color: var(--red); }
.stats { display: grid; grid-template-columns: repeat(5, 1fr); border-bottom: 1px solid var(--line); }
.stat { padding: 12px 14px; border-right: 1px solid var(--line); }
.stat:last-child { border-right: 0; }
.stat .v { font: 800 19px/1.15 var(--display); }
.stat .l { font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
.stat .s { font-size: 11.5px; color: var(--muted); }
@media (max-width: 640px) { .stats { grid-template-columns: repeat(2, 1fr); } .stat { border-bottom: 1px solid var(--line); } }
.games { padding: 6px 0; border-bottom: 1px solid var(--line); }
.game { display: grid; grid-template-columns: minmax(130px, 1.2fr) 1fr 1.4fr auto auto; align-items: center; gap: 12px; padding: 8px 18px; }
.game .gn { font-weight: 700; }
.game .gn a { text-decoration: none; }
.game .gn a:hover { color: var(--red); }
.game .top3 { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.game .top3 b { color: var(--text); font-weight: 600; }
.game .plays { font-size: 12.5px; color: var(--muted); }
.game .plays b { color: var(--text); }
@media (max-width: 640px) { .game { grid-template-columns: 1fr auto; } .game .plays, .game .top3 { grid-column: 1 / -1; } }
.card .cf { display: flex; align-items: center; gap: 8px; padding: 12px 18px; flex-wrap: wrap; }
.card .cf .info { margin-left: auto; font-size: 11.5px; color: var(--muted); text-align: right; line-height: 1.5; }
.card .notice { padding: 18px; color: var(--muted); border-bottom: 1px solid var(--line); }
.card .notice b { color: var(--text); }

/* switch */
.switch { position: relative; display: inline-block; width: 38px; height: 22px; margin: 0; flex: none; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; background: #333; border-radius: 99px; transition: background .15s; }
.switch span::after { content: ''; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::after { transform: translateX(16px); }
.switch input:focus-visible + span { outline: 2px solid var(--red); outline-offset: 2px; }

/* tables (staff, activity) */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; margin-bottom: 18px; }
.panel h3 { font: 800 16px var(--display); margin: 0; padding: 16px 18px; border-bottom: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; padding: 10px 18px; border-bottom: 1px solid var(--line); }
td { padding: 10px 18px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td .btn { padding: 4px 9px; font-size: 12px; }
.addform { display: grid; grid-template-columns: 2fr 1.5fr 1fr auto; gap: 10px; align-items: end; padding: 16px 18px; }
.addform label { margin-top: 0; }
@media (max-width: 640px) { .addform { grid-template-columns: 1fr; } }
.secret { margin: 0 18px 18px; padding: 14px 16px; border: 1px solid rgba(34, 197, 94, .4); background: rgba(34, 197, 94, .08); border-radius: 10px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.secret code { font: 700 17px ui-monospace, Consolas, monospace; letter-spacing: .5px; color: #fff; }

/* modal + toast */
.modal { position: fixed; inset: 0; background: rgba(0, 0, 0, .65); display: flex; align-items: center; justify-content: center; z-index: 20; padding: 20px; }
.modal form { width: 100%; max-width: 400px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 24px; }
.modal h3 { font: 800 18px var(--display); margin: 0 0 6px; }
.modal .row { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #fff; color: #0a0a0a; font-weight: 600; padding: 10px 16px; border-radius: 10px; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 30; }
#toast.on { opacity: 1; }
