:root {
  color-scheme: dark;
  --background: #090b10;
  --surface: #141822;
  --surface-raised: #1b2130;
  --text: #f5f7fb;
  --muted: #a8b0c0;
  --accent: #e5a00d;
  --accent-hover: #f7b62e;
  --danger: #e85c66;
  --border: #2a3242;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 80% -20%, rgb(229 160 13 / 16%), transparent 42rem),
    var(--background);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.site-header {
  display: flex;
  min-height: 4.25rem;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem clamp(1rem, 4vw, 3rem);
  border-bottom: 1px solid var(--border);
  background: rgb(9 11 16 / 78%);
  backdrop-filter: blur(14px);
}

.brand {
  color: var(--text);
  font-weight: 750;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.account,
.account form {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.account img {
  border-radius: 999px;
}

.header-link {
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 700;
  text-decoration: none;
}

.header-link:hover {
  color: var(--text);
}

.page-shell {
  width: min(1440px, calc(100% - 2rem));
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 4rem) 0;
}

.card {
  padding: clamp(1.5rem, 4vw, 2.5rem);
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: linear-gradient(145deg, var(--surface-raised), var(--surface));
  box-shadow: 0 1.25rem 4rem rgb(0 0 0 / 25%);
}

.narrow-card {
  max-width: 38rem;
  margin: 8vh auto 0;
}

h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.8rem, 5vw, 3rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
}

p {
  color: var(--muted);
  line-height: 1.6;
}

.eyebrow {
  margin: 0 0 0.6rem;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

button,
.button {
  display: inline-flex;
  min-height: 2.6rem;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1rem;
  border: 0;
  border-radius: 0.55rem;
  background: var(--accent);
  color: #181105;
  font: inherit;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
}

button:hover,
.button:hover {
  background: var(--accent-hover);
}

.secondary {
  border: 1px solid var(--border);
  background: var(--surface-raised);
  color: var(--text);
}

.link-button {
  min-height: auto;
  padding: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.875rem;
}

.link-button:hover {
  background: transparent;
  color: var(--text);
}

.watch-layout {
  display: grid;
  gap: 1rem;
}

.watch-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
}

.watch-heading h1 {
  margin-bottom: 0;
}

.status-pill {
  flex: none;
  margin: 0;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.8rem;
}

.status-pill.connected {
  border-color: rgb(67 190 128 / 55%);
  color: #78dfa9;
}

.warning {
  padding: 0.8rem 1rem;
  border: 1px solid rgb(229 160 13 / 45%);
  border-radius: 0.65rem;
  background: rgb(229 160 13 / 10%);
  color: #ffd77e;
}

.player-frame {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--border);
  border-radius: 0.8rem;
  background: #000;
  box-shadow: 0 1.5rem 5rem rgb(0 0 0 / 35%);
}

.player-frame video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.player-message {
  position: absolute;
  z-index: 2;
  top: 0.75rem;
  left: 50%;
  width: max-content;
  max-width: calc(100% - 1.5rem);
  padding: 0.55rem 0.8rem;
  border: 1px solid rgb(255 255 255 / 9%);
  border-radius: 999px;
  background: rgb(9 11 16 / 82%);
  color: var(--text);
  box-shadow: 0 0.5rem 1.5rem rgb(0 0 0 / 28%);
  font-size: 0.82rem;
  line-height: 1.35;
  text-align: center;
  transform: translateX(-50%);
  pointer-events: none;
  backdrop-filter: blur(12px);
}

.player-action {
  position: absolute;
  z-index: 3;
  top: 50%;
  left: 50%;
  min-width: 8.5rem;
  min-height: 3.25rem;
  padding: 0.8rem 1.25rem;
  border: 1px solid rgb(255 255 255 / 18%);
  border-radius: 999px;
  background: rgb(20 24 34 / 88%);
  color: var(--text);
  box-shadow: 0 0.75rem 2rem rgb(0 0 0 / 42%);
  font-size: 0.95rem;
  transform: translate(-50%, -50%);
  backdrop-filter: blur(14px);
}

.player-action:hover {
  background: rgb(35 42 57 / 94%);
}

.player-action:active {
  transform: translate(-50%, -50%) scale(0.97);
}

.leader-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.party-playback-controls {
  grid-area: controls;
  display: grid;
  gap: 0.65rem;
  padding: 0.75rem;
  border-top: 1px solid var(--border);
  background: #0d1119;
}

.party-timeline {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.65rem;
}

.party-time {
  min-width: 3.4rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: 0.78rem;
  text-align: center;
}

.party-seek,
.local-volume-controls input {
  accent-color: var(--accent);
}

.party-seek {
  width: 100%;
}

.party-seek:disabled {
  cursor: default;
  opacity: 0.65;
}

.party-control-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.party-control-button {
  min-height: 2.35rem;
  padding: 0.5rem 0.8rem;
  white-space: nowrap;
}

.primary-control {
  min-width: 5.5rem;
}

.party-ready-status {
  margin-right: auto;
  color: var(--muted);
  font-size: 0.78rem;
}

.local-volume-controls {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.local-volume-controls input {
  width: 7rem;
}

.playback-request-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid rgb(229 160 13 / 35%);
  border-radius: 0.65rem;
  background: rgb(229 160 13 / 8%);
}

.playback-request-panel > span {
  min-width: 0;
  color: var(--text);
  font-size: 0.82rem;
}

.playback-request-actions {
  display: flex;
  flex: none;
  gap: 0.4rem;
}

.playback-request-actions button {
  min-height: 2rem;
  padding: 0.35rem 0.65rem;
  font-size: 0.75rem;
}

.leader-controls .danger {
  background: var(--danger);
  color: white;
}

.helper-text {
  margin: 0;
  font-size: 0.875rem;
}

.quality-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}

.quality-controls select {
  max-width: 100%;
  padding: 0.5rem 0.75rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.4rem;
  font: inherit;
}

.quality-controls .helper-text {
  flex-basis: 100%;
}

[hidden] {
  display: none !important;
}

button:disabled {
  cursor: default;
  opacity: 0.5;
}

button:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

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

.player-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(20rem, 23rem);
  grid-template-rows: minmax(0, 1fr) auto auto;
  grid-template-areas:
    "video chat"
    "controls chat"
    "toolbar chat";
  overflow: hidden;
  border: 1px solid rgb(255 255 255 / 9%);
  border-radius: 1rem;
  background: #05070b;
  box-shadow: 0 1.5rem 5rem rgb(0 0 0 / 35%);
}

.player-shell.chat-hidden {
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "video"
    "controls"
    "toolbar";
}

.player-shell .player-frame {
  grid-area: video;
  min-width: 0;
  min-height: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.player-toolbar {
  display: flex;
  grid-area: toolbar;
  flex-wrap: wrap;
  align-items: center;
  justify-content: end;
  gap: 0.5rem;
  padding: 0.6rem;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.player-toolbar .helper-text {
  flex: 1 1 10rem;
  font-size: 0.75rem;
}

.player-toolbar button {
  min-height: 2.2rem;
  padding: 0.5rem 0.7rem;
  font-size: 0.8rem;
}

.chat-unread {
  min-width: 1.25rem;
  margin-left: 0.4rem;
  padding: 0.1rem 0.3rem;
  border-radius: 999px;
  background: var(--accent);
  color: #181105;
  font-size: 0.7rem;
}

.party-chat {
  display: flex;
  grid-area: chat;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  border-left: 1px solid rgb(255 255 255 / 8%);
  background:
    linear-gradient(180deg, rgb(255 255 255 / 3%), transparent 7rem),
    #10141d;
}

.chat-heading {
  display: flex;
  flex: none;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  border-bottom: 1px solid rgb(255 255 255 / 7%);
  background: rgb(255 255 255 / 2%);
  backdrop-filter: blur(10px);
}

.chat-heading h2 {
  margin: 0;
  color: var(--text);
  font-size: 1rem;
  letter-spacing: -0.01em;
}

.chat-heading h2 span {
  margin-right: 0.25rem;
  color: var(--muted);
  font-size: 1.15rem;
}

.chat-heading p {
  margin: 0.15rem 0 0;
  font-size: 0.7rem;
}

.party-members {
  flex: none;
  max-height: 14rem;
  overflow-y: auto;
  margin: 0.65rem;
  border: 1px solid rgb(255 255 255 / 8%);
  border-radius: 0.75rem;
  background: #0b0f17;
}

.party-members-heading {
  position: sticky;
  z-index: 1;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.65rem 0.7rem;
  border-bottom: 1px solid rgb(255 255 255 / 7%);
  background: #111722;
}

.party-members-label {
  display: inline-block;
  margin: 0;
  color: #8e97a8;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.party-member-count {
  margin-left: 0.45rem;
  color: var(--muted);
  font-size: 0.68rem;
}

.compact-button {
  min-height: 1.8rem;
  padding: 0.3rem 0.55rem;
  font-size: 0.7rem;
}

.party-member-list {
  display: grid;
  gap: 0.15rem;
  padding: 0.35rem;
}

.party-bans {
  border-top: 1px solid rgb(255 255 255 / 7%);
  color: var(--muted);
}

.party-bans summary {
  padding: 0.55rem 0.7rem;
  cursor: pointer;
  font-size: 0.7rem;
  font-weight: 750;
  list-style: none;
}

.party-bans summary::-webkit-details-marker {
  display: none;
}

.party-bans summary::before {
  margin-right: 0.35rem;
  content: "▸";
}

.party-bans[open] summary::before {
  content: "▾";
}

.party-ban-list {
  display: grid;
  gap: 0.2rem;
  padding: 0 0.35rem 0.45rem;
}

.party-ban-empty {
  margin: 0;
  padding: 0.45rem;
  font-size: 0.72rem;
}

.chat-section-label {
  display: flex;
  flex: none;
  align-items: center;
  gap: 0.5rem;
  padding: 0 0.8rem 0.35rem;
  color: #7f8899;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.chat-section-label::after {
  height: 1px;
  flex: 1;
  background: rgb(255 255 255 / 7%);
  content: "";
}

.party-member {
  display: grid;
  grid-template-columns: 1.7rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.25rem;
  padding: 0.25rem 0.35rem;
  border-radius: 0.45rem;
}

.party-member:hover,
.party-member:focus-within {
  background: rgb(255 255 255 / 4%);
}

.party-member-avatar {
  position: relative;
  display: flex;
  width: 1.7rem;
  height: 1.7rem;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 50%;
  background: #444565;
  color: #eeeefe;
  font-size: 0.7rem;
  font-weight: 800;
}

.party-member-avatar::after {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 0.48rem;
  height: 0.48rem;
  border: 2px solid #0d1119;
  border-radius: 50%;
  background: #23a55a;
  content: "";
}

.party-member-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.party-member-name {
  min-width: 0;
  min-height: auto;
  justify-content: flex-start;
  overflow: hidden;
  padding: 0;
  background: transparent;
  color: #d7d9dc;
  font-size: 0.78rem;
  font-weight: 650;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.party-member-name:hover {
  background: transparent;
  color: #fff;
  text-decoration: underline;
}

.party-member-leader .party-member-name::after {
  margin-left: 0.35rem;
  color: var(--accent);
  content: "★";
  font-size: 0.65rem;
}

.party-member-actions,
.chat-message-actions {
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.party-member-actions {
  opacity: 0;
}

.party-member:hover .party-member-actions,
.party-member:focus-within .party-member-actions {
  opacity: 1;
}

.chat-messages {
  position: relative;
  flex: 1 1 auto;
  height: 0;
  min-height: 5rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  padding: 0.7rem 0.4rem;
  scroll-padding-block: 0.75rem;
}

.chat-empty {
  padding: 0 1rem;
  font-size: 0.85rem;
}

.chat-message {
  position: relative;
  display: grid;
  grid-template-columns: 2.25rem minmax(0, 1fr);
  gap: 0.7rem;
  margin: 0.12rem 0;
  padding: 0.6rem 0.65rem;
  border-radius: 0.65rem;
}

.chat-message:hover {
  background: rgb(255 255 255 / 4%);
}

.chat-avatar {
  position: relative;
  display: flex;
  width: 2.25rem;
  height: 2.25rem;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 50%;
  background: #444565;
  color: #eeeefe;
  font-size: 0.8rem;
  font-weight: 700;
}

.chat-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chat-message-body {
  min-width: 0;
}

.chat-message-meta {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.2rem;
}

.chat-author {
  overflow-wrap: anywhere;
  color: #dee0ff;
  font-size: 0.85rem;
}

.chat-time {
  color: var(--muted);
  font-size: 0.65rem;
}

.chat-content {
  margin: 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  color: var(--text);
  font-size: 0.85rem;
  line-height: 1.5;
}

.chat-author {
  cursor: pointer;
}

.chat-reply-reference {
  display: block;
  width: 100%;
  min-height: auto;
  justify-content: flex-start;
  margin: 0 0 0.3rem;
  padding: 0 0 0 0.55rem;
  overflow: hidden;
  border-left: 2px solid #596273;
  border-radius: 0;
  background: transparent;
  color: #9da6b7;
  font-size: 0.7rem;
  font-weight: 550;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-reply-reference:hover {
  background: transparent;
  color: #d7dbe3;
}

.chat-message-actions {
  position: absolute;
  top: 0.2rem;
  right: 0.35rem;
  padding: 0.15rem;
  border: 1px solid rgb(255 255 255 / 8%);
  border-radius: 0.45rem;
  background: #181c26;
  box-shadow: 0 0.35rem 1rem rgb(0 0 0 / 30%);
  opacity: 0;
  transform: translateY(-35%);
  transition: opacity 100ms ease;
}

.chat-message:hover .chat-message-actions,
.chat-message:focus-within .chat-message-actions {
  opacity: 1;
}

.chat-action {
  min-width: 1.7rem;
  min-height: 1.7rem;
  padding: 0.2rem 0.4rem;
  border-radius: 0.35rem;
  background: transparent;
  color: #b9c0cc;
  font-size: 0.68rem;
  font-weight: 700;
}

.chat-action:hover {
  background: rgb(255 255 255 / 8%);
  color: #fff;
}

.chat-action-danger:hover {
  background: rgb(232 92 102 / 16%);
  color: #ff929a;
}

.chat-message-highlight {
  background: rgb(229 160 13 / 12%) !important;
}

.chat-jump {
  flex: none;
  min-height: 1.8rem;
  margin: 0.25rem 0.7rem;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
}

.chat-form {
  flex: none;
  padding: 0.8rem;
  border-top: 1px solid rgb(255 255 255 / 7%);
  background: rgb(5 7 11 / 45%);
}

.chat-reply {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 0.6rem;
  margin: -0.1rem 0 0.55rem;
  padding: 0.55rem 0.65rem;
  border-left: 3px solid #5865f2;
  border-radius: 0.45rem;
  background: #151a24;
}

.chat-reply-copy {
  min-width: 0;
}

.chat-reply-copy span {
  color: #b5bdca;
  font-size: 0.7rem;
}

.chat-reply-copy strong {
  color: #fff;
}

.chat-reply-copy p {
  margin: 0.1rem 0 0;
  overflow: hidden;
  color: #858e9e;
  font-size: 0.7rem;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-reply .link-button {
  flex: none;
  color: #aeb6c4;
  font-size: 1rem;
}

.chat-form textarea {
  display: block;
  width: 100%;
  min-height: 4rem;
  max-height: 9rem;
  resize: vertical;
  padding: 0.75rem 0.8rem;
  border: 1px solid rgb(255 255 255 / 10%);
  border-radius: 0.75rem;
  background: #0b0f17;
  color: var(--text);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 2%);
  font: inherit;
  font-size: 0.85rem;
  line-height: 1.45;
}

.chat-form textarea:disabled {
  opacity: 0.6;
}

.chat-compose-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.chat-count,
.chat-status,
.chat-hint {
  margin: 0.4rem 0 0;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.4;
}

.chat-count {
  margin: 0;
}

.chat-count.over-limit,
.chat-status.chat-error {
  color: #ff929a;
}

.chat-compose-footer button {
  min-height: 2rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.8rem;
}

.chat-context-menu {
  position: fixed;
  z-index: 1500;
  width: min(13rem, calc(100vw - 1rem));
  padding: 0.35rem;
  border: 1px solid rgb(255 255 255 / 10%);
  border-radius: 0.6rem;
  background: #111722;
  box-shadow: 0 1rem 3rem rgb(0 0 0 / 45%);
}

.chat-context-item {
  display: flex;
  width: 100%;
  min-height: 2.2rem;
  justify-content: flex-start;
  padding: 0.45rem 0.6rem;
  border-radius: 0.4rem;
  background: transparent;
  color: #d7dce5;
  font-size: 0.78rem;
  font-weight: 600;
}

.chat-context-item:hover,
.chat-context-item:focus-visible {
  background: rgb(255 255 255 / 8%);
  color: #fff;
}

.chat-context-item.danger {
  color: #ff929a;
}

.chat-context-item.danger:hover {
  background: rgb(232 92 102 / 15%);
}

.chat-context-separator {
  height: 1px;
  margin: 0.3rem;
  background: rgb(255 255 255 / 8%);
}

.party-dialog {
  width: min(30rem, calc(100vw - 2rem));
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: #111722;
  color: var(--text);
  box-shadow: 0 2rem 6rem rgb(0 0 0 / 60%);
}

.party-dialog::backdrop {
  background: rgb(0 0 0 / 65%);
  backdrop-filter: blur(4px);
}

.party-dialog form {
  padding: 1rem;
}

.party-dialog-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.party-dialog-heading h2 {
  margin: 0;
  font-size: 1.1rem;
}

.party-dialog-heading p {
  margin: 0.3rem 0 0;
  font-size: 0.78rem;
}

.party-dialog label,
.admin-inline-form label {
  display: grid;
  gap: 0.35rem;
  color: #c7ced9;
  font-size: 0.75rem;
  font-weight: 700;
}

.party-dialog input,
.admin-inline-form input,
.admin-inline-form select {
  width: 100%;
  min-height: 2.5rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: #0b0f17;
  color: var(--text);
  font: inherit;
}

.invite-suggestion-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.45rem;
  color: #c7ced9;
  font-size: 0.75rem;
  font-weight: 700;
}

.invite-suggestion-heading small,
.invite-helper {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 500;
}

.invite-suggestions {
  display: grid;
  max-height: 13rem;
  gap: 0.25rem;
  overflow-y: auto;
  margin-bottom: 0.8rem;
  padding: 0.3rem;
  border: 1px solid var(--border);
  border-radius: 0.65rem;
  background: #0b0f17;
}

.invite-candidate {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  min-height: 2.7rem;
  padding: 0.35rem 0.45rem;
  border: 0;
  border-radius: 0.5rem;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.invite-candidate:hover,
.invite-candidate:focus-visible {
  background: rgb(255 255 255 / 6%);
}

.invite-candidate .party-member-avatar::after {
  display: none;
}

.invite-candidate-name {
  overflow: hidden;
  font-size: 0.8rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.invite-candidate-action {
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
}

.party-dialog-actions {
  display: flex;
  justify-content: end;
  gap: 0.5rem;
  margin-top: 1rem;
}

.admin-page {
  display: grid;
  gap: 1.25rem;
}

.admin-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
}

.admin-heading h1 {
  margin-bottom: 0.35rem;
}

.admin-heading p {
  max-width: 52rem;
  margin: 0;
}

.admin-count {
  flex: none;
  padding: 0.4rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.78rem;
}

.admin-grid {
  display: grid;
  gap: 1rem;
}

.admin-party-card {
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: linear-gradient(145deg, var(--surface-raised), var(--surface));
}

.admin-party-top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
}

.admin-party-top h2 {
  margin: 0.2rem 0 0;
  font-size: 1.25rem;
}

.admin-server {
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.admin-party-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 0.65rem;
  margin: 1rem 0;
}

.admin-party-details div {
  padding: 0.65rem;
  border: 1px solid rgb(255 255 255 / 6%);
  border-radius: 0.55rem;
  background: rgb(0 0 0 / 12%);
}

.admin-party-details dt {
  color: var(--muted);
  font-size: 0.68rem;
}

.admin-party-details dd {
  margin: 0.2rem 0 0;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 0.82rem;
}

.admin-actions {
  display: grid;
  gap: 0.7rem;
}

.admin-actions form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.admin-actions .danger {
  background: var(--danger);
  color: white;
}

.admin-inline-form {
  display: grid !important;
  grid-template-columns: minmax(12rem, 1fr) auto;
  align-items: end;
}

.admin-empty h2 {
  margin-top: 0;
}

.profile-page {
  display: grid;
  width: 100%;
  gap: 1.25rem;
}

.profile-hero,
.profile-panel {
  border: 1px solid rgb(255 255 255 / 8%);
  border-radius: 1.15rem;
  background:
    linear-gradient(145deg, rgb(255 255 255 / 2%), transparent 44%),
    #111620;
  box-shadow: 0 1.25rem 3.5rem rgb(0 0 0 / 18%);
}

.profile-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(18rem, 24rem);
  gap: clamp(1.2rem, 3vw, 2.2rem);
  padding: clamp(1.25rem, 3vw, 2rem);
  background:
    radial-gradient(circle at 92% 8%, rgb(229 160 13 / 13%), transparent 24rem),
    linear-gradient(145deg, #1a202c, #10141d);
}

.profile-hero-main {
  display: grid;
  min-width: 0;
  align-content: center;
  gap: 1.15rem;
}

.profile-identity {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 1rem;
}

.profile-identity h1 {
  margin: 0 0 0.35rem;
}

.profile-subtitle {
  max-width: 46rem;
  margin: 0;
  font-size: 0.9rem;
}

.profile-avatar {
  width: 5.75rem;
  height: 5.75rem;
  flex: none;
  border: 2px solid rgb(255 255 255 / 12%);
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0.8rem 2.2rem rgb(0 0 0 / 30%);
}

.profile-avatar-fallback {
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, var(--surface-raised), #252d3e);
  color: var(--accent);
  font-size: 2rem;
  font-weight: 850;
}

.profile-stat-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-self: stretch;
  gap: 0.65rem;
}

.profile-stat {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.9rem 1rem;
  border: 1px solid rgb(255 255 255 / 7%);
  border-radius: 0.8rem;
  background: rgb(0 0 0 / 16%);
}

.profile-stat span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.profile-stat strong {
  color: var(--text);
  font-size: 1.55rem;
  line-height: 1;
}

.profile-server-strip {
  display: grid;
  gap: 0.5rem;
  padding-top: 0.9rem;
  border-top: 1px solid rgb(255 255 255 / 6%);
}

.profile-server-strip-label {
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.profile-server-strip > div {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.profile-server-chip {
  padding: 0.38rem 0.6rem;
  border: 1px solid rgb(255 255 255 / 8%);
  border-radius: 999px;
  background: rgb(255 255 255 / 3%);
  color: #d9dee8;
  font-size: 0.7rem;
  font-weight: 650;
}

.profile-panel {
  overflow: hidden;
}

.profile-panel-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem 1.25rem 1rem;
  border-bottom: 1px solid rgb(255 255 255 / 7%);
  background: rgb(255 255 255 / 1.5%);
}

.profile-panel-heading h2 {
  margin: 0.15rem 0 0.2rem;
  font-size: clamp(1.2rem, 2.2vw, 1.55rem);
}

.profile-panel-heading p {
  max-width: 48rem;
  margin: 0;
  font-size: 0.8rem;
}

.profile-panel-count {
  flex: none;
  padding: 0.35rem 0.6rem;
  border: 1px solid rgb(255 255 255 / 8%);
  border-radius: 999px;
  background: rgb(255 255 255 / 3%);
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
}

.profile-panel-body {
  padding: 1rem;
}

.active-party-grid,
.past-party-grid,
.history-grid {
  display: grid;
  gap: 0.85rem;
}

.active-party-grid {
  grid-template-columns: repeat(auto-fit, minmax(29rem, 1fr));
}

.past-party-grid,
.history-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.active-party-card,
.past-party-card,
.history-card {
  overflow: hidden;
  border: 1px solid rgb(255 255 255 / 7%);
  border-radius: 0.9rem;
  background:
    linear-gradient(145deg, rgb(255 255 255 / 2%), transparent 48%),
    #0d121b;
  transition:
    border-color 140ms ease,
    transform 140ms ease,
    background 140ms ease;
}

.active-party-card:hover,
.past-party-card:hover,
.history-card:hover {
  border-color: rgb(229 160 13 / 24%);
  transform: translateY(-1px);
  background:
    linear-gradient(145deg, rgb(229 160 13 / 3.5%), transparent 48%),
    #101620;
}

.active-party-card {
  display: grid;
  grid-template-columns: 9rem minmax(0, 1fr);
  min-height: 13.5rem;
}

.active-party-content {
  display: grid;
  min-width: 0;
  align-content: start;
  gap: 0.8rem;
  padding: 1rem;
}

.active-party-content h3,
.past-party-card h3,
.history-card h3 {
  margin: 0;
  color: var(--text);
  line-height: 1.25;
}

.active-party-content h3 {
  font-size: 1.15rem;
}

.profile-poster-shell {
  position: relative;
  display: grid;
  overflow: hidden;
  place-items: center;
  background:
    radial-gradient(circle at 35% 20%, rgb(229 160 13 / 14%), transparent 65%),
    #090d14;
  isolation: isolate;
}

.profile-poster-shell::after {
  position: absolute;
  z-index: 2;
  inset: 0;
  background: linear-gradient(180deg, transparent 62%, rgb(0 0 0 / 35%));
  content: "";
  pointer-events: none;
}

.profile-poster-large {
  min-height: 13.5rem;
  border-right: 1px solid rgb(255 255 255 / 6%);
}

.profile-poster-small,
.history-poster {
  border-right: 1px solid rgb(255 255 255 / 6%);
}

.profile-poster {
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-poster-fallback {
  color: #818b9d;
  font-size: 2rem;
}

.live-poster-badge,
.poster-kind {
  position: absolute;
  z-index: 3;
  right: 0.5rem;
  bottom: 0.5rem;
  padding: 0.24rem 0.42rem;
  border-radius: 0.35rem;
  background: rgb(7 10 15 / 82%);
  color: #f5f7fb;
  font-size: 0.58rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  backdrop-filter: blur(8px);
}

.live-poster-badge {
  top: 0.5rem;
  bottom: auto;
  background: rgb(194 53 62 / 88%);
  color: white;
}

.profile-card-topline,
.history-heading,
.history-footer,
.profile-progress-labels,
.past-party-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
}

.profile-server-badge {
  display: inline-flex;
  max-width: 14rem;
  padding: 0.27rem 0.48rem;
  overflow: hidden;
  border: 1px solid rgb(229 160 13 / 18%);
  border-radius: 999px;
  background: rgb(229 160 13 / 8%);
  color: var(--accent);
  font-size: 0.64rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-party-meta,
.profile-access-note,
.history-episode,
.history-time,
.past-party-footer time {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.45;
}

.profile-progress-block {
  display: grid;
  gap: 0.35rem;
}

.profile-progress-track {
  width: 100%;
  height: 0.38rem;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: #252d39;
  appearance: none;
}

.profile-progress-track::-webkit-progress-bar {
  border-radius: 999px;
  background: #252d39;
}

.profile-progress-track::-webkit-progress-value {
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover));
}

.profile-progress-track::-moz-progress-bar {
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover));
}

.profile-progress-labels {
  color: var(--muted);
  font-size: 0.65rem;
}

.profile-card-actions {
  display: flex;
  align-items: center;
  margin-top: auto;
  min-height: 2.25rem;
}

.button-link {
  display: inline-flex;
  min-height: 2.3rem;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.8rem;
  border-radius: 0.5rem;
  background: var(--accent);
  color: #14100a;
  font-size: 0.75rem;
  font-weight: 800;
  text-decoration: none;
}

.button-link:hover {
  background: var(--accent-hover);
}

.past-party-card {
  display: grid;
  grid-template-columns: 5.5rem minmax(0, 1fr);
  min-height: 8.25rem;
}

.profile-poster-small {
  min-height: 8.25rem;
}

.past-party-main {
  display: grid;
  min-width: 0;
  align-content: start;
  gap: 0.55rem;
  padding: 0.75rem 0.85rem;
}

.past-party-main h3 {
  overflow: hidden;
  font-size: 0.9rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.past-party-footer {
  margin-top: auto;
}

.participation-pill {
  flex: none;
  padding: 0.24rem 0.42rem;
  border: 1px solid rgb(67 190 128 / 28%);
  border-radius: 999px;
  background: rgb(67 190 128 / 9%);
  color: #78dfa9;
  font-size: 0.61rem;
  font-weight: 750;
}

.participation-pill.muted {
  border-color: rgb(255 255 255 / 8%);
  background: rgb(255 255 255 / 3%);
  color: var(--muted);
}

.history-card {
  display: grid;
  grid-template-columns: 7.25rem minmax(0, 1fr);
  min-height: 10.75rem;
}

.history-poster {
  min-height: 10.75rem;
}

.history-body {
  display: grid;
  min-width: 0;
  grid-template-rows: auto 1fr auto auto;
  gap: 0.65rem;
  padding: 0.85rem 0.95rem;
}

.history-heading {
  align-items: start;
}

.history-heading h3 {
  margin-top: 0.35rem;
  font-size: 0.98rem;
}

.history-year {
  color: var(--muted);
  font-size: 0.78em;
  font-weight: 550;
}

.history-state {
  flex: none;
  padding: 0.28rem 0.46rem;
  border-radius: 999px;
  background: rgb(229 160 13 / 10%);
  color: var(--accent);
  font-size: 0.62rem;
  font-weight: 800;
}

.history-state.complete {
  background: rgb(69 191 124 / 10%);
  color: #79dfa7;
}

.history-state.muted {
  background: rgb(255 255 255 / 5%);
  color: var(--muted);
}

.history-progress-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.65rem;
}

.history-progress-row strong {
  min-width: 2.5rem;
  color: var(--muted);
  font-size: 0.68rem;
  text-align: right;
}

.history-progress-removed {
  padding: 0.55rem 0.65rem;
  border: 1px dashed rgb(255 255 255 / 8%);
  border-radius: 0.5rem;
  background: rgb(255 255 255 / 2%);
  color: var(--muted);
  font-size: 0.68rem;
}

.history-footer {
  align-items: end;
}

.danger-outline {
  border: 1px solid rgb(232 92 102 / 38%);
  background: transparent;
  color: #ff9ca4;
}

.danger-outline:hover {
  background: rgb(232 92 102 / 12%);
}

.profile-empty {
  display: grid;
  min-height: 12rem;
  place-items: center;
  align-content: center;
  gap: 0.35rem;
  padding: 2rem;
  border: 1px dashed rgb(255 255 255 / 10%);
  border-radius: 0.85rem;
  background: rgb(0 0 0 / 10%);
  text-align: center;
}

.profile-empty-icon {
  font-size: 1.9rem;
}

.profile-empty h3,
.profile-empty p {
  margin: 0;
}

.profile-empty p {
  color: var(--muted);
  font-size: 0.78rem;
}

body.player-expanded {
  overflow: hidden;
}

.player-shell:fullscreen,
.player-shell.is-theater {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  grid-template-columns: minmax(0, 1fr) minmax(17rem, 20rem);
  grid-template-rows: minmax(0, 1fr) auto auto;
  grid-template-areas:
    "video chat"
    "controls chat"
    "toolbar chat";
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  border: 0;
  border-radius: 0;
}

.player-shell:fullscreen.chat-hidden,
.player-shell.is-theater.chat-hidden {
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "video"
    "controls"
    "toolbar";
}

.player-shell:fullscreen .party-chat,
.player-shell.is-theater .party-chat {
  border-right: 0;
  border-left: 1px solid rgb(255 255 255 / 8%);
}

.player-shell.is-theater {
  position: fixed;
  inset: 0;
  z-index: 1000;
}

.player-shell:fullscreen .player-frame,
.player-shell.is-theater .player-frame {
  aspect-ratio: auto;
}

@media (max-width: 800px) {
  .profile-hero {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .profile-stat-row {
    width: 100%;
  }

  .active-party-grid,
  .past-party-grid,
  .history-grid {
    grid-template-columns: 1fr;
  }

  .profile-panel-heading {
    align-items: start;
  }

  .page-shell {
    width: min(100% - 1rem, 1120px);
    padding-top: 1.25rem;
  }

  .watch-layout {
    gap: 0.8rem;
  }

  .player-frame {
    border-radius: 0.75rem;
  }

  .player-message {
    top: 0.5rem;
    max-width: calc(100% - 1rem);
    padding: 0.45rem 0.65rem;
    font-size: 0.74rem;
  }

  .player-action {
    min-width: 9rem;
    min-height: 3.5rem;
    font-size: 1rem;
  }

  .player-toolbar {
    min-height: 3.5rem;
    padding: 0.5rem;
  }

  .player-toolbar .helper-text {
    display: none;
  }

  .player-toolbar button {
    min-height: 2.75rem;
    padding-inline: 0.9rem;
    font-size: 0.9rem;
  }

  .player-shell {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto 24rem;
    grid-template-areas:
      "video"
      "controls"
      "toolbar"
      "chat";
  }

  .player-shell.chat-hidden {
    grid-template-rows: auto auto auto;
    grid-template-areas:
      "video"
      "controls"
      "toolbar";
  }

  .party-chat {
    height: 24rem;
    border-top: 1px solid var(--border);
    border-right: 0;
    border-left: 0;
  }

  .player-shell:fullscreen,
  .player-shell.is-theater {
    grid-template-columns: minmax(0, 1fr) minmax(14rem, 35%);
    grid-template-rows: minmax(0, 1fr) auto auto;
    grid-template-areas:
      "video chat"
      "controls chat"
      "toolbar chat";
  }

  .player-shell:fullscreen.chat-hidden,
  .player-shell.is-theater.chat-hidden {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto auto;
    grid-template-areas:
      "video"
      "controls"
      "toolbar";
  }

  .player-shell:fullscreen .party-chat,
  .player-shell.is-theater .party-chat {
    height: auto;
    border-left: 1px solid var(--border);
    border-top: 0;
  }

  .player-shell:fullscreen .player-toolbar .helper-text,
  .player-shell.is-theater .player-toolbar .helper-text {
    display: none;
  }
}

@media (max-width: 480px) and (orientation: portrait) {
  .player-shell:fullscreen,
  .player-shell.is-theater {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto auto minmax(0, 1fr);
    grid-template-areas:
      "video"
      "controls"
      "toolbar"
      "chat";
  }

  .player-shell:fullscreen.chat-hidden,
  .player-shell.is-theater.chat-hidden {
    grid-template-rows: minmax(0, 1fr) auto auto;
    grid-template-areas:
      "video"
      "controls"
      "toolbar";
  }

  .player-shell:fullscreen .party-chat,
  .player-shell.is-theater .party-chat {
    border-left: 0;
    border-top: 1px solid var(--border);
  }
}

@media (max-width: 800px) {
  .party-members {
    max-height: 10rem;
    margin: 0.5rem;
  }

  .chat-message-actions,
  .party-member-actions {
    opacity: 1;
  }
}

@media (max-width: 600px) {
  .site-header {
    align-items: flex-start;
  }

  .account {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .account > span {
    display: none;
  }

  .profile-identity {
    align-items: flex-start;
  }

  .profile-avatar {
    width: 4rem;
    height: 4rem;
  }

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

  .profile-stat {
    min-width: 0;
    padding: 0.7rem;
  }

  .profile-panel-heading {
    align-items: flex-start;
    flex-direction: column;
    padding: 1rem;
  }

  .profile-panel-body {
    padding: 0.75rem;
  }

  .active-party-card {
    grid-template-columns: 5.75rem minmax(0, 1fr);
    min-height: 9rem;
  }

  .profile-poster-large {
    min-height: 9rem;
  }

  .past-party-card {
    grid-template-columns: 5rem minmax(0, 1fr);
  }

  .profile-poster-small {
    min-height: 7.5rem;
  }

  .history-card {
    grid-template-columns: 5.5rem minmax(0, 1fr);
    min-height: 9rem;
  }

  .history-poster {
    min-height: 9rem;
  }

  .history-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .history-footer form,
  .history-footer button {
    width: 100%;
  }

  .page-shell {
    width: 100%;
    padding-inline: 0.75rem;
  }

  .watch-heading h1 {
    font-size: clamp(2rem, 10vw, 3rem);
  }

  .quality-controls {
    padding-inline: 0.1rem;
  }

  .quality-controls select {
    min-height: 2.75rem;
  }

  .account span {
    display: none;
  }

  .watch-heading {
    align-items: start;
    flex-direction: column;
  }
}

