:root {
  --bg:        #0a0f16;
  --surface:   #101823;
  --surface-2: #0d141d;
  --border:    #1c2a3a;
  --blue:      #2f6bd8;
  --blue-dim:  #1c3f7a;
  --text:      #e6edf3;
  --muted:     #7d8b9c;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* ---- masthead ---- */
.masthead {
  text-align: center;
  padding: 72px 24px 40px;
  border-bottom: 1px solid var(--border);
}

.seal { width: 200px; height: 200px; object-fit: contain; }

.org-name {
  margin-top: 24px;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.tagline {
  margin-top: 10px;
  font-size: 14px;
  color: var(--muted);
}

/* ---- toolbar ---- */
.wanted {
  max-width: 1080px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}

.toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 24px;
}

/* ---- buttons ---- */
.btn {
  display: inline-block;
  padding: 9px 18px;
  border-radius: 6px;
  background: var(--blue);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
}
.btn:hover { background: #3b7be0; }

.btn.ghost {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
}
.btn.ghost:hover { background: none; border-color: var(--blue-dim); color: var(--text); }

/* ---- roster (компактные карточки) ---- */
.roster {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
}

.roster > li { display: flex; }
.card {
  display: flex;
  flex-direction: column;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  transition: border-color 0.15s ease;
}
.card:hover { border-color: var(--blue-dim); }

.mugshot {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.mugshot.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
}
.mugshot.placeholder span {
  font-size: 46px;
  font-weight: 600;
  color: var(--blue-dim);
}

.card-body { padding: 16px; }
.card-name { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.card-id {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 1px;
}
.card-status {
  display: inline-block;
  margin-top: 8px;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--muted);
}
.card-reason {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---- back button ---- */
.back-btn {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 10;
  padding: 9px 16px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}
.back-btn:hover { border-color: var(--blue-dim); color: var(--text); }

/* ---- profile (отдельное окно) ---- */
.profile {
  width: 100%;
  max-width: 960px;
}
.profile-top {
  display: flex;
  gap: 48px;
  align-items: flex-start;
}
.profile-photo {
  flex: 0 0 340px;
  width: 340px;
  height: 340px;
  object-fit: cover;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
}
.profile-photo.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
}
.profile-photo.placeholder span {
  font-size: 120px;
  font-weight: 600;
  color: var(--blue-dim);
}
.profile-info { flex: 1; min-width: 0; }
.profile-nick { font-size: 44px; font-weight: 700; word-break: break-word; line-height: 1.1; }
.profile-status {
  display: inline-block;
  margin-top: 14px;
  padding: 5px 14px;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--text);
}
.profile-id {
  margin-top: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 15px;
  color: var(--muted);
  letter-spacing: 1px;
}
.profile-twitch {
  display: inline-block;
  margin-top: 24px;
  font-size: 18px;
  font-weight: 600;
  color: var(--blue);
}
.profile-twitch:hover { text-decoration: underline; }
.profile-desc {
  margin-top: 28px;
  font-size: 20px;
  color: var(--text);
  line-height: 1.6;
}
.profile-clip {
  margin-top: 44px;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: #000;
}
.profile-clip iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ---- footer ---- */
.foot {
  text-align: center;
  padding: 32px 24px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 1px;
}

/* ---- support widget ---- */
.support {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.support:hover { border-color: var(--blue-dim); transform: translateY(-2px); }
.support-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
}
.support-text { display: flex; flex-direction: column; line-height: 1.25; }
.support-text b { font-size: 14px; font-weight: 600; color: var(--text); }
.support-text small { font-size: 12px; color: var(--muted); }

@media (max-width: 480px) {
  .support { right: 14px; bottom: 14px; padding: 9px; gap: 0; }
  .support-text { display: none; }
}

/* ---- profile / form page ---- */
.sheet-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
}

.sheet-card {
  width: 100%;
  max-width: 420px;
  text-align: center;
}

.sheet-mug {
  width: 132px;
  height: 132px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sheet-mug span { font-size: 52px; font-weight: 600; color: var(--blue-dim); }

.sheet-name { margin-top: 24px; font-size: 22px; font-weight: 600; }
.sheet-status {
  display: inline-block;
  margin-top: 10px;
  font-size: 11px;
  letter-spacing: 2px;
  font-weight: 600;
  color: var(--blue);
}

.sheet-fields {
  margin-top: 28px;
  text-align: left;
  border-top: 1px solid var(--border);
}
.sheet-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 2px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.sheet-row .k {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}
.sheet-row .v { text-align: right; word-break: break-word; }
.sheet-row .v.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 1px;
}
.sheet-row .v.link { color: var(--blue); }

.sheet-card > .btn { margin-top: 28px; }

/* ---- form ---- */
.form { text-align: left; }
.form .sheet-name { text-align: center; margin-top: 0; margin-bottom: 28px; }

.field { display: block; margin-bottom: 18px; }
.field span {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.3px;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
}
.field input:focus,
.field select:focus,
.field textarea:focus { outline: none; border-color: var(--blue); }

.form-actions { display: flex; gap: 10px; margin-top: 24px; }

@media (max-width: 480px) {
  .org-name { font-size: 21px; }
  .roster { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .masthead { padding: 48px 20px 32px; }
  .profile-top { flex-direction: column; align-items: center; text-align: center; gap: 24px; }
  .profile-photo { flex-basis: auto; width: 100%; max-width: 260px; height: auto; aspect-ratio: 1/1; }
  .profile-nick { font-size: 32px; }
  .profile-desc { font-size: 17px; }
}
