:root {
    --bg: #0f1420;
    --panel: #171e2e;
    --panel-2: #1f2840;
    --text: #e6e9f0;
    --muted: #9aa3b8;
    --accent: #3b82f6;
    --accent-2: #2563eb;
    --ok: #22c55e;
    --bad: #ef4444;
    --warn: #f59e0b;
    --border: #2b3550;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    background: var(--bg);
    color: var(--text);
    font: 15px/1.5 "Segoe UI", Roboto, Arial, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
/* pages with the game's start artwork behind them (Register): the picture stays fixed and dimmed so the form reads well */
body.bg-art {
    background: var(--bg) url("/img/bg-art.jpg") center center / cover no-repeat fixed;
}
body.bg-art::before {
    content: ""; position: fixed; inset: 0; z-index: -1;
    background: linear-gradient(180deg, rgba(15, 20, 32, .55) 0%, rgba(15, 20, 32, .80) 100%);
}
body.bg-art .top, body.bg-art .bottom { background: rgba(23, 30, 46, .85); }
body.bg-art .card { background: rgba(23, 30, 46, .92); box-shadow: 0 12px 40px rgba(0, 0, 0, .45); }
body.bg-art h1, body.bg-art p.lead { text-shadow: 0 2px 8px rgba(0, 0, 0, .8); }
body.bg-art p.lead { color: #c9d0e0; }

/* the front page: the client's start image (Publish_CI - the Digivice logo on white, shown full screen when the game
   opens) as the page background; the content starts below the logo so it stays in view, the cards keep their dark look */
body.bg-home {
    background: #ffffff url("/img/bg-home.jpg") center 58px / min(90vw, 540px) auto no-repeat;
}
/* 540 px wide logo (302 px tall): at 1920x1080 the whole page fits without scrolling */
body.bg-home .page { padding-top: calc(min(90vw, 540px) * 0.53 + 70px); padding-bottom: 24px; }
body.bg-home h1, body.bg-home ol { color: #1a2030; }
body.bg-home p.lead { color: #3a4358; }
body.bg-home .top { border-bottom-color: #d5d9e3; }
body.bg-home .bottom { color: #5a6275; border-top-color: #d5d9e3; background: #ffffff; }
body.bg-home .card { box-shadow: 0 10px 30px rgba(20, 30, 60, .18); }
body.bg-home .card h2, body.bg-home .card ol, body.bg-home .card p { color: var(--text); }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.top {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 24px; background: var(--panel); border-bottom: 1px solid var(--border);
}
.top .brand { font-weight: 700; font-size: 18px; color: var(--text); letter-spacing: .3px; }
.top nav { display: flex; gap: 18px; align-items: center; }
.top nav a { color: var(--muted); }
.top nav a:hover { color: var(--text); text-decoration: none; }
form.inline { display: inline; margin: 0; }
button.link { background: none; border: 0; color: var(--muted); cursor: pointer; font: inherit; padding: 0; }
button.link:hover { color: var(--text); }

.page { flex: 1; width: 100%; max-width: 960px; margin: 0 auto; padding: 28px 20px 40px; }
.bottom {
    display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between;
    padding: 14px 24px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--border);
}

h1 { font-size: 26px; margin: 0 0 6px; }
h2 { font-size: 19px; margin: 24px 0 8px; }
p.lead { color: var(--muted); margin: 0 0 20px; }

.card {
    background: var(--panel); border: 1px solid var(--border); border-radius: 8px;
    padding: 22px 24px; margin: 0 0 18px;
}
.card.narrow { max-width: 520px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }

.field { margin: 0 0 14px; }
.field label { display: block; font-weight: 600; margin: 0 0 4px; }
.field .hint { color: var(--muted); font-size: 13px; margin: 3px 0 0; }
input[type=text], input[type=email], input[type=password] {
    width: 100%; padding: 9px 11px; border-radius: 5px; border: 1px solid var(--border);
    background: var(--panel-2); color: var(--text); font: inherit;
}
input:focus { outline: 2px solid var(--accent); border-color: var(--accent); }
.check { display: flex; gap: 8px; align-items: flex-start; }
.check input { margin-top: 5px; }

.btn {
    display: inline-block; padding: 9px 18px; border-radius: 5px; border: 0; cursor: pointer;
    background: var(--accent); color: #fff; font: inherit; font-weight: 600;
}
.btn:hover { background: var(--accent-2); text-decoration: none; }
.btn.secondary { background: var(--panel-2); color: var(--text); border: 1px solid var(--border); }
.btn.secondary:hover { background: var(--border); }
.actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 8px; }

.msg { padding: 11px 14px; border-radius: 6px; margin: 0 0 16px; border: 1px solid; }
.msg.ok { border-color: var(--ok); background: rgba(34, 197, 94, .12); }
.msg.bad { border-color: var(--bad); background: rgba(239, 68, 68, .12); }
.msg.warn { border-color: var(--warn); background: rgba(245, 158, 11, .12); }
ul.errors { margin: 0 0 14px; padding-left: 20px; color: var(--bad); }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; font-size: 13px; }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; }

.status { list-style: none; padding: 0; margin: 0; display: flex; gap: 16px; flex-wrap: wrap; }
.status li::before { content: "●"; margin-right: 6px; }
.status li.up::before { color: var(--ok); }
.status li.down::before { color: var(--bad); }
.small { font-size: 13px; color: var(--muted); }
code { background: var(--panel-2); padding: 1px 5px; border-radius: 3px; }
