:root {
  --navy: #060d18;
  --navy-2: #121c2e;
  --navy-3: #1b2a44;
  --gold: #f0c43a;
  --gold-2: #ffe48a;
  --gold-dim: #a88820;
  --ink: #f4f1ea;
  --muted: #8b97ab;
  --danger: #ff6b6b;
  --ok: #3ddc84;
  --line: rgba(240, 196, 58, 0.22);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
  --bubble-in: #1c2b45;
  --bubble-out: #f0c43a;
}

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

html, body, #app {
  height: 100%;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  background: #000;
  color: var(--ink);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}

.hidden { display: none !important; }

.view { height: 100%; max-height: 100dvh; overflow: hidden; }

/* LOGIN */
#view-login {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(ellipse at 50% -10%, #3a2a08 0%, #0a1220 42%, #02050a 100%);
}

.login-wrap {
  width: min(420px, 100%);
  text-align: center;
}

.login-seal {
  width: 168px;
  height: 168px;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid var(--gold);
  box-shadow: 0 0 40px rgba(212, 175, 55, 0.25);
  margin-bottom: 16px;
}

h1 {
  font-weight: 700;
  letter-spacing: 0.28em;
  font-size: 1.6rem;
  color: var(--gold);
}

.tagline { color: var(--gold-2); margin-top: 6px; font-size: 0.92rem; }
.sub { color: var(--muted); margin: 8px 0 22px; font-size: 0.85rem; }

#login-form { display: grid; gap: 12px; text-align: left; }
.check-row {
  display: flex !important;
  grid-template-columns: none;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink);
  font-size: 0.88rem;
  margin: 4px 0;
}
.check-row input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--gold);
}

label {
  display: grid;
  gap: 6px;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  text-transform: uppercase;
}

input, select, textarea {
  width: 100%;
  background: var(--navy-2);
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 1rem;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--gold);
}

.hint { margin-top: 16px; color: var(--muted); font-size: 0.78rem; line-height: 1.4; }

.btn {
  border: 0;
  border-radius: 10px;
  padding: 12px 16px;
  font-weight: 700;
  cursor: pointer;
  font-size: 0.95rem;
}

.btn.gold {
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  color: #1a1404;
}

.btn.gold:hover { filter: brightness(1.06); }

.btn.danger {
  background: #5a2020;
  color: #ffd0d0;
  border: 1px solid #8a3a3a;
}

/* APP LAYOUT */
#view-app {
  display: grid;
  grid-template-columns: 280px 1fr;
  grid-template-rows: 1fr;
  height: 100%;
  max-height: 100dvh;
  overflow: hidden;
  background: var(--navy);
}

.menu-toggle {
  display: none;
  position: fixed;
  top: max(10px, env(safe-area-inset-top, 0px));
  left: max(10px, env(safe-area-inset-left, 0px));
  z-index: 40;
  width: 52px;
  height: 52px;
  padding: 14px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--navy-2);
  color: var(--gold);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
  -webkit-tap-highlight-color: rgba(212,175,55,.25);
  touch-action: manipulation;
}
.menu-toggle span {
  display: block;
  width: 22px;
  height: 3px;
  background: var(--gold);
  border-radius: 2px;
}

.sidebar {
  background: #050b16;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.brand {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.brand img {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--gold);
}

.brand strong { display: block; color: var(--gold); letter-spacing: 0.12em; }
.brand span { font-size: 0.78rem; color: var(--muted); }

.rooms { padding: 12px; overflow: auto; flex: 1; }
.nav-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--gold-dim);
  margin: 12px 4px 8px;
}

.room-btn {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  color: var(--ink);
  padding: 10px 10px;
  border-radius: 10px;
  cursor: pointer;
  margin-bottom: 6px;
}
.ghost {
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  padding: 10px 10px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.86rem;
}
.side-foot .ghost, .rooms .ghost, .pop-menu .ghost { width: 100%; margin-bottom: 4px; }

.room-btn small { display: block; color: var(--muted); font-size: 0.72rem; }
.room-btn.active { background: var(--navy-3); border-color: var(--line); }
.room-btn:hover, .ghost:hover { background: var(--navy-2); }

.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3d5478;
  margin-right: 6px;
}
.gold-dot { background: var(--gold); }
.unread-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3ddc84;
  box-shadow: 0 0 8px #3ddc84;
  margin-left: 6px;
  vertical-align: middle;
}
.room-btn.unread { border-color: rgba(61, 220, 132, 0.35); }

.side-foot {
  padding: 12px;
  border-top: 1px solid var(--line);
}

.ghost { font-size: 0.86rem; color: var(--muted); }
.ghost.danger { color: var(--danger); }

.chat {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  height: 100%;
}

.chat-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  padding: 10px 14px 10px 62px;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 18, 36, 0.95);
  flex-shrink: 0;
  position: relative;
  min-height: 56px;
}
.head-title { min-width: 0; flex: 1; display: flex; align-items: center; gap: 10px; overflow: hidden; }
.head-copy { min-width: 0; flex: 1; overflow: hidden; }
.room-ava { width: 38px; height: 38px; flex-shrink: 0; }
#room-title.is-peer { cursor: pointer; }
#room-title.is-peer:active { opacity: .7; }
.dm-row { display: flex; align-items: center; gap: 10px; text-align: left; }
.dm-txt { min-width: 0; flex: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; }
.dm-txt b { font-weight: 650; }
.dm-row .av-mem { width: 36px; height: 36px; }
.chat-head h2 {
  font-size: 0.95rem;
  color: var(--gold-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-head p {
  font-size: 0.7rem;
  color: var(--muted);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.head-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}
.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--navy-2);
  color: var(--gold-2);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.pop-menu {
  position: absolute;
  right: 10px;
  top: 54px;
  z-index: 20;
  width: min(240px, calc(100% - 20px));
  background: #0b1c38;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px;
  box-shadow: var(--shadow);
}
#plus-menu { bottom: 58px; top: auto; left: 10px; right: auto; }
.pop-menu input[type="search"] {
  width: 100%;
  margin-top: 6px;
}
.poll { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.poll p { margin: 0 0 4px; font-size: 13px; color: var(--gold-2); }
.poll-opt { text-align: left; font-size: 12px; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--navy-2); color: var(--ink); cursor: pointer; }
.poll-opt.mine { border-color: var(--gold); }
.mention { color: var(--gold); font-weight: 600; }
.ticks { color: var(--ok); font-size: 11px; margin-left: 4px; }
.mem-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 8px 0; }
html.light {
  --navy: #e8e4d4;
  --navy-2: #f4f0e4;
  --navy-3: #fff;
  --ink: #1a2433;
  --muted: #5c6778;
  --line: rgba(20, 30, 50, 0.15);
}
html.light body, html.light #app { background: #e8e4d4; color: #1a2433; }
.lock { font-size: 0.78rem; color: var(--ok); }
.badge {
  font-size: 0.72rem;
  border: 1px solid var(--line);
  color: var(--gold);
  padding: 4px 8px;
  border-radius: 999px;
}

.messages {
  flex: 1 1 0%;
  min-height: 0;
  overflow-y: scroll;
  padding: 16px 14px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-anchor: none;
  background-color: #0a1424;
  background-image:
    radial-gradient(rgba(240,196,58,.09) 1.2px, transparent 1.2px);
  background-size: 16px 16px;
}

.msg {
  max-width: min(78%, 640px);
  background: var(--bubble-in);
  border: 0;
  border-radius: 18px 18px 18px 5px;
  padding: 8px 12px 10px;
  box-shadow: 0 6px 18px rgba(0,0,0,.2);
}

.msg.mine {
  align-self: flex-end;
  background: var(--bubble-out);
  color: #1a1404;
  border-radius: 18px 18px 5px 18px;
}
.msg.mine .author,
.msg.mine .meta { color: #5a4708; }
.msg.mine .body { color: #1a1404; }
.msg.mine .reply-snip { color: #4a3c08; border-left-color: #1a1404; }

.msg .meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 4px;
}

.msg .author { color: var(--gold); font-weight: 650; }
.msg .body { white-space: pre-wrap; word-break: break-word; line-height: 1.45; }

.msg img.media, .msg video.media, .msg audio.media {
  display: block;
  max-width: 100%;
  max-height: 320px;
  border-radius: 10px;
  margin-top: 8px;
  background: #000;
}
.msg audio.media { max-height: none; height: 36px; width: 100%; background: transparent; }

.msg .ops {
  display: none;
  margin-top: 6px;
  flex-wrap: wrap;
  gap: 4px;
}
.msg.show-ops .ops { display: flex; }
.msg .ops button {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: 8px;
  padding: 3px 7px;
  cursor: pointer;
  font-size: 0.7rem;
}
.msg .more-msg {
  float: right;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 16px;
  padding: 0 4px;
  cursor: pointer;
}

.sys {
  align-self: center;
  color: var(--muted);
  font-size: 0.78rem;
}

.composer {
  display: flex;
  gap: 8px;
  margin: 6px 10px 8px;
  padding: 6px 8px;
  padding-bottom: 6px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: #121c30;
  flex-shrink: 0;
  position: relative;
  align-items: center;
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
}
.composer input[type="text"] {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  border-radius: 22px;
  padding: 10px 8px;
}
#btn-send, .send-fab, #btn-send.send-fab {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(180deg, #ffe48a, #f0c43a);
  color: #1a1404;
  font-size: 16px;
  cursor: pointer;
}
.typing-line { min-height: 0; margin: 0 16px; font-size: 0.75rem; }

.attach-btn {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  background: var(--navy-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  font-size: 1.1rem;
  text-transform: none;
  letter-spacing: 0;
}

.composer input[type="text"] { flex: 1; }

.attach-preview {
  padding: 8px 12px 0;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.82rem;
}

.attach-preview img, .attach-preview video {
  height: 56px;
  border-radius: 8px;
}

/* MODAL */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  display: grid;
  place-items: center;
  padding: 16px;
  z-index: 50;
}

.modal-card {
  width: min(520px, 100%);
  background: var(--navy-2);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.modal-card h3 { color: var(--gold); margin-bottom: 10px; }
.modal-card p { color: var(--muted); font-size: 0.9rem; line-height: 1.45; margin-bottom: 12px; }
.modal-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.keybox {
  font-family: ui-monospace, monospace;
  background: #000;
  border: 1px dashed var(--gold);
  padding: 10px;
  border-radius: 8px;
  word-break: break-all;
  color: var(--gold-2);
}

/* MOBILE */
@media (max-width: 860px) {
  #view-login {
    align-items: center;
    overflow: auto;
    padding: 20px 18px;
    padding-top: max(20px, env(safe-area-inset-top, 0px));
    padding-bottom: max(20px, env(safe-area-inset-bottom, 0px));
  }
  .login-seal { width: 120px; height: 120px; margin-bottom: 12px; }
  h1 { font-size: 1.35rem; letter-spacing: 0.22em; }
  #view-app {
    display: flex;
    flex-direction: column;
    grid-template-columns: none;
    padding-top: env(safe-area-inset-top, 0px);
    box-sizing: border-box;
    height: 100dvh;
  }
  .chat {
    flex: 1 1 0%;
    height: auto;
    min-height: 0;
    overflow: hidden;
  }
  .menu-toggle {
    display: flex;
    top: calc(env(safe-area-inset-top, 0px) + 8px);
    left: 10px;
  }
  .chat-head {
    padding: 10px 8px 10px 58px;
    gap: 6px;
  }
  .chat-head h2 { font-size: 0.88rem; }
  .chat-head p { display: block; font-size: 0.68rem; }
  #role-badge { display: none !important; }
  .rules-chip { padding: 6px 9px; font-size: 0.62rem; letter-spacing: .04em; }
  .head-actions { gap: 4px; }
  .icon-btn { width: 36px; height: 36px; }
  #chat-search { width: 108px; }
  .messages { padding: 14px; gap: 10px; }
  .pin-bar, .reply-bar { margin: 6px 12px; }
  #typing-line { margin: 4px 12px 0 !important; }
  .composer { margin: 6px 10px max(8px, env(safe-area-inset-bottom, 0px)); padding: 6px 8px; }
  .sidebar {
    position: fixed;
    top: env(safe-area-inset-top, 0px);
    bottom: 0;
    left: 0;
    width: min(86vw, 320px);
    transform: translateX(-105%);
    transition: transform 0.2s ease;
    z-index: 30;
  }
  .sidebar.open { transform: translateX(0); }
  .msg { max-width: 100%; }
}

.quote {
  margin: 14px 0 0;
  padding: 10px 12px;
  border-left: 3px solid var(--gold);
  color: var(--muted);
  font-size: 13px;
  font-style: italic;
  line-height: 1.4;
}
#chat-search {
  width: 120px;
  background: var(--navy-3);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: 8px;
  padding: 6px 8px;
}
.pin-bar, .reply-bar {
  margin: 0 16px;
  padding: 8px 10px;
  background: var(--navy-3);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
}
.pin-bar { margin-top: 8px; }
.reply-snip {
  font-size: 12px;
  color: var(--muted);
  border-left: 2px solid var(--gold);
  padding-left: 8px;
  margin-bottom: 6px;
}
.reacts { margin-top: 4px; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.reacts button, .ops button {
  background: var(--navy-2);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: 999px;
  padding: 0 7px;
  height: 22px;
  font-size: 11px;
  line-height: 22px;
  cursor: pointer;
}
.reacts .rchip { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; }
.reacts .rchip span { font-size: 10px; color: var(--muted); }
.reacts .rchip.mine { border-color: var(--gold); color: var(--gold-2); }
.reacts .radd { width: 22px; padding: 0; font-size: 14px; color: var(--muted); }
.rpick {
  display: flex;
  gap: 4px;
  background: var(--navy);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 6px;
}
.rpick button {
  height: 26px;
  width: 26px;
  padding: 0;
  font-size: 14px;
  line-height: 26px;
  background: transparent;
  border: none;
}

@media (min-width: 861px) {
  .menu-toggle { display: none !important; }
  html, body, #app, #view-app {
    height: 100vh;
    max-height: 100vh;
  }
  #view-app {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
  }
  .sidebar, .chat {
    height: 100%;
    min-height: 0;
    max-height: 100vh;
  }
  .chat-head { padding-left: 18px; }
  #ocak { padding-bottom: 24px; }
  .dock { position: relative; }
}

/* OCAK */
#view-app { position: relative; }
.ocak {
  flex: 1 1 0%;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 16px 20px;
  padding-top: max(16px, env(safe-area-inset-top, 0px));
  position: relative;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(212,175,55,.16), transparent 55%),
    #071224;
}
.ocak-glow {
  pointer-events: none;
  position: absolute;
  inset: 0;
  background-image: radial-gradient(1px 1px at 20% 30%, rgba(240,215,122,.45), transparent),
    radial-gradient(1px 1px at 70% 20%, rgba(212,175,55,.35), transparent),
    radial-gradient(1px 1px at 40% 70%, rgba(240,215,122,.25), transparent);
}
.ocak-top {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  padding-left: 56px;
}
.ocak-seal {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--gold);
  box-shadow: 0 0 24px rgba(212,175,55,.45);
}
.ocak-top strong {
  display: block;
  letter-spacing: .28em;
  color: var(--gold);
  font-size: .95rem;
}
.ocak-top span { color: var(--muted); font-size: .75rem; }
.ocak-quote {
  position: relative;
  margin: 18px 0 8px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  color: var(--gold-2);
  line-height: 1.45;
  background: rgba(11,28,56,.7);
}
.fener-row {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 6px 0 10px;
  -webkit-overflow-scrolling: touch;
}
.fener {
  flex: 0 0 auto;
  width: 72px;
  text-align: center;
  background: transparent;
  border: 0;
  color: var(--ink);
  cursor: pointer;
}
.fener .ring {
  width: 64px;
  height: 64px;
  margin: 0 auto 6px;
  border-radius: 50%;
  padding: 3px;
  background: conic-gradient(var(--gold), var(--gold-2), #7a1f1f, var(--gold));
}
.fener .ring > span, .fener .ring img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #0b1c38;
  object-fit: cover;
  font-weight: 700;
  color: var(--gold);
}
.fener small { display: block; font-size: .65rem; color: var(--muted); max-width: 72px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ocak-btn { width: 100%; border: 1px dashed var(--line) !important; margin: 4px 0 14px; }
.wache, .ocak-lands { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.lantern {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--navy-2);
  font-size: .78rem;
}
.lantern .flame {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 8px var(--gold);
}
.land-chip {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--navy-2);
  font-size: .75rem;
  color: var(--ink);
}
.land-chip b { color: var(--gold); display: block; }
.dock {
  display: flex;
  flex-shrink: 0;
  border-top: 1px solid var(--line);
  background: #050b16;
  padding: 6px 8px max(8px, env(safe-area-inset-bottom, 0px));
  z-index: 25;
}
.dock-btn {
  flex: 1;
  background: transparent;
  border: 0;
  color: var(--muted);
  padding: 10px 4px;
  font-size: .72rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  cursor: pointer;
  position: relative;
}
.me-badge {
  position: absolute;
  top: 2px;
  right: 18%;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--gold);
  color: #1a1404;
  font-size: .62rem;
  font-weight: 800;
  line-height: 18px;
  letter-spacing: 0;
  text-transform: none;
  box-shadow: 0 0 0 2px #050b16;
}
.friend-note {
  position: fixed;
  top: max(12px, env(safe-area-inset-top, 0px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 90;
  background: #121c30;
  border: 1px solid var(--gold);
  color: var(--gold-2);
  border-radius: 999px;
  padding: 10px 18px;
  font-size: .86rem;
  font-weight: 650;
  box-shadow: 0 12px 32px rgba(0,0,0,.45);
  cursor: pointer;
  max-width: 92vw;
}
.dock-btn.active { color: var(--gold); }
#btn-watch.muted-on, #btn-watch.on-watch {
  background: var(--gold);
  color: #1a1404;
  border-color: var(--gold);
}

@media (min-width: 861px) {
  #view-app {
    grid-template-columns: 280px minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto;
  }
  .sidebar { grid-row: 1 / span 2; }
  #ocak, #chat-main, #handbuch { grid-column: 2; grid-row: 1; min-height: 0; }
  .dock { grid-column: 2; grid-row: 2; }
  .ocak-top { padding-left: 0; }
}

/* 2026 messenger */
.mode-switch {
  display: flex;
  background: rgba(11,28,56,.8);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px;
  margin: 18px 0 14px;
  gap: 4px;
}
.mode-switch .seg {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 10px 8px;
  font-weight: 650;
  cursor: pointer;
}
.mode-switch .seg.on {
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  color: #1a1404;
}
.login-wrap {
  background: rgba(7,18,36,.55);
  backdrop-filter: blur(18px);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 28px 22px;
}
.msg {
  border: 0;
  border-radius: 18px 18px 18px 5px;
  padding: 8px 13px 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
}
.msg.mine {
  border-radius: 18px 18px 5px 18px;
  background: var(--bubble-out);
  color: #1a1404;
}
.msg.pop { animation: bubbleIn .34s cubic-bezier(.2,1.4,.32,1); }
@keyframes bubbleIn {
  0% { transform: translateY(22px) scale(.84); opacity: 0; }
  72% { transform: translateY(-4px) scale(1.03); opacity: 1; }
  100% { transform: none; }
}
.composer {
  background: #121c30;
  backdrop-filter: blur(16px);
  gap: 8px;
  margin: 6px 10px 10px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 28px;
}
.composer input[type="text"] {
  border-radius: 22px;
  padding: 10px 8px;
  background: transparent;
  border: 0;
}
.attach-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
}
.send-fab, #btn-send.send-fab {
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  color: #1a1404;
  font-size: 16px;
  flex-shrink: 0;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(212,175,55,.28);
}
.send-fab.pulse { animation: sendPulse .28s ease; }
@keyframes sendPulse {
  0% { transform: scale(1); }
  40% { transform: scale(.86); }
  100% { transform: scale(1); }
}
.modal {
  background: rgba(3,8,16,.55);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.modal-card {
  border-radius: 22px;
  padding: 20px 18px 16px;
  background: rgba(11,28,56,.96);
  animation: cardIn .28s cubic-bezier(.2,.9,.3,1);
}
@keyframes cardIn {
  from { transform: translateY(16px) scale(.96); opacity: 0; }
  to { transform: none; opacity: 1; }
}
.report-card {
  background: #071224;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 12px;
  margin: 10px 0;
}
.rank-tag {
  display: inline-block;
  margin-left: 6px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  vertical-align: middle;
}
.rank-bl, .author.rank-bl { color: #e44545 !important; }
.rank-sl, .author.rank-sl { color: #7ec8ff !important; }
.rank-vip, .author.rank-vip { color: #f0c43a !important; }
.rank-eh, .author.rank-eh { color: #3dcc7a !important; }
#role-badge.rank-bl { color: #e44545; border-color: #e44545; }
#role-badge.rank-sl { color: #7ec8ff; border-color: #7ec8ff; }
#role-badge.rank-vip { color: #f0c43a; border-color: #f0c43a; }
#role-badge.rank-eh { color: #3dcc7a; border-color: #3dcc7a; }
.msg.mine .rank-bl { color: #b91c1c !important; }
.msg.mine .rank-sl { color: #1d4f7a !important; }
.msg.mine .rank-vip { color: #8a6a10 !important; }
.msg.mine .rank-eh { color: #0d6b3a !important; }
.book-body { padding: 8px 14px 28px; overflow: auto; flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 12px; }
.book-card {
  background: rgba(8, 16, 30, .72);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 14px 10px;
  border-left: 4px solid var(--gold);
}
.book-card.sl { border-left-color: #7ec8ff; }
.book-card.bl { border-left-color: #e44545; }
.book-card.vip { border-left-color: #f0c43a; }
.book-card.eh { border-left-color: #3dcc7a; }
.book-card.mem { border-left-color: #6b7288; }
.book-card header { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.book-rank { font-weight: 800; letter-spacing: .06em; text-transform: uppercase; font-size: .78rem; }
.book-card header small { color: var(--muted); font-size: .72rem; }
.book-card ul { margin: 0; padding: 0 0 4px 16px; }
.book-card li { color: var(--ink); font-size: .86rem; line-height: 1.45; margin: 0 0 6px; }
.btn-honor {
  border: 0;
  border-radius: 14px;
  padding: 12px 16px;
  font-weight: 700;
  cursor: pointer;
  background: #3dcc7a;
  color: #062214;
}
.btn-honor.is-on { background: #163c28; color: #8ee0b0; }
.btn-honor.tiny { padding: 4px 8px; border-radius: 8px; font-size: .72rem; }
.rules-chip {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: .68rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  cursor: pointer;
  flex-shrink: 0;
}
.rules-chip:hover { color: var(--gold); border-color: var(--gold); }
.rules-box { text-align: left; }
.rules-box li { margin: 6px 0; color: var(--ink); font-size: .9rem; line-height: 1.4; }
.x-mini {
  border: 0;
  background: #5a2020;
  color: #ffd0d0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  line-height: 1;
  cursor: pointer;
  margin-left: 4px;
}
.msg.censored { opacity: 1; background: #16141c; border: 1px dashed #4a4258; }
.censored-note { color: var(--muted); font-size: .85rem; margin: 6px 0 4px; }
.censored-open { margin: 4px 0 0; display: flex; gap: 8px; align-items: center; text-transform: none; letter-spacing: 0; color: var(--gold-2); font-size: .8rem; }
.censored-open input { width: auto; margin: 0; }
.me-card { text-align: left; }
.me-hero { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.msg-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  max-width: min(86%, 720px);
  align-self: flex-start;
  width: auto;
}
.msg-row.mine { align-self: flex-end; flex-direction: row-reverse; }
.msg-row .msg { max-width: 100%; cursor: pointer; }
.av-msg {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1.5px solid var(--gold);
  overflow: hidden;
  flex-shrink: 0;
  padding: 0;
  background: #0e1a2c;
  cursor: pointer;
}
.av-msg img, .av-in, .av-mem, .me-ava, .prof-ava {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%;
}
.av-letter {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: var(--gold);
  font-weight: 800;
  font-size: .78rem;
  background: linear-gradient(180deg, #1a2a44, #0c1626);
}
.av-mem { width: 36px; height: 36px; border-radius: 50%; overflow: hidden; flex-shrink: 0; border: 1px solid var(--gold); }
.mem-who { display: flex; gap: 10px; align-items: center; min-width: 0; }
.prof { text-align: center; }
.prof-ava-wrap {
  width: 132px;
  height: 132px;
  margin: 4px auto 12px;
  border-radius: 50%;
  padding: 3px;
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  box-shadow: 0 10px 28px rgba(0,0,0,.35);
}
.prof-ava {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  background: #0c1626;
  display: grid;
  place-items: center;
  font-size: 2.4rem;
  color: var(--gold);
}
.prof h3 { margin: 0 0 4px; }
.prof-meta { color: var(--muted); margin: 0 0 6px; font-size: .82rem; }
.prof-st { color: var(--ink); margin: 0 0 14px; }
.prof-acts { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 12px; }
.btn-friend {
  border: 0;
  border-radius: 14px;
  padding: 12px 16px;
  font-weight: 700;
  letter-spacing: .04em;
  cursor: pointer;
  background: #7ec8ff;
  color: #072036;
}
.btn-friend.is-on, .btn-friend.is-wait { background: #1c3a55; color: #9fd4ff; }
.btn-block {
  border: 0;
  border-radius: 14px;
  padding: 12px 16px;
  font-weight: 700;
  letter-spacing: .04em;
  cursor: pointer;
  background: #e44545;
  color: #fff;
}
.btn-block.tiny { padding: 6px 10px; font-size: .75rem; border-radius: 8px; }
.prof-lead { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.prof-mute { margin: 8px 0 4px; text-align: left; }
.mute-row { display: flex; flex-wrap: wrap; gap: 6px; }
.mute-row .ghost, .mute-row .btn-block { flex: 1 1 30%; min-width: 72px; padding: 8px 6px; font-size: .75rem; }
.me-ava-btn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  padding: 0;
  border: 2px solid var(--gold);
  overflow: hidden;
  background: #0c1626;
  cursor: pointer;
  flex-shrink: 0;
}
.file-ghost {
  position: fixed;
  left: -9999px;
  top: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.me-ava-btn.busy { opacity: .45; pointer-events: none; }
.av-msg img, .me-ava, .prof-ava { pointer-events: none; }
.me-pin {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  background: #0a1220;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 12px;
  margin: 12px 0;
}
.me-pin span { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); grid-column: 1 / -1; }
.me-pin code { color: var(--gold-2); font-size: .95rem; letter-spacing: .12em; }
.mute-banner {
  margin: 0 12px 6px;
  padding: 8px 12px;
  border-radius: 12px;
  background: #3a1515;
  color: #ffd0d0;
  font-size: 0.82rem;
  text-align: center;
}
.composer.is-muted { opacity: .45; pointer-events: none; }
.msg audio.media, .msg video.media { position: relative; z-index: 0; }
.msg .ops { position: relative; z-index: 2; }
.ocak-reports .btn { width: 100%; }
.mem-acts { display: flex; gap: 6px; flex-shrink: 0; }
.btn.tiny { padding: 6px 10px; font-size: .75rem; border-radius: 8px; }
.dock {
  background: rgba(5,11,22,.92);
  backdrop-filter: blur(16px);
}
.dock-btn.active { font-weight: 700; }
@media (max-width: 860px) {
  .modal { place-items: end center; padding: 0; }
  .modal-card {
    width: 100%;
    max-height: 88dvh;
    overflow: auto;
    border-radius: 22px 22px 0 0;
    padding-bottom: max(20px, env(safe-area-inset-bottom, 0px));
    animation: sheetUp .3s cubic-bezier(.2,.9,.3,1);
  }
  .modal-card::before {
    content: "";
    display: block;
    width: 40px;
    height: 4px;
    border-radius: 4px;
    background: rgba(212,175,55,.35);
    margin: 4px auto 14px;
  }
}
@keyframes sheetUp {
  from { transform: translateY(36%); }
  to { transform: none; }
}
/* ==========================================================================
   MAK NET — Oberfläche 2026
   --------------------------------------------------------------------------
   Die Struktur (Raster, Positionen, Umbrüche) bleibt oben unverändert.
   Hier wird die komplette Erscheinung neu gesetzt: Farbe, Schrift, Flächen,
   Abstände, Bewegung. Dieser Block steht am Ende und gewinnt deshalb.

   Haltung: Marineblau und das Gold des Siegels bleiben — das ist die
   Identität. Neu sind Tiefe statt flacher Kästen, mehr Luft, und
   Bewegung, die immer eine Antwort auf eine Handlung ist.
   ========================================================================== */

:root {
  /* Grundflächen, von tief nach nah */
  --void:        #03060d;
  --navy:        #050a13;
  --navy-2:      #0d1727;
  --navy-3:      #17243a;
  --raise:       rgba(22, 36, 59, 0.74);
  --raise-2:     rgba(30, 47, 76, 0.88);
  --veil:        rgba(255, 255, 255, 0.045);
  --veil-2:      rgba(255, 255, 255, 0.08);

  /* Gold des Siegels — der einzige Akzent */
  --gold:        #f0c43a;
  --gold-2:      #ffe9a3;
  --gold-3:      #fff6d8;
  --gold-dim:    #b1903a;
  --gold-wash:   rgba(240, 196, 58, 0.11);

  --line:        rgba(240, 196, 58, 0.15);
  --line-2:      rgba(240, 196, 58, 0.32);
  --hair:        rgba(255, 255, 255, 0.07);

  --ink:         #f4f2ed;
  --ink-2:       #cfd6e2;
  --muted:       #93a1b8;
  --muted-2:     #6b7b95;

  --ember:       #e0655c;
  --danger:      #e0655c;
  --jade:        #45d68c;
  --ok:          #45d68c;

  --bubble-in:   rgba(27, 43, 70, 0.9);
  --bubble-out:  linear-gradient(145deg, #ffe291, #eec03d);

  /* Radien nach Rolle gestaffelt, nicht ein Wert für alles */
  --r-bubble: 20px;
  --r-panel:  18px;
  --r-card:   16px;
  --r-field:  13px;
  --r-media:  14px;

  --lift:    0 10px 34px rgba(0, 0, 0, 0.42);
  --lift-lg: 0 26px 70px rgba(0, 0, 0, 0.55);
  --glow:    0 0 28px rgba(240, 196, 58, 0.28);

  --ease:   cubic-bezier(0.22, 0.75, 0.3, 1);
  --spring: cubic-bezier(0.34, 1.45, 0.5, 1);
  --fast:   140ms;
  --base:   240ms;
  --slow:   420ms;
}

/* --------------------------------------------------------------------------
   Schrift
   Archivo: klare Grotesk mit vollständigen türkischen Zeichen (ı İ ğ ş ç).
   Wichtig, sonst bricht „Müdafaa-i Akıl ve Kemalizm".
   -------------------------------------------------------------------------- */

html, body, #app {
  background: var(--void);
  font-family: "Archivo", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", sans-serif;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  letter-spacing: -0.006em;
}

h1, h2, h3, .brand strong, .ocak-top strong { font-weight: 650; }
b, strong { font-weight: 600; }
::selection { background: rgba(240, 196, 58, 0.3); color: var(--gold-3); }

/* Bildlaufleisten unauffällig halten */
* { scrollbar-width: thin; scrollbar-color: rgba(240, 196, 58, 0.22) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: rgba(240, 196, 58, 0.2); border-radius: 99px; }
*::-webkit-scrollbar-track { background: transparent; }

/* --------------------------------------------------------------------------
   Bewegung als Grundregel: Druck spürbar machen statt Hover für Mäuse
   -------------------------------------------------------------------------- */

button, .room-btn, .ghost, .dock-btn, .seg, .btn, .icon-btn, .badge,
.fener, .land-chip, .lantern, .poll-opt, .rules-chip {
  transition:
    background var(--fast) var(--ease),
    border-color var(--fast) var(--ease),
    color var(--fast) var(--ease),
    opacity var(--fast) var(--ease),
    transform var(--fast) var(--ease),
    box-shadow var(--base) var(--ease);
}
button:active, .room-btn:active, .ghost:active, .dock-btn:active,
.seg:active, .btn:active, .fener:active, .land-chip:active { transform: scale(0.965); }

:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 8px; }

input, select, textarea {
  font-family: inherit;
  transition: border-color var(--fast) var(--ease), background var(--fast) var(--ease),
              box-shadow var(--base) var(--ease);
}
input::placeholder { color: var(--muted-2); }

/* ==========================================================================
   1 — Anmeldung. Der eine inszenierte Moment der App.
   ========================================================================== */

#view-login {
  background:
    radial-gradient(120% 78% at 50% -18%, rgba(240, 196, 58, 0.17) 0%, transparent 56%),
    radial-gradient(95% 70% at 50% 112%, rgba(28, 58, 108, 0.36) 0%, transparent 62%),
    var(--void);
}
.login-wrap > * { animation: riseIn var(--slow) var(--ease) both; }
.login-seal {
  border-radius: 50%;
  filter: drop-shadow(0 20px 54px rgba(240, 196, 58, 0.24));
  animation: sealIn 900ms var(--ease) both;
}
.login-wrap h1 {
  animation-delay: 90ms;
  letter-spacing: 0.16em;
  font-size: 1.9rem;
  margin-top: 18px;
}
.tagline {
  animation-delay: 150ms;
  color: var(--gold-2);
  font-size: 0.95rem;
  letter-spacing: 0.01em;
}
.sub { animation-delay: 200ms; color: var(--muted); margin: 10px 0 20px; }
.login-wrap .quote { animation-delay: 260ms; }
.mode-switch { animation-delay: 310ms; }
.login-wrap form { animation-delay: 360ms; }
.login-wrap .hint { animation-delay: 430ms; }

@keyframes sealIn {
  from { opacity: 0; transform: scale(0.88) translateY(12px); filter: blur(8px); }
  to   { opacity: 1; transform: none; filter: drop-shadow(0 20px 54px rgba(240, 196, 58, 0.24)); }
}
@keyframes riseIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

.quote {
  font-family: Georgia, "Iowan Old Style", "Times New Roman", serif;
  font-style: italic;
  color: var(--gold-2);
  border: 0;
  border-left: 2px solid var(--line-2);
  background: linear-gradient(100deg, var(--gold-wash), transparent 70%);
  border-radius: 0 var(--r-card) var(--r-card) 0;
  padding: 14px 18px;
  line-height: 1.55;
}

/* Umschalter Anmelden / Registrieren */
.mode-switch {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--hair);
  margin: 20px 0 18px;
}
.seg {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 550;
  cursor: pointer;
}
.seg.on {
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  color: #241a02;
  font-weight: 650;
  box-shadow: 0 6px 18px rgba(240, 196, 58, 0.26);
}

label { display: block; text-align: left; font-size: 0.82rem; color: var(--muted); }
input[type="text"], input[type="password"], input[type="search"], select {
  width: 100%;
  margin-top: 6px;
  padding: 13px 14px;
  border-radius: var(--r-field);
  border: 1px solid var(--hair);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  font-size: 0.95rem;
}
input:focus, select:focus {
  outline: none;
  border-color: var(--line-2);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 0 3px rgba(240, 196, 58, 0.1);
}

.btn {
  border-radius: var(--r-field);
  padding: 13px 18px;
  font-weight: 650;
  letter-spacing: 0.005em;
}
.btn.gold {
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  color: #241a02;
  box-shadow: 0 8px 24px rgba(240, 196, 58, 0.24);
}
.btn.gold:hover { filter: brightness(1.05); }
.btn.danger {
  background: rgba(224, 101, 92, 0.15);
  border: 1px solid rgba(224, 101, 92, 0.42);
  color: #ffcac5;
}
.hint { color: var(--muted-2); line-height: 1.5; }
.hint-inline { color: var(--muted-2); font-size: 0.82rem; line-height: 1.5; margin-top: 10px; }

/* ==========================================================================
   2 — Seitenmenü
   ========================================================================== */

.sidebar {
  background: linear-gradient(180deg, #070d19, #04080f);
  border-right: 1px solid rgba(240, 196, 58, 0.1);
  transition: transform var(--base) var(--ease);
}
.brand { border-bottom: 1px solid var(--hair); padding: 18px 16px; }
.brand img {
  border: 1px solid var(--line-2);
  box-shadow: 0 0 0 4px rgba(240, 196, 58, 0.06);
}
.brand strong { letter-spacing: 0.17em; color: var(--gold); }
.brand span { color: var(--muted-2); }

/* Rubriken mit auslaufender Haarlinie statt gesperrter Versalien */
.nav-label {
  display: flex;
  align-items: center;
  gap: 10px;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--gold-dim);
  margin: 20px 4px 10px;
}
.nav-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(240, 196, 58, 0.24), transparent);
}

.room-btn, .ghost { border-radius: var(--r-field); padding: 11px 12px; }
.room-btn { position: relative; margin-bottom: 4px; font-size: 0.92rem; }
.room-btn small { color: var(--muted-2); margin-top: 2px; }
.room-btn.active {
  background: linear-gradient(100deg, var(--gold-wash), rgba(240, 196, 58, 0.02));
  border-color: var(--line);
}
.room-btn.active::before {
  content: "";
  position: absolute;
  left: 0; top: 50%;
  width: 3px; height: 60%;
  transform: translateY(-50%);
  border-radius: 0 3px 3px 0;
  background: var(--gold);
}
.room-btn:hover, .ghost:hover { background: var(--veil); }
.room-btn.unread { border-color: rgba(69, 214, 140, 0.3); }
.ghost.danger { color: var(--ember); }
.side-foot { border-top: 1px solid var(--hair); padding: 12px; }

.dot { box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.04); }
.gold-dot { background: var(--gold); box-shadow: 0 0 10px rgba(240, 196, 58, 0.6); }
.unread-dot { background: var(--jade); box-shadow: 0 0 10px rgba(69, 214, 140, 0.6); }

.menu-toggle span { background: var(--gold); transition: transform var(--base) var(--ease), opacity var(--fast); }

/* ==========================================================================
   3 — Kopfzeile des Chats
   ========================================================================== */

.chat-head {
  background: rgba(6, 13, 25, 0.76);
  -webkit-backdrop-filter: saturate(165%) blur(18px);
  backdrop-filter: saturate(165%) blur(18px);
  border-bottom: 1px solid var(--hair);
}
.chat-head h2 { font-weight: 650; letter-spacing: -0.012em; }
.chat-head p { color: var(--muted-2); }
.badge {
  background: var(--gold-wash);
  border: 1px solid var(--line);
  color: var(--gold-2);
  font-weight: 600;
  padding: 5px 10px;
}
.icon-btn {
  border-radius: 50%;
  background: var(--veil);
  border: 1px solid transparent;
  color: var(--ink-2);
}
.icon-btn:hover { background: var(--veil-2); }
.rules-chip {
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--gold-wash);
  color: var(--gold-2);
  padding: 5px 11px;
  font-size: 0.74rem;
}
.room-ava, .av-msg, .av-mem { border: 1px solid var(--hair); }
.av-letter {
  background: linear-gradient(145deg, var(--navy-3), var(--navy-2));
  color: var(--gold);
  font-weight: 650;
}

/* ==========================================================================
   4 — Nachrichten
   ========================================================================== */

.messages {
  padding: 18px 14px 26px;
  gap: 10px;
  background-color: #060d19;
  background-image:
    radial-gradient(120% 55% at 50% 0%, rgba(240, 196, 58, 0.05), transparent 62%),
    radial-gradient(rgba(240, 196, 58, 0.05) 1px, transparent 1px);
  background-size: auto, 22px 22px;
  scroll-behavior: smooth;
}
.messages.room-in > * { animation: roomIn var(--base) var(--ease) both; }
@keyframes roomIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

.msg {
  border-radius: var(--r-bubble) var(--r-bubble) var(--r-bubble) 6px;
  padding: 10px 14px 12px;
  background: var(--bubble-in);
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.26);
  transition: box-shadow var(--base) var(--ease);
}
.msg.mine {
  background: var(--bubble-out);
  border-radius: var(--r-bubble) var(--r-bubble) 6px var(--r-bubble);
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 10px 28px rgba(240, 196, 58, 0.17);
}
.msg .meta { color: var(--muted-2); font-size: 0.72rem; }
.msg .author { color: var(--gold); font-weight: 650; }
.msg .body { line-height: 1.5; font-size: 0.95rem; }
.msg.mine .author, .msg.mine .meta { color: #6b5409; }
.msg.mine .body { color: #201803; }
.msg img.media, .msg video.media { border-radius: var(--r-media); }
.msg audio.media { height: 38px; }
.mention {
  color: var(--gold);
  font-weight: 600;
  background: var(--gold-wash);
  border-radius: 5px;
  padding: 0 3px;
}
.msg.mine .mention { background: rgba(0, 0, 0, 0.12); color: #4a3a05; }
.ticks { color: var(--jade); }
.msg.mine .ticks { color: #3f7d55; }

/* Eintritt: nur für Nachrichten, die gerade wirklich neu sind */
.msg-row.is-new { animation: msgIn 380ms var(--spring) both; }
.msg-row.is-new.mine { animation-name: msgInMine; }
@keyframes msgIn {
  from { opacity: 0; transform: translateY(14px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}
@keyframes msgInMine {
  from { opacity: 0; transform: translateY(14px) scale(0.94); }
  to   { opacity: 1; transform: none; }
}

.msg .ops { animation: opsIn 180ms var(--ease) both; gap: 5px; }
@keyframes opsIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: none; }
}
.msg .ops button, .reacts button {
  border-radius: 999px;
  border: 1px solid var(--hair);
  background: var(--veil);
  color: var(--ink-2);
  padding: 4px 10px;
}
.msg.mine .ops button {
  border-color: rgba(0, 0, 0, 0.16);
  background: rgba(0, 0, 0, 0.09);
  color: #4a3a05;
}
.reacts .rchip:active { transform: scale(0.88); }
.reacts .rchip.mine { border-color: var(--line-2); background: var(--gold-wash); color: var(--gold-2); }
.rpick {
  border-radius: 999px;
  background: var(--raise-2);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border: 1px solid var(--line);
  box-shadow: var(--lift);
  animation: popIn 190ms var(--spring) both;
}
.rpick button { transition: transform var(--fast) var(--spring); }
.rpick button:active { transform: scale(1.25); }

.reply-snip {
  border-left: 2px solid var(--gold-dim);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
  border-radius: 0 8px 8px 0;
  padding: 4px 8px;
}
.sys {
  padding: 5px 13px;
  border-radius: 999px;
  background: var(--veil);
  border: 1px solid var(--hair);
  color: var(--muted-2);
}
.censored-note { color: var(--muted-2); font-style: italic; }

/* Tippanzeige */
.typing-line { margin: 2px 18px 0; color: var(--muted-2); }
.typing-line.on { animation: fadeIn var(--fast) var(--ease); }
.tdots { display: inline-flex; gap: 3px; margin-left: 4px; vertical-align: middle; }
.tdots i {
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--gold-dim);
  animation: tbounce 1.1s infinite var(--ease);
}
.tdots i:nth-child(2) { animation-delay: 0.15s; }
.tdots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes tbounce {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30%           { opacity: 1;   transform: translateY(-3px); }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.mute-banner {
  border-radius: var(--r-card);
  background: rgba(224, 101, 92, 0.12);
  border: 1px solid rgba(224, 101, 92, 0.34);
  color: #ffcac5;
  animation: riseIn var(--base) var(--ease) both;
}

/* ==========================================================================
   5 — Eingabeleiste
   ========================================================================== */

.composer {
  margin: 8px 12px 10px;
  padding: 6px 7px;
  border-radius: 26px;
  background: rgba(15, 26, 44, 0.9);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  backdrop-filter: blur(16px) saturate(150%);
  border: 1px solid rgba(240, 196, 58, 0.17);
  box-shadow: var(--lift);
  transition: border-color var(--base) var(--ease), box-shadow var(--base) var(--ease);
}
.composer:focus-within {
  border-color: var(--line-2);
  box-shadow: var(--lift), 0 0 0 3px rgba(240, 196, 58, 0.1);
}
.composer input[type="text"] {
  margin-top: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  font-size: 0.95rem;
}
.composer input[type="text"]:focus { box-shadow: none; background: transparent; }

#btn-send, .send-fab, #btn-send.send-fab {
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  color: #241a02;
  box-shadow: 0 6px 18px rgba(240, 196, 58, 0.3);
  transition: transform var(--fast) var(--spring), box-shadow var(--base) var(--ease), filter var(--fast);
}
#btn-send:active { transform: scale(0.88); }
#btn-send:disabled { filter: grayscale(0.5) brightness(0.8); }
#btn-send.pulse { animation: sendPop 300ms var(--spring); }
@keyframes sendPop {
  0%   { transform: scale(0.85); }
  55%  { transform: scale(1.12); }
  100% { transform: scale(1); }
}
.attach-btn {
  border-radius: 50%;
  background: var(--veil);
  border: 1px solid var(--hair);
  color: var(--gold);
  font-size: 22px;
  transition: transform var(--base) var(--spring), background var(--fast);
}
.attach-btn:active { transform: rotate(135deg) scale(0.9); }
.attach-preview {
  border-radius: var(--r-card);
  background: var(--raise);
  border: 1px solid var(--hair);
  animation: riseIn var(--base) var(--ease) both;
}
.attach-preview img, .attach-preview video { border-radius: 10px; }

/* Eingabe im Ankündigungsmodus */
#msg-input.announce-mode::placeholder { color: var(--gold-2); opacity: 0.9; }
.composer.announce-mode {
  border-color: var(--line-2);
  box-shadow: var(--lift), 0 0 0 3px rgba(240, 196, 58, 0.16);
}

/* ==========================================================================
   6 — Schwebende Flächen: Menüs, Fenster
   ========================================================================== */

.pop-menu {
  border-radius: var(--r-panel);
  background: var(--raise-2);
  -webkit-backdrop-filter: blur(20px) saturate(155%);
  backdrop-filter: blur(20px) saturate(155%);
  border: 1px solid var(--line);
  box-shadow: var(--lift-lg);
  padding: 6px;
  animation: popIn 190ms var(--spring) both;
  transform-origin: top right;
}
#plus-menu { transform-origin: bottom left; }
.pop-menu .ghost { border-radius: 11px; }
@keyframes popIn {
  from { opacity: 0; transform: scale(0.94) translateY(-6px); }
  to   { opacity: 1; transform: none; }
}

.modal {
  background: rgba(3, 6, 13, 0.66);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  animation: fadeIn var(--base) var(--ease);
}
.modal-card {
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(26, 41, 66, 0.97), rgba(11, 20, 34, 0.98));
  border: 1px solid var(--line);
  box-shadow: var(--lift-lg);
  padding: 22px;
  animation: cardIn 300ms var(--spring) both;
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(18px) scale(0.96); }
  to   { opacity: 1; transform: none; }
}
.modal-card h3 { color: var(--gold); font-weight: 650; letter-spacing: -0.01em; font-size: 1.1rem; }
.modal-card p { color: var(--ink-2); line-height: 1.55; }
.modal-card .ghost { border: 1px solid var(--hair); background: var(--veil); color: var(--ink-2); }
.modal-actions { gap: 8px; margin-top: 16px; }

/* Nummerierte Anleitungen (Mitteilungen einrichten) */
.howto {
  margin: 12px 0 4px;
  padding-left: 0;
  list-style: none;
  counter-reset: step;
}
.howto li {
  counter-increment: step;
  position: relative;
  padding: 8px 0 8px 36px;
  color: var(--ink-2);
  font-size: 0.9rem;
  line-height: 1.5;
  border-bottom: 1px solid var(--hair);
}
.howto li:last-child { border-bottom: 0; }
.howto li::before {
  content: counter(step);
  position: absolute;
  left: 0; top: 8px;
  width: 22px; height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--gold-wash);
  border: 1px solid var(--line);
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 650;
}
.modal-card code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.85em;
  background: var(--veil);
  border-radius: 5px;
  padding: 1px 5px;
  color: var(--gold-2);
}

.keybox {
  border-radius: var(--r-card);
  background: var(--veil);
  border: 1px dashed var(--line-2);
  color: var(--gold-2);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  letter-spacing: 0.06em;
}
.check-row { border-radius: var(--r-field); background: var(--veil); border: 1px solid var(--hair); }

/* ==========================================================================
   7 — Ocak, die Startseite
   ========================================================================== */

.ocak {
  background:
    radial-gradient(ellipse 90% 45% at 50% 0%, rgba(240, 196, 58, 0.15), transparent 58%),
    #060d19;
  padding: 18px 16px 24px;
}
.ocak-glow { animation: emberPulse 7s ease-in-out infinite; }
@keyframes emberPulse {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50%      { opacity: 0.95; transform: scale(1.05); }
}
.ocak-seal {
  border: 2px solid var(--gold);
  box-shadow: var(--glow);
  transition: transform var(--slow) var(--ease);
}
.ocak-seal:active { transform: rotate(-5deg) scale(0.94); }
.ocak-top strong { letter-spacing: 0.3em; color: var(--gold); }
.ocak-top span { color: var(--muted-2); }
.ocak-quote {
  border: 0;
  border-left: 2px solid var(--line-2);
  border-radius: 0 var(--r-card) var(--r-card) 0;
  background: linear-gradient(100deg, var(--gold-wash), rgba(11, 28, 56, 0.5) 70%);
  color: var(--gold-2);
}

/* Fener — die 24-Stunden-Leuchtfeuer */
.fener .ring {
  background: conic-gradient(from 210deg, var(--gold), var(--gold-2), var(--ember), var(--gold));
  transition: transform var(--base) var(--spring);
}
.fener:active .ring { transform: scale(0.92); }
.fener .ring > span, .fener .ring img { background: #0a1729; }
.fener small { color: var(--muted-2); }
.ocak-btn {
  border: 1px dashed var(--line) !important;
  border-radius: var(--r-card) !important;
  color: var(--gold-dim);
  text-align: center;
}
.ocak-btn:hover { border-color: var(--line-2) !important; color: var(--gold); }

.lantern {
  background: var(--veil);
  border: 1px solid var(--hair);
  color: var(--ink-2);
}
.lantern .flame {
  background: var(--gold);
  box-shadow: 0 0 10px var(--gold);
  animation: flicker 2.6s ease-in-out infinite;
}
@keyframes flicker {
  0%, 100% { opacity: 1; }
  45%      { opacity: 0.55; }
  70%      { opacity: 0.9; }
}
.land-chip {
  border-radius: var(--r-field);
  background: var(--veil);
  border: 1px solid var(--hair);
  color: var(--ink-2);
}
.land-chip:hover { border-color: var(--line); background: var(--gold-wash); }
.land-chip b { color: var(--gold); }
.ocak-reports { animation: riseIn var(--base) var(--ease) both; }
.report-card {
  border-radius: var(--r-card);
  background: rgba(224, 101, 92, 0.1);
  border: 1px solid rgba(224, 101, 92, 0.3);
}

/* ==========================================================================
   8 — Untere Navigation
   ========================================================================== */

.dock {
  background: rgba(5, 10, 19, 0.88);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  border-top: 1px solid var(--hair);
}
.dock-btn {
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.78rem;
  font-weight: 550;
  color: var(--muted-2);
  border-radius: 12px;
}
.dock-btn.active { color: var(--gold); }
/* Aktiver Reiter bekommt einen kurzen goldenen Strich */
.dock-btn.active::after {
  content: "";
  position: absolute;
  left: 50%; bottom: 4px;
  width: 18px; height: 2px;
  transform: translateX(-50%);
  border-radius: 2px;
  background: var(--gold);
  animation: dashIn var(--base) var(--spring) both;
}
@keyframes dashIn {
  from { width: 0; opacity: 0; }
  to   { width: 18px; opacity: 1; }
}
.me-badge {
  background: var(--gold);
  color: #241a02;
  box-shadow: 0 0 0 2px rgba(5, 10, 19, 0.9);
  animation: badgePop var(--base) var(--spring) both;
}
@keyframes badgePop {
  from { transform: scale(0); }
  to   { transform: scale(1); }
}

/* ==========================================================================
   9 — Profil, Mitglieder, Ränge
   ========================================================================== */

.me-card, .prof, .me-hero {
  border-radius: var(--r-panel);
  background: var(--raise);
  border: 1px solid var(--hair);
}
.me-hero {
  background: linear-gradient(160deg, var(--gold-wash), rgba(22, 36, 59, 0.7));
  border-color: var(--line);
}
.prof-ava, .me-ava { border: 2px solid var(--line-2); box-shadow: 0 0 0 5px rgba(240, 196, 58, 0.06); }
.me-pin, .prof-meta, .prof-st { color: var(--muted-2); }
.mem-row {
  border-radius: var(--r-field);
  padding: 8px 10px;
  transition: background var(--fast) var(--ease);
}
.mem-row:hover { background: var(--veil); }
.mem-who b { font-weight: 600; }

.rank-tag, .book-rank {
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 0.66rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  vertical-align: middle;
}
.rank-bl  { background: var(--gold); color: #241a02; }
.rank-sl  { background: rgba(240, 196, 58, 0.18); color: var(--gold-2); border: 1px solid var(--line-2); }
.rank-vip { background: rgba(140, 170, 255, 0.16); color: #bcd0ff; border: 1px solid rgba(140, 170, 255, 0.34); }
.rank-eh  { background: rgba(69, 214, 140, 0.15); color: #a6f0c8; border: 1px solid rgba(69, 214, 140, 0.34); }

.btn-friend, .btn-block, .btn-honor { border-radius: 999px; font-size: 0.78rem; padding: 7px 13px; }
.lock { color: var(--jade); }

/* Handbuch */
.book-body { display: grid; gap: 12px; }
.book-card {
  border-radius: var(--r-card);
  background: var(--raise);
  border: 1px solid var(--hair);
  border-left: 3px solid var(--line-2);
  padding: 16px;
  animation: riseIn var(--base) var(--ease) both;
}
.book-card.bl  { border-left-color: var(--gold); }
.book-card.sl  { border-left-color: var(--gold-dim); }
.book-card.vip { border-left-color: #8caaff; }
.book-card.eh  { border-left-color: var(--jade); }
.book-card.mem { border-left-color: var(--muted-2); }
.book-card header { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.book-card small { color: var(--muted-2); }
.book-card ul { margin: 0; padding-left: 18px; }
.book-card li { color: var(--ink-2); line-height: 1.55; margin-bottom: 6px; font-size: 0.88rem; }
.rules-box {
  border-radius: var(--r-card);
  background: var(--veil);
  border: 1px solid var(--hair);
}

/* Hinweis oben, z. B. neue Freundschaftsanfrage */
.friend-note {
  background: var(--raise-2);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border: 1px solid var(--line-2);
  box-shadow: var(--lift-lg);
  animation: noteIn 340ms var(--spring) both;
}
@keyframes noteIn {
  from { opacity: 0; transform: translate(-50%, -16px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

/* ==========================================================================
   10 — Einladung, Mitteilungen einzuschalten
   ========================================================================== */

.push-nudge {
  position: fixed;
  left: 50%;
  bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  z-index: 80;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(94vw, 420px);
  padding: 12px 14px;
  border-radius: 999px;
  background: var(--raise-2);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  border: 1px solid var(--line-2);
  box-shadow: var(--lift-lg);
  color: var(--ink);
  font-size: 0.86rem;
  font-family: inherit;
  cursor: pointer;
  opacity: 0;
  transform: translate(-50%, 16px);
  transition: opacity var(--base) var(--ease), transform var(--base) var(--spring);
}
.push-nudge.show { opacity: 1; transform: translate(-50%, 0); }
.push-nudge-txt { flex: 1; text-align: left; }
.push-nudge-x { color: var(--muted-2); padding: 0 2px; font-size: 0.9rem; }

/* ==========================================================================
   11 — Ankündigungen
   ========================================================================== */

.pin-bar, .reply-bar {
  border-radius: var(--r-panel);
  background: var(--raise);
  border: 1px solid var(--hair);
  animation: riseIn var(--base) var(--ease) both;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.pin-bar .pin-label {
  flex: 0 0 auto;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted-2);
  white-space: nowrap;
}
.pin-bar .pin-body {
  flex: 1 1 140px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink-2);
}
.pin-bar .pin-body b { color: var(--gold-2); font-weight: 600; }
.pin-bar .pin-acts { flex: 0 0 auto; display: flex; gap: 6px; margin-left: auto; }
.pin-bar .pin-acts .ghost { padding: 4px 10px; font-size: 0.75rem; border-radius: 999px; }

.pin-bar.is-announce {
  background: linear-gradient(100deg, rgba(240, 196, 58, 0.15), rgba(240, 196, 58, 0.03));
  border-color: var(--line-2);
  box-shadow: 0 0 0 1px rgba(240, 196, 58, 0.1), var(--lift);
}
.pin-bar.is-announce .pin-label { color: var(--gold); }

.msg-row.announce-row .msg {
  border: 1px solid var(--line-2);
  background: linear-gradient(160deg, rgba(240, 196, 58, 0.13), var(--bubble-in));
}
.tag-ann {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 650;
  color: #241a02;
  background: var(--gold);
  vertical-align: middle;
}
.tag-pin { margin-left: 5px; opacity: 0.7; font-size: 0.68rem; }

.msg-row.flash > * { animation: flashMsg 1.5s ease; }
@keyframes flashMsg {
  0%, 100% { box-shadow: 0 8px 24px rgba(0, 0, 0, 0.26); }
  15%      { box-shadow: 0 0 0 2px var(--gold); }
  60%      { box-shadow: 0 0 0 2px rgba(240, 196, 58, 0.35); }
}

/* ==========================================================================
   12 — Umfragen
   ========================================================================== */

.poll p { color: var(--gold-2); font-weight: 600; }
.poll-opt {
  border-radius: 11px;
  border: 1px solid var(--hair);
  background: var(--veil);
  color: var(--ink-2);
  padding: 9px 12px;
}
.poll-opt:hover { border-color: var(--line); background: var(--gold-wash); }
.poll-opt.mine { border-color: var(--line-2); background: var(--gold-wash); color: var(--gold-2); }
.msg.mine .poll-opt { border-color: rgba(0, 0, 0, 0.16); background: rgba(0, 0, 0, 0.08); color: #3f3104; }

/* ==========================================================================
   13 — Rücksicht auf Menschen, die Bewegung nicht vertragen
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ==========================================================================
   14 — Nachbesserungen nach dem ersten Test auf dem iPhone
   ========================================================================== */

/* Das Suchfeld erschien HINTER den Nachrichten. Ursache: der
   Weichzeichner auf .chat-head erzeugt einen eigenen Stapelkontext,
   in dem das z-index des Menüs gefangen bleibt. Die Kopfzeile selbst
   muss also über der Nachrichtenliste liegen. */
.chat-head { z-index: 30; }
.composer  { z-index: 26; }
.pop-menu  { z-index: 40; }
.messages  { z-index: 1; }

/* Das Menü war durchscheinend und ließ den Text darunter durchschlagen. */
.pop-menu {
  background: rgba(14, 24, 41, 0.97);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  backdrop-filter: blur(22px) saturate(150%);
}

/* Der Menüknopf lag auf dem "A" von Allgemein. */
@media (max-width: 860px) {
  .chat-head { padding-left: 76px; }
  .ocak-top  { padding-left: 68px; }
}
.menu-toggle {
  background: rgba(14, 24, 41, 0.9);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-radius: 15px;
}

/* Kopfzeile der Nachricht: Name, Rang und Uhrzeit dürfen nicht mehr
   umbrechen und die Blase in die Breite ziehen. */
.msg .meta {
  flex-wrap: nowrap;
  align-items: center;
  font-size: 0.68rem;
  gap: 8px;
}
.msg .author {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.78rem;
}
.msg .meta > span:last-child { flex: 0 0 auto; white-space: nowrap; display: inline-flex; align-items: center; }
.msg .more-msg { float: none; margin-left: 2px; line-height: 1; }

/* Rangabzeichen: das Rot des Bundesleiters stand auf goldenem Grund und
   war kaum lesbar. Jetzt kräftiger Grund, heller Text — und in der
   eigenen goldenen Blase umgekehrt. */
.rank-tag, .book-rank {
  padding: 2px 7px;
  font-size: 0.6rem;
  line-height: 1.4;
  flex: 0 0 auto;
}
.rank-bl, .author.rank-bl {
  background: #9e2b23;
  color: #ffe0dc !important;
  border: 1px solid rgba(255, 255, 255, 0.16);
}
.msg.mine .rank-bl, .msg.mine .author.rank-bl {
  background: #7d1f18;
  color: #ffe8e5 !important;
  border-color: rgba(0, 0, 0, 0.2);
}
#role-badge.rank-bl { background: transparent; color: #e8736b; border-color: rgba(232, 115, 107, 0.5); }

/* Der Reaktionsknopf war ein großer Kreis unter jeder Nachricht. */
.reacts { margin-top: 6px; gap: 5px; }
.reacts .radd {
  width: 24px;
  height: 24px;
  min-width: 24px;
  padding: 0;
  font-size: 13px;
  line-height: 1;
  display: grid;
  place-items: center;
  color: var(--muted-2);
  background: transparent;
  border: 1px solid var(--hair);
  opacity: 0.55;
}
.reacts .radd:hover { opacity: 1; border-color: var(--line); }
.msg.mine .reacts .radd { border-color: rgba(0, 0, 0, 0.18); color: #6b5409; }
.reacts .rchip { padding: 3px 9px; font-size: 12px; }

/* Blasen sollen sich an den Text anpassen, nicht an die Kopfzeile. */
.msg { min-width: 0; }
.msg .body { min-width: 0; }

/* Bild und Blase auf einer Grundlinie. */
.msg-row { align-items: flex-end; gap: 7px; }
.av-msg { margin-bottom: 1px; border-width: 1px; }

/* ==========================================================================
   15 — Zweiter Testdurchlauf
   ========================================================================== */

/* Das Rangabzeichen wurde abgeschnitten ("STANDORTLE", "BUNDESL"),
   weil der ganze Namensblock beschnitten wurde. Jetzt weicht der Name,
   das Abzeichen bleibt vollständig. */
.msg .author { overflow: visible; flex: 0 1 auto; }
.msg .aname {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rank-tag, .book-rank { flex: 0 0 auto; white-space: nowrap; overflow: visible; }

/* Ankreuzfelder waren riesige weiße Kästen: die allgemeine input-Regel
   gab ihnen Polsterung, Rahmen und Hintergrund. */
input[type="checkbox"], input[type="radio"] {
  width: 20px;
  height: 20px;
  min-width: 20px;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  accent-color: var(--gold);
  flex: 0 0 auto;
}
input[type="radio"] { border-radius: 50%; }
.check-row { padding: 10px 12px; }

/* Feldbeschriftungen standen in gesperrten Großbuchstaben. */
label {
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.8rem;
  font-weight: 550;
  color: var(--muted);
}

/* Antwort-Vorschau: im hellen eigenen Ballon war sie kaum lesbar. */
.reply-snip {
  font-size: 0.78rem;
  padding: 5px 9px;
  margin-bottom: 7px;
  background: rgba(255, 255, 255, 0.05);
  border-left: 2px solid var(--gold-dim);
  border-radius: 0 9px 9px 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.msg.mine .reply-snip {
  background: rgba(0, 0, 0, 0.09);
  border-left-color: rgba(0, 0, 0, 0.35);
  color: #5a4708;
}

/* Siegel im Ocak: fester Ausschnitt und dunkler Grund, damit ein
   langsam ladendes Bild nicht als leerer Ring erscheint. */
.ocak-seal, .login-seal, .brand img {
  object-fit: cover;
  object-position: center;
  background: #0a1729 center / cover no-repeat;
}
.ocak-seal { width: 52px; height: 52px; }

/* Fenster dürfen nie über den Bildschirmrand hinauslaufen. */
.modal-card {
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: max(18px, env(safe-area-inset-bottom, 0px));
}

/* Die Kopfzeile im Ocak: Überschrift war gesperrt bis zur Unlesbarkeit. */
.ocak-top strong { letter-spacing: 0.2em; font-size: 1rem; }
.ocak-top { gap: 14px; }

/* Buttons im Profilfenster einheitlich auf volle Breite und ruhiger. */
.modal-card .ghost {
  width: 100%;
  margin-bottom: 6px;
  padding: 12px 14px;
  border-radius: var(--r-field);
}
.mem-acts, .prof-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.mem-acts .ghost, .prof-acts .ghost { width: auto; flex: 1 1 auto; }
