/* HoweWatch — окна как интерфейс Minecraft: серые панели с фаской, вдавленные ячейки, кнопки-камни. */
@font-face { font-family: Monocraft; src: url(assets/fonts/monocraft.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: Monocraft; src: url(assets/fonts/monocraft-bold.woff2) format('woff2'); font-weight: 700; font-display: swap; }

:root, :root[data-theme="day"] {
  --tile: url(assets/bg-day.png);
  --strip: url(assets/strip-day.png);
  --land: url(assets/land-day.png);
  --panel: #c6c6c6; --hi: #ffffff; --lo: #555555; --edge: #000000;
  --slot: #8b8b8b; --slot-hi: #ffffff; --slot-lo: #373737; --row: #bdbdbd; --row-alt: #b4b4b4;
  --ink: #2b2b2b; --soft: #555555; --faint: #6f6f6f; --on-dark: #ffffff;
  --field: #000000; --field-ink: #ffffff; --field-edge: #a0a0a0;
  --accent: #2f7d1f; --accent-ink: #ffffff;
  --ok: #2a8a12; --warn: #a87400; --bad: #c22121;
  --c-points: #1f8a2e; --c-cases: #a8650a; --c-kits: #11808a; --c-donate: #9a7d00; --c-perms: #c22121;
  --c-items: #2f6fb3; --c-money: #6b7a12; --c-events: #0b6d70; --c-punish: #8e1414; --c-gamemode: #3647b0; --c-other: #6a6a6a;
  --shadow: rgba(0,0,0,.25);
}
:root[data-theme="night"] {
  --tile: url(assets/bg-night.png);
  --strip: url(assets/strip-night.png);
  --land: url(assets/land-night.png);
  --panel: #303034; --hi: #4a4a50; --lo: #17171a; --edge: #000000;
  --slot: #1f1f22; --slot-hi: #45454b; --slot-lo: #0c0c0e; --row: #2a2a2e; --row-alt: #26262a;
  --ink: #e8e8e8; --soft: #b0b0b0; --faint: #8a8a8a; --on-dark: #ffffff;
  --field: #0a0a0b; --field-ink: #ffffff; --field-edge: #6a6a70;
  --accent: #5fbf3a; --accent-ink: #0b1a06;
  --ok: #55ff55; --warn: #ffd84d; --bad: #ff5555;
  --c-points: #55ff55; --c-cases: #ffaa00; --c-kits: #55ffff; --c-donate: #ffff55; --c-perms: #ff5555;
  --c-items: #7fb4ff; --c-money: #c6e05a; --c-events: #3fd1c9; --c-punish: #ff6b6b; --c-gamemode: #8f9bff; --c-other: #9a9a9a;
  --shadow: rgba(0,0,0,.5);
}
:root[data-theme="nether"] {
  --tile: url(assets/bg-nether.png);
  --strip: url(assets/strip-nether.png);
  --land: url(assets/land-nether.png);
  --panel: #2b1d1b; --hi: #4d3330; --lo: #120a09; --edge: #000000;
  --slot: #1c1110; --slot-hi: #4a2f2c; --slot-lo: #0a0505; --row: #261917; --row-alt: #221614;
  --ink: #f3e6da; --soft: #c9ad9c; --faint: #9c8172; --on-dark: #ffffff;
  --field: #0d0605; --field-ink: #fff3e8; --field-edge: #7a4a40;
  --accent: #ffb13b; --accent-ink: #2a1300;
  --ok: #8bea5a; --warn: #ffc44d; --bad: #ff5a45;
  --c-points: #8bea5a; --c-cases: #ffb13b; --c-kits: #5fe6d6; --c-donate: #ffe45c; --c-perms: #ff5a45;
  --c-items: #8fc0ff; --c-money: #d6e86a; --c-events: #4fd8c4; --c-punish: #ff7a6b; --c-gamemode: #a3adff; --c-other: #a8928a;
  --shadow: rgba(0,0,0,.5);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; color: var(--ink);
  font: 400 15px/1.5 Monocraft, ui-monospace, Consolas, monospace;
  font-feature-settings: "liga" 0, "calt" 0;
  background-color: var(--panel); background-image: var(--tile); background-size: 64px 64px;
  image-rendering: pixelated;
}
img { image-rendering: pixelated; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 700; line-height: 1.2; }
.muted { color: var(--soft); }
.faint { color: var(--faint); }
.mono-num { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }

/* ── окно Minecraft ─────────────────────────────────────────────────────── */
.win {
  background: var(--panel); position: relative;
  box-shadow: inset 3px 3px 0 var(--hi), inset -3px -3px 0 var(--lo), 0 0 0 2px var(--edge), 6px 6px 0 var(--shadow);
  clip-path: polygon(2px 0, calc(100% - 2px) 0, 100% 2px, 100% calc(100% - 2px), calc(100% - 2px) 100%, 2px 100%, 0 calc(100% - 2px), 0 2px);
  padding: 18px;
}
.win.flat { box-shadow: inset 3px 3px 0 var(--hi), inset -3px -3px 0 var(--lo), 0 0 0 2px var(--edge); }
.slot {
  background: var(--slot);
  box-shadow: inset 2px 2px 0 var(--slot-lo), inset -2px -2px 0 var(--slot-hi);
  padding: 12px 14px;
}
.title-shadow { text-shadow: 2px 2px 0 var(--shadow); }

.btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer; text-decoration: none;
  padding: 7px 14px 8px; border: 0; color: #fff; text-shadow: 2px 2px 0 #3f3f3f;
  background: #6f6f6f;
  box-shadow: inset 2px 2px 0 #aaaaaa, inset -2px -3px 0 #3b3b3b, 0 0 0 2px #000;
  white-space: nowrap;
}
.btn:hover, .btn:focus-visible { background: #7c86a8; outline: none; box-shadow: inset 2px 2px 0 #b9c3e8, inset -2px -3px 0 #4a5272, 0 0 0 2px #fff; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: #4c8a2c; box-shadow: inset 2px 2px 0 #7fc25a, inset -2px -3px 0 #2c5a16, 0 0 0 2px #000; }
.btn.primary:hover { background: #59a033; box-shadow: inset 2px 2px 0 #95d870, inset -2px -3px 0 #2c5a16, 0 0 0 2px #fff; }
.btn.danger { background: #8e2a2a; box-shadow: inset 2px 2px 0 #c45a5a, inset -2px -3px 0 #511313, 0 0 0 2px #000; }
.btn.small { padding: 3px 9px 4px; font-size: 13px; }
.btn[disabled] { opacity: .5; pointer-events: none; }

.field {
  background: var(--field); color: var(--field-ink); border: 2px solid var(--field-edge);
  padding: 7px 10px; outline: none; min-width: 0; border-radius: 0;
}
.field:focus { border-color: #ffffff; }
select.field { appearance: none; padding-right: 28px; background-image: linear-gradient(45deg, transparent 50%, var(--field-ink) 50%), linear-gradient(135deg, var(--field-ink) 50%, transparent 50%); background-position: calc(100% - 15px) 52%, calc(100% - 10px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
.field::placeholder { color: #8d8d8d; }
label.lbl { display: block; font-size: 13px; color: var(--soft); margin: 0 0 4px; }

/* ── шапка ──────────────────────────────────────────────────────────────── */
.strip { height: 24px; background-image: var(--strip); background-size: 48px 48px; background-position: 0 0; border-bottom: 2px solid #000; }
.top {
  max-width: 1320px; margin: 0 auto; padding: 14px 16px 6px;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; margin-right: auto; }
.brand img { width: 40px; height: 40px; }
.brand b { font-size: 22px; letter-spacing: .5px; }
.brand small { display: block; color: var(--soft); font-size: 12px; margin-top: -2px; }
.top-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.lamp { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; padding: 5px 10px; }
.lamp i { width: 12px; height: 12px; display: inline-block; background: #5a1f1f; box-shadow: 0 0 0 2px #000; }
.lamp.on i { background: #ffd65c; box-shadow: 0 0 0 2px #000, 0 0 10px #ffcf3a; }
.themes { display: flex; gap: 6px; }
.themes button { width: 30px; height: 30px; padding: 0; border: 0; cursor: pointer; background-size: 30px 30px; box-shadow: 0 0 0 2px #000; }
.themes button[aria-pressed="true"] { box-shadow: 0 0 0 2px #000, 0 0 0 4px #fff; }
.themes .t-day { background-image: url(assets/strip-day.png); }
.themes .t-night { background-image: url(assets/strip-night.png); }
.themes .t-nether { background-image: url(assets/strip-nether.png); }
.who { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.who img { width: 24px; height: 24px; box-shadow: 0 0 0 2px #000; }

/* ── вкладки как у творческого инвентаря ────────────────────────────────── */
.shell { max-width: 1320px; margin: 0 auto; padding: 8px 16px 48px; }
.tabs { display: flex; gap: 4px; padding-left: 6px; overflow-x: auto; scrollbar-width: none; position: relative; z-index: 2; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  display: flex; align-items: center; gap: 8px; padding: 9px 14px 10px; text-decoration: none; white-space: nowrap;
  background: var(--slot); color: var(--soft);
  box-shadow: inset 3px 3px 0 var(--slot-hi), inset -3px 0 0 var(--slot-lo), 0 0 0 2px var(--edge);
  margin-top: 6px;
}
.tab img { width: 24px; height: 24px; }
.tab:hover { color: var(--ink); }
.tab[aria-current="page"] {
  background: var(--panel); color: var(--ink); margin-top: 0; padding-bottom: 16px;
  box-shadow: inset 3px 3px 0 var(--hi), inset -3px 0 0 var(--lo), 0 -2px 0 0 var(--edge), 2px 0 0 0 var(--edge), -2px 0 0 0 var(--edge);
}
.main { margin-top: -2px; min-height: 60vh; }

/* ── блоки страницы ─────────────────────────────────────────────────────── */
.how { display: flex; gap: 12px; align-items: flex-start; font-size: 13px; color: var(--soft); margin: 0 0 16px; }
.how .q { flex: none; width: 22px; height: 22px; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-weight: 700; box-shadow: 0 0 0 2px #000; }
.row { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }
.grow { flex: 1 1 auto; }
.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
@media (max-width: 960px) { .cols-2 { grid-template-columns: minmax(0, 1fr); } }
.section-title { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; font-size: 16px; }
.section-title img { width: 20px; height: 20px; }
.section-title .grow { height: 2px; background: var(--slot-lo); opacity: .35; }
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.page-head h1 { font-size: 22px; }

/* шаги «как это работает» */
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.step { display: flex; gap: 12px; align-items: flex-start; font-size: 13px; }
.step > b { flex: none; width: 28px; height: 28px; display: grid; place-items: center; background: var(--field); color: var(--field-ink); box-shadow: 0 0 0 2px var(--field-edge); }
.step p { margin: 0; }
@media (max-width: 760px) { .steps { grid-template-columns: minmax(0, 1fr); } }

/* ячейки-счётчики */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-bottom: 18px; }
.tile { display: block; text-decoration: none; cursor: pointer; position: relative; }
.tile:hover { outline: 2px solid var(--on-dark); outline-offset: -2px; }
.tile .ico { width: 32px; height: 32px; float: right; }
.tile .num { font-size: 24px; font-weight: 700; display: block; line-height: 1.1; margin-top: 2px; }
.tile .lab { font-size: 12px; color: var(--soft); }
.tile .sub { font-size: 12px; margin-top: 6px; min-height: 18px; }
.slot .lab, .slot .muted { color: var(--soft); }
:root[data-theme="day"] .slot { color: #fff; text-shadow: 2px 2px 0 #3f3f3f; }
:root[data-theme="day"] .slot .lab, :root[data-theme="day"] .slot .muted, :root[data-theme="day"] .slot .faint { color: #e6e6e6; }
:root[data-theme="day"] .slot .c-text { text-shadow: 1px 1px 0 #000; }

/* категории */
.cat { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 1px 7px 2px; white-space: nowrap; color: var(--cc); box-shadow: inset 0 0 0 2px var(--cc); }
.cat img { width: 16px; height: 16px; }
.c-points { --cc: var(--c-points); } .c-cases { --cc: var(--c-cases); } .c-kits { --cc: var(--c-kits); }
.c-donate { --cc: var(--c-donate); } .c-perms { --cc: var(--c-perms); } .c-items { --cc: var(--c-items); }
.c-money { --cc: var(--c-money); } .c-events { --cc: var(--c-events); } .c-punish { --cc: var(--c-punish); }
.c-gamemode { --cc: var(--c-gamemode); } .c-other { --cc: var(--c-other); }
.c-text { color: var(--cc); }

/* бейджи */
.badge { display: inline-block; font-size: 11px; padding: 0 5px 1px; margin-left: 4px; vertical-align: 1px; font-weight: 700; box-shadow: 0 0 0 2px #000; }
.badge.op { background: #c22121; color: #fff; }
.badge.star { background: #f2c230; color: #2a1d00; }
.badge.staff { background: #2f6fb3; color: #fff; }
.badge.console { background: #444; color: #fff; }
.badge.sys { background: #777; color: #fff; }
.badge.online { background: #2a8a12; color: #fff; }
.flag { display: inline-block; font-size: 11px; padding: 0 6px 1px; margin: 2px 4px 0 0; box-shadow: inset 0 0 0 2px currentColor; }
.flag.bad { color: var(--bad); } .flag.warn { color: var(--warn); } .flag.ok { color: var(--ok); }

/* риск: номер-уровень и полоса как опыт */
.risk { display: inline-grid; place-items: center; min-width: 34px; height: 24px; padding: 0 6px; font-weight: 700; color: #fff; text-shadow: 2px 2px 0 rgba(0,0,0,.6); box-shadow: 0 0 0 2px #000; }
.risk.r0 { background: #4b4b4b; } .risk.r1 { background: #3f8a1f; } .risk.r2 { background: #b8860b; } .risk.r3 { background: #c22121; }
.xp { height: 12px; background: #1b1b1b; box-shadow: 0 0 0 2px #000; position: relative; overflow: hidden; min-width: 80px; }
.xp > i { position: absolute; inset: 0 auto 0 0; display: block; background: var(--xc, #7cd93a); box-shadow: inset 0 3px 0 rgba(255,255,255,.35), inset 0 -3px 0 rgba(0,0,0,.25); }
.xp::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 calc(10% - 2px), #000 calc(10% - 2px) 10%); }
.lvl-low { --xc: #7cd93a; } .lvl-mid { --xc: #ffc93a; } .lvl-high { --xc: #ff4a3a; }
.lvl-word { font-size: 12px; font-weight: 700; }
.lvl-word.lvl-low { color: var(--ok); } .lvl-word.lvl-mid { color: var(--warn); } .lvl-word.lvl-high { color: var(--bad); }

/* таблицы */
.tbl-wrap { overflow-x: auto; margin: 0 -6px; padding: 0 6px; }
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.tbl th { text-align: left; font-weight: 400; color: var(--soft); font-size: 12px; padding: 6px 10px; border-bottom: 2px solid var(--slot-lo); white-space: nowrap; user-select: none; }
.tbl th.sort { cursor: pointer; }
.tbl th.sort:hover { color: var(--ink); }
.tbl th.sort[data-dir]::after { content: ' ▼'; font-size: 10px; }
.tbl th.sort[data-dir="asc"]::after { content: ' ▲'; }
.tbl td { padding: 8px 10px; vertical-align: top; border-bottom: 2px solid var(--row-alt); }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: var(--row); }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl .zero { color: var(--faint); }
.who-cell { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.who-cell .badge { margin-left: 0; }
.who-cell img { width: 20px; height: 20px; box-shadow: 0 0 0 2px #000; flex: none; }
.who-cell a { text-decoration: none; }
.who-cell a:hover { text-decoration: underline; }
.when { white-space: nowrap; color: var(--soft); font-size: 12px; }
.what { min-width: 220px; }
.what .cmd { display: block; margin-top: 4px; font-size: 12px; color: var(--soft); word-break: break-all; }
.items { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.item { font-size: 12px; padding: 1px 6px; background: var(--slot); color: #fff; box-shadow: inset 2px 2px 0 var(--slot-lo), inset -2px -2px 0 var(--slot-hi); text-shadow: 1px 1px 0 #000; }
.empty { text-align: center; padding: 40px 10px; color: var(--soft); }
.empty img { width: 48px; height: 48px; display: block; margin: 0 auto 10px; opacity: .8; }

/* фильтры */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 14px; }
.filters .f { display: flex; flex-direction: column; }
.filters .field { width: 190px; }
.filters select.field { width: auto; min-width: 120px; }
@media (max-width: 640px) { .filters .f { flex: 1 1 140px; } .filters .field { width: 100%; } }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.chip { cursor: pointer; border: 0; background: transparent; font-size: 12px; padding: 3px 8px 4px; display: inline-flex; align-items: center; gap: 6px; color: var(--cc, var(--ink)); box-shadow: inset 0 0 0 2px var(--cc, var(--slot-lo)); opacity: .55; }
.chip img { width: 16px; height: 16px; }
.chip[aria-pressed="true"] { opacity: 1; background: var(--slot); color: #fff; box-shadow: inset 0 0 0 2px var(--cc, #fff), 0 0 0 2px #000; text-shadow: 1px 1px 0 #000; }
.chip:hover { opacity: 1; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; user-select: none; }
.check input { appearance: none; width: 18px; height: 18px; margin: 0; background: var(--field); box-shadow: 0 0 0 2px var(--field-edge); cursor: pointer; }
.check input:checked { background: var(--accent); box-shadow: 0 0 0 2px #fff; }
.check input:checked::after { content: ''; display: block; width: 6px; height: 10px; margin: 2px 0 0 6px; border: solid var(--accent-ink); border-width: 0 3px 3px 0; transform: rotate(45deg); }

/* карточка игрока */
.phead { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.phead .face { width: 72px; height: 72px; box-shadow: 0 0 0 3px #000; }
.phead h1 { font-size: 26px; }
.reasons { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.reasons li { display: flex; gap: 10px; padding: 5px 0; border-bottom: 2px solid var(--row-alt); }
.reasons li b { min-width: 46px; text-align: right; color: var(--bad); }
.subtabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 18px 0 12px; }

/* полоса «осталось» */
.left { display: inline-flex; align-items: center; gap: 8px; }
.meter { width: 70px; height: 10px; background: #1b1b1b; box-shadow: 0 0 0 2px #000; position: relative; }
.meter > i { position: absolute; inset: 0 auto 0 0; background: #7cd93a; }
.meter.mid > i { background: #ffc93a; } .meter.gone > i { background: #ff4a3a; }

/* график по дням */
.chart { display: flex; align-items: flex-end; gap: 4px; height: 140px; padding: 8px 4px 0; border-bottom: 2px solid var(--slot-lo); }
.chart .bar { flex: 1 1 0; display: flex; flex-direction: column-reverse; min-width: 4px; height: 100%; justify-content: flex-start; position: relative; }
.chart .bar i { display: block; background: var(--cc); box-shadow: inset 0 2px 0 rgba(255,255,255,.25); }
.chart-x { display: flex; gap: 4px; padding: 4px 4px 0; font-size: 10px; color: var(--faint); }
.chart-x span { flex: 1 1 0; text-align: center; overflow: hidden; white-space: nowrap; }
.legend { display: flex; flex-wrap: wrap; gap: 10px; font-size: 12px; margin-top: 8px; }
.legend span::before { content: ''; display: inline-block; width: 10px; height: 10px; margin-right: 5px; background: var(--cc); box-shadow: 0 0 0 1px #000; }

/* подсказка */
.tip { position: fixed; z-index: 50; max-width: 340px; pointer-events: none; padding: 8px 10px; font-size: 12px; color: #fff; background: #101010; box-shadow: 0 0 0 2px #3c3c3c, 0 0 0 4px #000; text-shadow: 1px 1px 0 #000; }

/* вход */
.login-bg { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--land) center bottom / cover no-repeat, #000; }
.login { width: min(420px, 100%); }
.login h1 { font-size: 22px; display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.login h1 img { width: 32px; height: 32px; }
.login form { display: grid; gap: 12px; margin-top: 16px; }
.login .err { color: var(--bad); font-size: 13px; min-height: 20px; }
.login-corner { position: fixed; top: 16px; right: 16px; }

/* модальное окно */
.modal { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 16px; background: rgba(0,0,0,.55); }
.modal .win { width: min(640px, 100%); max-height: calc(100vh - 32px); overflow: auto; }
.modal h2 { font-size: 18px; margin-bottom: 12px; }
.rules { width: 100%; border-collapse: collapse; font-size: 13px; }
.rules td { padding: 5px 6px; border-bottom: 2px solid var(--row-alt); vertical-align: top; }
.rules td:first-child { color: var(--bad); font-weight: 700; white-space: nowrap; text-align: right; }

.more { display: flex; justify-content: center; margin-top: 14px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; }
.pw { font-size: 18px; letter-spacing: 1px; user-select: all; padding: 8px 12px; background: var(--field); color: var(--field-ink); box-shadow: 0 0 0 2px var(--field-edge); display: inline-block; }

@media (max-width: 640px) {
  body { font-size: 14px; }
  .win { padding: 14px; }
  .brand b { font-size: 18px; }
  .tab span { display: none; }
  .tab { padding: 8px 10px 9px; }
  .tab[aria-current="page"] { padding-bottom: 14px; }
  .tab[aria-current="page"] span { display: inline; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
