/* SkyMine Поддержка (/support): то же оформление, что у сайта, но фиолетовое и без магазина. */
:root {
  --bg: #130E22;
  --bg-deep: #0E0A1A;
  --panel: #1B1431;
  --field: #251C42;
  --field-hover: #2E2352;
  --border: #3A2C60;
  --muted: #A69BC6;
  --text: #EEEAF8;
  --white: #FFFFFF;
  --accent: #A77CF6;       /* главное действие */
  --accent-hover: #B993F9;
  --accent-text: #170C2C;
  --error: #F2857A;
  --success: #86CFA3;
  --taken: #7DB4F0;
  --progress: #F2B544;
  --radius: 16px;
  --shadow: 0 10px 30px -12px rgba(0, 0, 0, .6);
  --ease: .2s ease;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: var(--border) var(--bg); }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--bg); color: var(--text);
  font: 15px/1.55 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--accent); color: var(--accent-text); }
a { color: var(--text); }
a:hover { color: var(--accent-hover); }
h1, h2, h3 { margin: 0; color: var(--white); line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: clamp(24px, 4vw, 32px); font-weight: 900; }
h2 { font-size: 19px; font-weight: 800; }
h3 { font-size: 16px; font-weight: 700; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 11px; }
.hidden { display: none !important; }
.icon { width: 18px; height: 18px; flex-shrink: 0; }
.icon-sm { width: 13px; height: 13px; }
.icon-lg { width: 24px; height: 24px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 640px) { .wrap { padding: 0 24px; } }

/* Шапка */
.s-header {
  position: sticky; top: 0; z-index: 30;
  background: rgba(19, 14, 34, .92); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.s-header-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 72px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; min-width: 0; }
.brand:hover { color: inherit; }
.brand img { width: 42px; height: 42px; border-radius: 10px; display: block; flex-shrink: 0; }
.brand-name { font-size: 21px; font-weight: 800; color: var(--white); line-height: 1.1; }
.brand-name span { color: var(--accent); }
.brand-sub { font-size: 12px; color: var(--muted); }
.s-header-right { display: flex; align-items: center; gap: 10px; }
.pill { display: flex; align-items: center; gap: 10px; padding: 6px 12px 6px 6px; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; }
.avatar {
  width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex-shrink: 0; overflow: hidden;
  font-weight: 800; font-size: 13px; color: var(--accent-text);
  background: linear-gradient(135deg, var(--accent-hover), #7C56D8);
}
.av-sm { width: 22px; height: 22px; border-radius: 6px; font-size: 11px; }
.av-md { width: 30px; height: 30px; }
/* Лицо из скина: 8×8 пикселей, растянутые без размытия */
.avatar:has(.avatar-face) { background: var(--field); }
.avatar-face { width: 100%; height: 100%; display: block; image-rendering: pixelated; image-rendering: crisp-edges; }
.pill-title { font-size: 13px; font-weight: 700; color: var(--white); line-height: 1.2; }
@media (max-width: 639px) {
  .brand-sub, .hide-sm { display: none; }
  .s-header-row { height: 62px; }
  .brand-name { font-size: 18px; }
}

main { flex: 1; }
/* main — ещё и .wrap (у него padding: 0 16px), поэтому отступы сверху и снизу — отдельным правилом */
main.wrap { padding-top: 32px; padding-bottom: 48px; }
.s-footer { border-top: 1px solid var(--border); background: var(--bg-deep); padding: 18px 0; font-size: 12px; color: var(--muted); }
.s-footer a { color: var(--muted); }

/* Вкладки */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.tab {
  font: inherit; font-size: 14px; font-weight: 700; padding: 9px 16px; border-radius: 12px; cursor: pointer;
  background: var(--panel); border: 1px solid var(--border); color: var(--muted);
  display: inline-flex; align-items: center; gap: 8px;
  transition: color var(--ease), background var(--ease), border-color var(--ease);
}
.tab:hover { color: var(--white); }
.tab[aria-selected=true] { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.tab .count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: var(--accent-text); font-size: 11px; font-weight: 800; display: inline-grid; place-items: center; }
.tab[aria-selected=true] .count { background: var(--accent-text); color: var(--accent); }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head p { margin-top: 6px; max-width: 62ch; }

/* Кнопки, поля, ярлыки */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 9px 16px; border-radius: 12px; cursor: pointer;
  font: inherit; font-size: 14px; font-weight: 700; color: var(--white); text-decoration: none;
  background: var(--field); border: 1px solid var(--border);
  transition: background var(--ease), border-color var(--ease);
}
.btn:hover { background: var(--field-hover); color: var(--white); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-main { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 800; box-shadow: 0 6px 18px -8px rgba(167, 124, 246, .7); }
.btn-main:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-text); }
.btn-sm { min-height: 36px; padding: 7px 12px; font-size: 13px; }
.btn-ghost { background: transparent; }
.btn-danger { color: var(--error); }
.btn-danger:hover { color: var(--error); border-color: rgba(242, 133, 122, .5); }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
label, .label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 6px; }
input[type=text], textarea, select {
  width: 100%; min-height: 42px; padding: 10px 14px; border-radius: 12px;
  background: var(--field); border: 1px solid var(--border); color: var(--white);
  font: inherit; font-size: 14px; transition: border-color var(--ease);
}
textarea { min-height: 100px; resize: vertical; line-height: 1.5; }
select {
  appearance: none; cursor: pointer; padding-right: 34px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); }
::placeholder { color: var(--muted); opacity: .7; }
.hint { font-size: 12px; color: var(--muted); margin-top: 5px; }

.msg { border-radius: 12px; padding: 11px 14px; margin-bottom: 16px; font-size: 14px; border: 1px solid var(--border); background: var(--field); }
.msg-error { border-color: rgba(242, 133, 122, .5); color: var(--error); background: rgba(242, 133, 122, .08); }
.msg-success { border-color: rgba(134, 207, 163, .5); color: var(--success); background: rgba(134, 207, 163, .08); }
.msg:empty { display: none; }

.chip {
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
  font-size: 11px; font-weight: 700; letter-spacing: .02em;
  padding: 3px 9px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--field); color: var(--muted);
}
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.st-new { color: var(--accent); border-color: rgba(167, 124, 246, .4); background: rgba(167, 124, 246, .12); }
.st-taken { color: var(--taken); border-color: rgba(125, 180, 240, .35); background: rgba(125, 180, 240, .1); }
.st-progress { color: var(--progress); border-color: rgba(242, 181, 68, .35); background: rgba(242, 181, 68, .1); }
.st-solved { color: var(--success); border-color: rgba(134, 207, 163, .35); background: rgba(134, 207, 163, .1); }
.st-rejected { color: var(--error); border-color: rgba(242, 133, 122, .35); background: rgba(242, 133, 122, .08); }
/* Плашки ролей команды (те же цвета — на основном сайте, style.css) */
.chip-role { color: var(--rc); border-color: color-mix(in srgb, var(--rc) 40%, transparent); background: color-mix(in srgb, var(--rc) 12%, transparent); }
.role-founder { --rc: #F2B544; }
.role-admin { --rc: #F2857A; }
.role-support { --rc: #A3A9FF; }
.role-moderator { --rc: #7DB4F0; }
.role-helper { --rc: #5FCFC8; }
.role-tester { --rc: #63BE8B; }
.role-builder { --rc: #E59A5C; }
.who { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.nobody { color: var(--accent); font-weight: 700; font-size: 13px; }

.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.card-pad { padding: 20px; }
.badge-new { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: var(--accent-text); font-size: 11px; font-weight: 800; display: inline-grid; place-items: center; }
.empty { text-align: center; color: var(--muted); padding: 32px 16px; display: grid; gap: 8px; justify-items: center; }
.empty .icon { width: 30px; height: 30px; opacity: .7; }

/* Игрок: список + заявка */
.split { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 960px) { .split { grid-template-columns: minmax(0, 360px) minmax(0, 1fr); } }
.list { display: grid; gap: 10px; }
.item {
  text-align: left; width: 100%; font: inherit; color: inherit; cursor: pointer;
  display: grid; gap: 8px; padding: 14px 16px; border-radius: 14px;
  background: var(--panel); border: 1px solid var(--border);
  transition: border-color var(--ease), background var(--ease);
}
.item:hover { border-color: rgba(167, 124, 246, .55); }
.item.active { border-color: var(--accent); background: linear-gradient(180deg, rgba(167, 124, 246, .1), var(--panel)); }
.row-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.item-title { font-weight: 700; color: var(--white); font-size: 14px; line-height: 1.35; overflow-wrap: anywhere; }
.meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.num { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 12px; font-weight: 600; }
.back { display: none; margin-bottom: 10px; }
@media (max-width: 959px) { .back { display: inline-flex; } }

/* Заявка */
.t-head { padding: 20px; border-bottom: 1px solid var(--border); display: grid; gap: 12px; }
.t-head h2 { overflow-wrap: anywhere; }
.facts { display: grid; gap: 10px 20px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.fact .label { margin-bottom: 2px; }
.fact-v { font-size: 14px; color: var(--white); font-weight: 600; overflow-wrap: anywhere; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.actions select { width: auto; min-width: 170px; min-height: 36px; padding-top: 6px; padding-bottom: 6px; font-size: 13px; }
.thread { padding: 20px; display: grid; gap: 14px; }
.m { display: grid; gap: 6px; max-width: 680px; min-width: 0; }
.m.me { justify-self: end; }
.m-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.m-head b { color: var(--white); font-size: 13px; }
.m.me .m-head { justify-content: flex-end; }
.bubble { padding: 12px 14px; border-radius: 14px; background: var(--field); border: 1px solid var(--border); white-space: pre-wrap; overflow-wrap: anywhere; }
.m.staff .bubble { background: rgba(125, 180, 240, .08); border-color: rgba(125, 180, 240, .3); }
.m.me .bubble { background: rgba(167, 124, 246, .12); border-color: rgba(167, 124, 246, .35); }
.m.note .bubble { background: rgba(242, 181, 68, .07); border: 1px dashed rgba(242, 181, 68, .45); }
.sys { justify-self: center; font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; text-align: center; }
.shots { display: flex; gap: 8px; flex-wrap: wrap; }
.m.me .shots { justify-content: flex-end; }
.shot {
  width: 132px; max-width: 100%; aspect-ratio: 16 / 10; border-radius: 10px; overflow: hidden; padding: 0;
  border: 1px solid var(--border); background: var(--bg-deep); display: grid; place-items: center; position: relative; color: var(--muted);
}
button.shot { cursor: zoom-in; font: inherit; }
.shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shot .x { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 6px; border: 0; background: rgba(14, 10, 26, .85); color: var(--white); cursor: pointer; display: grid; place-items: center; padding: 0; }
.composer { padding: 16px 20px 20px; border-top: 1px solid var(--border); display: grid; gap: 10px; }
.closed-note { padding: 16px 20px; border-top: 1px solid var(--border); color: var(--muted); font-size: 13px; display: flex; gap: 8px; align-items: center; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--white); cursor: pointer; text-transform: none; letter-spacing: 0; font-weight: 600; margin: 0; }
.check input { accent-color: var(--accent); width: 16px; height: 16px; }
.file-btn { margin: 0; text-transform: none; letter-spacing: 0; font-size: 13px; color: var(--white); }

/* Новая заявка */
.types { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.type {
  text-align: left; font: inherit; color: inherit; cursor: pointer;
  padding: 14px; border-radius: 14px; background: var(--field); border: 1px solid var(--border);
  display: grid; gap: 4px; transition: border-color var(--ease), background var(--ease);
}
.type:hover { border-color: rgba(167, 124, 246, .55); }
.type[aria-pressed=true] { border-color: var(--accent); background: rgba(167, 124, 246, .12); }
.type-name { display: flex; align-items: center; gap: 8px; font-weight: 800; color: var(--white); }
.type-name .icon { color: var(--accent); }
.type-desc { font-size: 12px; color: var(--muted); }
.form { display: grid; gap: 16px; }
.grid2 { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 720px) { .grid2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.drop {
  display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 12px; margin: 0;
  border: 1px dashed var(--border); background: var(--bg-deep); color: var(--muted); font-size: 13px; cursor: pointer;
  text-transform: none; letter-spacing: 0; font-weight: 500;
}
.drop:hover { border-color: var(--accent); color: var(--text); }

/* Команда */
.stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 18px; }
.stat {
  text-align: left; font: inherit; color: inherit; cursor: pointer;
  padding: 14px 16px; border-radius: 14px; background: var(--panel); border: 1px solid var(--border);
  display: grid; gap: 2px; transition: border-color var(--ease);
}
.stat:hover { border-color: rgba(167, 124, 246, .55); }
.stat b { font-size: 26px; font-weight: 900; color: var(--white); font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat span { font-size: 12px; color: var(--muted); font-weight: 600; }
.stat.hot b { color: var(--accent); }
.filters { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); padding: 16px; border-bottom: 1px solid var(--border); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
.tickets table { min-width: 780px; }
th { text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 10px 16px; border-bottom: 1px solid var(--border); }
td { padding: 12px 16px; border-bottom: 1px solid rgba(58, 44, 96, .6); vertical-align: middle; }
.tickets tbody tr { cursor: pointer; transition: background var(--ease); }
.tickets tbody tr:hover { background: rgba(167, 124, 246, .06); }
.tickets tbody tr.active { background: rgba(167, 124, 246, .12); }
/* Игрок дописал в заявку — полоса слева и ярлык «Новое сообщение» */
.tickets tbody tr.waiting td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.new-msg { color: var(--accent-text); background: var(--accent); border-color: var(--accent); margin-top: 4px; }
tbody tr:last-child td { border-bottom: 0; }
td .t { color: var(--white); font-weight: 600; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); }
#staff-ticket { margin-top: 18px; scroll-margin-top: 90px; }

/* Роли и права */
.legend { display: flex; flex-wrap: wrap; gap: 8px; }
.perm table { min-width: 900px; }
.perm td, .perm th { text-align: center; }
.perm td:first-child, .perm th:first-child { text-align: left; }
.perm .yes { color: var(--success); }
.perm .part { color: var(--progress); font-size: 12px; font-weight: 700; }
.perm .no { color: var(--muted); opacity: .55; }
.perm .group td { background: var(--bg-deep); color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; text-align: left; }
.pcell { font: inherit; color: inherit; background: none; border: 1px dashed transparent; border-radius: 8px; min-width: 44px; min-height: 32px; cursor: pointer; display: inline-grid; place-items: center; padding: 2px 6px; transition: border-color var(--ease), background var(--ease); }
.pcell:hover { border-color: var(--accent); background: rgba(167, 124, 246, .08); }
.pcell.changed { border: 1px solid var(--accent); background: rgba(167, 124, 246, .16); }
.locked { opacity: .55; }
.perm-hint { display: flex; gap: 10px; align-items: flex-start; padding: 14px 16px; border-bottom: 1px solid var(--border); font-size: 13px; color: var(--muted); }
.perm-hint .icon { color: var(--accent); margin-top: 1px; }
.log { display: grid; gap: 8px; }

/* Файл тащат на страницу: подсказка поверх всего */
body.dragging::after {
  content: "Отпустите, чтобы прикрепить скриншот";
  position: fixed; inset: 12px; z-index: 80; pointer-events: none;
  display: grid; place-items: center; text-align: center; padding: 24px;
  border: 2px dashed var(--accent); border-radius: 18px;
  background: rgba(19, 14, 34, .82); color: var(--white); font-size: 20px; font-weight: 800;
}

/* Лог во вложениях и окно просмотра */
.logfile { cursor: pointer; display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 8px; text-align: center; color: var(--text); }
.logfile .icon { color: var(--accent); }
.log-name { font-size: 12px; font-weight: 700; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log-viewer {
  cursor: auto; width: min(1100px, 100%); max-height: 100%; display: flex; flex-direction: column; gap: 12px;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow);
}
.log-viewer pre {
  margin: 0; flex: 1; min-height: 0; overflow: auto; padding: 12px; border-radius: 10px;
  background: var(--bg-deep); border: 1px solid var(--border); color: var(--text);
  font: 12px/1.5 ui-monospace, "Cascadia Mono", Consolas, monospace; white-space: pre; tab-size: 4;
}

/* Просмотр скриншота */
.viewer { position: fixed; inset: 0; z-index: 60; background: rgba(8, 6, 16, .88); display: grid; place-items: center; padding: 24px; cursor: zoom-out; }
.viewer img { max-width: 100%; max-height: 100%; border-radius: 10px; box-shadow: var(--shadow); }
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 20px; z-index: 70;
  background: var(--field); border: 1px solid var(--accent); color: var(--white); max-width: calc(100% - 32px);
  padding: 10px 16px; border-radius: 12px; font-size: 14px; font-weight: 600; box-shadow: var(--shadow);
}
.skeleton { color: var(--muted); padding: 16px; font-size: 14px; }
@media (prefers-reduced-motion: no-preference) {
  .toast { animation: up .2s ease; }
  @keyframes up { from { transform: translate(-50%, 8px); opacity: 0; } }
}
.perm td:first-child { min-width: 240px; }
.perm th .chip { text-transform: none; letter-spacing: .02em; }
