:root {
  --bg-obsidian: #06070b;
  --bg-panel: rgba(13, 16, 26, 0.84);
  --bg-panel-solid: #0d101a;
  --bg-card: rgba(20, 25, 40, 0.72);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --neon-gold: #f5c542;
  --neon-gold-glow: rgba(245, 197, 66, 0.35);
  --neon-cyan: #00f0ff;
  --neon-cyan-glow: rgba(0, 240, 255, 0.3);
  --neon-crimson: #ff2a6d;
  --neon-crimson-glow: rgba(255, 42, 109, 0.35);
  --text-main: #eef2ff;
  --text-muted: #8b9bb4;
  --radius: 14px;
}

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

input, textarea, select, .selectable {
  user-select: text;
}

body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-obsidian);
  background-image:
    radial-gradient(circle at 15% 15%, rgba(0, 240, 255, 0.12), transparent 32%),
    radial-gradient(circle at 85% 80%, rgba(245, 197, 66, 0.11), transparent 38%),
    radial-gradient(circle at 65% 18%, rgba(255, 42, 109, 0.07), transparent 28%),
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 100% 100%, 40px 40px, 40px 40px;
  background-attachment: fixed;
  animation: ambientShift 14s ease-in-out infinite alternate;
  color: var(--text-main);
  min-height: 100vh;
  overflow: hidden;
}

@keyframes ambientShift {
  0% { background-position: 0 0, 0 0, 0 0, 0 0, 0 0; }
  100% { background-position: 18px 8px, -14px 18px, 10px -12px, 0 0, 0 0; }
}

.boot-loader {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background:
    radial-gradient(circle at center, rgba(245, 197, 66, 0.09), transparent 22%),
    linear-gradient(145deg, #070910, #030409);
  transition: opacity .45s ease, visibility .45s ease;
}
.boot-loader.done { opacity: 0; visibility: hidden; }
.boot-orbit {
  position: relative;
  width: 112px;
  height: 112px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(245, 197, 66, 0.25);
  border-radius: 50%;
  box-shadow: 0 0 35px rgba(245, 197, 66, 0.12);
  animation: bootPulse 1.8s ease-in-out infinite;
}
.boot-orbit img { width: 64px; filter: drop-shadow(0 0 14px var(--neon-gold-glow)); }
.boot-orbit span {
  position: absolute;
  inset: -7px;
  border: 2px solid transparent;
  border-top-color: var(--neon-gold);
  border-right-color: rgba(0, 240, 255, 0.7);
  border-radius: 50%;
  animation: bootSpin 1.1s linear infinite;
}
.boot-title { color: var(--neon-gold); font-weight: 800; letter-spacing: 4px; }
.boot-status { width: 180px; height: 3px; overflow: hidden; background: rgba(255,255,255,.08); border-radius: 999px; }
.boot-status span { display:block; width:45%; height:100%; background:linear-gradient(90deg,var(--neon-cyan),var(--neon-gold)); animation: bootLoad 1.1s ease-in-out infinite; }
.boot-message { min-height: 1.2em; color: var(--text-muted); font-size: .78rem; letter-spacing: .5px; text-align: center; }
@keyframes bootSpin { to { transform: rotate(360deg); } }
@keyframes bootPulse { 50% { box-shadow: 0 0 52px rgba(245,197,66,.22); transform: scale(1.025); } }
@keyframes bootLoad { from { transform: translateX(-110%); } to { transform: translateX(330%); } }

.hidden { display: none !important; }
.app-shell.entering { animation: appReveal .55s ease both; }
@keyframes appReveal {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* Login View */
.login-screen {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 50%, rgba(0, 240, 255, 0.08), transparent 24%),
    radial-gradient(circle at 50% 100%, rgba(245, 197, 66, 0.09), transparent 30%),
    linear-gradient(135deg, #050713 0%, #090b16 48%, #05060a 100%);
}

.login-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 240, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 240, 255, 0.035) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: radial-gradient(circle at center, #000 12%, transparent 72%);
  pointer-events: none;
}

.continental-gate {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  perspective: 1200px;
}

.gate-panel {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50.2%;
  border-top: 1px solid rgba(245, 197, 66, 0.2);
  border-bottom: 1px solid rgba(245, 197, 66, 0.16);
  background:
    linear-gradient(90deg, transparent 96%, rgba(245, 197, 66, 0.12) 96%, transparent 100%),
    repeating-linear-gradient(90deg, rgba(255,255,255,.018) 0 1px, transparent 1px 38px),
    linear-gradient(145deg, rgba(12, 16, 29, .96), rgba(3, 5, 10, .98));
  box-shadow: 0 0 80px rgba(0, 0, 0, .82);
  transition: transform 1.15s cubic-bezier(.68, 0, .22, 1);
}

.gate-left {
  left: 0;
  border-right: 2px solid rgba(245, 197, 66, 0.38);
  transform-origin: left center;
}

.gate-right {
  right: 0;
  border-left: 2px solid rgba(245, 197, 66, 0.38);
  transform-origin: right center;
}

.gate-panel span {
  position: absolute;
  bottom: 24px;
  color: rgba(245, 197, 66, .38);
  font-size: .58rem;
  letter-spacing: 5px;
}
.gate-left span { right: 24px; }
.gate-right span { left: 24px; }

.gate-seal {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 50%;
  width: 82px;
  height: 82px;
  display: grid;
  place-items: center;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(245, 197, 66, .45);
  border-radius: 50%;
  background: rgba(6, 8, 15, .92);
  box-shadow: 0 0 35px rgba(245, 197, 66, .16);
  transition: opacity .4s ease, transform .7s ease;
}
.gate-seal img { width: 48px; filter: drop-shadow(0 0 12px rgba(245,197,66,.42)); }

.login-screen.unlocked .gate-left { transform: translateX(-102%) rotateY(-12deg); }
.login-screen.unlocked .gate-right { transform: translateX(102%) rotateY(12deg); }
.login-screen.unlocked .gate-seal { opacity: 0; transform: translate(-50%, -50%) scale(.25) rotate(180deg); }
.login-screen.unlocked .login-card { animation: loginSettle .8s .28s both; }

@keyframes loginSettle {
  from { opacity: 0; transform: scale(.94) translateY(12px); filter: blur(5px); }
  to { opacity: 1; transform: none; filter: none; }
}

@media (prefers-reduced-motion: reduce) {
  .boot-orbit, .boot-orbit span, .boot-status span { animation-duration: 2.5s; }
  .gate-panel, .gate-seal { transition-duration: .01ms; }
  .login-screen.unlocked .login-card, .app-shell.entering { animation-duration: .01ms; }
}

.login-card {
  position: relative;
  z-index: 3;
  width: 100%;
  max-width: 440px;
  background: var(--bg-panel);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(245, 197, 66, 0.3);
  border-radius: 20px;
  padding: 40px 32px;
  text-align: center;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.8), 0 0 30px rgba(245, 197, 66, 0.12);
}

.crest-logo {
  width: 72px;
  height: 72px;
  margin: 0 auto 18px;
  display: block;
  filter: drop-shadow(0 0 12px var(--neon-gold-glow));
}

.login-card h1 {
  font-size: 1.55rem;
  letter-spacing: 3px;
  color: var(--neon-gold);
  text-shadow: 0 0 16px var(--neon-gold-glow);
  margin-bottom: 8px;
}

.login-sub {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 28px;
  line-height: 1.5;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-discord {
  width: 100%;
  background: linear-gradient(135deg, #5865F2, #4752C4);
  color: #fff;
  box-shadow: 0 0 20px rgba(88, 101, 242, 0.4);
}
.btn-discord:hover { transform: translateY(-1px); box-shadow: 0 0 28px rgba(88, 101, 242, 0.65); }

.btn-gold {
  background: linear-gradient(135deg, #f5c542, #c99415);
  color: #08090d;
  box-shadow: 0 0 16px var(--neon-gold-glow);
}
.btn-gold:hover { filter: brightness(1.1); }

.btn-cyan {
  background: rgba(0, 240, 255, 0.12);
  color: var(--neon-cyan);
  border-color: rgba(0, 240, 255, 0.4);
}
.btn-cyan:hover { background: rgba(0, 240, 255, 0.22); box-shadow: 0 0 14px var(--neon-cyan-glow); }

.btn-crimson {
  background: rgba(255, 42, 109, 0.14);
  color: var(--neon-crimson);
  border-color: rgba(255, 42, 109, 0.45);
}
.btn-crimson:hover { background: rgba(255, 42, 109, 0.26); box-shadow: 0 0 14px var(--neon-crimson-glow); }

.btn-ghost {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  border-color: var(--border-subtle);
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.1); }

/* Main App Layout */
.app-shell {
  display: grid;
  grid-template-columns: 270px 1fr 270px;
  height: 100vh;
}

.sidebar, .rightbar {
  background: var(--bg-panel);
  backdrop-filter: blur(16px);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.rightbar {
  border-right: none;
  border-left: 1px solid var(--border-subtle);
}

.brand-header {
  padding: 18px 16px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-header img { width: 34px; height: 34px; }
.brand-title { font-size: 0.95rem; font-weight: 700; letter-spacing: 1.5px; color: var(--neon-gold); }
.brand-ip { font-size: 0.72rem; color: var(--neon-cyan); font-family: monospace; }

.timer-box {
  margin: 12px 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 42, 109, 0.08);
  border: 1px solid rgba(255, 42, 109, 0.3);
  font-size: 0.76rem;
}
.timer-box span {
  display: block;
  font-family: monospace;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--neon-crimson);
  margin-top: 2px;
  text-shadow: 0 0 10px var(--neon-crimson-glow);
}

.nav-section {
  padding: 10px 12px;
  overflow-y: auto;
  flex: 1;
}

.nav-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: var(--text-muted);
  margin: 14px 8px 6px;
}

.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-main);
  font-size: 0.88rem;
  cursor: pointer;
  margin-bottom: 4px;
  text-align: left;
  transition: 0.15s;
}

.nav-item:hover { background: rgba(255, 255, 255, 0.05); }
.nav-item.active {
  background: rgba(0, 240, 255, 0.1);
  border-color: rgba(0, 240, 255, 0.35);
  color: var(--neon-cyan);
}

.user-footer {
  padding: 14px;
  border-top: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--neon-gold);
}

.coin-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--neon-gold);
  background: rgba(245, 197, 66, 0.12);
  border: 1px solid rgba(245, 197, 66, 0.35);
  padding: 2px 8px;
  border-radius: 999px;
}

.role-badge {
  font-size: 0.66rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

/* Main Content Area */
.main-area {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  background: rgba(6, 7, 11, 0.55);
}

.topbar {
  padding: 16px 22px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(13, 16, 26, 0.65);
  backdrop-filter: blur(12px);
}

.topbar h2 { font-size: 1.05rem; letter-spacing: 1px; }
.topbar p { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }
.top-status {
  color: var(--neon-cyan);
  border: 1px solid rgba(0, 240, 255, 0.25);
  background: rgba(0, 240, 255, 0.06);
  border-radius: 999px;
  padding: 7px 11px;
  font-size: 0.72rem;
  letter-spacing: .7px;
}

.world-clock {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  margin: 0 14px 10px;
  padding: 9px;
  border: 1px solid rgba(245, 197, 66, 0.18);
  border-radius: 10px;
  background: rgba(245, 197, 66, 0.04);
}
.world-clock div { min-width: 0; text-align: center; }
.world-clock span { display: block; color: var(--text-muted); font-size: .52rem; }
.world-clock strong { color: var(--neon-gold); font-family: monospace; font-size: .68rem; }
.world-clock .world-date { grid-column: 1 / -1; text-align: center; margin-top: 4px; color: var(--text-main); font-size: .62rem; }

.messages-wrap {
  flex: 1;
  overflow-y: auto;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.msg-card {
  display: flex;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
}

.msg-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.msg-author { font-weight: 600; font-size: 0.9rem; }
.msg-time { font-size: 0.72rem; color: var(--text-muted); }
.msg-text { font-size: 0.92rem; line-height: 1.45; color: #dce4f5; word-break: break-word; }

.chat-form {
  padding: 14px 20px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  gap: 10px;
  background: rgba(13, 16, 26, 0.85);
}

.attachment-btn { width: 42px; height: 42px; flex-shrink: 0; font-size: 1rem; }
.chat-form .input { flex: 1; }
.chat-form .btn:disabled { opacity: .65; cursor: wait; }
.message-image {
  display: block;
  max-width: 420px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
}
.message-image img { display: block; width: 100%; max-height: 320px; object-fit: cover; }
.message-file {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 520px;
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px solid rgba(0, 240, 255, 0.25);
  border-radius: 10px;
  background: rgba(0, 240, 255, 0.05);
  color: var(--text-main);
  text-decoration: none;
}
.message-file-icon { font-size: 1.15rem; }
.message-file strong, .message-file small { display: block; }
.message-file strong { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.message-file small { color: var(--text-muted); margin-top: 2px; }
.message-file-download { margin-left: auto; color: var(--neon-cyan); font-size: .78rem; }

.input {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 0.9rem;
  outline: none;
}
.input:focus { border-color: var(--neon-cyan); box-shadow: 0 0 12px var(--neon-cyan-glow); }

/* Rightbar Operatives List */
.operative-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 10px;
  border-radius: 10px;
  margin-bottom: 6px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid transparent;
}
.operative-row:hover { border-color: rgba(0, 240, 255, 0.25); }

.op-info { display: flex; align-items: center; gap: 9px; min-width: 0; }
.op-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.op-dot.online { background: #22c55e; box-shadow: 0 0 8px #22c55e; }
.op-dot.offline { background: #475569; }
.op-actions { display: flex; gap: 4px; }

.icon-btn {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
}
.icon-btn:hover { border-color: var(--neon-cyan); color: var(--neon-cyan); }

/* Subviews (Contracts, Vault, Admin) */
.panel-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 22px;
}

.rules-view {
  max-width: 1100px;
  width: 100%;
  align-self: center;
}

.rules-hero {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
  padding: 22px;
  border: 1px solid rgba(245, 197, 66, 0.34);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(245, 197, 66, 0.11), transparent 54%),
    rgba(13, 16, 26, 0.82);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.24);
}

.rules-seal {
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(245, 197, 66, 0.48);
  border-radius: 50%;
  font-size: 1.8rem;
  background: rgba(245, 197, 66, 0.07);
  box-shadow: 0 0 24px rgba(245, 197, 66, 0.12);
}

.rules-kicker {
  color: var(--neon-cyan);
  font-size: 0.64rem;
  letter-spacing: 1.8px;
  text-transform: uppercase;
}

.rules-hero h3 {
  margin: 5px 0 4px;
  color: var(--neon-gold);
  font-size: 1.28rem;
  letter-spacing: 0.7px;
}

.rules-hero p {
  max-width: 760px;
  color: #b7c1d6;
  font-size: 0.82rem;
  line-height: 1.55;
}

.rules-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.rule-card {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 14px;
  min-height: 118px;
  padding: 17px;
  border: 1px solid var(--border-subtle);
  border-radius: 13px;
  background: rgba(20, 25, 40, 0.72);
}

.rule-card:last-child {
  grid-column: 1 / -1;
}

.rule-number {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(0, 240, 255, 0.28);
  border-radius: 12px;
  color: var(--neon-cyan);
  font-family: monospace;
  font-size: 0.9rem;
  background: rgba(0, 240, 255, 0.05);
}

.rule-card h4 {
  margin: 2px 0 7px;
  color: var(--text-main);
  font-size: 0.92rem;
}

.rule-card p {
  color: #9ba8bf;
  font-size: 0.78rem;
  line-height: 1.55;
}

.excommunicado-card {
  margin-top: 12px;
  padding: 18px 20px 16px;
  border: 1px solid rgba(255, 42, 109, 0.38);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255, 42, 109, 0.09), rgba(13, 16, 26, 0.82));
}

.excommunicado-kicker {
  color: var(--neon-crimson);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.penalty-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.penalty-list div {
  display: grid;
  grid-template-columns: 34px 1fr;
  column-gap: 8px;
  align-items: center;
  min-height: 58px;
  padding: 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
}

.penalty-list span {
  grid-row: 1 / 3;
  color: var(--neon-crimson);
  font-family: monospace;
  font-size: 0.72rem;
}

.penalty-list strong { font-size: 0.78rem; }
.penalty-list small { color: var(--text-muted); font-size: 0.66rem; }

.excommunicado-card blockquote {
  margin-top: 14px;
  text-align: center;
  color: var(--neon-gold);
  font-family: Georgia, serif;
  font-size: 0.88rem;
  letter-spacing: 0.3px;
}

.profile-view {
  width: 100%;
  max-width: 820px;
  align-self: center;
}

.profile-card {
  overflow: hidden;
  border: 1px solid rgba(245, 197, 66, 0.28);
  border-radius: 18px;
  background: rgba(13, 16, 26, 0.88);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.34);
}

.profile-banner {
  height: 190px;
  background:
    linear-gradient(135deg, rgba(245, 197, 66, 0.15), transparent 48%),
    radial-gradient(circle at 75% 30%, rgba(0, 240, 255, 0.16), transparent 25%),
    linear-gradient(145deg, #151b2d, #080a10);
  background-size: cover;
  background-position: center;
  border-bottom: 1px solid var(--border-subtle);
}

.profile-main {
  position: relative;
  padding: 58px 26px 24px;
}

.profile-avatar-wrap {
  position: absolute;
  left: 24px;
  top: -52px;
  width: 104px;
  height: 104px;
  padding: 5px;
  border-radius: 50%;
  background: #0d101a;
  border: 1px solid var(--border-subtle);
}

.profile-avatar-wrap img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.profile-status-dot {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 18px;
  height: 18px;
  border: 4px solid #0d101a;
  border-radius: 50%;
  background: #22c55e;
}

.profile-status-dot.idle { background: #f5c542; }
.profile-status-dot.do-not-disturb { background: #ff2a6d; }
.profile-status-dot.offline { background: #64748b; }

.profile-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  min-height: 34px;
  margin-bottom: 12px;
}

.profile-name-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.profile-name-row h3 {
  font-size: 1.32rem;
  color: var(--text-main);
}

.profile-tag {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-family: monospace;
}

.profile-bio {
  margin: 18px 0;
  min-height: 48px;
  color: #cbd5e1;
  line-height: 1.6;
  white-space: pre-wrap;
}

.profile-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.profile-meta div {
  padding: 10px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
}

.profile-meta span {
  display: block;
  color: var(--text-muted);
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.profile-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.profile-link {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid rgba(0, 240, 255, 0.25);
  border-radius: 9px;
  color: var(--neon-cyan);
  background: rgba(0, 240, 255, 0.05);
  text-decoration: none;
  font-size: 0.78rem;
}

.profile-link-status {
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.profile-link-status.online {
  color: #73d98b;
  background: rgba(115, 217, 139, .12);
  border: 1px solid rgba(115, 217, 139, .32);
}
.profile-link-status.maintenance {
  color: #f5c542;
  background: rgba(245, 197, 66, .12);
  border: 1px solid rgba(245, 197, 66, .32);
}
.profile-link-status.offline {
  color: #ff6b92;
  background: rgba(255, 42, 109, .12);
  border: 1px solid rgba(255, 42, 109, .32);
}

.profile-link-edit-row {
  display: grid;
  grid-template-columns: minmax(120px, .8fr) minmax(180px, 1.4fr) minmax(110px, .7fr);
  gap: 9px;
}

.profile-editor {
  width: min(680px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  border: 1px solid rgba(245, 197, 66, 0.5);
  border-radius: 18px;
  padding: 24px;
  background: linear-gradient(145deg, #111522, #080a10);
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.82);
}

.profile-editor-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.profile-editor-header h2 {
  color: var(--neon-gold);
  font-size: 1.35rem;
}

.profile-editor-form {
  display: grid;
  gap: 12px;
}

.profile-preview-fields,
.profile-link-fields {
  display: grid;
  gap: 9px;
}

.profile-upload-grid,
.profile-field-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
}

.profile-upload {
  display: grid;
  gap: 7px;
  color: var(--text-muted);
  font-size: 0.72rem;
}

.profile-upload input { display: none; }
.profile-upload .btn { width: 100%; }
.profile-color {
  width: 100%;
  height: 42px;
  padding: 4px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
}
.profile-save { width: 100%; }

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 18px;
}

.card-gold { border-color: rgba(245, 197, 66, 0.35); }
.card-crimson { border-color: rgba(255, 42, 109, 0.4); }

.form-grid { display: grid; gap: 10px; margin-top: 12px; }

/* Call Overlay & Modal */
.call-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 6, 12, 0.92);
  backdrop-filter: blur(18px);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.video-stage {
  position: relative;
  width: 100%;
  max-width: 860px;
  aspect-ratio: 16 / 9;
  background: #0a0d16;
  border: 1px solid rgba(0, 240, 255, 0.4);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 0 40px rgba(0, 240, 255, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
}

#remoteVideo { width: 100%; height: 100%; object-fit: cover; }
#localVideo {
  position: absolute;
  bottom: 16px;
  right: 16px;
  width: 200px;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  border: 2px solid var(--neon-gold);
  object-fit: cover;
  background: #000;
}

.call-controls {
  margin-top: 20px;
  display: flex;
  gap: 12px;
}

.toast-box {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 12px 16px;
  border-radius: 10px;
  background: var(--bg-panel-solid);
  border: 1px solid var(--neon-cyan);
  color: var(--text-main);
  font-size: 0.85rem;
  box-shadow: 0 8px 24px rgba(0,0,0,0.6);
}
.toast.gold { border-color: var(--neon-gold); color: var(--neon-gold); }
.toast.error { border-color: var(--neon-crimson); color: var(--neon-crimson); }

@media (max-width: 980px) {
  .app-shell { grid-template-columns: 220px 1fr; }
  .rightbar { display: none; }
  .rules-grid { grid-template-columns: 1fr; }
  .rule-card:last-child { grid-column: auto; }
  .penalty-list { grid-template-columns: 1fr; }
}

.welcome-card {
  display: flex;
  align-items: center;
  gap: 14px;
  width: min(520px, 100%);
  margin: 8px auto;
  padding: 18px;
  border: 1px solid rgba(245, 197, 66, 0.38);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(245, 197, 66, 0.10), rgba(0, 240, 255, 0.04));
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.28);
}
.welcome-card .avatar { width: 54px; height: 54px; }
.welcome-card h3 { margin: 4px 0 6px; color: var(--neon-gold); }
.welcome-kicker { color: var(--neon-cyan); font-size: .62rem; letter-spacing: 1.4px; }

.vip-card {
  max-width: 520px;
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.vip-card p { color: var(--text-muted); font-size: .82rem; margin-top: 4px; }
.news-admin { margin-top: 16px; }

.coin-dashboard {
  display: grid;
  grid-template-columns: minmax(280px, 1.7fr) repeat(2, minmax(140px, .65fr));
  gap: 14px;
  margin-bottom: 14px;
}
.coin-balance-card,
.coin-stat,
.coin-history-card,
.service-card {
  border: 1px solid rgba(245, 197, 66, .22);
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(245, 197, 66, .08), rgba(13, 16, 26, .92));
}
.coin-balance-card {
  min-height: 150px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 20px;
}
.coin-mark {
  width: 78px;
  height: 78px;
  display: grid;
  place-items: center;
  border: 2px solid #f5c542;
  border-radius: 50%;
  color: #f5c542;
  background: radial-gradient(circle, rgba(245,197,66,.22), rgba(245,197,66,.03));
  box-shadow: 0 0 30px rgba(245,197,66,.16), inset 0 0 16px rgba(245,197,66,.12);
  font-family: Georgia, serif;
  font-size: 2.2rem;
  font-weight: 800;
}
.coin-kicker {
  color: var(--neon-cyan);
  font-size: .62rem;
  letter-spacing: 1.7px;
}
.coin-balance-card h3 { margin: 5px 0; }
.coin-balance-card strong { color: #f5c542; font-size: 2rem; }
.coin-stat {
  display: grid;
  align-content: center;
  padding: 18px;
  text-align: center;
}
.coin-stat span { color: var(--text-muted); font-size: .76rem; }
.coin-stat strong { margin-top: 8px; color: #dce4f5; font-size: 1.35rem; }
.coin-account-grid {
  display: grid;
  grid-template-columns: minmax(280px, .9fr) minmax(320px, 1.1fr);
  gap: 14px;
}
.coin-transfer-card,
.coin-history-card { padding: 18px; }
.coin-transfer-card p { color: var(--text-muted); font-size: .78rem; margin: 5px 0 12px; }
.coin-history { display: grid; gap: 8px; max-height: 260px; overflow-y: auto; margin-top: 12px; }
.coin-history-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 9px;
  background: rgba(255,255,255,.035);
}
.coin-history-row div { display: grid; }
.coin-history-row small { color: var(--text-muted); margin-top: 3px; }
.coin-history-row .incoming { color: #73d98b; }
.coin-history-row .outgoing { color: #ff6b92; }
.coin-history-empty { color: var(--text-muted); padding: 20px 4px; }
.service-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  margin: 24px 0 12px;
}
.service-heading h3 { margin-top: 5px; }
.service-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 12px;
}
.service-card {
  display: grid;
  grid-template-columns: 58px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 14px;
}
.service-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(0,240,255,.38);
  border-radius: 14px;
  color: var(--neon-cyan);
  background: rgba(0,240,255,.06);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .7px;
}
.service-content span { color: var(--neon-gold); font-size: .62rem; text-transform: uppercase; letter-spacing: 1px; }
.service-content h4 { margin: 3px 0; }
.service-content p { color: var(--text-muted); font-size: .72rem; }

.poster-overlay {
  position: fixed;
  inset: 0;
  z-index: 1500;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(3, 4, 9, 0.82);
  backdrop-filter: blur(14px);
}
.news-poster {
  position: relative;
  width: min(560px, 100%);
  overflow: hidden;
  border: 1px solid rgba(245, 197, 66, 0.58);
  border-radius: 18px;
  padding: 34px;
  text-align: center;
  background:
    linear-gradient(135deg, rgba(245, 197, 66, 0.12), transparent 45%),
    linear-gradient(145deg, #111522, #080a10);
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.8), 0 0 44px rgba(245, 197, 66, 0.14);
}
.poster-kicker { color: var(--neon-cyan); font-size: .68rem; letter-spacing: 2px; margin-bottom: 12px; }
.news-poster h2 { color: var(--neon-gold); font-size: 1.7rem; margin-bottom: 12px; }
.news-poster p { color: #dce4f5; line-height: 1.65; margin-bottom: 22px; }
.rules-poster ol { text-align: left; margin: 10px 0 22px 22px; color: #dce4f5; line-height: 1.8; }

.map-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
}
.map-toolbar h3 { color: var(--neon-gold); }
.map-toolbar p { color: var(--text-muted); font-size: .82rem; }
.rp-map {
  position: relative;
  min-height: 560px;
  overflow: hidden;
  border: 1px solid rgba(245, 197, 66, 0.28);
  border-radius: 18px;
  background:
    radial-gradient(ellipse at 74% 8%, rgba(73, 132, 151, .34), transparent 34%),
    linear-gradient(180deg, #10232c 0%, #14242b 42%, #101a21 100%);
}
.map-terrain {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, .34));
}
.map-land { fill: #293a32; }
.map-coastline { fill: none; stroke: #91a993; stroke-width: 3; opacity: .68; }
.map-river { fill: none; stroke: #386877; stroke-width: 28; opacity: .72; }
.map-contours { fill: none; stroke: #a7b394; stroke-width: 1.2; opacity: .12; }
.map-roads { fill: none; stroke: #d3c7a2; stroke-width: 11; opacity: .36; }
.map-streets { fill: none; stroke: #aeb39b; stroke-width: 3; opacity: .25; }
.map-node {
  position: absolute;
  z-index: 2;
  width: 148px;
  min-height: 58px;
  padding: 9px 11px;
  border: 1px solid rgba(205, 198, 164, .42);
  border-radius: 7px;
  background: rgba(13, 20, 19, .88);
  color: var(--text-main);
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(0,0,0,.4);
  text-align: left;
  transition: .18s ease;
}
.map-node:hover, .map-node.selected {
  transform: translateY(-3px);
  border-color: var(--neon-gold);
  box-shadow: 0 10px 28px rgba(245,197,66,.22);
}
.map-node span, .map-node small { display: block; }
.map-node span { color: #f0dfb0; font-weight: 700; font-size: .79rem; }
.map-node small { color: #a8b7a9; margin-top: 4px; font-size: .68rem; }
.north-haven { left: 8%; top: 16%; }
.silver-district { left: 39%; top: 13%; }
.east-pier { right: 7%; top: 26%; }
.old-town { left: 17%; bottom: 15%; }
.high-table { left: 44%; top: 43%; }
.south-gate { right: 14%; bottom: 11%; }
.base-marker {
  width: 12px;
  height: 12px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--neon-gold);
  box-shadow: 0 0 14px var(--neon-gold);
  z-index: 4;
}
.base-marker.north-haven { left: 13%; top: 24%; }
.base-marker.silver-district { left: 44%; top: 21%; }
.base-marker.east-pier { right: 12%; top: 34%; }
.base-marker.old-town { left: 22%; bottom: 23%; }
.base-marker.high-table { left: 49%; top: 51%; }
.base-marker.south-gate { right: 19%; bottom: 19%; }

.announcement-heading { margin: 4px 0 18px; }
.announcement-heading h3 { color: var(--neon-gold); font-size: 1.45rem; margin-bottom: 6px; }
.announcement-heading p { color: var(--text-muted); font-size: .88rem; }
.announcement-list { display: grid; gap: 14px; }
.announcement-card {
  padding: 22px;
  border: 1px solid rgba(245, 197, 66, .3);
  border-left: 3px solid var(--neon-gold);
  border-radius: 12px;
  background:
    linear-gradient(125deg, rgba(245, 197, 66, .08), transparent 48%),
    var(--bg-card);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .2);
}
.announcement-meta { color: var(--neon-cyan); font-size: .67rem; letter-spacing: 1.4px; margin-bottom: 10px; }
.announcement-meta span { color: var(--text-muted); letter-spacing: 0; }
.announcement-card h3 { color: var(--neon-gold); font-size: 1.3rem; margin-bottom: 10px; }
.announcement-card p { color: #dce4f5; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.announcement-empty {
  padding: 26px;
  border: 1px dashed rgba(139, 155, 180, .35);
  border-radius: 12px;
  color: var(--text-muted);
  text-align: center;
}
.map-node.selected::after {
  content: "STÜTZPUNKT";
  position: absolute;
  left: 50%;
  bottom: -15px;
  transform: translateX(-50%);
  color: var(--neon-gold);
  background: #080a10;
  border: 1px solid rgba(245,197,66,.45);
  border-radius: 999px;
  padding: 3px 7px;
  font-size: .52rem;
  white-space: nowrap;
}

@media (max-width: 640px) {
  html, body {
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
  }

  .login-screen {
    padding: 14px;
  }
  .login-card {
    max-height: calc(100dvh - 28px);
    overflow-y: auto;
    padding: 24px 18px;
  }
  .crest-logo { width: 58px; height: 58px; margin-bottom: 12px; }
  .gate-seal { width: 62px; height: 62px; }
  .gate-seal img { width: 38px; }

  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: 58px minmax(0, 1fr);
    height: 100dvh;
  }
  .sidebar {
    height: 58px;
    width: 100%;
    flex-direction: row;
    align-items: stretch;
    border-right: 0;
    border-bottom: 1px solid var(--border-subtle);
  }
  .sidebar .brand-header {
    width: 132px;
    flex: 0 0 132px;
    padding: 8px 10px;
  }
  .sidebar .brand-header img { width: 28px; height: 28px; }
  .brand-title { font-size: .68rem; letter-spacing: 1px; }
  .brand-ip { display: none; }
  .timer-box,
  .world-clock,
  .sidebar .user-footer,
  .nav-label { display: none; }
  .nav-section {
    display: flex;
    flex: 1;
    min-width: 0;
    padding: 6px;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    scrollbar-width: none;
  }
  .nav-section::-webkit-scrollbar { display: none; }
  #channelList {
    display: flex;
  }
  .nav-item {
    width: auto;
    flex: 0 0 auto;
    min-height: 44px;
    margin: 0 3px;
    padding: 8px 10px;
    font-size: .72rem;
  }

  .rightbar { display: none; }
  .main-area {
    height: 100%;
    min-height: 0;
  }
  .topbar {
    min-height: 52px;
    padding: 8px 12px;
  }
  .topbar h2 {
    max-width: 68vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: .9rem;
  }
  .topbar p {
    max-width: 68vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .top-status { display: none; }

  .messages-wrap {
    padding: 10px;
    overscroll-behavior: contain;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
  }
  .msg-card {
    padding: 9px;
    gap: 8px;
  }
  .chat-form {
    padding: 8px;
    gap: 6px;
  }
  .chat-form .input {
    min-height: 44px;
  }
  .chat-form .btn {
    min-width: 62px;
    min-height: 44px;
    padding: 8px 10px;
  }
  .attachment-btn {
    width: 44px;
    height: 44px;
  }

  .panel-scroll {
    padding: 12px;
  }
  .rules-hero {
    align-items: flex-start;
    padding: 14px;
  }
  .rules-seal {
    width: 48px;
    height: 48px;
    flex-basis: 48px;
  }
  .rules-grid,
  .penalty-list,
  .profile-meta,
  .profile-upload-grid,
  .profile-field-row,
  .profile-link-edit-row {
    grid-template-columns: 1fr;
  }
  .rule-card {
    grid-template-columns: 44px 1fr;
  }
  .rule-number { width: 44px; height: 44px; }

  .profile-banner { height: 130px; }
  .profile-main { padding: 54px 14px 18px; }
  .profile-avatar-wrap {
    left: 14px;
    width: 86px;
    height: 86px;
  }
  .profile-actions { min-height: 38px; }

  .profile-editor {
    width: 100%;
    max-height: calc(100dvh - 20px);
    padding: 14px;
  }
  .profile-editor-header h2 { font-size: 1.1rem; }

  .coin-dashboard,
  .coin-account-grid,
  .service-grid {
    grid-template-columns: 1fr;
  }
  .coin-balance-card { min-height: 120px; }
  .coin-mark { width: 64px; height: 64px; }
  .service-heading { align-items: flex-start; gap: 10px; }
  .service-card {
    grid-template-columns: 52px 1fr;
  }
  .service-card .btn { grid-column: 1 / -1; width: 100%; }

  .grid-2 { grid-template-columns: 1fr; }
  .poster-overlay {
    padding: 10px;
  }
  .news-poster {
    max-height: calc(100dvh - 20px);
    overflow-y: auto;
    padding: 22px 16px;
  }
  .toast-box {
    left: 10px;
    right: 10px;
    bottom: 10px;
  }
  .toast {
    width: 100%;
  }

  .map-toolbar {
    align-items: flex-start;
  }
  .map-toolbar .btn {
    min-height: 44px;
  }
}

@media (max-width: 700px) {
  .rp-map { min-height: 610px; }
  .map-node { width: 124px; }
  .north-haven { left: 4%; }
  .silver-district { left: 53%; }
  .east-pier { right: 3%; top: 37%; }
  .old-town { left: 7%; bottom: 10%; }
  .high-table { left: 36%; top: 46%; }
  .south-gate { right: 4%; bottom: 8%; }
  .world-clock { display: none; }
}
