:root {
  --bg: #f5f3f0;
  --card: #fff;
  --line: #e6e1da;
  --text: #1d1916;
  --muted: #7a7068;
  --red: #e63946;
  --red-2: #c92a37;
  --green: #2a9d8f;
  --gold: #c99a2e;
  --radius: 14px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 'Manrope', system-ui, sans-serif; }
h1 { font-size: 26px; margin: 0 0 20px; }
h2 { font-size: 18px; margin: 0 0 12px; }
a { color: var(--red); }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 18px; border-radius: 10px;
  border: 0; background: var(--red); color: #fff; font: 700 14px 'Manrope', sans-serif; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--red-2); }
.btn:disabled { opacity: .55; cursor: default; }
.btn--ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn--ghost:hover { background: #fff; }
.btn--green { background: var(--green); }
.btn--green:hover { background: #21867a; }
.btn--sm { padding: 6px 12px; font-size: 13px; }
.btn--block { width: 100%; }
.btn--link { background: none; color: var(--red); padding: 4px 6px; }
.btn--link:hover { background: none; text-decoration: underline; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; }
.brand small { color: var(--muted); font-weight: 600; }
.brand__mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: var(--red); color: #fff; }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login__card { width: min(380px, 100%); display: grid; gap: 14px; padding: 28px; }

/* forms */
label { display: grid; gap: 5px; font-weight: 600; font-size: 13px; color: var(--muted); }
input, select, textarea {
  width: 100%; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff;
  font: 500 15px 'Manrope', sans-serif; color: var(--text); outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--red); }
input[type=color] { padding: 2px; height: 40px; }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--red); }
textarea { min-height: 90px; resize: vertical; }
.check { display: flex; align-items: center; gap: 8px; color: var(--text); }
.error { padding: 10px 12px; border-radius: 10px; background: #fde8ea; color: var(--red-2); font-weight: 600; font-size: 14px; }
.grid { display: grid; gap: 14px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row--end { justify-content: flex-end; }
.spacer { flex: 1; }

/* layout */
.layout { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 24px; padding: 22px 16px; background: #1d1916; color: #f5efe6; }
.menu { display: grid; gap: 4px; }
.menu a { padding: 10px 12px; border-radius: 10px; color: #cfc5ba; text-decoration: none; font-weight: 600; }
.menu a:hover { background: rgba(255,255,255,.06); color: #fff; }
.menu a.active { background: var(--red); color: #fff; }
.side__foot { margin-top: auto; display: grid; gap: 10px; }
.side__foot a { color: #cfc5ba; font-size: 14px; }
.side__foot .btn--ghost { color: #f5efe6; box-shadow: inset 0 0 0 1.5px #3a322c; }
.side__foot .btn--ghost:hover { background: #2a2420; }
.main { padding: 28px; min-width: 0; }

/* stats */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat b { display: block; font-size: 28px; font-weight: 800; }
.stat span { color: var(--muted); font-size: 13px; font-weight: 600; }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 160px; padding-top: 10px; }
.bars__col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; min-width: 0; }
.bars__bar { width: 100%; max-width: 36px; border-radius: 6px 6px 0 0; background: #f3c2c6; position: relative; min-height: 2px; }
.bars__bar i { position: absolute; bottom: 0; left: 0; right: 0; background: var(--red); border-radius: 6px 6px 0 0; }
.bars__col small { font-size: 11px; color: var(--muted); }

/* table */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; white-space: nowrap; }
tr:hover td { background: #faf8f6; }
.mono { font-family: ui-monospace, Menlo, monospace; font-weight: 700; }
.tag { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; background: #eee; color: var(--muted); white-space: nowrap; }
.tag--ok { background: #dff3f0; color: #1d7a6f; }
.tag--warn { background: #fdf1d8; color: #9a6b0c; }
.tag--off { background: #f1eeeb; color: #8a8077; }
.tag--red { background: #fde8ea; color: var(--red-2); }
.swatch { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -2px; margin-right: 6px; }

/* games */
.game-card { margin-bottom: 18px; }
.game-card__head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.game-card__head h2 { margin: 0; }
.chance { font-weight: 700; }

/* check */
.check-box { max-width: 560px; }
.check-input { font: 700 22px ui-monospace, Menlo, monospace; text-transform: uppercase; letter-spacing: .05em; }
.check-result { margin-top: 16px; }
.check-result dl { display: grid; grid-template-columns: 140px 1fr; gap: 8px 12px; margin: 0 0 16px; }
.check-result dt { color: var(--muted); font-weight: 600; }
.check-result dd { margin: 0; font-weight: 600; }
.big-status { font-size: 20px; font-weight: 800; margin-bottom: 12px; }

.pager { display: flex; align-items: center; gap: 10px; margin-top: 14px; }

/* dialog */
.dlg { border: 0; border-radius: 18px; padding: 0; width: min(620px, calc(100% - 24px)); box-shadow: 0 30px 80px rgba(0,0,0,.3); }
.dlg::backdrop { background: rgba(20,17,15,.55); }
.dlg__form { padding: 24px; display: grid; gap: 14px; }
.dlg__form h2 { margin: 0 0 4px; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #1d1916; color: #fff; padding: 12px 20px; border-radius: 12px; font-weight: 600; z-index: 100; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.toast--err { background: var(--red-2); }

@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .side { position: static; height: auto; padding: 14px 16px; gap: 12px; }
  .menu { grid-auto-flow: column; overflow-x: auto; grid-auto-columns: max-content; }
  .side__foot { grid-auto-flow: column; justify-content: space-between; align-items: center; }
  .main { padding: 18px 16px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .check-result dl { grid-template-columns: 110px 1fr; }
}
