﻿:root {
  --bg: #0e1f2f;
  --bg-soft: #112f45;
  --panel: #163f5d;
  --card: #1c4b6d;
  --text: #e7f6ff;
  --muted: #9fc0d6;
  --accent: #2ec7a4;
  --accent-strong: #1db590;
  --danger: #f95b5b;
  --border: rgba(255, 255, 255, 0.15);
  --font-main: "Trebuchet MS", "Verdana", sans-serif;
  --font-title: "Palatino Linotype", "Book Antiqua", serif;
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100%;
  background:
    radial-gradient(circle at 20% 20%, rgba(46, 199, 164, 0.22), transparent 32%),
    radial-gradient(circle at 90% 0%, rgba(33, 120, 220, 0.25), transparent 35%),
    linear-gradient(155deg, var(--bg), #0a1624);
  color: var(--text);
  font-family: var(--font-main);
}

.auth-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.auth-shell {
  width: min(96vw, 460px);
  animation: rise-in 0.45s ease;
}

.auth-card {
  border: 1px solid var(--border);
  background: rgba(9, 22, 37, 0.85);
  backdrop-filter: blur(8px);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

.auth-card h1 {
  margin: 0;
  font-family: var(--font-title);
  letter-spacing: 0.04em;
}

.auth-logo {
  width: 72px;
  height: 72px;
  display: block;
  margin: 0 auto 10px;
  object-fit: contain;
}

.subtitle {
  color: var(--muted);
  margin-top: 6px;
  margin-bottom: 18px;
}

form label {
  display: block;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 14px;
}

input,
select,
textarea,
button {
  font-family: var(--font-main);
  min-width: 0;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(8, 17, 29, 0.75);
  color: var(--text);
  padding: 10px 12px;
  outline: none;
}

textarea {
  resize: vertical;
  min-height: 86px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(46, 199, 164, 0.2);
}

button {
  border: none;
  border-radius: 10px;
  cursor: pointer;
  padding: 9px 14px;
  max-width: 100%;
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  transition: transform 0.16s ease, opacity 0.16s ease, background 0.16s ease;
}

button:hover {
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
}

.primary-btn {
  background: linear-gradient(130deg, var(--accent), var(--accent-strong));
  color: #08221b;
  font-weight: 700;
}

.secondary-btn {
  background: rgba(255, 255, 255, 0.14);
  color: var(--text);
}

a.primary-btn,
a.secondary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border-radius: 10px;
  padding: 9px 14px;
  line-height: 1;
}

.secondary-btn.danger,
.menu-item.danger {
  background: rgba(249, 91, 91, 0.24);
  color: #ffd4d4;
}

.mode-switch {
  display: flex;
  gap: 8px;
  margin: 14px 0;
}

.mode-btn {
  flex: 1;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.mode-btn.active {
  background: rgba(46, 199, 164, 0.25);
  color: #d9fff5;
}

.error-text {
  min-height: 1.2em;
  color: #ffb9b9;
  margin: 10px 0;
}

.switch-link {
  margin-top: 12px;
  color: var(--muted);
}

a {
  color: #8fd6ff;
}

.hidden {
  display: none !important;
}

.app-shell {
  margin-left: 320px;
  min-height: 100vh;
  transition: margin-left 0.25s ease;
}

.left-menu {
  position: fixed;
  inset: 0 auto 0 0;
  width: 320px;
  border-right: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(11, 28, 44, 0.94), rgba(8, 22, 34, 0.92));
  backdrop-filter: blur(9px);
  display: flex;
  flex-direction: column;
  z-index: 30;
  transition: transform 0.25s ease;
}

.profile-top {
  min-height: 170px;
  padding: 18px;
  background:
    linear-gradient(130deg, rgba(46, 199, 164, 0.2), rgba(33, 120, 220, 0.3)),
    rgba(4, 14, 25, 0.72);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-end;
  gap: 14px;
}

.menu-avatar {
  width: 62px;
  height: 62px;
  min-width: 62px;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.menu-name {
  font-size: 18px;
  font-weight: 700;
}

.menu-username {
  color: var(--muted);
  font-size: 14px;
}

.menu-nav {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  overflow: auto;
}

.menu-item {
  text-align: left;
  background: transparent;
  color: var(--text);
  border: 1px solid transparent;
}

.menu-item.active,
.menu-item:hover {
  background: rgba(46, 199, 164, 0.15);
  border-color: rgba(46, 199, 164, 0.3);
}

.menu-bottom {
  padding: 10px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
}

.menu-gear {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
  font-size: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.menu-gear.active {
  background: rgba(46, 199, 164, 0.28);
  border-color: rgba(46, 199, 164, 0.55);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  background: rgba(11, 22, 35, 0.8);
  backdrop-filter: blur(7px);
}

.top-title {
  font-size: 18px;
  font-weight: 700;
}

.top-online {
  margin-left: auto;
  color: #7eff9e;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.call-mini-widget {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: 8px;
  padding: 6px 8px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 999px;
  background: rgba(11, 18, 28, 0.84);
  backdrop-filter: blur(12px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.34);
}

.call-mini-avatar {
  width: 34px;
  height: 34px;
  min-width: 34px;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.call-mini-btn {
  min-width: 34px;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.32);
  background: rgba(255, 255, 255, 0.14);
  color: #eff5ff;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}

.call-mini-btn.danger {
  background: linear-gradient(160deg, rgba(255, 89, 109, 0.95), rgba(217, 48, 78, 0.95));
  border-color: rgba(255, 122, 140, 0.65);
  color: #fff;
}

.online-antenna {
  width: 20px;
  height: 16px;
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
}

.online-antenna-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #54ff87;
  box-shadow: 0 0 8px rgba(84, 255, 135, 0.5);
}

.online-antenna-bar {
  width: 3px;
  border-radius: 2px;
  background: #54ff87;
  box-shadow: 0 0 7px rgba(84, 255, 135, 0.45);
  animation: pulse-signal 1.3s ease-in-out infinite;
}

.online-antenna-bar-1 { height: 6px; animation-delay: 0s; }
.online-antenna-bar-2 { height: 10px; animation-delay: 0.12s; }
.online-antenna-bar-3 { height: 14px; animation-delay: 0.24s; }

.upload-progress {
  margin: 0 14px 12px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid rgba(46, 199, 164, 0.42);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.33);
}

.upload-progress-track {
  height: 16px;
  border-radius: 999px;
  border: 1px solid rgba(126, 255, 158, 0.55);
  background: rgba(22, 64, 30, 0.52);
  overflow: hidden;
}

.upload-progress-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #3dff8f, #12a889);
  transition: width 0.12s linear;
  box-shadow: 0 0 18px rgba(61, 255, 143, 0.55);
}

.upload-progress-text {
  font-size: 13px;
  color: #c6ffd7;
  min-width: 90px;
  text-align: right;
  font-weight: 700;
}

.icon-btn {
  background: rgba(255, 255, 255, 0.14);
  color: var(--text);
  min-width: 42px;
}

.view {
  display: none;
  padding: 14px;
  animation: fade-in 0.25s ease;
}

.view.active {
  display: block;
}

.split-layout {
  display: grid;
  grid-template-columns: minmax(260px, 360px) 1fr;
  gap: 12px;
}

.split-layout.chat-shell {
  position: relative;
  display: block;
  min-height: calc(100vh - 104px);
  height: calc(100vh - 104px);
}

.panel,
.chat-list-panel,
.chat-room-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(13, 30, 48, 0.8);
  padding: 12px;
}

.chat-list-panel,
.chat-room-panel {
  min-height: calc(100vh - 110px);
}

.chat-room-panel {
  display: none;
  position: absolute;
  inset: 0;
  flex-direction: column;
  min-height: calc(100vh - 104px);
  overflow: hidden;
}

.chat-header {
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
}

body.chat-open .chat-room-panel {
  display: flex;
}

body.chat-open .chat-list-panel {
  display: none;
}

body.chat-open #view-chats {
  padding: 0;
}

body.chat-open .split-layout.chat-shell {
  min-height: calc(100dvh - 62px);
  height: calc(100dvh - 62px);
}

body.chat-open .chat-room-panel,
body.chat-open .chat-list-panel {
  border-radius: 0;
  border-left: none;
  border-right: none;
}

body.chat-open .left-menu {
  transform: translateX(-105%);
}

body.chat-open .app-shell {
  margin-left: 0;
}

body.chat-open.menu-open .left-menu {
  transform: translateX(0);
}

body.chat-open.menu-open .app-shell {
  margin-left: 320px;
}

.chat-room-top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 10px;
}

.chat-top-actions {
  margin-left: auto;
  display: inline-flex;
  gap: 8px;
}

.call-top-btn {
  min-width: 42px;
  min-height: 40px;
  padding: 0;
  font-size: 18px;
  font-weight: 700;
}

.chat-partner-text {
  min-width: 0;
}

.chat-info-name {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  color: inherit;
  padding: 0;
}

#chat-partner-name,
#chat-partner-status {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-online {
  color: #4cff85;
  font-weight: 700;
}

.status-offline {
  color: #ff7474;
  font-weight: 700;
}

.chat-dropzone {
  position: absolute;
  inset: 72px 12px 64px 12px;
  z-index: 6;
  border: 2px dashed var(--accent);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  color: #dcfff5;
  background: rgba(10, 33, 28, 0.86);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.stories-topbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-bottom: 8px;
}

.stories-list {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 6px 2px 8px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.stories-empty {
  color: var(--muted);
  font-size: 13px;
  padding: 6px 0;
}

.story-chip {
  min-width: 84px;
  max-width: 84px;
  padding: 0;
  background: transparent;
  border-radius: 10px;
  border: 1px solid transparent;
}

.story-chip-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.story-avatar-ring {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  padding: 2px;
  display: grid;
  place-items: center;
  background: var(--story-ring, linear-gradient(145deg, #57e9ff, #52ff9c));
}

.story-avatar-ring img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(7, 18, 30, 0.92);
}

.story-chip-name {
  font-size: 12px;
  line-height: 1.1;
  text-align: center;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.list.compact .item {
  padding: 8px;
}

.item {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
  overflow: hidden;
}

.item:hover {
  border-color: rgba(46, 199, 164, 0.45);
}

.item-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.item-avatar {
  width: 44px;
  height: 44px;
  min-width: 44px;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 auto;
}

.item-text {
  min-width: 0;
}

.item-title {
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.verified {
  color: #58d2ff;
}

.verified-badge {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(145deg, #4db4ff, #1d87ff);
  color: #ffffff;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.16), 0 4px 10px rgba(0, 85, 255, 0.35);
  transform: translateY(1px);
}

.live-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  background: #ff3434;
  box-shadow: 0 0 0 2px rgba(255, 52, 52, 0.22);
}

.item-sub {
  color: var(--muted);
  font-size: 13px;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.badge {
  background: rgba(46, 199, 164, 0.3);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
}

.messages {
  flex: 1;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(3, 12, 20, 0.5);
}

.stream-video {
  width: 100%;
  max-height: min(70vh, 520px);
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #03080f;
  object-fit: contain;
}

#streaming-list .item {
  align-items: center;
}

.stream-watch-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stream-chat-list {
  max-height: min(42vh, 360px);
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(3, 12, 20, 0.5);
}

.stream-chat-form {
  margin-top: 10px;
  display: flex;
  gap: 8px;
}

.stream-chat-form input {
  flex: 1;
}

.stream-chat-note {
  margin-top: 10px;
}

.stream-chat-msg {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 8px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.stream-chat-msg.self {
  border-color: rgba(46, 199, 164, 0.45);
  background: rgba(46, 199, 164, 0.14);
}

.stream-chat-msg-avatar {
  width: 30px;
  height: 30px;
  min-width: 30px;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.stream-chat-msg-main {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.stream-chat-msg-head {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.stream-chat-msg-name {
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  margin: 0;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.stream-chat-msg-time {
  color: var(--muted);
  font-size: 12px;
}

.stream-chat-msg-text {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.msg {
  max-width: min(88%, 600px);
  border-radius: 12px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  position: relative;
  user-select: text;
}

.msg.flash-target {
  box-shadow: 0 0 0 2px rgba(126, 255, 158, 0.65);
}

.msg-forwarded {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
  border-left: 2px solid rgba(46, 199, 164, 0.5);
  padding-left: 6px;
}

.msg.self {
  margin-left: auto;
  background: rgba(46, 199, 164, 0.2);
}

.msg.peer {
  margin-right: auto;
  background: rgba(255, 255, 255, 0.08);
}

.msg-head {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
  gap: 8px;
}

.msg-head span {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.msg img.inline-photo {
  max-width: 240px;
  border-radius: 8px;
  cursor: zoom-in;
}

.msg .inline-video-player {
  width: min(100%, 420px);
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #000;
}

.video-note-wrap {
  width: 190px;
  height: 190px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(46, 199, 164, 0.5);
  background: rgba(0, 0, 0, 0.62);
}

.video-note-player {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.sticker-pack-line {
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.sticker-pack-line .secondary-btn {
  padding: 4px 8px;
  font-size: 12px;
}

.msg audio {
  width: 100%;
  height: 34px;
}

.audio-message-card {
  margin-top: 6px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px;
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 8px;
  align-items: center;
  background: rgba(255, 255, 255, 0.07);
}

.audio-message-card.voice-message-card .audio-cover {
  display: none;
}

.audio-message-card.voice-message-card {
  grid-template-columns: 1fr;
  background: rgba(46, 199, 164, 0.16);
  border-color: rgba(46, 199, 164, 0.36);
  padding: 10px 10px 8px;
}

.audio-message-card.voice-message-card .audio-track-title {
  font-size: 12px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

.audio-message-card.voice-message-card .audio-player {
  border-radius: 999px;
  padding: 4px 8px 4px 4px;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
}

.audio-message-card.voice-message-card .audio-toggle {
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  border-radius: 50%;
  padding: 0;
}

.audio-message-card.voice-message-card .audio-time {
  min-width: 74px;
}

.audio-cover {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.28);
}

.audio-meta {
  min-width: 0;
}

.audio-track-title {
  font-size: 13px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audio-track-artist {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audio-player {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  background: rgba(255, 255, 255, 0.07);
  position: relative;
}

.audio-native {
  display: none;
}

.audio-progress {
  width: 100%;
}

.audio-time {
  color: var(--muted);
  font-size: 12px;
  min-width: 86px;
  text-align: right;
}

.audio-volume-toggle {
  width: 32px;
  min-width: 32px;
  height: 32px;
  min-height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.audio-volume-wrap {
  position: absolute;
  right: 8px;
  top: calc(100% + 6px);
  z-index: 8;
  width: 140px;
  background: rgba(8, 18, 28, 0.96);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.audio-volume-wrap.hidden {
  display: none !important;
}

.audio-volume {
  width: 100%;
}

.msg-call-log {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.06);
  display: grid;
  gap: 4px;
}

.msg-call-log.missed {
  border-color: rgba(255, 99, 99, 0.55);
  background: rgba(255, 99, 99, 0.14);
}

.msg-call-log.declined {
  border-color: rgba(255, 176, 73, 0.55);
  background: rgba(255, 176, 73, 0.16);
}

.msg-call-log-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.msg-call-log-sub {
  color: var(--muted);
  font-size: 12px;
}

.geo-picker-card {
  max-width: min(94vw, 760px);
}

.geo-picker-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.geo-map-stage {
  position: relative;
  width: 100%;
  height: min(62vh, 430px);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(6, 14, 22, 0.72);
}

.geo-map-grid {
  position: absolute;
  inset: 0;
}

.geo-map-tile {
  position: absolute;
  width: 256px;
  height: 256px;
  user-select: none;
  pointer-events: none;
}

.geo-map-crosshair {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid #ff5a5a;
  color: #ff5a5a;
  font-weight: 800;
  line-height: 18px;
  text-align: center;
  background: rgba(0, 0, 0, 0.35);
  pointer-events: none;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2);
}

.profile-stories {
  margin-top: 14px;
}

.profile-stories-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.profile-story-pill {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  color: inherit;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
}

.profile-tracks-list {
  margin-top: 12px;
  display: grid;
  gap: 10px;
}

.profile-track-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.05);
}

.profile-track-title {
  font-size: 13px;
  font-weight: 700;
}

.profile-track-artist {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
  margin-bottom: 6px;
}

.profile-track-item audio {
  width: 100%;
}

.ban-screen {
  position: fixed;
  inset: 0;
  z-index: 1400;
  background: radial-gradient(circle at 50% 20%, rgba(255, 125, 125, 0.28), rgba(15, 0, 0, 0.95));
  display: grid;
  place-items: center;
  padding: 20px;
}

.ban-screen-card {
  width: min(96vw, 560px);
  border: 1px solid rgba(255, 130, 130, 0.42);
  border-radius: 14px;
  padding: 20px;
  background: rgba(25, 7, 11, 0.95);
  text-align: center;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45);
}

.ban-screen-card h2 {
  margin: 0 0 10px;
  color: #ffb3b3;
}

.ban-screen-card p {
  margin: 0 0 14px;
  color: #ffd9d9;
}

.ban-screen-card .primary-btn {
  display: inline-flex;
}

.ban-screen.hidden {
  display: none !important;
}

.record-modal-card {
  width: min(94vw, 420px);
}

.record-preview-wrap {
  width: 100%;
  min-height: 180px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.5);
  display: grid;
  place-items: center;
  margin: 10px 0;
  overflow: hidden;
}

.record-video-preview {
  width: 100%;
  max-height: 300px;
  object-fit: cover;
}

.record-audio-preview {
  font-size: 28px;
  font-weight: 700;
  color: #ff6a6a;
  letter-spacing: 0.06em;
  animation: pulse-signal 1.1s ease-in-out infinite;
}

.call-modal-card {
  display: grid;
  grid-template-rows: auto 1fr auto;
  background:
    radial-gradient(circle at 22% 12%, rgba(89, 162, 255, 0.16), transparent 36%),
    radial-gradient(circle at 85% 85%, rgba(51, 212, 161, 0.15), transparent 40%),
    rgba(7, 12, 21, 0.95);
}

.call-toolbar {
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(8, 14, 24, 0.58);
  backdrop-filter: blur(10px);
}

.call-toolbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.call-peer {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.call-peer-text {
  min-width: 0;
}

.call-peer .item-avatar {
  width: 42px;
  height: 42px;
  min-width: 42px;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.36);
  object-fit: cover;
}

.call-stage {
  position: relative;
  width: 100%;
  height: min(70vh, 560px);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background:
    radial-gradient(circle at 25% 15%, rgba(89, 164, 255, 0.24), transparent 42%),
    radial-gradient(circle at 80% 85%, rgba(49, 211, 154, 0.22), transparent 44%),
    linear-gradient(150deg, rgba(18, 30, 50, 0.96), rgba(6, 12, 22, 0.96));
  overflow: hidden;
}

.call-stage-name {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 6;
  max-width: min(92%, 520px);
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.36);
  background: rgba(10, 17, 28, 0.66);
  color: #ecf3ff;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.call-audio-avatar-wrap {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 1;
  pointer-events: none;
}

.call-audio-avatar {
  width: min(40vw, 240px);
  height: min(40vw, 240px);
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.45);
  box-shadow: 0 14px 45px rgba(0, 0, 0, 0.5);
}

.call-remote-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
  position: relative;
  z-index: 2;
}

.call-local-video {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: min(36%, 210px);
  aspect-ratio: 4 / 3;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.46);
  background: #000;
  object-fit: cover;
  z-index: 3;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
}

.call-room-panel {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 8px;
  padding: 12px;
  background: rgba(4, 10, 18, 0.58);
  overflow: auto;
}

#call-room-users .item {
  background: rgba(10, 18, 29, 0.86);
}

.call-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 12px;
  padding: 12px 16px 20px;
  justify-content: center;
  gap: 14px;
}

#call-answer-btn,
#call-decline-btn,
#call-mute-btn,
#call-output-btn,
#call-camera-btn,
#call-hangup-btn {
  min-width: 62px;
  min-height: 62px;
  border-radius: 999px;
  font-size: 24px;
  line-height: 1;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.34);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(10px);
}

#call-answer-btn {
  background: linear-gradient(160deg, #33d185, #26b96f);
  color: #f4fff8;
}

#call-decline-btn,
#call-hangup-btn {
  background: linear-gradient(160deg, #ff5e79, #d73d5b);
  color: #fff5f7;
}

#call-mute-btn,
#call-output-btn,
#call-camera-btn,
#call-close-btn,
#call-minimize-btn {
  background: rgba(255, 255, 255, 0.16);
  color: #ecf3ff;
  border: 1px solid rgba(255, 255, 255, 0.34);
}

#call-close-btn,
#call-minimize-btn {
  min-width: 42px;
  min-height: 42px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.msg-file {
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 8px;
}

.msg-reply {
  margin-bottom: 6px;
  border-left: 3px solid rgba(126, 255, 158, 0.7);
  padding: 4px 8px;
  border-radius: 8px;
  background: rgba(10, 26, 40, 0.52);
  cursor: pointer;
}

.msg-reply-title {
  font-size: 12px;
  font-weight: 700;
  color: #7eff9e;
}

.msg-reply-text {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.msg-poll-option {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.message-form {
  margin-top: 10px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
}

.reply-preview {
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  background: rgba(12, 28, 42, 0.7);
}

.reply-preview-text {
  min-width: 0;
}

.reply-preview-title {
  color: #7eff9e;
  font-size: 12px;
  font-weight: 700;
}

.reply-preview-body {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: min(76vw, 620px);
}

.chat-room-panel.channel-readonly .message-form,
.chat-room-panel.channel-readonly .reply-preview,
.chat-room-panel.channel-readonly .attachment-menu {
  display: none !important;
}

.attachment-menu {
  position: absolute;
  left: 12px;
  bottom: 68px;
  z-index: 12;
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(5, 14, 24, 0.95);
  min-width: 180px;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.45);
}

.attachment-item {
  background: rgba(255, 255, 255, 0.09);
  color: var(--text);
  text-align: left;
  white-space: nowrap;
}

.media-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.media-tabs .secondary-btn.active {
  background: rgba(46, 199, 164, 0.3);
  border: 1px solid rgba(46, 199, 164, 0.55);
}

.media-panel {
  position: relative;
  padding-bottom: 84px;
}

.media-item {
  display: grid;
  gap: 8px;
}

.media-cover {
  width: 100%;
  max-height: 260px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
}

.media-item h4 {
  margin: 0;
  font-size: 15px;
}

.media-item video,
.media-item audio {
  width: 100%;
  border-radius: 10px;
}

.media-meta {
  color: var(--muted);
  font-size: 12px;
}

.media-sender-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  margin: 0;
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.media-fab {
  position: absolute;
  right: 16px;
  bottom: 16px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  font-size: 30px;
  line-height: 1;
  padding: 0;
  border: 1px solid rgba(46, 199, 164, 0.45);
  background: linear-gradient(140deg, var(--accent), var(--accent-strong));
  color: #05271e;
  font-weight: 700;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
}

.media-fab:hover {
  transform: translateY(-2px);
}

.inline-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.inline-form > * {
  min-width: 0;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 10px;
}

.settings-sections {
  display: grid;
  gap: 14px;
}

.settings-section-block {
  display: grid;
  gap: 10px;
}

.settings-section-head {
  display: grid;
  gap: 2px;
  padding: 6px 2px 2px;
}

.settings-section-head h3 {
  margin: 0;
  font-size: 19px;
}

.setting-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.05);
  overflow: hidden;
}

.other-projects-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.other-project-card {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(94, 200, 255, 0.22);
  background:
    radial-gradient(circle at 0% 0%, rgba(54, 203, 176, 0.16), transparent 40%),
    radial-gradient(circle at 100% 0%, rgba(67, 132, 255, 0.2), transparent 42%),
    rgba(9, 21, 35, 0.84);
  color: var(--text);
  text-decoration: none;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.other-project-card:hover {
  transform: translateY(-2px);
  border-color: rgba(94, 200, 255, 0.42);
  box-shadow: 0 18px 30px rgba(0, 0, 0, 0.24);
}

.other-project-logo {
  width: 72px;
  height: 72px;
  object-fit: contain;
  filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.32));
}

.other-project-body {
  min-width: 0;
}

.other-project-name {
  font-size: 18px;
  font-weight: 800;
}

.setting-card h3 {
  margin-top: 2px;
}

.setting-card form {
  display: grid;
  gap: 10px;
}

.field-label {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.toggle-field {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 14px;
  margin-top: 6px;
  cursor: pointer;
}

.toggle-field input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: #38d680;
  cursor: pointer;
}

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

.permission-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
}

.permission-title {
  font-weight: 700;
}

.file-picker-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.file-picked-name {
  font-size: 12px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.media-native-input {
  margin-top: 6px;
}

.profile-link {
  cursor: pointer;
}

.profile-link:hover {
  filter: brightness(1.05);
}

.msg-sender-btn,
.entity-member-profile-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  margin: 0;
  font: inherit;
  cursor: pointer;
  text-align: left;
}

.msg-sender-btn:hover,
.entity-member-profile-btn:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.media-publish-card {
  width: min(96vw, 760px);
}

.media-kind-switch {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.media-step {
  display: grid;
  gap: 10px;
}

.media-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.media-preview-cell {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.04);
  min-height: 120px;
}

.media-preview-image,
.media-preview-video,
.media-post-file-preview-image,
.media-post-file-preview-video {
  width: 100%;
  max-height: 220px;
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.3);
}

.media-preview-audio,
.media-post-file-preview-audio {
  width: 100%;
}

.media-post-files-preview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.media-post-file-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.03);
  display: grid;
  gap: 6px;
}

.user-picker-card {
  width: min(94vw, 680px);
}

#user-picker-list {
  max-height: min(56vh, 520px);
  overflow: auto;
}

.user-picker-item {
  text-align: left;
}

.user-picker-item.selected {
  border-color: rgba(46, 199, 164, 0.6);
  background: rgba(46, 199, 164, 0.18);
}

.user-picker-check {
  min-width: 24px;
  text-align: right;
  font-weight: 700;
  color: var(--accent);
}

.media-post-attachments {
  display: grid;
  gap: 8px;
}

.media-attachment-row {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.03);
  display: grid;
  gap: 6px;
}

.profile-preview-banner {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.code-editor {
  width: 100%;
  min-height: 220px;
  border-radius: 12px;
  margin-top: 10px;
  font-family: "Lucida Console", "Consolas", monospace;
  font-size: 14px;
}

.game-explorer {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.game-explorer-toolbar {
  margin-top: 0;
}

.game-explorer-hint {
  margin-top: 8px;
  margin-bottom: 8px;
}

.game-path-breadcrumb {
  margin-top: 8px;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.game-table-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.game-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
}

.game-table th,
.game-table td {
  border-bottom: 1px solid var(--border);
  padding: 8px;
  text-align: left;
  vertical-align: top;
}

.game-table thead th {
  position: sticky;
  top: 0;
  background: rgba(6, 15, 24, 0.94);
  z-index: 1;
}

.game-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.06);
}

.game-entry-row {
  cursor: pointer;
  user-select: none;
}

.game-entry-row.active {
  background: rgba(46, 199, 164, 0.14);
}

.game-entry-name {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.vscode-file-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 22px;
  padding: 0 7px;
  border-radius: 7px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #fff;
  background: #5f6d82;
  border: 1px solid rgba(255, 255, 255, 0.22);
  vertical-align: middle;
}

.vscode-icon-folder { background: #c9962c; }
.vscode-icon-js { background: #d4bc1c; color: #222; }
.vscode-icon-ts { background: #2d7cd6; }
.vscode-icon-json { background: #a77a2e; }
.vscode-icon-html { background: #d66f2d; }
.vscode-icon-css { background: #4156df; }
.vscode-icon-py { background: linear-gradient(135deg, #3477ab, #ffd847); color: #1f2937; }
.vscode-icon-md { background: #585f67; }
.vscode-icon-img { background: #2cb36f; }
.vscode-icon-audio { background: #8a54d6; }
.vscode-icon-video { background: #d64a6e; }
.vscode-icon-archive { background: #7d5c36; }
.vscode-icon-php { background: #5e6ad2; }
.vscode-icon-java { background: #f27521; }
.vscode-icon-c { background: #4b7cd6; }
.vscode-icon-rust { background: #c86c30; }
.vscode-icon-go { background: #23a8e0; color: #082030; }
.vscode-icon-shell { background: #2f9f66; }
.vscode-icon-file { background: #5f6d82; }

.game-actions {
  margin-top: 0;
}

.game-trash-head {
  align-items: center;
}

.game-trash-head h3 {
  margin: 0;
}

.game-trash-entry-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.game-entry-menu-card {
  width: min(92vw, 460px);
}

.game-entry-menu-actions {
  grid-template-columns: 1fr 1fr;
}

.sticker-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 8px;
}

.sticker-grid img {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--border);
  cursor: pointer;
}

.sticker-grid .item-sub {
  grid-column: 1 / -1;
}

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

.modal-card,
.viewer-card {
  width: min(92vw, 620px);
  max-height: 90vh;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(8, 20, 31, 0.95);
  padding: 14px;
}

.viewer-card {
  text-align: center;
}

.viewer-card.fullscreen {
  width: 100vw;
  height: 100vh;
  max-height: 100vh;
  border-radius: 0;
  border: none;
  padding: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  background: rgba(2, 8, 15, 0.98);
}

.viewer-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.35);
}

.viewer-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  padding: 14px;
}

.doc-viewer-frame {
  width: min(98vw, 1600px);
  height: calc(100vh - 120px);
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}

.story-viewer-card {
  grid-template-rows: auto 1fr auto auto;
}

.story-toolbar {
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.story-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.story-meta-text {
  min-width: 0;
}

.story-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.story-emoji-picker {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
}

.story-emoji-btn {
  min-width: 44px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 22px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.story-emoji-btn:hover {
  border-color: rgba(46, 199, 164, 0.65);
  background: rgba(46, 199, 164, 0.2);
}

.story-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  padding: 18px;
  background:
    radial-gradient(circle at 30% 20%, rgba(46, 199, 164, 0.08), transparent 35%),
    rgba(2, 8, 15, 0.55);
}

.story-stage img,
.story-stage video {
  max-width: min(98vw, 1600px);
  max-height: calc(100vh - 220px);
  border-radius: 12px;
}

.story-stage audio {
  width: min(680px, 94vw);
}

.story-caption {
  padding: 4px 14px 10px;
  color: var(--text);
  font-size: 14px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.story-reactions {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 0 14px 14px;
  min-height: 48px;
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
}

.story-reaction-chip {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  padding: 6px 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  min-width: 48px;
  justify-content: center;
}

.story-reaction-emoji {
  font-size: 20px;
  line-height: 1;
}

.code-login-box {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 10px;
  background: rgba(255, 255, 255, 0.06);
}

.code-login-title {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
}

.device-login-code {
  font-size: 26px;
  letter-spacing: 0.2em;
  font-weight: 700;
  margin-bottom: 6px;
  text-align: center;
}

.entity-info-modal-card {
  width: min(92vw, 760px);
}

.entity-info-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.entity-info-head-text {
  min-width: 0;
}

.entity-info-section {
  margin-top: 12px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}

#viewer-image {
  max-width: min(98vw, 2400px);
  max-height: calc(100vh - 110px);
  border-radius: 12px;
  object-fit: contain;
}

.close-modal {
  float: right;
  background: rgba(255, 255, 255, 0.15);
  color: var(--text);
}

.message-action-menu {
  position: fixed;
  z-index: 85;
  min-width: 180px;
  display: grid;
  gap: 2px;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(7, 18, 30, 0.96);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.4);
}

.message-action-btn {
  width: 100%;
  text-align: left;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  padding: 10px 12px;
}

.message-action-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.message-action-btn.danger {
  color: #ffc7c7;
}

.redsun-warning {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: #8d0707;
  color: #fff2f2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.redsun-warning-card {
  width: min(94vw, 560px);
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-radius: 14px;
  padding: 20px;
  background: rgba(35, 0, 0, 0.72);
  text-align: center;
  display: grid;
  gap: 12px;
}

.redsun-warning-card h2 {
  margin: 0;
  font-size: 28px;
}

.redsun-warning-card p {
  margin: 0;
  line-height: 1.45;
}

.redsun-timer {
  font-size: 40px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.mobile-mask {
  display: none;
}

.create-fab-global {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 1px solid rgba(46, 199, 164, 0.45);
  background: linear-gradient(140deg, var(--accent), var(--accent-strong));
  color: #05271e;
  font-size: 34px;
  line-height: 1;
  font-weight: 700;
  padding: 0;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.4);
  z-index: 65;
}

.create-fab-global:hover {
  transform: translateY(-2px);
}

.app-toast {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 140;
  max-width: min(90vw, 420px);
  background: rgba(8, 20, 32, 0.95);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  color: var(--text);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
}

.admin-notice {
  margin: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
}

.notice-error {
  border-color: rgba(249, 91, 91, 0.65);
  color: #ffd3d3;
  background: rgba(130, 15, 15, 0.3);
}

.notice-success {
  border-color: rgba(70, 255, 134, 0.66);
  color: #d8ffe5;
  background: rgba(9, 88, 30, 0.3);
}

.admin-auth-card {
  margin: 12px;
}

.admin-shell {
  min-height: 100vh;
}

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

.admin-grid .panel.wide {
  grid-column: span 2;
}

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

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes pulse-signal {
  0%,
  100% {
    opacity: 0.25;
  }
  50% {
    opacity: 1;
  }
}

@media (max-width: 980px) {
  .app-shell {
    margin-left: 0;
  }

  body.chat-open.menu-open .app-shell {
    margin-left: 0;
  }

  .left-menu {
    transform: translateX(-105%);
    transition: transform 0.25s ease;
  }

  body.menu-open .left-menu {
    transform: translateX(0);
  }

  .mobile-mask {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 20;
  }

  body.menu-open .mobile-mask {
    display: block;
  }

  .split-layout {
    grid-template-columns: 1fr;
  }

  .chat-list-panel,
  .chat-room-panel {
    min-height: 320px;
  }

  .chat-room-panel {
    position: absolute;
    inset: 0;
  }

  .story-toolbar {
    flex-wrap: wrap;
  }

  .story-toolbar-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .attachment-menu {
    left: 10px;
    right: 10px;
    min-width: 0;
  }

  .audio-message-card {
    grid-template-columns: 48px 1fr;
  }

  .audio-cover {
    width: 48px;
    height: 48px;
  }

  .audio-player {
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    gap: 6px;
  }

  .audio-volume-wrap {
    width: min(70vw, 180px);
  }

  .audio-time {
    min-width: 66px;
  }

  .video-note-wrap {
    width: 150px;
    height: 150px;
  }

  .call-stage {
    height: min(60vh, 430px);
  }

  .call-local-video {
    width: min(45%, 150px);
  }

  .call-audio-avatar {
    width: min(56vw, 220px);
    height: min(56vw, 220px);
  }

  .call-stage-name {
    top: 8px;
    font-size: 12px;
    padding: 6px 10px;
  }

  .call-room-panel {
    padding: 10px;
  }

  #call-room-users .secondary-btn {
    min-width: 44px;
    min-height: 40px;
  }

  .call-actions {
    gap: 10px;
    padding: 10px 12px 16px;
  }

  #call-answer-btn,
  #call-decline-btn,
  #call-mute-btn,
  #call-output-btn,
  #call-camera-btn,
  #call-hangup-btn {
    min-width: 56px;
    min-height: 56px;
    font-size: 22px;
  }

  #call-close-btn,
  #call-minimize-btn {
    width: 38px;
    min-width: 38px;
    height: 38px;
    min-height: 38px;
    font-size: 16px;
  }

  .call-mini-widget {
    padding: 3px 4px;
    gap: 4px;
  }

  .call-mini-avatar,
  .call-mini-btn {
    width: 26px;
    min-width: 26px;
    height: 26px;
  }

  .other-project-card {
    grid-template-columns: 58px 1fr;
  }

  .other-project-logo {
    width: 58px;
    height: 58px;
  }

  .create-fab-global {
    right: 14px;
    bottom: 14px;
    width: 54px;
    height: 54px;
    font-size: 30px;
  }

  .admin-grid {
    grid-template-columns: 1fr;
  }

  .admin-grid .panel.wide {
    grid-column: auto;
  }

  .permission-row {
    flex-direction: column;
    align-items: stretch;
  }

  .permission-row .secondary-btn {
    width: 100%;
  }

  .game-explorer {
    padding: 6px;
  }

  .game-table {
    min-width: 540px;
  }

  .game-table th,
  .game-table td {
    padding: 6px;
    font-size: 13px;
  }

  .game-entry-menu-actions {
    grid-template-columns: 1fr;
  }
}
