/* The Simenco portal: the same calm look as the games' staff pages. */
:root { --accent: #c8102e; --accent-dark: #a30d22; --ink: #1c1c1c; --muted: #5f5f5a; --line: #e2e2de; --soft: #f4f4f2; }
* { box-sizing: border-box; }
body { margin: 0; font-family: "Segoe UI", system-ui, -apple-system, sans-serif; font-size: 16px; line-height: 1.5; background: var(--soft); color: var(--ink); }
a { color: var(--accent-dark); }
code { font-family: ui-monospace, Consolas, monospace; font-size: 0.92em; }

header { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; padding: 12px 24px; background: #fff; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; font-size: 18px; }
.brand-mark { width: 14px; height: 14px; border-radius: 50%; background: var(--accent); }
.brand-area { color: var(--muted); font-size: 14px; }
.top { display: flex; flex-wrap: wrap; gap: 4px; margin-right: auto; }
.top a { padding: 8px 12px; border-radius: 8px; color: var(--ink); text-decoration: none; white-space: nowrap; }
.top a:hover, .top a[aria-current] { background: var(--soft); }
.top a[aria-current] { font-weight: 600; }
.logout { display: flex; align-items: center; gap: 12px; margin: 0; color: var(--muted); font-size: 14px; }
.logout a { padding: 6px 10px; border-radius: 8px; color: var(--ink); text-decoration: none; }
.logout a:hover, .logout a[aria-current] { background: var(--soft); }
.logout a[aria-current] { font-weight: 600; }

main { max-width: 1100px; margin: 0 auto; padding: 32px 24px; display: flex; flex-direction: column; gap: 20px; }
main.narrow { max-width: 460px; padding-top: 56px; }
.page-head h1, .card h1 { margin: 0; font-size: 28px; letter-spacing: -0.02em; }
.page-head .lead, .card .lead { margin: 6px 0 0; color: var(--muted); }
.kicker { margin: 0 0 4px; }
.kicker a { color: var(--muted); text-decoration: none; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 22px 24px; }
.card h2 { margin: 0 0 12px; font-size: 18px; }
.card.notice { border-color: #f0c36d; background: #fff8e6; }
.empty, .field-note { color: var(--muted); }
.field-note { font-size: 14px; margin: 8px 0 0; }

.message { margin: 0; padding: 10px 14px; border-radius: 10px; }
.message.success { background: #e6f4ea; color: #1d5a2c; }
.message.error { background: #fbe6e6; color: #a30d22; }
.validation-summary-valid { display: none; }
.field-validation-error { color: #a00000; font-size: 14px; }

form.stacked label { display: block; margin-top: 14px; font-weight: 500; }
form.stacked label.check { display: flex; align-items: center; gap: 8px; font-weight: 400; }
form.stacked input:not([type=checkbox]):not([type=radio]) { display: block; width: 100%; max-width: 420px; margin-top: 4px; padding: 9px 10px; border: 1px solid #cfcfca; border-radius: 8px; font: inherit; }
form.stacked input[readonly] { background: var(--soft); color: var(--muted); }
form.stacked textarea { display: block; width: 100%; max-width: 420px; margin-top: 4px; padding: 9px 10px; border: 1px solid #cfcfca; border-radius: 8px; font: inherit; resize: vertical; }
form.stacked fieldset { margin: 14px 0 0; padding: 0; border: 0; }
form.stacked fieldset legend { padding: 0; font-weight: 500; }
form.stacked fieldset label.check { margin-top: 8px; }
form.stacked label.check.indent { margin-left: 26px; }
button { font: inherit; padding: 8px 14px; min-height: 40px; border: 1px solid #cfcfca; border-radius: 8px; background: #fff; color: var(--ink); cursor: pointer; }
button:hover { border-color: #9a9a95; }
form.stacked button { margin-top: 20px; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
button.primary:hover { background: var(--accent-dark); }
button.danger { color: var(--accent-dark); border-color: #e7b2ba; }
.narrow form.stacked button.primary { width: 100%; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-size: 13px; font-weight: 600; }
code.secret { display: inline-block; padding: 8px 10px; background: #fff; border: 1px solid var(--line); border-radius: 8px; word-break: break-all; }

.game-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.game-card { display: flex; flex-direction: column; gap: 4px; padding: 22px 24px; background: #fff; border: 1px solid var(--line); border-radius: 14px; color: var(--ink); text-decoration: none; }
.game-card strong { font-size: 20px; }
.game-card span { color: var(--muted); font-size: 14px; }
.game-card:hover { border-color: var(--accent); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06); }
/* The Games page (ADR-016): each game with what it is about; the other games without a link to open them. */
.game-info { display: flex; flex-direction: column; gap: 8px; }
.game-info p { margin: 0; }
.game-description { white-space: pre-line; color: var(--ink); font-size: 15px; }
.game-other { padding: 22px 24px; border: 1px dashed var(--line); border-radius: 14px; }
.game-other strong { font-size: 20px; }

@media (max-width: 640px) {
    header { padding: 12px 16px; }
    .top { margin-left: -10px; }
    .top a { padding: 6px 10px; }
    main { padding: 20px 16px; }
    table, thead, tbody, tr, th, td { display: block; }
    thead { display: none; }
    tr { padding: 8px 0; border-bottom: 1px solid var(--line); }
    td { border: 0; padding: 2px 0; }
}

/* Logging in with a code or a passkey, and the Security page (ADR-002). */
a.button { display: inline-flex; align-items: center; padding: 8px 14px; min-height: 40px; border: 1px solid #cfcfca; border-radius: 8px; background: #fff; color: var(--ink); text-decoration: none; font-weight: 500; }
a.button.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
button.wide { width: 100%; }
.or { display: flex; align-items: center; gap: 12px; margin: 20px 0 8px; color: var(--muted); font-size: 14px; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
input.code-input { max-width: 180px !important; font-size: 22px; letter-spacing: 0.2em; font-variant-numeric: tabular-nums; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; margin-right: 6px; }
.badge.on { background: #e6f4ea; color: #1d5a2c; }
.badge.off { background: var(--soft); color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.actions form { margin: 0; }
.cell-note { color: var(--muted); font-size: 14px; }
.plain-list { list-style: none; margin: 0 0 8px; padding: 0; }
.plain-list li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 18px; }
.qr { width: 200px; height: 200px; margin: 12px 0 4px; padding: 8px; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.qr svg { display: block; width: 100%; height: 100%; }
.codes { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.codes code { display: block; padding: 6px 10px; background: #fff; border: 1px solid var(--line); border-radius: 8px; text-align: center; font-size: 15px; }

/* Clients and their departments (ADR-003). */
.card h3 { margin: 24px 0 0; font-size: 16px; }
.department-list { list-style: none; margin: 0; padding: 0; }
.department-list > li { border-bottom: 1px solid var(--line); }
.department-list summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; padding: 12px 0; cursor: pointer; list-style: none; }
.department-list summary::-webkit-details-marker { display: none; }
.department-list summary::before { content: ""; align-self: center; width: 7px; height: 7px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); transition: transform 0.15s; }
.department-list details[open] > summary::before { transform: rotate(45deg); }
@media (prefers-reduced-motion: reduce) { .department-list summary::before { transition: none; } }
.department-list details[open] { padding-bottom: 16px; }
.department-list form.remove { margin-top: 12px; }

/* Accounts (ADR-004). */
select { font: inherit; padding: 8px 10px; min-height: 40px; border: 1px solid #cfcfca; border-radius: 8px; background: #fff; color: var(--ink); max-width: 100%; }
.inline-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0; }
.inline-form label { font-weight: 500; }
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 12px; }
.card-head h2 { margin: 0; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
form.stacked label.check .cell-note { margin-left: 4px; }
@media (max-width: 640px) {
    form.stacked label.check { flex-wrap: wrap; }
    form.stacked label.check .cell-note { flex-basis: 100%; margin: -4px 0 0 26px; }
}

/* Sessions across games (ADR-007). */
input.number-input { width: 90px; padding: 6px 8px; min-height: 36px; border: 1px solid #cfcfca; border-radius: 8px; font: inherit; }
details.correct { margin-top: 6px; }
details.correct summary { cursor: pointer; color: var(--muted); font-size: 14px; }
details.correct form { margin-top: 6px; }
table.sessions td { vertical-align: top; }

/* The home page: the sessions of every game (ADR-009, ADR-014); the games themselves are on the Games page. */
.home-sessions { display: flex; flex-direction: column; gap: 20px; min-width: 0; }

/* A game's sessions while they load: gray rows fading in and out, in place of its table. */
.skeleton { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.skeleton-row { display: block; height: 40px; border-radius: 8px; background: var(--line); animation: skeleton-fade 1.4s ease-in-out infinite; }
.skeleton-row:nth-child(2) { width: 85%; animation-delay: 0.2s; }
.skeleton-row:nth-child(3) { width: 65%; animation-delay: 0.4s; }
@keyframes skeleton-fade { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) { .skeleton-row { animation: none; opacity: 0.6; } }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* A card that stays folded until opened, such as a new client. */
details.fold > summary { display: flex; align-items: center; gap: 10px; cursor: pointer; list-style: none; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary h2 { margin: 0; }
details.fold > summary::before { content: ""; width: 7px; height: 7px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); transition: transform 0.15s; }
details.fold[open] > summary::before { transform: rotate(45deg); }
details.fold[open] > summary { margin-bottom: 4px; }
@media (prefers-reduced-motion: reduce) { details.fold > summary::before { transition: none; } }
