@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700&display=swap");

:root {
  color-scheme: dark;
  --bg: #14161c;
  --panel: rgba(28, 31, 39, 0.85);
  --border: #2b2f3a;
  --text: #e8e9ed;
  --muted: #8a8f9c;
  --ready: #2ecc71;
  --soon: #f1c40f;
  --window: #e67e22;
  --wait: #3d84f7;
  --danger: #e74c3c;
  --btn-primary: #4a76b8;
  --btn-primary-hover: #5583c6;
  --btn-primary-active: #3d6299;
  --btn-primary-text: #eef3fa;
  --btn-kill: #c2503f;
  --btn-kill-hover: #d15c49;
  --btn-kill-text: #fff5f2;
  --btn-surface: #1d2029;
  --btn-surface-hover: #252935;
  --btn-tile: #22252f;
  --btn-tile-hover: #2b2f3a;
  --btn-radius: 12px;
  --btn-radius-sm: 9px;
  --btn-radius-lg: 16px;
  --accent: #9b7cf0;
  --accent-soft: #a58cf5;
  --accent-text: #c9b8ff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}

#watermark-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  background-repeat: repeat;
}

#bg-particles {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: block;
  background: #14161c;
}

/* контент должен лежать в своём стекинг-контексте выше canvas (z-index:0),
   иначе фиксированный канвас перекроет статично спозиционированные блоки */
.location-tabs,
main {
  position: relative;
  z-index: 1;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(20, 22, 28, 0.92);
  backdrop-filter: blur(8px);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-mark {
  display: flex;
  align-items: center;
  flex: none;
}

.guild-switcher {
  background: #14161c;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 8px;
  color: var(--text);
  font-size: 0.8rem;
  width: auto;
}

h1 {
  font-size: 1.3rem;
  margin: 0;
}

#admin-title,
#site-title {
  font-weight: 600;
  background: linear-gradient(100deg, #7fb0ff, #9b5ce0, #5ad1e6, #7fb0ff);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: karos-shimmer 12s ease-in-out infinite;
}

.conn-status {
  font-size: 0.78rem;
  color: var(--muted);
}

.conn-status.online {
  color: var(--ready);
}

.online-users {
  font-size: 0.78rem;
  color: var(--muted);
  margin-left: 4px;
}

.online-users:empty {
  display: none;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-block {
  display: flex;
  align-items: center;
  gap: 16px;
}

.user-menu {
  position: relative;
}

.user-menu-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--btn-radius);
  padding: 0 12px 0 4px;
  cursor: pointer;
  width: auto;
  flex: none;
  box-shadow: none;
  transition: background 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.user-menu-trigger:hover {
  border-color: transparent;
  background: var(--btn-surface);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.45);
}

.user-menu.open .user-menu-trigger {
  border-color: transparent;
  background: var(--btn-surface-hover);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.user-menu-trigger:active {
  transform: none;
}

.user-avatar {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #5ad1e6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: #0d0f14;
}

.user-name {
  font-size: 0.85rem;
  color: var(--text);
  font-weight: 600;
}

.user-menu-arrow {
  color: var(--muted);
  font-size: 0.7rem;
  transition: transform 0.15s ease;
}

.user-menu.open .user-menu-arrow {
  transform: rotate(180deg);
}

.user-menu-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #1b1e27;
  border: 1px solid var(--border);
  border-radius: var(--btn-radius);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 168px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  z-index: 30;
}

.user-menu-dropdown[hidden] {
  display: none;
}

.menu-item {
  flex: none;
  width: 100%;
  height: 34px;
  text-align: left;
  background: transparent;
  border: none;
  color: #c8ccd6;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0 10px;
  border-radius: var(--btn-radius-sm);
  cursor: pointer;
  text-decoration: none;
  display: flex;
  align-items: center;
  box-shadow: none;
  transition: background 0.16s ease, color 0.16s ease;
}

.menu-item:hover {
  background: var(--btn-tile-hover);
  color: var(--text);
  box-shadow: none;
}

.menu-item:active {
  transform: none;
  background: var(--btn-tile);
}

.menu-item-danger {
  color: #e07a6e;
}

.menu-item-danger:hover {
  background: #2e252a;
  color: #f08b7e;
}

@keyframes karos-shimmer {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes karos-flip {
  0%, 46% { transform: rotate(0deg); }
  50%, 96% { transform: rotate(180deg); }
  100% { transform: rotate(360deg); }
}

@keyframes karos-sand {
  0% { transform: translateY(0); opacity: 0; }
  20% { opacity: 1; }
  80% { opacity: 1; }
  100% { transform: translateY(9px); opacity: 0; }
}

@keyframes karos-fill-top {
  0% { transform-origin: 50% 100%; transform: scale(1); opacity: 0.8; }
  44% { transform-origin: 50% 100%; transform: scale(0.2); opacity: 0.8; }
  45.9% { transform-origin: 50% 100%; transform: scale(0.2); opacity: 0; }
  /* точка оседания переключается мгновенно и только при нулевой прозрачности */
  46% { transform-origin: 50% 0%; transform: scale(0.2); opacity: 0; }
  50% { transform-origin: 50% 0%; transform: scale(0.2); opacity: 0.8; }
  100% { transform-origin: 50% 0%; transform: scale(1); opacity: 0.8; }
}

@keyframes karos-fill-bottom {
  0% { transform-origin: 50% 100%; transform: scale(0.38); opacity: 0.8; }
  44% { transform-origin: 50% 100%; transform: scale(1); opacity: 0.8; }
  46% { transform-origin: 50% 0%; transform: scale(1); opacity: 0.8; }
  95.9% { transform-origin: 50% 0%; transform: scale(0.38); opacity: 0; }
  96% { transform-origin: 50% 100%; transform: scale(0.38); opacity: 0; }
  99% { transform-origin: 50% 100%; transform: scale(0.38); opacity: 0.8; }
  100% { transform-origin: 50% 100%; transform: scale(0.38); opacity: 0.8; }
}

@keyframes karos-counterflip {
  0% { transform: rotate(0deg); opacity: 0; }
  4% { opacity: 1; }
  43% { opacity: 1; }
  45% { opacity: 0; }
  46% { transform: rotate(0deg); }
  50% { transform: rotate(-180deg); }
  54% { opacity: 0; }
  57% { opacity: 1; }
  93% { opacity: 1; }
  95% { opacity: 0; }
  96% { transform: rotate(-180deg); }
  100% { transform: rotate(-360deg); opacity: 0; }
}

.clock-widget {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #14161c;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 22px 8px 16px;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.hourglass {
  flex: none;
  color: var(--muted);
  overflow: visible;
  transform-origin: 50% 50%;
  animation: karos-flip 16s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}

.hourglass-fill-top,
.hourglass-fill-bottom {
  fill: #7fb0ff;
  opacity: 0.8;
}

.hourglass-fill-top {
  transform-box: fill-box;
  animation: karos-fill-top 16s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}

.hourglass-fill-bottom {
  transform-box: fill-box;
  animation: karos-fill-bottom 16s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}

.hourglass-sand {
  fill: #a8cbff;
  animation: karos-sand 1.3s linear infinite;
}

/* струйка не переворачивается вместе с колбой — песок всегда сыплется вниз */
.hourglass-stream {
  transform-box: view-box;
  transform-origin: 50% 50%;
  animation: karos-counterflip 16s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}

.clock-readout {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.clock-time-row {
  display: flex;
  align-items: center;
  gap: 5px;
}

/* часы и минуты — отдельные приподнятые плитки, цифры залиты переливающимся градиентом */
.clock-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 36px;
  border-radius: 10px;
  background: var(--btn-surface);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  font-size: 1.45rem;
  font-weight: 700;
  background-image: linear-gradient(100deg, #a8cbff, #6fd3ff, #b79bff, #a8cbff);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: karos-shimmer 14s ease-in-out infinite;
}

.clock-seconds {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 36px;
  border-radius: 10px;
  background: rgba(29, 32, 41, 0.5);
  font-size: 0.95rem;
  font-weight: 600;
  color: #7f93b5;
}

.clock-msk {
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6b7280;
}

.clock-msk[hidden] {
  display: none;
}

.admin-link {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 16px;
  border-radius: var(--btn-radius);
  background: var(--btn-surface);
  color: var(--accent-soft);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.45);
  transition: background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.admin-link:hover {
  background: var(--btn-surface-hover);
  color: var(--accent-text);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.55);
}

.logout-btn {
  flex: none;
  width: auto;
  padding: 0 14px;
  background: transparent;
  border: 1px solid transparent;
  color: #6b7280;
  font-weight: 500;
  box-shadow: none;
}

.logout-btn:hover {
  background: var(--btn-surface);
  color: var(--text);
  box-shadow: none;
}

.profile-btn {
  flex: none;
  width: auto;
  padding: 0 16px;
  background: var(--btn-surface);
  border: 1px solid var(--border);
  color: var(--accent-soft);
  font-weight: 500;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.45);
}

.profile-btn:hover {
  background: var(--btn-surface-hover);
  color: var(--accent-text);
}

/* Auth pages */

.auth-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  min-height: 100vh;
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.01em;
}

.auth-form {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
  width: 320px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-form h1 {
  font-size: 1.2rem;
  margin: 0 0 4px;
}

.auth-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--muted);
}

.auth-form input {
  background: #14161c;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  color: var(--text);
  font-size: 0.9rem;
}

.error-msg {
  color: var(--danger);
  font-size: 0.85rem;
  margin: 0;
}

.success-msg {
  color: var(--ready);
  font-size: 0.85rem;
  margin: 0;
}

.switch-link {
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
  margin: 0;
}

.switch-link a {
  color: var(--wait);
}

/* Admin */

.admin-main {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--btn-radius-lg);
  padding: 18px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.panel h2 {
  margin: 0 0 14px;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #f2eeff;
  border-left: 3px solid var(--accent);
  padding-left: 11px;
}

/* заголовок-переключатель сворачивания не должен добавлять нижний отступ до раскрытия */
.panel h2.panel-header {
  margin-bottom: 0;
}

.panel h2.panel-header + div {
  margin-top: 14px;
}

.inline-form {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 16px;
}

.inline-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--muted);
}

.inline-form label[hidden] {
  display: none;
}



.inline-form input,
.inline-form select {
  background: #14161c;
  border: 1px solid var(--border);
  border-radius: var(--btn-radius-sm);
  height: 34px;
  padding: 0 12px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.85rem;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4);
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
  width: 100px;
}

.inline-form select {
  width: auto;
  min-width: 180px;
  cursor: pointer;
}

.inline-form input:focus,
.inline-form select:focus,
.promote-controls input:focus,
.boss-form input:focus,
.boss-form select:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4), 0 0 0 3px rgba(155, 124, 240, 0.18);
}

.inline-form input[type="checkbox"],
.manage-location-title input[type="checkbox"] {
  accent-color: var(--accent);
  height: auto;
  box-shadow: none;
}

.inline-form button {
  flex: none;
  width: auto;
  height: 34px;
  padding: 0 16px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

th, td {
  text-align: left;
  padding: 9px 10px;
  border-bottom: 1px solid var(--border);
}

th {
  color: var(--muted);
  font-weight: 500;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.03em;
}

.panel tbody tr {
  transition: background 0.14s ease;
}

.panel tbody tr:hover {
  background: rgba(155, 124, 240, 0.07);
}

.promote-controls {
  display: flex;
  gap: 6px;
}

.promote-controls input {
  background: #14161c;
  border: 1px solid var(--border);
  border-radius: var(--btn-radius-sm);
  height: 34px;
  padding: 0 12px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.85rem;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4);
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
  height: 30px;
  width: 140px;
  font-size: 0.8rem;
}

.promote-controls button {
  width: auto;
  height: 30px;
  padding: 0 12px;
  font-size: 0.8rem;
}

.user-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.user-actions button {
  width: auto;
  height: 30px;
  padding: 0 12px;
  font-size: 0.8rem;
}

.request-card {
  background: var(--btn-surface);
  border: 1px solid var(--border);
  border-radius: var(--btn-radius);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  padding: 14px;
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.request-nickname {
  color: #57d98a;
  font-weight: 600;
  font-size: 0.9rem;
}

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

.request-actions button {
  width: auto;
  height: 30px;
  padding: 0 14px;
}

.muted {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.55;
}

.manage-location {
  background: var(--btn-surface);
  border: 1px solid var(--border);
  border-radius: var(--btn-radius);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  padding: 14px;
  margin-bottom: 10px;
}

.manage-location h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #f2eeff;
}

.manage-location-title {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.manage-location-title input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.manage-location-title .expand-arrow {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.75rem;
}

.panel-header {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.panel-header .expand-arrow {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.75rem;
}

.manage-location .boss-form {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.boss-form {
  flex-wrap: wrap;
  margin-bottom: 0;
}

.boss-form input,
.boss-form select {
  background: #14161c;
  border: 1px solid var(--border);
  border-radius: var(--btn-radius-sm);
  height: 34px;
  padding: 0 12px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.85rem;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4);
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

main {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.location-tabs {
  display: flex;
  gap: 6px;
  padding: 12px 24px;
  flex-wrap: nowrap;
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
  background: rgba(20, 22, 28, 0.35);
}

.location-tab {
  background: transparent;
  border: none;
  border-radius: var(--btn-radius);
  color: var(--muted);
  font-weight: 500;
  height: 36px;
  padding: 0 18px;
  cursor: grab;
  font-size: 0.9rem;
  width: auto;
  flex: none;
  box-shadow: none;
  touch-action: none;
  user-select: none;
  transition: color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease, opacity 0.15s ease;
}

.location-tab:hover {
  background: var(--btn-surface);
  color: var(--text);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

.location-tab.active {
  color: #d9ccff;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: linear-gradient(180deg, #2a2540, #221e35);
  box-shadow: 0 5px 16px rgba(155, 124, 240, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.07), inset 0 -2px 0 0 var(--accent);
}

.location-tab.dragging {
  opacity: 0.9;
  cursor: grabbing;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
  z-index: 10;
  position: relative;
  transition: box-shadow 0.15s ease, opacity 0.15s ease; /* без transform — следует за курсором мгновенно */
}

.location-tabs.drag-active .location-tab:not(.dragging) {
  opacity: 0.7;
}

.boss-panels {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: start;
}

@media (min-width: 1620px) {
  .boss-panels {
    grid-template-columns: repeat(2, 1fr);
  }
}

.boss-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--btn-radius-lg);
  padding: 16px;
  overflow-x: auto;
  min-width: 0;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.boss-panel-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 10px;
}

.boss-panel-heading {
  border-left: 3px solid var(--accent);
  padding-left: 11px;
}

.boss-panel-title {
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #f2eeff;
  text-shadow: 0 0 18px rgba(155, 124, 240, 0.28);
}

.boss-panel-subtitle {
  font-size: 0.75rem;
  color: var(--muted);
}

.boss-panel-actions {
  margin-left: auto;
  display: flex;
  gap: 6px;
}

.boss-panel-actions .icon-btn {
  width: 26px;
  height: 26px;
  border-radius: var(--btn-radius-sm);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.boss-panel-actions .icon-btn svg {
  width: 13px;
  height: 13px;
}

.channel-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-size: 0.85rem;
  table-layout: fixed;
}

/* фиксированные пропорции колонок — одинаковые у всех боссов, иначе каждая
   таблица подстраивает ширину под своё содержимое и колонки съезжают между карточками */
.channel-table th:nth-child(1),
.channel-table td:nth-child(1) {
  width: 8%;
}

.channel-table th:nth-child(2),
.channel-table td:nth-child(2) {
  width: 17%;
}

.channel-table th:nth-child(3),
.channel-table td:nth-child(3) {
  width: 13%;
}

.channel-table th:nth-child(4),
.channel-table td:nth-child(4) {
  width: 16%;
}

.channel-table th:nth-child(5),
.channel-table td:nth-child(5) {
  width: 14%;
}

.channel-table th:nth-child(6),
.channel-table td:nth-child(6) {
  width: 13%;
}

.channel-table th:nth-child(7),
.channel-table td:nth-child(7) {
  width: 19%;
}

.channel-table th {
  color: var(--muted);
  font-weight: 500;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.03em;
  text-align: left;
  padding: 6px 10px;
  border-bottom: 1px solid var(--border);
}

.channel-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.channel-row {
  transition: background 0.14s ease;
}

.channel-row:hover {
  background: rgba(155, 124, 240, 0.07);
}

.channel-row:last-child td {
  border-bottom: none;
}

.channel-row-missing td {
  color: var(--muted);
  font-style: italic;
}

.timer-cell {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.range-cell {
  color: #d3d8e2;
  font-weight: 600;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

.kill-time-cell {
  color: #a6acb9;
  font-weight: 500;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

.killed-by-cell {
  color: var(--accent-soft);
  font-weight: 500;
}

@keyframes pulse-bubble {
  0% {
    transform: scale(1);
  }
  35% {
    transform: scale(1.3);
    color: var(--ready);
    text-shadow: 0 0 10px rgba(46, 204, 113, 0.7);
  }
  100% {
    transform: scale(1);
  }
}

.killed-by-cell span.pulse {
  display: inline-block;
  animation: pulse-bubble 0.7s ease-out;
}

#site-title.pulse {
  animation: pulse-bubble 0.7s ease-out;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: var(--btn-radius-sm);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.badge-wait {
  background: color-mix(in srgb, var(--ready) 18%, transparent);
  color: var(--ready);
}

.badge-window {
  background: color-mix(in srgb, var(--window) 20%, transparent);
  color: var(--window);
}

.badge-ready {
  background: color-mix(in srgb, var(--ready) 16%, transparent);
  color: #57d98a;
}

.badge-missed {
  background: color-mix(in srgb, var(--danger) 20%, transparent);
  color: var(--danger);
}

.channel-row.state-window .timer-cell {
  color: var(--window);
}

.channel-row.state-ready .timer-cell {
  color: var(--ready);
}

.channel-row.state-missed .timer-cell {
  color: var(--danger);
}

.row-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
}

.icon-btn {
  flex: none;
  width: 34px;
  height: 34px;
  padding: 0;
  border: none;
  border-radius: var(--btn-radius);
  background: var(--btn-tile);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.icon-btn svg {
  width: 15px;
  height: 15px;
  display: block;
}

.icon-btn:hover {
  background: var(--btn-tile-hover);
  color: var(--accent-text);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.icon-btn:active {
  transform: translateY(1px);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
}

.icon-btn.danger-icon:hover {
  background: #2e252a;
  color: #d99287;
}

.kill-btn {
  flex: none;
  width: auto;
  height: 34px;
  padding: 0 18px;
  border: none;
  border-radius: var(--btn-radius);
  background: var(--btn-kill);
  color: var(--btn-kill-text);
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(194, 80, 63, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.kill-btn:hover {
  background: var(--btn-kill-hover);
  box-shadow: 0 6px 20px rgba(194, 80, 63, 0.46), inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.kill-btn:active {
  transform: translateY(2px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.modal-overlay[hidden] {
  display: none;
}

.modal {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  width: 300px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal h3 {
  margin: 0;
  font-size: 1rem;
}

.modal-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 4px 0;
  width: 100%;
}

.modal label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--muted);
}

.profile-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.8rem;
  color: var(--muted);
}

.profile-info strong {
  color: var(--text);
}

.modal input {
  background: #14161c;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  color: var(--text);
  font-size: 0.9rem;
}

.modal-actions {
  display: flex;
  gap: 8px;
}

button {
  flex: 1;
  border: none;
  border-radius: var(--btn-radius);
  height: 34px;
  padding: 0 18px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  background: var(--btn-primary);
  color: var(--btn-primary-text);
  box-shadow: 0 4px 14px rgba(74, 118, 184, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.13);
  transition: background 0.16s ease, box-shadow 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

button:focus-visible {
  outline: 2px solid #7fa6d8;
  outline-offset: 2px;
}

button:disabled {
  opacity: 0.45;
  cursor: default;
  box-shadow: none;
}

button.reset {
  font-weight: 500;
  background: var(--btn-surface);
  border: 1px solid var(--border);
  color: var(--muted);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

button.reset:hover {
  background: var(--btn-surface-hover);
  color: var(--text);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.5);
}

button.danger {
  font-weight: 500;
  background: var(--btn-surface);
  border: 1px solid var(--border);
  color: #e07a6e;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4), inset 0 -2px 0 0 rgba(231, 76, 60, 0.5);
}

button.danger:hover {
  background: #26202b;
  color: #f08b7e;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5), inset 0 -2px 0 0 var(--danger);
}

button:hover {
  background: var(--btn-primary-hover);
  box-shadow: 0 6px 18px rgba(74, 118, 184, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.17);
}

button:active {
  background: var(--btn-primary-active);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  transform: translateY(2px);
}

.icon-btn:hover,
.kill-btn:hover,
button.reset:hover,
button.danger:hover,
.menu-item:hover,
.user-menu-trigger:hover,
.location-tab:hover {
  filter: none;
}
.member-activity {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  white-space: nowrap;
  font-size: 0.85rem;
}
.member-activity::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: currentColor;
}
.member-activity-online { color: #64d98b; }
.member-activity-afk { color: #f0c36b; }
.member-activity-unknown { color: #a0a6b4; }

.invite-request-toolbar, .invite-request-pagination, .invite-request-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.invite-request-toolbar label { display: flex; gap: 10px; align-items: center; }
.invite-request-card { padding: 20px; margin: 14px 0; border: 1px solid var(--border); border-radius: 12px; background: #171a22; }
.invite-request-card-heading { display: flex; justify-content: space-between; gap: 15px; }
.invite-request-card p { font-size: 14px; line-height: 1.6; }
.invite-request-contact, .invite-request-message { white-space: pre-wrap; overflow-wrap: anywhere; }
.invite-request-pagination { margin-top: 20px; }

/* Invitation inbox */
.invite-inbox-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.invite-inbox-heading h2 { margin-bottom: 0; }
.invite-inbox-eyebrow { margin: 0 0 9px; color: #a991d8; font-size: 10px; letter-spacing: 1.5px; }
.invite-inbox-tabs { display: flex; gap: 8px; flex-wrap: wrap; border-bottom: 1px solid var(--border); padding: 6px 0 16px; margin-top: 22px; }
.invite-inbox-tabs button { display: inline-flex; align-items: center; gap: 10px; background: transparent; border: 1px solid transparent; color: #a7adbd; box-shadow: none; }
.invite-inbox-tabs button[aria-selected="true"] { background: #a98be51c; border-color: #a98be54a; color: #dccdff; }
.invite-inbox-tabs button span { padding: 1px 7px; border-radius: 6px; background: #ffffff0b; font-size: 11px; }
.invite-inbox-empty { text-align: center; padding: 45px 16px; color: var(--muted); border: 1px dashed var(--border); border-radius: 12px; }
.inbox-card { padding: 24px; background: #191c25; max-width: 960px; }
.inbox-card-header, .inbox-identity, .inbox-contact-row, .inbox-code-row { display: flex; align-items: center; gap: 14px; }
.inbox-card-header, .inbox-contact-row, .inbox-code-row { justify-content: space-between; }
.inbox-identity { min-width: 0; }
.inbox-avatar { display: grid; place-items: center; flex: 0 0 42px; height: 42px; background: #a387d51c; color: #c3a8f2; border: 1px solid #a387d533; border-radius: 12px; font-size: 19px; }
.inbox-name { font-size: 18px; margin: 0 0 5px; overflow-wrap: anywhere; }
.inbox-time { font-size: 11px; }
.inbox-status { white-space: nowrap; font-size: 11px; padding: 5px 9px; border-radius: 6px; color: #a9b0bf; background: #ffffff07; border: 1px solid #ffffff15; }
.inbox-status-pending { color: #bc9eff; background: #a480ff10; border-color: #a480ff35; }
.inbox-status-contacted { color: #edc781; background: #edc7810b; border-color: #edc78130; }
.inbox-status-sent { color: #79d4a4; background: #79d4a40b; border-color: #79d4a430; }
.inbox-status-rejected { color: #e79797; background: #e797970a; border-color: #e797972b; }
.inbox-contact-row { padding: 19px 0; margin-top: 18px; border-top: 1px solid var(--border); }
.inbox-contact-row > div { min-width: 0; }
.inbox-field-label { font-size: 10px; color: #929aaf; letter-spacing: 1px; }
.inbox-contact-row p { margin: 6px 0 0; color: #dce0ed; }
.inbox-message { padding: 16px; background: #10131b; border-radius: 8px; color: #b1b8ca; margin: 0 0 18px; }
.inbox-card .inbox-small-button { font-size: 11px; padding: 8px 11px; white-space: nowrap; }
.inbox-note { margin: 16px 0; }
.inbox-note summary { color: #929bb1; font-size: 12px; cursor: pointer; }
.inbox-note textarea, .inbox-reply { display: block; width: 100%; resize: vertical; padding: 12px; margin: 12px 0 10px; background: #10131b; color: #c4cada; border: 1px solid var(--border); border-radius: 8px; font: inherit; font-size: 13px; line-height: 1.6; }
.inbox-note textarea:focus, .inbox-reply:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.inbox-issue-row { display: flex; align-items: end; gap: 12px; padding: 18px 0 0; flex-wrap: wrap; }
.inbox-issue-row label { display: grid; gap: 8px; font-size: 11px; color: #a3aabd; }
.inbox-issue-row select { min-width: 200px; max-width: 100%; padding: 10px 12px; background: #10131b; border: 1px solid var(--border); border-radius: 8px; color: var(--text); font: inherit; font-size: 13px; }
.inbox-primary { background: #b69bea; color: #17121f; border: 1px solid #c1aaf1; }
.inbox-primary:hover { background: #c4aff0; }
.inbox-reject { background: transparent; color: #d88f8f; border: 1px solid #b970703d; box-shadow: none; }
.inbox-card-actions { padding-top: 20px; margin-top: 20px; border-top: 1px solid var(--border); }
.inbox-code-panel { padding: 18px; border: 1px solid #a480ff29; border-radius: 10px; background: #a480ff06; margin-top: 20px; }
.inbox-code-row { margin: 12px 0; flex-wrap: wrap; }
.inbox-code { font-family: ui-monospace, monospace; font-size: 18px; letter-spacing: 2px; color: #d7c5ff; overflow-wrap: anywhere; }
.inbox-copy-hint { font-size: 11px !important; margin-bottom: 0; }
.inbox-copy-buffer { position: fixed; opacity: 0; left: 0; top: 0; width: 1px; height: 1px; }
@media (max-width: 600px) {
  .inbox-card { padding: 16px; }
  .inbox-contact-row { align-items: start; flex-direction: column; }
  .inbox-card-header { align-items: start; }
  .inbox-status { font-size: 10px; }
  .inbox-issue-row label, .inbox-issue-row select, .inbox-issue-row > button { width: 100%; min-width: 0; }
  .invite-inbox-tabs { gap: 3px; }
  .invite-inbox-tabs button { padding: 9px; font-size: 12px; }
}
.invite-inbox-heading > button,
.inbox-contact-row > button,
.inbox-code-row > button,
.inbox-note > button,
.inbox-card-actions > button,
.invite-request-pagination > button { flex: 0 0 auto; width: auto; white-space: nowrap; }
.inbox-card { max-width: none; }
.invite-request-pagination { justify-content: space-between; }
.inbox-issue-row input { min-width: 240px; max-width: 100%; padding: 10px 12px; background: #10131b; border: 1px solid var(--border); border-radius: 8px; color: var(--text); font: inherit; font-size: 13px; }
@media (max-width: 600px) { .inbox-issue-row input { width: 100%; min-width: 0; } .inline-form { flex-wrap: wrap; } }

.registration-fields { border: 0; padding: 0; margin: 0; min-width: 0; display: grid; gap: 14px; }
.registration-fields[hidden] { display: none; }
#registration-contact[hidden] { display: none; }

.invite-inbox-view { display: flex; gap: 8px; margin: 16px 0; }
.invite-inbox-view button { width: auto; }
.invite-inbox-view button[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.inbox-list-row { border: 1px solid var(--border); border-radius: 10px; margin: 10px 0; overflow: hidden; }
.inbox-list-summary { display: grid; grid-template-columns: 1fr 1.2fr 1fr auto auto auto; gap: 14px; align-items: center; padding: 16px; cursor: pointer; font-size: 13px; }
.inbox-list-summary > * { min-width: 0; overflow-wrap: anywhere; }
.inbox-list-summary::-webkit-details-marker { display: none; }
.inbox-list-summary:hover, .inbox-list-row[open] > summary { background: #ffffff05; }
.inbox-list-contact, .inbox-list-guild { color: var(--muted); }
.inbox-list-date, .inbox-list-expand { font-size: 11px; }
.inbox-list-row > .inbox-card { margin: 0; border: 0; border-top: 1px solid var(--border); border-radius: 0; }
@media (max-width: 850px) { .inbox-list-summary { grid-template-columns: 1fr 1fr auto; } }
@media (max-width: 480px) { .inbox-list-summary { grid-template-columns: 1fr 1fr; gap: 10px; padding: 12px; } }

.invite-table-scroll { max-width: 100%; overflow-x: auto; }

.guild-directory-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--border); padding: 16px 0; }
.guild-directory-row > div { min-width: 0; overflow-wrap: anywhere; }
.guild-directory-row p { margin: 6px 0 0; font-size: 12px; }
.guild-directory-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.guild-directory-actions button { width: auto; }
#guild-directory { margin-bottom: 20px; }
#users-list, #guild-members-list { max-width: 100%; overflow-x: auto; }
#users-list td, #guild-members-list td { vertical-align: middle; }
@media (max-width: 600px) { .guild-directory-row { align-items: stretch; flex-direction: column; } }

.guild-directory-actions { flex: 0 0 auto; justify-content: flex-end; }
.guild-directory-actions button { flex: 0 0 auto; height: auto; min-height: 38px; padding: 10px 16px; line-height: 1.35; white-space: nowrap; }
#owner-back-link[hidden] { display: none; }
#admin-title { overflow-wrap: anywhere; min-width: 0; }
@media (max-width: 600px) { .guild-directory-actions { justify-content: flex-start; } .guild-directory-actions button { max-width: 100%; white-space: normal; } }
