:root {
  color-scheme: light;
  --lime: #b8f34a;
  --lime-strong: #9ee52c;
  --lime-soft: #efffd2;
  --forest: #123a2b;
  --forest-deep: #071f18;
  --ink: #13251f;
  --muted: #65756f;
  --paper: #fbfdf9;
  --white: #ffffff;
  --line: #dfe8e1;
  --player: #07130f;
  --danger: #ff6b61;
  --shadow: 0 24px 70px rgba(18, 58, 43, 0.13);
  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 14px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  min-width: 320px;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 16% -10%, rgba(184, 243, 74, 0.28), transparent 28rem),
    linear-gradient(180deg, #f8fcf5 0%, #eef5ef 100%);
  color: var(--ink);
  font-size: 16px;
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(158, 229, 44, 0.45);
  outline-offset: 3px;
}

.ambient {
  position: fixed;
  z-index: -1;
  border-radius: 999px;
  filter: blur(2px);
  opacity: 0.6;
  pointer-events: none;
}

.ambient-one {
  width: 24rem;
  height: 24rem;
  right: -9rem;
  top: 20%;
  background: rgba(184, 243, 74, 0.2);
}

.ambient-two {
  width: 18rem;
  height: 18rem;
  left: -8rem;
  bottom: 8%;
  background: rgba(66, 170, 122, 0.12);
}

.app-shell {
  width: min(1540px, 100%);
  margin: 0 auto;
  padding: 20px clamp(16px, 3vw, 44px) 32px;
}

.topbar {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.brand,
.join-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--forest-deep);
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  text-decoration: none;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border-radius: 13px;
  background: var(--lime);
  box-shadow: 0 8px 18px rgba(126, 190, 35, 0.24);
}

.brand-mark svg {
  width: 27px;
  height: 27px;
}

.brand-mark.large {
  width: 44px;
  height: 44px;
}

.room-meta,
.control-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.room-meta {
  position: relative;
}

.voice-controls {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.sync-pill,
.people-pill,
.top-chat-button,
.voice-button,
.profile-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 1px solid rgba(18, 58, 43, 0.09);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  padding: 8px 13px;
  color: var(--forest);
  font-size: 0.9rem;
  font-weight: 700;
  backdrop-filter: blur(14px);
}

.people-pill {
  cursor: pointer;
}

.top-chat-button,
.voice-button,
.profile-button {
  position: relative;
  cursor: pointer;
}

.top-chat-button:hover,
.voice-button:hover,
.profile-button:hover {
  background: var(--lime-soft);
}

.top-chat-button svg,
.voice-button svg {
  width: 19px;
  height: 19px;
}

.voice-button .mic-on-icon {
  display: none;
}

.voice-button[data-state="on"] {
  border-color: rgba(66, 200, 120, 0.26);
  background: var(--forest-deep);
  color: var(--lime);
  box-shadow: 0 8px 22px rgba(7, 31, 24, 0.16);
}

.voice-button[data-state="on"] .mic-on-icon {
  display: block;
}

.voice-button[data-state="on"] .mic-off-icon {
  display: none;
}

.voice-button[data-state="connecting"] {
  color: #8a650c;
}

.voice-button[data-state="connecting"] svg {
  animation: voice-pulse 900ms ease-in-out infinite alternate;
}

.voice-button[data-state="error"] {
  border-color: rgba(255, 107, 97, 0.28);
  background: rgba(255, 107, 97, 0.1);
  color: #b33f37;
}

.mic-device-picker {
  position: relative;
  min-width: 42px;
  max-width: 176px;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  overflow: hidden;
  border: 1px solid rgba(18, 58, 43, 0.09);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  padding: 8px 12px;
  color: var(--forest);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  backdrop-filter: blur(14px);
}

.mic-device-picker:hover,
.mic-device-picker:focus-within {
  background: var(--lime-soft);
}

.mic-device-picker svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
}

.mic-device-picker > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mic-device-picker select {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  opacity: 0;
  cursor: pointer;
}

.mic-device-picker:has(select:disabled) {
  opacity: 0.55;
  cursor: wait;
}

.mic-device-picker select:disabled {
  cursor: wait;
}

@keyframes voice-pulse {
  from { opacity: 0.45; }
  to { opacity: 1; }
}

.sync-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #42c878;
  box-shadow: 0 0 0 5px rgba(66, 200, 120, 0.13);
}

.sync-pill[data-state="waiting"] .sync-dot {
  background: #f2bd3d;
  box-shadow: 0 0 0 5px rgba(242, 189, 61, 0.15);
}

.sync-pill[data-state="warning"] .sync-dot {
  background: #f2bd3d;
  box-shadow: 0 0 0 5px rgba(242, 189, 61, 0.15);
}

.sync-pill[data-state="error"] .sync-dot {
  background: var(--danger);
  box-shadow: 0 0 0 5px rgba(255, 107, 97, 0.14);
}

.avatar-stack {
  display: flex;
}

.avatar-stack span {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  margin-left: -6px;
  border: 2px solid white;
  border-radius: 50%;
  background: var(--forest);
  color: white;
  font-size: 0.68rem;
  font-weight: 850;
  overflow: hidden;
}

.avatar-stack span:first-child {
  margin-left: 0;
  background: var(--lime);
  color: var(--forest-deep);
}

.avatar-stack span.mic-active {
  box-shadow: 0 0 0 2px rgba(66, 200, 120, 0.5);
}

.avatar-stack span.speaking {
  box-shadow: 0 0 0 2px var(--lime), 0 0 0 5px rgba(66, 200, 120, 0.18);
  animation: voice-pulse 520ms ease-in-out infinite alternate;
}

.profile-button {
  max-width: 190px;
  padding: 6px 12px 6px 7px;
}

.profile-button-avatar {
  width: 29px;
  height: 29px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(18, 58, 43, 0.1);
  border-radius: 50%;
  background: var(--lime);
  color: var(--forest-deep);
  font-size: 0.72rem;
  font-weight: 900;
}

.profile-button-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.avatar-stack img,
.profile-button-avatar img,
.toast-avatar img,
.message-avatar img,
.participant-avatar img,
.system-avatar img,
.system-icon img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.watch-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  align-items: stretch;
  transition: grid-template-columns 240ms ease;
}

.watch-layout.chat-closed {
  grid-template-columns: minmax(0, 1fr) 0;
}

.player-column {
  min-width: 0;
}

.video-card {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  background: var(--player);
  box-shadow: var(--shadow);
}

.video-stage {
  position: relative;
  aspect-ratio: 16 / 9;
  min-height: 280px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 28%, rgba(184, 243, 74, 0.1), transparent 25%),
    linear-gradient(145deg, #0d241b 0%, #04100c 76%);
  color: white;
}

.video-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.07) 0.7px, transparent 0.7px);
  background-size: 5px 5px;
  opacity: 0.16;
  pointer-events: none;
}

#video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: none;
  background: #000;
  object-fit: contain;
}

.empty-state {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-content: center;
  justify-items: center;
  padding: 40px;
  text-align: center;
}

.media-notice {
  position: absolute;
  z-index: 8;
  top: 18px;
  right: 18px;
  max-width: min(430px, calc(100% - 36px));
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  background: rgba(7, 31, 24, 0.92);
  padding: 11px 14px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.83rem;
  line-height: 1.4;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px);
  backdrop-filter: blur(14px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.media-notice.visible {
  opacity: 1;
  transform: translateY(0);
}

.media-notice[data-state="warning"] {
  border-color: rgba(242, 189, 61, 0.45);
}

.media-notice[data-state="error"] {
  border-color: rgba(255, 107, 97, 0.55);
}

.media-notice[data-state="success"] {
  border-color: rgba(184, 243, 74, 0.45);
}

.empty-icon {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  border: 1px solid rgba(184, 243, 74, 0.34);
  border-radius: 24px;
  background: rgba(184, 243, 74, 0.12);
  color: var(--lime);
  box-shadow: inset 0 0 32px rgba(184, 243, 74, 0.05);
}

.empty-icon svg {
  width: 44px;
  height: 44px;
}

.eyebrow {
  margin: 0 0 7px;
  color: #7bb925;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.empty-state h1 {
  max-width: 620px;
  margin: 0;
  font-size: clamp(1.5rem, 3vw, 2.45rem);
  line-height: 1.05;
  letter-spacing: -0.045em;
}

.empty-state > p:not(.eyebrow) {
  max-width: 540px;
  margin: 13px 0 23px;
  color: rgba(255, 255, 255, 0.64);
  line-height: 1.55;
}

.primary-button,
.share-button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 0;
  border-radius: 15px;
  background: var(--lime);
  padding: 0 19px;
  color: var(--forest-deep);
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(151, 220, 39, 0.23);
  transition: transform 160ms ease, background 160ms ease;
}

.primary-button:hover,
.share-button:hover {
  background: #c7ff5f;
  transform: translateY(-1px);
}

.primary-button svg,
.share-button svg {
  width: 21px;
  height: 21px;
}

.primary-button.wide {
  width: 100%;
}

.action-toast {
  position: absolute;
  z-index: 6;
  top: 18px;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 999px;
  background: rgba(4, 16, 12, 0.82);
  padding: 8px 13px 8px 8px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.88rem;
  transform: translate(-50%, -80px);
  opacity: 0;
  backdrop-filter: blur(14px);
  transition: transform 240ms ease, opacity 240ms ease;
}

.action-toast.visible {
  transform: translate(-50%, 0);
  opacity: 1;
}

.toast-avatar,
.message-avatar {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--lime);
  color: var(--forest-deep);
  font-weight: 800;
  overflow: hidden;
}

.toast-avatar {
  width: 30px;
  height: 30px;
  font-size: 0.72rem;
}

.big-play {
  position: absolute;
  z-index: 5;
  inset: 50% auto auto 50%;
  width: 68px;
  height: 68px;
  display: none;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  background: rgba(184, 243, 74, 0.9);
  color: var(--forest-deep);
  transform: translate(-50%, -50%);
  cursor: pointer;
  backdrop-filter: blur(10px);
}

.video-stage.has-video.is-paused .big-play,
.video-stage.has-video.needs-gesture .big-play {
  display: grid;
}

.video-stage.has-video.is-playing:not(.needs-gesture) .big-play {
  display: none;
}

.big-play svg {
  width: 36px;
  height: 36px;
}

.player-controls {
  position: absolute;
  z-index: 7;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 52px 18px 16px;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.82));
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.video-stage.has-video:hover .player-controls,
.video-stage.has-video.controls-visible .player-controls,
.video-stage.has-video:focus-within .player-controls {
  opacity: 1;
  pointer-events: auto;
}

.timeline-wrap {
  height: 20px;
  display: flex;
  align-items: center;
}

.timeline,
.volume {
  accent-color: var(--lime);
  cursor: pointer;
}

.timeline {
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--lime) 0 var(--progress, 0%), rgba(255, 255, 255, 0.32) var(--progress, 0%) 100%);
  appearance: none;
}

.timeline::-webkit-slider-thumb {
  width: 15px;
  height: 15px;
  border: 3px solid var(--lime);
  border-radius: 50%;
  background: white;
  appearance: none;
}

.timeline::-moz-range-thumb {
  width: 11px;
  height: 11px;
  border: 3px solid var(--lime);
  border-radius: 50%;
  background: white;
}

.volume {
  width: 84px;
}

.control-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.icon-button,
.text-control,
.close-chat {
  min-width: 42px;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: white;
  cursor: pointer;
}

.icon-button:hover,
.text-control:hover {
  background: rgba(255, 255, 255, 0.12);
}

.icon-button svg,
.text-control svg,
.close-chat svg {
  width: 22px;
  height: 22px;
}

.pause-icon {
  display: none;
}

.is-playing .play-icon {
  display: none;
}

.is-playing .pause-icon {
  display: block;
}

.text-control {
  padding: 0 11px;
  font-size: 0.88rem;
  font-weight: 700;
}

.unread-badge {
  min-width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--lime);
  padding: 0 5px;
  color: var(--forest-deep);
  font-size: 0.65rem;
  font-weight: 900;
}

.time-label {
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
}

.time-divider {
  margin: 0 5px;
  color: rgba(255, 255, 255, 0.38);
}

.below-player {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 6px 0;
}

.below-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 9px;
}

.below-player h2,
.chat-header h2 {
  margin: 0;
  font-size: 1.2rem;
  letter-spacing: -0.025em;
}

.share-button {
  min-height: 44px;
  border: 1px solid rgba(18, 58, 43, 0.1);
  background: white;
  box-shadow: none;
}

.share-button:hover {
  background: var(--lime-soft);
}

.chat-panel {
  position: relative;
  min-width: 0;
  height: 100%;
  min-height: 560px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid rgba(18, 58, 43, 0.08);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 18px 52px rgba(18, 58, 43, 0.09);
  backdrop-filter: blur(18px);
  transition: opacity 180ms ease, transform 220ms ease;
}

.participants-popover {
  position: absolute;
  z-index: 30;
  top: calc(100% + 9px);
  right: 0;
  width: min(320px, calc(100vw - 28px));
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.96);
  padding: 14px;
  box-shadow: 0 16px 44px rgba(18, 58, 43, 0.16);
  backdrop-filter: blur(16px);
}

.participants-popover > strong {
  display: block;
  margin-bottom: 10px;
  color: var(--forest);
  font-size: 0.84rem;
}

.participant-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 7px 0;
}

.participant-avatar {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--lime-soft);
  color: var(--forest);
  font-size: 0.7rem;
  font-weight: 900;
  overflow: hidden;
}

.participant-name {
  overflow: hidden;
  font-size: 0.86rem;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.participant-state {
  color: #61a229;
  font-size: 0.75rem;
}

.participant-state.buffering {
  color: #bc8117;
}

.participant-state.error {
  color: var(--danger);
}

.participant-row.mic-active .participant-state,
.participant-state.voice-live {
  color: #378a58;
  font-weight: 700;
}

.participant-state.voice-muted {
  color: var(--muted);
}

.participant-row.speaking .participant-avatar {
  box-shadow: 0 0 0 3px rgba(184, 243, 74, 0.5), 0 0 0 6px rgba(66, 200, 120, 0.14);
  animation: voice-pulse 520ms ease-in-out infinite alternate;
}

.chat-closed .chat-panel {
  opacity: 0;
  pointer-events: none;
  transform: translateX(24px);
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 15px;
  border-bottom: 1px solid var(--line);
}

.close-chat {
  color: var(--muted);
}

.close-chat:hover {
  background: var(--lime-soft);
  color: var(--forest);
}

.chat-stream {
  overflow-y: auto;
  padding: 18px;
  overscroll-behavior: contain;
}

.system-message,
.activity-message {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 16px;
  border-radius: 13px;
  color: var(--muted);
  font-size: 0.83rem;
  line-height: 1.45;
}

.system-message {
  background: var(--lime-soft);
  padding: 10px 12px;
  color: #486329;
}

.system-icon {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--lime);
  color: var(--forest-deep);
  font-size: 0.7rem;
  font-weight: 900;
  overflow: hidden;
}

.system-avatar {
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(18, 58, 43, 0.08);
  border-radius: 50%;
  background: var(--lime);
  color: var(--forest-deep);
  font-size: 0.7rem;
  font-weight: 900;
}

.chat-message {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

.message-avatar {
  width: 38px;
  height: 38px;
  font-size: 0.8rem;
}

.message-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
  font-size: 0.88rem;
}

.message-meta time {
  color: #94a19c;
  font-size: 0.75rem;
}

.chat-message p {
  margin: 0;
  color: #30443c;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.activity-message {
  justify-content: center;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 9px 0;
}

.chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  gap: 8px;
  padding: 14px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
}

.chat-form input,
.join-card input {
  width: 100%;
  min-height: 46px;
  border: 1px solid #d5e0d7;
  border-radius: 13px;
  background: white;
  padding: 0 14px;
  color: var(--ink);
}

button:disabled {
  cursor: wait;
  opacity: 0.62;
  transform: none !important;
}

.chat-form input::placeholder,
.join-card input::placeholder {
  color: #97a49f;
}

.chat-form button {
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 13px;
  background: var(--lime);
  color: var(--forest-deep);
  cursor: pointer;
}

.chat-form button svg {
  width: 22px;
  height: 22px;
}

.join-backdrop {
  position: fixed;
  z-index: 40;
  inset: 0;
  display: grid;
  place-items: center;
  overflow-y: auto;
  padding: 24px;
  background: rgba(5, 27, 20, 0.76);
  backdrop-filter: blur(18px);
}

.join-backdrop.hidden {
  display: none;
}

.join-card {
  width: min(100%, 480px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 30px;
  background: rgba(251, 253, 249, 0.96);
  padding: clamp(24px, 5vw, 38px);
  box-shadow: 0 40px 100px rgba(0, 17, 12, 0.3);
}

.join-brand {
  margin-bottom: 36px;
}

.join-card h1 {
  margin: 0;
  color: var(--forest-deep);
  font-size: clamp(2rem, 6vw, 3rem);
  line-height: 1;
  letter-spacing: -0.055em;
}

.join-copy {
  margin: 15px 0 18px;
  color: var(--muted);
  line-height: 1.55;
}

.account-hint {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.account-hint span {
  border: 1px solid rgba(113, 169, 43, 0.18);
  border-radius: 999px;
  background: rgba(183, 243, 74, 0.13);
  padding: 7px 11px;
  color: var(--muted);
  font-size: 0.78rem;
}

.account-hint strong {
  color: var(--forest);
}

.join-card label {
  display: block;
  margin-bottom: 8px;
  color: var(--forest);
  font-size: 0.86rem;
  font-weight: 800;
}

.join-card input {
  min-height: 54px;
  font-size: 1rem;
}

.login-form {
  display: grid;
  gap: 16px;
}

.login-field {
  display: grid;
}

.login-field input:focus {
  border-color: #87c92f;
  outline: 3px solid rgba(183, 243, 74, 0.22);
}

.login-form .field-error {
  margin: -5px 0 -1px;
}

.login-form .field-error:empty {
  display: none;
}

.field-error {
  min-height: 20px;
  margin: 0 0 7px;
  color: #bc3d35;
  font-size: 0.82rem;
}

.privacy-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
  text-align: center;
}

.privacy-note svg {
  flex: 0 0 auto;
  width: 19px;
  height: 19px;
  color: #71a92b;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.profile-page {
  min-height: 100vh;
  min-height: 100dvh;
  padding-bottom: 56px;
}

.profile-topbar {
  width: min(1180px, 100%);
  min-height: 82px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 18px;
  margin: 0 auto;
  padding: 16px clamp(16px, 3vw, 38px);
}

.profile-back,
.avatar-change-link {
  border: 0;
  background: transparent;
  color: var(--forest);
  font-weight: 800;
  cursor: pointer;
}

.profile-back {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 8px;
  border: 1px solid rgba(18, 58, 43, 0.09);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.74);
  padding: 0 14px 0 10px;
  box-shadow: 0 8px 24px rgba(18, 58, 43, 0.06);
  backdrop-filter: blur(14px);
}

.profile-back:hover {
  background: var(--lime-soft);
}

.profile-back svg {
  width: 22px;
  height: 22px;
}

.profile-topbar .join-brand {
  justify-self: center;
}

.profile-live-pill {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-self: end;
  gap: 9px;
  border: 1px solid rgba(18, 58, 43, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  padding: 7px 13px;
  color: var(--forest);
  font-size: 0.82rem;
  font-weight: 750;
  backdrop-filter: blur(14px);
}

.profile-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.profile-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  padding: clamp(34px, 6vw, 70px) 4px 28px;
}

.profile-heading h1 {
  margin: 0;
  color: var(--forest-deep);
  font-size: clamp(2.2rem, 5vw, 4.1rem);
  line-height: 0.98;
  letter-spacing: -0.06em;
}

.profile-heading h1:focus {
  outline: none;
}

.profile-heading > div:first-child > p:last-child {
  max-width: 610px;
  margin: 15px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.now-watching-chip {
  min-width: 250px;
  max-width: 360px;
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(184, 243, 74, 0.16);
  border-radius: 18px;
  background: var(--forest-deep);
  padding: 13px 16px;
  color: white;
  box-shadow: 0 16px 36px rgba(7, 31, 24, 0.16);
}

.now-watching-chip > span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 0 5px rgba(184, 243, 74, 0.13);
}

.now-watching-chip div {
  min-width: 0;
}

.now-watching-chip small,
.now-watching-chip strong {
  display: block;
}

.now-watching-chip small {
  margin-bottom: 2px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.now-watching-chip strong {
  overflow: hidden;
  font-size: 0.9rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-grid {
  display: grid;
  grid-template-columns: minmax(300px, 350px) minmax(0, 1fr);
  gap: 20px;
  align-items: stretch;
}

.profile-card,
.profile-summary {
  border: 1px solid rgba(18, 58, 43, 0.08);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 56px rgba(18, 58, 43, 0.09);
}

.profile-card {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(18px);
}

.identity-card {
  padding: clamp(22px, 3vw, 30px);
}

.identity-card h2,
.profile-section-heading h2 {
  margin: 0;
  color: var(--forest-deep);
  font-size: 1.22rem;
  letter-spacing: -0.025em;
}

.avatar-editor {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 27px 0 26px;
}

.profile-avatar-large {
  position: relative;
  width: 94px;
  height: 94px;
  flex: 0 0 94px;
  display: grid;
  place-items: center;
  overflow: visible;
  border: 4px solid white;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--lime), #e1ff9d);
  padding: 0;
  color: var(--forest-deep);
  font-size: 1.8rem;
  font-weight: 900;
  box-shadow: 0 12px 30px rgba(116, 170, 39, 0.22), 0 0 0 1px rgba(18, 58, 43, 0.09);
  cursor: pointer;
}

.profile-avatar-large > span:first-child,
.profile-avatar-large > img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
}

.profile-avatar-large > span:first-child {
  display: grid;
  place-items: center;
}

.profile-avatar-large > img {
  object-fit: cover;
}

.avatar-edit-badge {
  position: absolute;
  right: -3px;
  bottom: 0;
  width: 31px !important;
  height: 31px !important;
  display: grid;
  place-items: center;
  border: 3px solid white;
  border-radius: 50% !important;
  background: var(--forest-deep);
  color: var(--lime);
  box-shadow: 0 6px 16px rgba(7, 31, 24, 0.22);
}

.avatar-edit-badge svg {
  width: 16px;
  height: 16px;
}

.avatar-change-link {
  min-height: 36px;
  padding: 0;
  color: #4d841f;
}

.avatar-change-link:hover {
  color: var(--forest-deep);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.avatar-editor p {
  max-width: 180px;
  margin: 1px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.profile-form label {
  display: block;
  margin-bottom: 8px;
  color: var(--forest);
  font-size: 0.86rem;
  font-weight: 800;
}

.profile-form input {
  width: 100%;
  min-height: 52px;
  border: 1px solid #d5e0d7;
  border-radius: 14px;
  background: white;
  padding: 0 14px;
  color: var(--ink);
  font-size: 1rem;
  box-shadow: inset 0 1px 2px rgba(18, 58, 43, 0.02);
}

.profile-form .field-error,
.profile-success {
  min-height: 19px;
  margin: 7px 0 3px;
  font-size: 0.8rem;
  line-height: 1.35;
}

.profile-form .field-error {
  color: #bc3d35;
}

.profile-success {
  color: #4f8623;
}

.profile-form .field-error:empty,
.profile-success:empty {
  display: none;
}

.profile-form .primary-button {
  margin-top: 10px;
}

.account-session {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 22px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
}

.account-session small,
.account-session strong {
  display: block;
}

.account-session small {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 0.72rem;
}

.account-session strong {
  color: var(--forest-deep);
  font-size: 0.9rem;
}

.logout-button {
  min-height: 40px;
  flex: 0 0 auto;
  border: 1px solid rgba(188, 61, 53, 0.2);
  border-radius: 12px;
  background: rgba(188, 61, 53, 0.06);
  padding: 0 12px;
  color: #94332e;
  font-weight: 800;
  cursor: pointer;
}

.logout-button:hover {
  border-color: rgba(188, 61, 53, 0.32);
  background: rgba(188, 61, 53, 0.11);
}

.profile-summary {
  overflow: hidden;
  background:
    radial-gradient(circle at 88% 0%, rgba(184, 243, 74, 0.18), transparent 17rem),
    linear-gradient(145deg, #123a2b, #071f18);
  padding: clamp(22px, 3vw, 30px);
  color: white;
}

.profile-summary .eyebrow {
  color: var(--lime);
}

.profile-summary .profile-section-heading h2 {
  color: white;
}

.profile-section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}

.counting-note,
.history-total {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.counting-note {
  max-width: 170px;
  color: rgba(255, 255, 255, 0.58);
  text-align: right;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 27px;
}

.stat-card {
  min-width: 0;
  min-height: 168px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.07);
  padding: 18px;
}

.stat-card.featured {
  border-color: transparent;
  background: var(--lime);
  color: var(--forest-deep);
}

.stat-card > span {
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.82rem;
  font-weight: 750;
}

.stat-card.featured > span {
  color: rgba(7, 31, 24, 0.66);
}

.stat-card strong {
  overflow-wrap: anywhere;
  font-size: clamp(1.65rem, 3.5vw, 2.45rem);
  line-height: 0.95;
  letter-spacing: -0.055em;
}

.stat-card small {
  color: rgba(255, 255, 255, 0.48);
  font-size: 0.75rem;
  line-height: 1.35;
}

.stat-card.featured small {
  color: rgba(7, 31, 24, 0.56);
}

.history-card {
  margin-top: 20px;
  padding: clamp(22px, 3vw, 30px);
}

.history-list {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}

.history-list:not(:empty) + .history-empty {
  display: none;
}

.history-item,
.history-entry,
.history-row {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(251, 253, 249, 0.86);
  padding: 13px 15px;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.history-item:hover,
.history-entry:hover,
.history-row:hover {
  border-color: #c9daa8;
  background: var(--lime-soft);
  transform: translateY(-1px);
}

.history-item-icon,
.history-icon,
.history-thumb {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 14px;
  background: var(--forest-deep);
  color: var(--lime);
}

.history-item-icon svg,
.history-icon svg,
.history-thumb svg {
  width: 23px;
  height: 23px;
}

.history-item-icon {
  font-size: 0.82rem;
}

.history-item-main,
.history-main,
.history-copy {
  min-width: 0;
}

.history-item-title,
.history-title,
.history-item-main > strong {
  display: block;
  overflow: hidden;
  color: var(--forest-deep);
  font-size: 0.92rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-item-meta,
.history-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.4;
}

.history-progress,
.history-progress-track {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: #dfe8e1;
}

.history-progress {
  width: min(240px, 100%);
  margin-top: 9px;
}

.history-progress > span,
.history-progress-bar,
.history-progress-fill {
  height: 100%;
  display: block;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--lime-strong), #65c771);
}

progress.history-progress {
  appearance: none;
  border: 0;
}

progress.history-progress::-webkit-progress-bar {
  border-radius: 999px;
  background: #dfe8e1;
}

progress.history-progress::-webkit-progress-value {
  border-radius: 999px;
  background: linear-gradient(90deg, var(--lime-strong), #65c771);
}

progress.history-progress::-moz-progress-bar {
  border-radius: 999px;
  background: linear-gradient(90deg, var(--lime-strong), #65c771);
}

.history-watch-time,
.history-item-time,
.history-duration {
  color: #4e6e60;
  font-size: 0.8rem;
  font-weight: 800;
  text-align: right;
  white-space: nowrap;
}

.history-empty {
  display: grid;
  justify-items: center;
  padding: clamp(34px, 6vw, 60px) 20px 34px;
  color: var(--muted);
  text-align: center;
}

.history-empty > span {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  border-radius: 18px;
  background: var(--lime-soft);
  color: #679a2b;
}

.history-empty svg {
  width: 31px;
  height: 31px;
}

.history-empty strong {
  color: var(--forest-deep);
}

.history-empty p {
  max-width: 390px;
  margin: 7px 0 0;
  font-size: 0.86rem;
  line-height: 1.5;
}

.app-shell.theater {
  width: 100%;
  max-width: none;
  padding: 0 0 20px;
}

.app-shell.theater .topbar,
.app-shell.theater .below-player {
  padding-right: clamp(16px, 3vw, 44px);
  padding-left: clamp(16px, 3vw, 44px);
}

.app-shell.theater .watch-layout {
  gap: 0;
}

.app-shell.theater .video-card,
.app-shell.theater .video-stage {
  border-radius: 0;
}

.app-shell.theater .chat-panel {
  margin-right: 12px;
  border-radius: 0 22px 22px 0;
}

.watch-layout:fullscreen {
  height: 100vh;
  grid-template-columns: minmax(0, 1fr) 370px;
  gap: 0;
  background: #030b08;
}

.watch-layout:fullscreen.chat-closed {
  grid-template-columns: minmax(0, 1fr) 0;
}

.watch-layout:fullscreen .player-column,
.watch-layout:fullscreen .video-card,
.watch-layout:fullscreen .video-stage {
  height: 100%;
}

.watch-layout:fullscreen .video-card,
.watch-layout:fullscreen .video-stage,
.watch-layout:fullscreen .chat-panel {
  border-radius: 0;
}

.watch-layout:fullscreen .video-stage {
  aspect-ratio: auto;
}

.watch-layout:fullscreen .below-player {
  display: none;
}

.watch-layout:fullscreen .chat-panel {
  min-height: 0;
  border-top: 0;
  border-right: 0;
  border-bottom: 0;
}

@media (max-width: 980px) {
  .watch-layout,
  .watch-layout.chat-closed {
    grid-template-columns: minmax(0, 1fr);
  }

  .watch-layout:fullscreen,
  .watch-layout:fullscreen.chat-closed {
    grid-template-columns: minmax(0, 1fr);
  }

  .chat-panel {
    position: fixed;
    z-index: 20;
    right: 14px;
    bottom: 14px;
    width: min(390px, calc(100vw - 28px));
    height: min(650px, calc(100vh - 28px));
    min-height: 0;
  }

  .chat-closed .chat-panel {
    transform: translateY(28px);
  }

  .video-stage {
    min-height: 0;
  }

  .profile-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .identity-card {
    display: grid;
    grid-template-columns: minmax(220px, 0.8fr) minmax(260px, 1fr);
    column-gap: 28px;
    align-items: start;
  }

  .identity-card h2 {
    grid-column: 1 / -1;
  }

  .avatar-editor {
    margin-bottom: 0;
  }
}

@media (max-width: 380px) {
  .control-group {
    gap: 4px;
  }

  #theaterButton {
    display: none;
  }

  .time-label {
    font-size: 0.72rem;
  }
}

@media (max-width: 820px) and (min-width: 621px) {
  .brand > span:last-child,
  .sync-pill > span:last-child,
  .top-chat-button > span:not(.unread-badge),
  .voice-button > span,
  .mic-device-picker > span,
  .people-pill > span:last-child,
  .profile-button-name {
    display: none;
  }

  .room-meta {
    gap: 6px;
  }

  .sync-pill,
  .top-chat-button,
  .voice-button,
  .people-pill,
  .profile-button {
    min-width: 42px;
    justify-content: center;
    padding: 7px 10px;
  }

  .mic-device-picker {
    width: 42px;
    padding: 7px 10px;
    justify-content: center;
  }

  .profile-button {
    padding: 6px;
  }
}

@media (max-width: 620px) {
  .app-shell {
    padding: 10px 10px 24px;
  }

  .topbar {
    min-height: 54px;
    margin-bottom: 10px;
  }

  .sync-pill {
    display: none;
  }

  .brand > span:last-child,
  .sync-pill > span:last-child,
  .top-chat-button > span:not(.unread-badge),
  .voice-button > span,
  .mic-device-picker > span,
  .people-pill > span:last-child,
  .profile-button-name {
    display: none;
  }

  .room-meta {
    gap: 6px;
  }

  .sync-pill,
  .top-chat-button,
  .voice-button,
  .people-pill,
  .profile-button {
    min-width: 42px;
    justify-content: center;
    padding: 7px 10px;
  }

  .mic-device-picker {
    width: 42px;
    padding: 7px 10px;
    justify-content: center;
  }

  .profile-button {
    padding: 6px;
  }

  .video-card {
    border-radius: 20px;
  }

  .empty-state {
    padding: 24px 18px;
  }

  .empty-icon,
  .empty-state > p:not(.eyebrow) {
    display: none;
  }

  .empty-state h1 {
    max-width: 330px;
    margin-bottom: 18px;
    font-size: 1.35rem;
  }

  .player-controls {
    padding: 38px 10px 8px;
  }

  .volume,
  .text-control span,
  .time-divider,
  #duration {
    display: none;
  }

  .icon-button,
  .text-control {
    min-width: 44px;
    min-height: 44px;
    padding: 0;
  }

  .below-player {
    align-items: flex-start;
    padding: 14px 3px 0;
  }

  .below-actions {
    gap: 6px;
  }

  .share-button {
    width: 46px;
    min-width: 46px;
    padding: 0;
    font-size: 0;
  }

  .chat-panel {
    right: 8px;
    bottom: 8px;
    width: calc(100vw - 16px);
    height: min(72vh, 620px);
    border-radius: 22px;
  }

  .join-backdrop {
    align-items: end;
    padding: 8px;
  }

  .join-card {
    border-radius: 26px;
  }

  .profile-page {
    padding-bottom: 28px;
  }

  .profile-topbar {
    min-height: 64px;
    gap: 8px;
    padding: 10px;
  }

  .profile-back,
  .profile-live-pill {
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    justify-content: center;
    padding: 0;
  }

  .profile-back span,
  .profile-topbar .join-brand > span:last-child {
    display: none;
  }

  .profile-live-pill {
    font-size: 0;
  }

  .profile-shell {
    width: calc(100% - 20px);
  }

  .profile-heading {
    align-items: stretch;
    flex-direction: column;
    gap: 20px;
    padding: 30px 4px 22px;
  }

  .profile-heading h1 {
    font-size: clamp(2.25rem, 13vw, 3.3rem);
  }

  .profile-heading > div:first-child > p:last-child {
    margin-top: 12px;
    font-size: 0.9rem;
  }

  .now-watching-chip {
    width: 100%;
    min-width: 0;
    max-width: none;
  }

  .profile-card,
  .profile-summary {
    border-radius: 22px;
  }

  .identity-card {
    display: block;
    padding: 22px;
  }

  .avatar-editor {
    margin: 23px 0 24px;
  }

  .profile-avatar-large {
    width: 82px;
    height: 82px;
    flex-basis: 82px;
  }

  .profile-summary,
  .history-card {
    padding: 22px;
  }

  .profile-section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .counting-note {
    max-width: none;
    text-align: left;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 20px;
  }

  .stat-card {
    min-height: 142px;
    padding: 16px;
  }

  .stat-card.featured {
    grid-column: 1 / -1;
    min-height: 150px;
  }

  .stat-card strong {
    font-size: clamp(1.75rem, 9vw, 2.35rem);
  }

  .history-card {
    margin-top: 12px;
  }

  .history-item,
  .history-entry,
  .history-row {
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 11px;
    padding: 12px;
  }

  .history-item-icon,
  .history-icon,
  .history-thumb {
    width: 42px;
    height: 42px;
    border-radius: 12px;
  }

  .history-watch-time,
  .history-item-time,
  .history-duration {
    grid-column: 2;
    margin-top: -4px;
    text-align: left;
  }
}

@media (max-width: 380px) {
  .stats-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .stat-card.featured {
    grid-column: auto;
  }

  .avatar-editor {
    align-items: flex-start;
    gap: 14px;
  }

  .profile-avatar-large {
    width: 76px;
    height: 76px;
    flex-basis: 76px;
  }
}

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