:root {
  --bg-deep: #08141e;
  --bg-card: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.08);
  --text: #eef6ff;
  --text-dim: #91a5be;
  --accent-main: #83f2cf;
  --accent-sky: #8dc8ff;
  --accent-warm: #ffcd83;
  --shadow: 0 26px 58px rgba(0, 0, 0, 0.35);
}

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

body {
  font-family: 'Space Grotesk', sans-serif;
  background: var(--bg-deep);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  line-height: 1.6;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 16% 12%, rgba(131, 242, 207, 0.14), transparent 36%),
    radial-gradient(circle at 82% 14%, rgba(141, 200, 255, 0.12), transparent 30%),
    radial-gradient(circle at 60% 84%, rgba(255, 205, 131, 0.1), transparent 28%);
  pointer-events: none;
  z-index: 0;
}

.pl-back,
.pl-shell {
  position: relative;
  z-index: 1;
}

.pl-back {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 8px;
}

.pl-back a {
  color: var(--accent-main);
  text-decoration: none;
  font-weight: 600;
}

.pl-shell {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 10px 0 40px;
  display: grid;
  grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
  gap: 22px;
}

.pl-sidebar,
.pl-main {
  display: grid;
  gap: 18px;
  align-content: start;
}

.pl-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 24px;
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}

.pl-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--accent-main);
  border: 1px solid rgba(131, 242, 207, 0.2);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  font-family: 'Fredoka', sans-serif;
}

h1 {
  margin: 12px 0 10px;
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  line-height: 1.03;
}

h2 {
  font-size: 1.45rem;
  color: var(--accent-warm);
  margin-bottom: 10px;
}

h3 {
  font-size: 1rem;
  margin-bottom: 8px;
}

.pl-copy,
.pl-helper,
.pl-system,
.pl-message-text {
  color: var(--text-dim);
}

.pl-pill-row,
.pl-meta,
.pl-avatar-grid,
.pl-prompt-grid,
.pl-reactions,
.pl-roster {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pl-pill,
.pl-meta-chip,
.pl-roster-pill,
.pl-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 9px 13px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.85rem;
}

.pl-pill-row {
  margin-top: 16px;
}

.pl-label {
  display: block;
  margin: 12px 0 7px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
}

.pl-input {
  width: 100%;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  padding: 14px 15px;
  font: inherit;
  outline: none;
}

.pl-input:focus {
  border-color: rgba(131, 242, 207, 0.35);
  box-shadow: 0 0 0 3px rgba(131, 242, 207, 0.12);
}

.pl-avatar-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-top: 16px;
}

.pl-avatar-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 12px;
}

.pl-avatar-btn {
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  padding: 14px;
  cursor: pointer;
  color: var(--text);
  display: grid;
  gap: 8px;
  text-align: left;
}

.pl-avatar-btn.active {
  border-color: rgba(131, 242, 207, 0.35);
  box-shadow: 0 0 0 2px rgba(131, 242, 207, 0.14);
}

.pl-avatar-chip {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  background: linear-gradient(135deg, var(--avatar-accent), var(--avatar-secondary));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 14px 24px rgba(0, 0, 0, 0.22);
}

.pl-avatar-name {
  font-weight: 700;
}

.pl-avatar-note {
  color: var(--text-dim);
  font-size: 0.82rem;
}

.pl-join-btn,
.pl-prompt-btn,
.pl-reactions button,
#plSendBtn {
  border: 0;
  border-radius: 18px;
  font: inherit;
  cursor: pointer;
}

.pl-join-btn {
  width: 100%;
  margin-top: 16px;
  padding: 14px 16px;
  font-weight: 800;
  color: #07111b;
  background: linear-gradient(135deg, var(--accent-main), var(--accent-sky));
  box-shadow: 0 16px 30px rgba(131, 242, 207, 0.22);
}

.pl-stage {
  position: relative;
  min-height: 220px;
  border-radius: 26px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 18%, rgba(131, 242, 207, 0.24), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(8, 20, 30, 0.24));
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.pl-stage::before,
.pl-stage::after {
  content: '';
  position: absolute;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.pl-stage::before {
  width: 180px;
  height: 16px;
  bottom: 34px;
}

.pl-stage::after {
  width: 6px;
  height: 58px;
  bottom: 0;
}

.pl-stage-glow {
  position: absolute;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.16), transparent 64%);
}

.pl-stage-avatar {
  position: relative;
  z-index: 1;
  width: 112px;
  height: 112px;
  border-radius: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.4rem;
  background: linear-gradient(135deg, var(--avatar-accent, var(--accent-main)), var(--avatar-secondary, var(--accent-warm)));
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.28);
}

.pl-stage-name {
  position: relative;
  z-index: 1;
  font-family: 'Fredoka', sans-serif;
  font-size: 1.2rem;
}

.pl-stage-label {
  position: relative;
  z-index: 1;
  color: var(--text-dim);
}

.pl-prompt-grid {
  margin-top: 14px;
}

.pl-prompt-btn {
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.pl-main-top {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: start;
}

.pl-meta-chip {
  min-width: 96px;
  justify-content: center;
  flex-direction: column;
  text-align: center;
}

.pl-meta-chip strong {
  font-family: 'Fredoka', sans-serif;
  font-size: 1.2rem;
  color: var(--accent-main);
}

.pl-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(260px, 0.9fr);
  gap: 18px;
}

.pl-chat-shell,
.pl-roster-shell {
  display: grid;
  gap: 14px;
}

.pl-chat-log {
  min-height: 420px;
  max-height: 58vh;
  overflow-y: auto;
  padding-right: 6px;
  display: grid;
  gap: 10px;
}

.pl-system,
.pl-message {
  border-radius: 18px;
  padding: 12px 14px;
}

.pl-system {
  background: rgba(255, 255, 255, 0.05);
  border: 1px dashed rgba(255, 255, 255, 0.08);
  font-size: 0.88rem;
}

.pl-message {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.pl-message.self {
  border-color: rgba(131, 242, 207, 0.22);
  background: rgba(131, 242, 207, 0.08);
}

.pl-message-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.pl-message-avatar {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  background: linear-gradient(135deg, var(--avatar-accent), var(--avatar-secondary));
}

.pl-message-name {
  font-weight: 700;
}

.pl-message-meta {
  color: var(--text-dim);
  font-size: 0.76rem;
}

.pl-message.reaction .pl-message-text {
  font-size: 2rem;
  line-height: 1;
}

.pl-reactions button {
  width: 48px;
  height: 42px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.pl-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
}

.pl-composer input {
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  padding: 14px 15px;
  font: inherit;
  outline: none;
}

.pl-composer input:focus {
  border-color: rgba(131, 242, 207, 0.35);
}

#plSendBtn {
  padding: 0 18px;
  background: linear-gradient(135deg, var(--accent-warm), var(--accent-main));
  color: #07111b;
  font-weight: 800;
}

.pl-roster {
  display: grid;
  gap: 10px;
}

.pl-roster-pill {
  border-radius: 18px;
  padding: 11px 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 10px;
}

.pl-roster-pill .pl-message-avatar {
  width: 30px;
  height: 30px;
  font-size: 1rem;
}

.pl-status.ok {
  color: var(--accent-main);
  border-color: rgba(131, 242, 207, 0.22);
}

.pl-status.warn {
  color: var(--accent-warm);
  border-color: rgba(255, 205, 131, 0.22);
}

.pl-status.error {
  color: #ffb0b0;
  border-color: rgba(255, 176, 176, 0.22);
}

@media (max-width: 1040px) {
  .pl-shell {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 720px) {
  .pl-back,
  .pl-shell {
    width: min(1280px, calc(100% - 24px));
  }

  .pl-card {
    padding: 18px;
    border-radius: 24px;
  }

  .pl-avatar-grid {
    grid-template-columns: 1fr;
  }

  .pl-main-top {
    flex-direction: column;
  }

  .pl-composer {
    grid-template-columns: 1fr;
  }
}
