:root {
  color-scheme: dark;
  font-family: "Segoe UI", "Microsoft YaHei UI", sans-serif;
  font-synthesis: none;
  --text: #eef5ff;
  --muted: #8fa2bb;
  --line: rgba(142, 171, 207, .22);
  --panel: rgba(30, 43, 60, .56);
}

* { box-sizing: border-box; }
html, body { min-width: 100%; min-height: 100%; margin: 0; }
body { color: var(--text); background: #07101a; }
button, input { font: inherit; }
button { cursor: pointer; }

.viewer-page { background: transparent !important; overflow-x: hidden; }
.viewer-shell { min-height: 100vh; padding: 10px; background: transparent; }
.viewer-header {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: linear-gradient(100deg, rgba(10, 20, 33, .9), rgba(15, 29, 46, .72));
  box-shadow: 0 7px 24px rgba(0, 0, 0, .26);
  backdrop-filter: blur(14px);
}
.title-wrap { display: flex; align-items: center; min-width: 0; gap: 10px; }
.title-wrap h1 { margin: 0; font-size: 14px; font-weight: 700; letter-spacing: .08em; }
.title-wrap p { margin: 3px 0 0; color: var(--muted); font-size: 10px; }
.pulse { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: #3ed892; box-shadow: 0 0 0 5px rgba(62, 216, 146, .1), 0 0 14px #31d48a; }
.connection { flex: 0 0 auto; padding: 4px 8px; border: 1px solid rgba(65, 211, 145, .23); border-radius: 999px; color: #63e5ab; background: rgba(27, 114, 78, .16); font-size: 10px; }
.connection.disconnected { border-color: rgba(245, 114, 125, .28); color: #ff8a94; background: rgba(141, 37, 48, .18); }
.connection.connecting { border-color: rgba(249, 197, 91, .28); color: #f9cd71; background: rgba(133, 95, 22, .18); }

.line-list { display: grid; gap: 6px; }
.line-row {
  position: relative;
  min-height: 58px;
  display: grid;
  grid-template-columns: 55px minmax(90px, 1.2fr) minmax(110px, 1.7fr) 62px 58px;
  align-items: center;
  gap: 10px;
  padding: 8px 11px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .2);
  backdrop-filter: blur(12px);
}
.line-row::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--hp-color); box-shadow: 0 0 12px var(--hp-color); }
.line-row.warning { border-color: rgba(244, 190, 76, .42); }
.line-row.expired { opacity: .67; border-color: rgba(240, 92, 104, .4); filter: saturate(.72); }
.line-number { font-size: 18px; font-weight: 750; font-variant-numeric: tabular-nums; }
.line-number small { margin-left: 2px; color: var(--muted); font-size: 10px; font-weight: 500; }
.owner { min-width: 0; overflow: hidden; color: #d9e9ff; font-size: 13px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.hp { min-width: 0; }
.hp-label { display: flex; justify-content: space-between; margin-bottom: 5px; color: var(--muted); font-size: 10px; }
.hp-label strong { color: var(--hp-color); font-size: 12px; }
.hp-track { height: 5px; overflow: hidden; border-radius: 99px; background: rgba(139, 160, 187, .17); }
.hp-fill { height: 100%; width: var(--hp); border-radius: inherit; background: var(--hp-color); box-shadow: 0 0 8px var(--hp-color); transition: width .25s ease; }
.players { text-align: right; font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.players small { display: block; margin-top: 2px; color: var(--muted); font-size: 9px; font-weight: 400; }
.updated { color: var(--muted); text-align: right; font-size: 9px; }
.expired .updated { color: #ff828c; }
.warning .updated { color: #f4ca6b; }

.empty-state { min-height: 190px; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 7px; border: 1px dashed rgba(139, 163, 193, .23); border-radius: 12px; color: #b5c4d7; background: rgba(8, 14, 23, .58); backdrop-filter: blur(10px); }
.empty-state.visible { display: flex; }
.empty-state small { color: #72869f; }
.empty-radar { width: 34px; height: 34px; display: grid; place-items: center; margin-bottom: 4px; border: 1px solid #386892; border-radius: 50%; }
.empty-radar span { width: 7px; height: 7px; border-radius: 50%; background: #48b8ff; box-shadow: 0 0 15px #48b8ff; }

@media (max-width: 440px) {
  .viewer-shell { padding: 6px; }
  .viewer-header { min-height: 45px; margin-bottom: 5px; }
  .line-row { min-height: 52px; grid-template-columns: 44px minmax(70px, 1fr) minmax(95px, 1.4fr) 46px; gap: 7px; padding: 7px 8px; }
  .updated { display: none; }
  .line-number { font-size: 15px; }
  .owner { font-size: 12px; }
  .players { font-size: 14px; }
}

.admin-page { min-height: 100vh; background: radial-gradient(circle at 75% 0%, #172c48 0, transparent 35%), #08101b; }
.admin-shell { width: min(1040px, calc(100% - 32px)); margin: 0 auto; padding: 34px 0 70px; }
.admin-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.eyebrow { margin: 0 0 8px; color: #5aa8ff; font-size: 11px; font-weight: 750; letter-spacing: .2em; text-transform: uppercase; }
.admin-header h1 { margin: 0; font-size: clamp(25px, 4vw, 39px); letter-spacing: -.04em; }
.admin-subtitle { margin: 8px 0 0; color: var(--muted); }
.admin-status { padding: 7px 11px; border: 1px solid #314158; border-radius: 999px; color: #f5ca6f; background: #131d2b; font-size: 12px; white-space: nowrap; }
.admin-status.online { color: #69e7af; }
.card { border: 1px solid #24354c; border-radius: 14px; background: rgba(13, 22, 35, .88); box-shadow: 0 20px 55px rgba(0, 0, 0, .25); }
.login-card { max-width: 510px; padding: 22px; }
.login-card h2 { margin: 0 0 7px; font-size: 17px; }
.login-card p { margin: 0 0 16px; color: var(--muted); font-size: 13px; }
.login-form { display: flex; gap: 9px; }
input { width: 100%; min-width: 0; height: 42px; padding: 0 12px; border: 1px solid #30425c; border-radius: 8px; outline: 0; color: #edf5ff; background: #080e17; }
input:focus { border-color: #3988ef; box-shadow: 0 0 0 3px rgba(48, 126, 231, .17); }
.btn { height: 42px; padding: 0 15px; border: 1px solid transparent; border-radius: 8px; color: white; background: #256bd4; font-weight: 650; white-space: nowrap; }
.btn:hover { background: #3179e4; }
.btn.secondary { border-color: #344760; color: #c8d7ea; background: #162235; }
.btn.danger { border-color: #6d3040; color: #ffb5bc; background: #351722; }
.btn.icon { width: 38px; height: 38px; padding: 0; }
.workspace[hidden], .login-card[hidden] { display: none; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.toolbar-note { color: var(--muted); font-size: 12px; }
.lines-table { overflow: hidden; }
.table-head, .edit-row { display: grid; grid-template-columns: 105px 1fr 150px 150px 52px; align-items: center; gap: 12px; }
.table-head { padding: 11px 16px; border-bottom: 1px solid #24354c; color: #7f93ad; font-size: 11px; }
.edit-row { padding: 12px 16px; border-bottom: 1px solid #1e2c3e; }
.edit-row:last-child { border-bottom: 0; }
.edit-row input { height: 38px; }
.field-suffix { position: relative; }
.field-suffix input { padding-right: 30px; }
.field-suffix span { position: absolute; top: 50%; right: 11px; color: #758aa5; font-size: 11px; transform: translateY(-50%); pointer-events: none; }
.row-state { grid-column: 1 / -1; min-height: 0; margin-top: -5px; color: #6bddaa; font-size: 10px; text-align: right; }
.row-state.error { color: #ff8d98; }
.admin-empty { padding: 45px 20px; color: #7f93ad; text-align: center; }
.toast-admin { position: fixed; right: 22px; bottom: 22px; max-width: 360px; padding: 11px 15px; border: 1px solid #66313e; border-radius: 9px; color: #ffd6db; background: #321822; box-shadow: 0 12px 40px #0008; opacity: 0; pointer-events: none; transform: translateY(8px); transition: .2s; }
.toast-admin.show { opacity: 1; transform: translateY(0); }

@media (max-width: 720px) {
  .admin-shell { width: min(100% - 20px, 1040px); padding-top: 22px; }
  .admin-header { align-items: flex-start; flex-direction: column; }
  .table-head { display: none; }
  .edit-row { grid-template-columns: 1fr 1fr; gap: 9px; }
  .edit-row .owner-field { grid-column: 1 / -1; }
  .edit-row .delete-button { justify-self: end; }
  .login-form { flex-direction: column; }
}

.viewer-page .viewer-header { display: none; }
.viewer-page { user-select: none; -webkit-user-select: none; }
