:root {
  --bg: #07140f;
  --bg-2: #0d2419;
  --ink: #e7f6ec;
  --muted: #8fb39c;
  --line: rgba(231, 246, 236, 0.12);
  --brand: #19c155;
  --brand-deep: #0e7a36;
  --mine: #143524;
  --theirs: #10281c;
  --danger: #ff8b8b;
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
  font-family: "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
}

body {
  min-height: 100%;
  min-height: 100dvh;
}

.gc-app {
  height: 100%;
  height: 100dvh;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(1200px 400px at 10% -10%, rgba(25, 193, 85, 0.18), transparent 55%),
    linear-gradient(180deg, var(--bg-2), var(--bg) 28%);
}

.gc-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  padding: 12px 12px 10px;
  border-bottom: 1px solid var(--line);
}

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

.gc-logo {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #06210f;
  background: linear-gradient(145deg, #b8ffd0, var(--brand) 55%, var(--brand-deep));
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2), 0 8px 18px rgba(25, 193, 85, 0.28);
}

.gc-brand-text { min-width: 0; }

.gc-title {
  font-weight: 750;
  font-size: 15px;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.gc-online {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: rgba(7, 20, 15, 0.55);
  color: var(--ink);
  border-radius: 999px;
  padding: 6px 10px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.gc-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 10px var(--brand);
}

.gc-body {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
}

.gc-messages {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 14px 12px 8px;
  scroll-behavior: auto;
}

.gc-day {
  margin: 8px auto 12px;
  width: fit-content;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.04em;
}

.gc-msg {
  display: flex;
  gap: 8px;
  margin: 0 0 10px;
  max-width: 100%;
  min-width: 0;
  animation: rise 0.18s ease;
}

.gc-msg.mine {
  flex-direction: row-reverse;
}

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

.gc-avatar {
  width: 28px;
  height: 28px;
  margin-top: 16px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  font-size: 10px;
  font-weight: 800;
  color: #d9ffe6;
  background: #1c4632;
}

.gc-msg.mine .gc-avatar { background: var(--brand-deep); }

.gc-bubble {
  min-width: 0;
  max-width: min(86%, 420px);
}

.gc-msg-head {
  display: flex;
  gap: 6px;
  align-items: baseline;
  margin: 0 4px 3px;
}

.gc-msg.mine .gc-msg-head { justify-content: flex-end; }

.gc-msg-name {
  font-size: 12px;
  font-weight: 700;
}

.gc-msg-name.member { color: #8dffc0; }

.gc-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #8dffc0;
}

.gc-msg-time {
  color: var(--muted);
  font-size: 11px;
}

.gc-msg-body {
  padding: 8px 11px;
  border-radius: 16px;
  background: var(--theirs);
  border: 1px solid var(--line);
  line-height: 1.4;
  overflow-wrap: anywhere;
  box-shadow: var(--shadow);
}

.gc-msg.mine .gc-msg-body {
  background: linear-gradient(180deg, #1c5a38, var(--mine));
  border-color: rgba(25, 193, 85, 0.35);
}

.gc-msg-body a { color: #b8ffd0; }

.gc-empty {
  margin: auto;
  max-width: 16rem;
  text-align: center;
  color: var(--muted);
  padding: 28px 8px;
}

.gc-empty strong {
  display: block;
  color: var(--ink);
  font-size: 16px;
  margin-bottom: 6px;
}

.gc-people {
  position: absolute;
  top: 8px;
  right: 8px;
  width: min(200px, 78%);
  max-height: calc(100% - 16px);
  overflow: auto;
  padding: 10px;
  border-radius: 14px;
  background: rgba(7, 20, 15, 0.94);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  z-index: 3;
}

.gc-people h4 {
  margin: 0 0 8px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.gc-person {
  padding: 6px 4px;
  font-size: 13px;
}

.gc-person.member { color: #8dffc0; }

.gc-jump {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  border: 0;
  border-radius: 999px;
  padding: 7px 12px;
  background: var(--brand);
  color: #06210f;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: var(--shadow);
  z-index: 2;
}

.gc-compose {
  flex: 0 0 auto;
  min-width: 0;
  padding: 8px 10px 10px;
  border-top: 1px solid var(--line);
  background: rgba(7, 20, 15, 0.92);
}

.gc-name-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.gc-name-row input,
#gcInput {
  width: 100%;
  border: 1px solid var(--line);
  background: #0c1f18;
  color: var(--ink);
  font: inherit;
  outline: none;
}

.gc-name-row input {
  flex: 1;
  min-width: 0;
  border-radius: 999px;
  padding: 8px 12px;
}

#gcInput {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  resize: none;
  max-height: 96px;
  border-radius: 16px;
  padding: 9px 12px;
  line-height: 1.35;
}

.gc-name-row input:focus,
#gcInput:focus { border-color: rgba(25, 193, 85, 0.7); }

.gc-sent {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.gc-sent-n {
  color: var(--brand);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.gc-input-row {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  min-width: 0;
}

.gc-emoji-btn,
.gc-send {
  height: 38px;
  border-radius: 14px;
  cursor: pointer;
  font: inherit;
}

.gc-emoji-btn {
  width: 38px;
  border: 1px solid var(--line);
  background: #0c1f18;
  color: var(--ink);
  font-size: 18px;
}

.gc-send {
  flex: 0 0 auto;
  border: 0;
  padding: 0 12px;
  background: var(--brand);
  color: #06210f;
  font-weight: 800;
}

.gc-send-icon { display: none; }

@media (max-width: 420px) {
  .gc-send { width: 38px; padding: 0; }
  .gc-send-label { display: none; }
  .gc-send-icon { display: inline; font-size: 16px; }
}

.gc-send:disabled { opacity: 0.45; cursor: default; }

.gc-emoji-panel {
  display: none;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
  margin: 0 0 8px;
  padding: 6px;
  max-height: 92px;
  overflow: auto;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #0c1f18;
}

.gc-emoji-panel.is-open { display: grid; }

.gc-emoji-panel button {
  border: 0;
  background: transparent;
  font-size: 18px;
  line-height: 1.3;
  border-radius: 8px;
  cursor: pointer;
}

.gc-emoji-panel button:hover { background: rgba(255, 255, 255, 0.06); }

.gc-status {
  min-height: 1em;
  margin: 6px 2px 0;
  color: var(--muted);
  font-size: 12px;
}

.gc-status.error { color: var(--danger); }

.gc-messages::-webkit-scrollbar,
.gc-emoji-panel::-webkit-scrollbar { width: 8px; }

.gc-messages::-webkit-scrollbar-thumb,
.gc-emoji-panel::-webkit-scrollbar-thumb {
  background: rgba(231, 246, 236, 0.18);
  border-radius: 99px;
}
