:root {
  --bg: #050607;
  --bg-soft: #0d1117;
  --panel: rgba(15, 19, 26, 0.86);
  --panel-solid: #0f131a;
  --text: #e6edf6;
  --muted: #8ea0b6;
  --line: #253141;
  --line-strong: #324257;
  --accent: #ff8c3a;
  --accent-2: #2ec5b6;
  --accent-soft: #2b1b12;
  --shadow: 0 20px 56px rgba(0, 0, 0, 0.55);
  --radius: 20px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Space Grotesk", sans-serif;
  background:
    radial-gradient(circle at 10% 10%, rgba(80, 121, 255, 0.22) 0%, transparent 38%),
    radial-gradient(circle at 90% 0%, rgba(255, 140, 58, 0.18) 0%, transparent 34%),
    linear-gradient(180deg, #07090d 0%, #040507 100%);
}

.bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(151, 172, 194, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(151, 172, 194, 0.07) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: radial-gradient(circle at 60% 20%, #000 0%, transparent 65%);
}

.shell {
  position: relative;
  z-index: 1;
  max-width: 1400px;
  margin: 0 auto;
  padding: 26px;
  display: grid;
  gap: 18px;
  grid-template-columns: 360px 1fr;
}

body.is-auth.control-fullscreen .shell {
  max-width: none;
  width: 100%;
  grid-template-columns: 1fr;
  padding: 14px;
}

body.is-auth.control-fullscreen .right {
  display: none;
}

body.is-auth.control-fullscreen .left {
  width: 100%;
  height: calc(100vh - 28px);
  overflow: auto;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}

.left {
  padding: 20px;
  height: fit-content;
}

.right {
  min-height: 86vh;
  overflow: hidden;
}

.brand-chip {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: #101a24;
  border: 1px solid #2e4157;
  color: #90c2f0;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.2px;
  text-transform: uppercase;
}

h1 {
  margin: 10px 0 0;
  font-size: clamp(1.9rem, 2.4vw, 2.4rem);
  letter-spacing: -0.5px;
}

h2 {
  margin: 0;
  font-size: clamp(1.4rem, 2vw, 1.9rem);
  letter-spacing: -0.35px;
}

h3 {
  margin: 0;
  font-size: 1.04rem;
}

.intro {
  color: var(--muted);
  line-height: 1.55;
  margin-top: 14px;
  max-width: 34ch;
}

.login-btn {
  display: inline-block;
  margin-top: 14px;
  padding: 11px 16px;
  border-radius: 12px;
  border: 1px solid #5865f2;
  color: #fff;
  background: linear-gradient(135deg, #5865f2 0%, #4554e4 100%);
  text-decoration: none;
  font-weight: 700;
  box-shadow: 0 10px 22px rgba(88, 101, 242, 0.34);
  transition: transform .18s ease, box-shadow .18s ease;
}

.login-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(88, 101, 242, 0.42);
}

.auth-hints {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hint {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #131922;
  color: #a9bbd0;
  font-size: 0.77rem;
  padding: 4px 10px;
  font-weight: 600;
}

.profile {
  margin-top: 13px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #111722;
}

.profile .name { font-weight: 700; }
.profile .id { color: var(--muted); font-size: .84rem; margin-top: 4px; }

.auth-menu-tabs {
  margin-top: 12px;
  display: flex;
  gap: 8px;
}

.menu-tab {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #111722;
  color: #c9d6e6;
  padding: 8px 10px;
  font-weight: 700;
  cursor: pointer;
}

.menu-tab.active {
  border-color: #33527a;
  background: #17283b;
  color: #eaf4ff;
}

.menu-panel {
  display: none;
}

.menu-panel.active {
  display: block;
}

.panel-note {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.82rem;
}

.control-card {
  margin-top: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #101721;
}

.control-title {
  font-weight: 800;
  font-size: 0.95rem;
}

.control-subtitle {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.82rem;
}

.control-workspace {
  margin-top: 12px;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(320px, 1.15fr) minmax(280px, .95fr) minmax(280px, 1fr);
}

.workspace-pane {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0d141e;
  padding: 10px;
  min-height: 420px;
}

.pane-detail,
.pane-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.control-card label {
  margin-top: 7px;
  display: block;
  font-size: 0.76rem;
  color: var(--muted);
  text-transform: uppercase;
  font-weight: 700;
}

.control-card input,
.control-card select {
  margin-top: 5px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #0d141e;
  color: var(--text);
  padding: 8px 10px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.78rem;
}

.control-card input[readonly] {
  opacity: 0.9;
  cursor: default;
}

.control-card select {
  font-family: "Space Grotesk", sans-serif;
}

.users-table-wrap {
  margin-top: 8px;
  max-height: calc(100vh - 330px);
  min-height: 320px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0b1119;
}

body.is-auth.control-fullscreen .users-table-wrap {
  max-height: calc(100vh - 310px);
}

.users-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

.users-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  text-align: left;
  padding: 8px;
  background: #121a25;
  color: #9eb2c9;
  border-bottom: 1px solid #203144;
  text-transform: uppercase;
  letter-spacing: 0.2px;
}

.users-table td {
  padding: 9px 8px;
  border-bottom: 1px solid #141f2c;
  color: #d6e5f7;
  vertical-align: middle;
}

.users-table tr:last-child td {
  border-bottom: none;
}

.users-table tr:hover td,
.users-table tr.selected td {
  background: #162335;
}

.user-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-cell img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid #22374d;
}

.user-cell .line1 {
  display: block;
  font-size: 0.9rem;
  color: #d9e8fb;
  font-weight: 700;
}

.user-cell .line2 {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
}

.member-empty {
  padding: 10px;
  font-size: 0.82rem;
  color: var(--muted);
}

.member-loading {
  text-align: center;
  min-height: 56px;
}

.member-loading-inner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.loader-spin {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #2b3e55;
  border-top-color: #ff8c3a;
  animation: loader-spin .8s linear infinite;
}

@keyframes loader-spin {
  to { transform: rotate(360deg); }
}

.control-card button {
  margin-top: 8px;
  border: 1px solid #3b5170;
  border-radius: 10px;
  background: #18304e;
  color: #e8f3ff;
  padding: 9px 10px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
}

.control-card button:hover {
  background: #26446a;
  transform: translateY(-1px);
}

.control-checkbox {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--muted);
}

.control-status {
  margin-top: 10px;
  font-size: 0.82rem;
  color: var(--muted);
  white-space: pre-wrap;
}

.detail-title {
  font-weight: 700;
  font-size: 0.88rem;
  color: #cfe2f8;
}

.selected-user-card {
  border: 1px solid #203245;
  border-radius: 12px;
  background: #0a1017;
  min-height: 230px;
  padding: 12px;
}

.selected-empty {
  color: var(--muted);
  font-size: 0.82rem;
}

.selected-user-filled {
  display: none;
}

.selected-user-filled.active {
  display: block;
}

.selected-main {
  display: flex;
  align-items: center;
  gap: 10px;
}

.selected-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid #2a425b;
  object-fit: cover;
}

.selected-display {
  font-weight: 700;
  color: #eff7ff;
}

.selected-username {
  margin-top: 2px;
  color: #9fb7cf;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.8rem;
}

.selected-grid {
  margin-top: 12px;
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr 1fr;
}

.selected-grid > div {
  border: 1px solid #1f2f42;
  border-radius: 9px;
  background: #0d1622;
  padding: 8px;
}

.selected-grid span {
  display: block;
  font-size: 0.7rem;
  color: #8aa0b7;
  text-transform: uppercase;
}

.selected-grid strong {
  display: block;
  margin-top: 4px;
  font-size: 0.82rem;
  color: #e5f0ff;
  font-family: "IBM Plex Mono", monospace;
  overflow-wrap: anywhere;
}

.action-card {
  border: 1px solid #22374f;
  border-radius: 12px;
  padding: 10px;
  background: #0b1220;
}

.action-title {
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.rank-card {
  border-color: #2f4f74;
}

.balls-card {
  border-color: #285763;
}

.warn-card {
  border-color: #684349;
  background: #170f14;
}

.warn-card button {
  border-color: #8c4954;
  background: #5a2630;
}

.warn-card button:hover {
  background: #76313d;
}

.toast-stack {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 40;
  display: grid;
  gap: 8px;
}

.toast-item {
  min-width: 260px;
  max-width: 420px;
  border: 1px solid #355a81;
  border-radius: 10px;
  background: rgba(20, 32, 48, 0.96);
  color: #e7f2ff;
  padding: 9px 11px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
  font-size: 0.82rem;
  animation: rise .2s ease both;
}

.toast-item.error {
  border-color: #8c4a55;
  background: rgba(58, 23, 31, 0.96);
}

@media (max-width: 1280px) {
  .control-workspace {
    grid-template-columns: 1fr;
  }
  .workspace-pane {
    min-height: 0;
  }
  .users-table-wrap {
    max-height: 340px;
    min-height: 220px;
  }
}

.actions {
  margin-top: 11px;
  display: flex;
  gap: 8px;
  align-items: center;
}

.actions button,
.logout {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #121923;
  color: var(--text);
  padding: 8px 10px;
  text-decoration: none;
  cursor: pointer;
  font-weight: 600;
}

.actions button:hover,
.logout:hover {
  border-color: var(--line-strong);
  background: #172231;
}

.steamid-search {
  margin-top: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #101721;
}

.steamid-search label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.2px;
}

.steamid-search input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #0d141e;
  color: var(--text);
  padding: 8px 10px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.78rem;
}

.steamid-search input:focus {
  outline: none;
  border-color: #3f67b4;
  box-shadow: 0 0 0 2px rgba(63, 103, 180, 0.25);
}

.steamid-actions {
  margin-top: 8px;
  display: flex;
  gap: 6px;
}

.steamid-actions button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #121923;
  color: var(--text);
  padding: 6px 9px;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.78rem;
}

.steamid-actions button:hover {
  border-color: var(--line-strong);
  background: #172231;
}

.file-list {
  margin-top: 14px;
  display: grid;
  gap: 9px;
  max-height: 72vh;
  overflow: auto;
  padding-right: 4px;
}

.file-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #111722;
  padding: 10px;
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}

.file-item:hover,
.file-item.active {
  border-color: #5f3c24;
  background: #1b1a19;
  transform: translateY(-1px);
}

.file-item .name {
  font-family: "IBM Plex Mono", monospace;
  font-size: .77rem;
  overflow-wrap: anywhere;
}

.file-item .meta {
  margin-top: 4px;
  font-size: .76rem;
  color: var(--muted);
}

.transcript-head {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(18, 24, 32, 0.95), rgba(15, 19, 26, 0.72));
}

.meta {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.85rem;
}

.messages {
  padding: 14px;
  display: grid;
  gap: 10px;
}

.message {
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--panel-solid);
  padding: 11px;
  animation: rise .22s ease both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.message header {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--accent-soft);
  object-fit: cover;
}

.line1 {
  display: flex;
  gap: 8px;
  align-items: baseline;
  flex-wrap: wrap;
}

.display-name { font-weight: 700; }
.username,
.line2 { color: var(--muted); font-size: 0.82rem; }

.line2 { display: flex; gap: 8px; }

.content {
  margin-top: 8px;
  white-space: pre-wrap;
  line-height: 1.53;
}

.code-inline {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.88em;
  color: #f2f3f5;
  background: #2b2d31;
  border: none;
  border-radius: 4px;
  padding: 0 4px;
}

.code-block-wrap {
  margin-top: 6px;
}

.code-block {
  margin: 0;
  overflow-x: auto;
  background: #1e1f22;
  border: 1px solid #2f3136;
  border-radius: 10px;
  padding: 10px 12px;
}

.code-block code {
  font-family: "IBM Plex Mono", monospace;
  color: #dbdee1;
  white-space: pre;
  font-size: 0.85rem;
}

.text-underline {
  text-decoration: underline;
}

.text-strike {
  text-decoration: line-through;
}

.spoiler-text {
  cursor: pointer;
  border-radius: 5px;
  background: #151c26;
  color: transparent;
  text-shadow: 0 0 7px rgba(193, 207, 222, 0.8);
  padding: 0 4px;
  transition: color 0.12s ease;
}

.spoiler-text.revealed {
  color: var(--text);
  text-shadow: none;
}

.mention {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 6px;
  margin: 0 1px;
  font-weight: 600;
  font-size: 0.92em;
}

.mention-role {
  color: #c6a9ff;
  background: #251c3a;
  border: 1px solid #4e3b75;
}

.mention-user {
  color: #8dc3ff;
  background: #13263f;
}

.mention-channel {
  color: #7ee7d5;
  background: #12302c;
}

.ext-link-wrap { display: inline; }

.ext-link {
  color: #7fb8ff;
  text-decoration: underline;
  word-break: break-all;
}

.ext-link-warning,
.ext-link-trusted {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.2px;
  text-transform: uppercase;
  border-radius: 6px;
  padding: 1px 6px;
  vertical-align: baseline;
}

.ext-link-warning {
  color: #ffb37a;
  background: #3a2311;
  border: 1px solid #7a4b28;
}

.ext-link-trusted {
  color: #8be6ad;
  background: #163023;
  border: 1px solid #2d6948;
}

.attachments {
  margin-top: 8px;
  display: grid;
  gap: 8px;
}

.image-preview {
  max-width: min(460px, 100%);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.video-wrap {
  display: grid;
  gap: 6px;
  width: min(560px, 100%);
}

.video-preview {
  width: 100%;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #070b12;
}

.file-link {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.78rem;
  text-decoration: none;
  color: #9bc3ff;
  background: #132034;
  border: 1px solid #2f4f78;
  border-radius: 8px;
  padding: 6px 9px;
  display: inline-block;
}

.empty {
  color: var(--muted);
  padding: 20px;
}

.guest-hero {
  min-height: 100%;
  padding: clamp(20px, 4vw, 44px);
  display: grid;
  gap: 16px;
  align-content: start;
}

.hero-badge {
  display: inline-block;
  width: fit-content;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid #2a675f;
  background: #102926;
  color: #78e3d6;
  text-transform: uppercase;
  letter-spacing: 0.2px;
  font-size: .73rem;
  font-weight: 700;
}

.guest-hero p {
  color: var(--muted);
  max-width: 62ch;
  margin: 0;
  line-height: 1.6;
}

.hero-grid {
  margin-top: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.hero-grid article {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #111722;
  padding: 12px;
}

.hero-grid article p {
  margin-top: 7px;
  font-size: 0.9rem;
}

@media (max-width: 1180px) {
  .shell { grid-template-columns: 320px 1fr; padding: 14px; }
  .hero-grid { grid-template-columns: 1fr; }
}

@media (max-width: 920px) {
  .shell { grid-template-columns: 1fr; }
  .right { min-height: 58vh; }
  .left { order: 2; }
  .right { order: 1; }
}

.embed-list {
  margin-top: 8px;
  display: grid;
  gap: 8px;
}

.embed-card {
  border: 1px solid var(--line);
  border-left: 4px solid #4d5fe5;
  border-radius: 10px;
  background: #121a25;
  padding: 9px 10px;
}

.embed-title {
  font-weight: 700;
  line-height: 1.4;
}

.embed-desc {
  margin-top: 4px;
  white-space: pre-wrap;
  line-height: 1.45;
}

.embed-fields {
  margin-top: 7px;
  display: grid;
  gap: 6px;
}

.embed-field {
  border: 1px solid #2d3e53;
  border-radius: 8px;
  background: #0d141e;
  padding: 6px 8px;
}

.embed-field-name {
  font-weight: 700;
  font-size: 0.86rem;
}

.embed-field-value {
  margin-top: 2px;
  font-size: 0.9rem;
  color: #c3d2e3;
  white-space: pre-wrap;
}

.embed-footer {
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.8rem;
}
