@charset "UTF-8";

:root {
  color-scheme: light;
  --page: #f4f6f5;
  --surface: #ffffff;
  --ink: #25372f;
  --muted: #6d7972;
  --line: #e0e6e2;
  --green: #24533f;
  --green-hover: #183e2d;
  --green-light: #eaf2ed;
  --error: #a83c35;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--page); }
body { margin: 0; color: var(--ink); font-size: 14px; -webkit-font-smoothing: antialiased; }
button, input { font: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: wait; opacity: .6; }
button, input { outline: none; }
button:focus-visible, input:focus-visible { outline: 3px solid #a9cbb6; outline-offset: 3px; }
button svg, .screen-empty svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
[hidden] { display: none !important; }
.svg-symbols { position: absolute; width: 0; height: 0; overflow: hidden; }
.app-name { font-size: 22px; font-weight: 650; white-space: nowrap; }
.entry-view { min-height: 100svh; }
.entry-header { height: 72px; padding: 0 34px; display: flex; align-items: center; gap: 18px; border-bottom: 1px solid var(--line); background: var(--surface); }
.app-description { font-size: 13px; color: var(--muted); padding-left: 18px; border-left: 1px solid var(--line); }
.entry-main { padding: 68px 24px 48px; }
.entry-card { width: 100%; max-width: 450px; margin: auto; padding: 30px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.entry-card h1 { font-size: 24px; font-weight: 600; margin: 0 0 12px; }
.entry-description { font-size: 13px; color: var(--muted); margin: 0; line-height: 1.7; }
.entry-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin: 25px 0; border-radius: 8px; background: #eef2ef; }
.entry-modes button { min-height: 40px; border: 0; border-radius: 5px; background: transparent; color: #6f7d73; }
.entry-modes button[aria-pressed="true"] { background: var(--surface); color: var(--green); font-weight: 550; box-shadow: 0 1px 3px #14321f0b; }
.form-field { margin-bottom: 20px; }
label { display: flex; align-items: center; justify-content: space-between; font-size: 13px; color: #465c4e; margin-bottom: 9px; }
label span { color: #89948d; font-size: 12px; font-weight: normal; }
input { width: 100%; min-width: 0; height: 44px; border: 1px solid #dbe3dd; border-radius: 6px; color: var(--ink); background: var(--surface); padding: 0 12px; }
input::placeholder { color: #9ba59e; }
input:focus { border-color: #87ac94; box-shadow: 0 0 0 3px #eaf2ed; }
#room-id, .room-code { letter-spacing: 2px; text-transform: uppercase; font-family: Consolas, "SFMono-Regular", monospace; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 43px; padding: 0 16px; border: 0; border-radius: 6px; font-weight: 500; font-size: 13px; }
.button-primary { background: var(--green); color: white; }
.button-primary:hover { background: var(--green-hover); }
.button-secondary { background: #edf3ef; color: #42654d; border: 1px solid #dce6de; }
.button-secondary:hover { background: #e3ede6; }
.entry-submit { width: 100%; margin-top: 3px; }
.entry-error { color: var(--error); background: #fff1ed; border: 1px solid #f1d4cc; border-radius: 6px; padding: 10px 12px; margin: 0 0 18px; line-height: 1.7; font-size: 12px; }
.entry-error:empty { display: none; }
.browser-note { margin: 20px 0 0; font-size: 12px; color: #869187; line-height: 1.75; }

.room-view { min-height: 100svh; display: flex; flex-direction: column; }
.room-header { min-height: 65px; padding: 16px 25px; display: flex; align-items: center; gap: 25px; border-bottom: 1px solid var(--line); background: var(--surface); }
.room-header .app-name { font-size: 20px; }
.room-header h1 { margin: 0; font-size: 15px; font-weight: 550; padding-left: 25px; border-left: 1px solid var(--line); }
.connection-status { margin-left: auto; color: #6f8b76; font-size: 12px; white-space: nowrap; }
.connection-status.is-reconnecting { color: #ad8051; }
.room-main { width: 100%; flex: 1; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) 235px; gap: 16px; padding: 18px 20px 14px; align-items: start; }
.screens-panel { min-width: 0; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); overflow: hidden; }
.screens-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 49px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.screens-toolbar h2 { font-size: 13px; font-weight: 550; margin: 0; }
.screens-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; min-width: 0; }
.screen-view-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; align-items: center; gap: 6px; }
.screen-view-button, .screen-tile-fullscreen { min-height: 30px; padding: 4px 9px; border: 1px solid var(--line); border-radius: 4px; color: var(--ink); background: var(--surface); font-size: 12px; white-space: nowrap; }
.screen-view-button:hover, .screen-tile-fullscreen:hover { background: var(--green-light); }
.screen-view-button:disabled { cursor: default; }
.viewer-message { margin: 0; padding: 8px 12px; font-size: 12px; line-height: 1.6; color: var(--ink); background: var(--green-light); }
.transmission-status { font-size: 12px; color: #788a7b; text-align: right; }
.transmission-status.is-transmitting { color: #386e4b; }
.screen-empty { min-height: 420px; padding: 45px 20px; display: flex; flex-direction: column; justify-content: center; align-items: center; color: #91a195; text-align: center; }
.screen-empty > svg { width: 37px; height: 37px; stroke-width: 1.3; margin-bottom: 19px; color: #9aad9f; }
.screen-empty h2 { margin: 0 0 12px; font-size: 17px; font-weight: 500; color: #687d6d; }
.screen-empty p { margin: 0; max-width: 360px; font-size: 13px; line-height: 1.8; color: #8a998e; }
.screen-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 12px; align-content: start; min-width: 0; }
.screen-grid:empty { display: none; }
.screen-grid > :only-child { grid-column: 1 / -1; }
.screen-tile { display: flex; flex-direction: column; min-width: 0; overflow: hidden; border: 1px solid #dce4de; border-radius: 7px; background: #182b21; }
.screen-tile-header { display: flex; align-items: center; justify-content: space-between; min-height: 37px; gap: 10px; padding: 9px 11px; background: #f6f8f6; }
.screen-tile-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 500; color: #4c6655; }
.screen-tile-status { color: #87968a; font-size: 11px; white-space: nowrap; }
.screen-tile-tools { display: flex; align-items: center; gap: 8px; margin-left: auto; flex-shrink: 0; }
.screen-select { display: inline-flex; justify-content: flex-start; align-items: center; gap: 5px; margin: 0; font-size: 12px; cursor: pointer; white-space: nowrap; }
.screen-select input { width: 15px; height: 15px; min-width: 15px; margin: 0; padding: 0; accent-color: var(--green); cursor: pointer; }
.screen-select span { font-size: 12px; color: var(--ink); }
.screen-tile.is-selected { border-color: var(--green); }
.screen-tile-fullscreen { min-height: 27px; padding: 3px 7px; }
.screen-tile-video { display: block; width: 100%; height: auto; min-height: 0; aspect-ratio: 16 / 9; object-fit: contain; background: #182b21; }
.screen-tile-video video { display: block; width: 100%; height: 100%; object-fit: contain; }
.screen-grid > :only-child .screen-tile-video { max-height: calc(100svh - 245px); }
.people-panel { min-width: 0; border: 1px solid var(--line); border-radius: 10px; padding: 17px 14px; background: var(--surface); }
.people-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 17px; }
.people-heading h2 { margin: 0; font-size: 13px; font-weight: 550; }
.participant-count { color: #7d8c81; font-size: 12px; }
.participants { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 9px; }
.participant { display: flex; align-items: center; gap: 9px; padding: 9px; border-radius: 7px; background: #f4f7f4; min-width: 0; }
.participant.is-self, .participant.self { background: #eaf2eb; }
.participant-avatar { display: grid; place-items: center; flex-shrink: 0; width: 33px; height: 33px; border-radius: 8px; background: #dce8dd; color: #648369; font-size: 13px; }
.participant:nth-child(2n) .participant-avatar { background: #e8e0d3; color: #927f64; }
.participant:nth-child(3n) .participant-avatar { background: #e3dfeb; color: #837694; }
.participant-info { min-width: 0; flex: 1; }
.participant-name { display: block; color: #49614e; font-size: 12px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.participant-meta { display: block; margin-top: 4px; font-size: 10px; color: #86958a; line-height: 1.5; }
.participant-badge { color: #79917d; background: #e2ece2; padding: 3px 4px; border-radius: 3px; font-size: 9px; white-space: nowrap; }
.participant.speaking .participant-avatar { box-shadow: 0 0 0 2px #71a67c; }
.room-footer { padding: 0 20px 18px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.room-status-row { min-height: 20px; display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.status-message { color: #7c8b80; font-size: 12px; text-align: center; line-height: 1.7; }
.status-message:empty { display: none; }
.status-message.error { color: var(--error); }
.sound-button { display: inline-flex; align-items: center; gap: 5px; border: 1px solid #d7e4d9; color: #52745b; background: #edf4ed; padding: 5px 9px; border-radius: 5px; font-size: 12px; }
.sound-button svg { width: 14px; height: 14px; }
.room-controls { padding: 8px; display: flex; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.control-button { border: 0; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 9px 16px; border-radius: 6px; background: transparent; color: #536c5a; font-size: 13px; white-space: nowrap; }
.control-button svg { width: 18px; height: 18px; }
.control-button:hover { background: #eef4ef; }
.control-button[aria-pressed="true"] { background: #e9f2e9; color: #397144; }
.share-button { color: white; background: var(--green); }
.share-button:hover { background: var(--green-hover); }
.share-button[aria-pressed="true"] { background: #e5efe6; color: #3f754a; }
.leave-button { color: #a86e60; }
.leave-button:hover { background: #fbefea; color: #9d5142; }
.remote-audio { display: none; }

.invite-dialog { width: min(420px, calc(100% - 32px)); padding: 25px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: var(--surface); box-shadow: 0 15px 65px #11271925; }
.invite-dialog::backdrop { background: #1f30284d; }
.dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 25px; }
.dialog-header h2 { margin: 0; font-size: 20px; font-weight: 550; }
.icon-button { width: 29px; height: 29px; padding: 5px; border: 0; border-radius: 5px; color: #839188; background: transparent; display: grid; place-items: center; }
.icon-button:hover { background: #f0f4f0; }
.icon-button svg { width: 18px; height: 18px; }
.copy-row { display: flex; align-items: center; gap: 8px; margin-bottom: 22px; }
.copy-row .button { flex-shrink: 0; padding-inline: 12px; font-size: 12px; }
.invite-dialog input { font-size: 12px; background: #f7f9f7; }
.invite-dialog .room-code { font-size: 17px; font-weight: 550; color: #4f6a57; }
#copy-invite { width: 100%; margin-top: 12px; }
#copy-invite svg { width: 17px; height: 17px; }
.invite-note { margin: 17px 0 0; font-size: 12px; color: #8b968e; line-height: 1.75; }

@media (min-width: 1500px) {
  .room-main { grid-template-columns: minmax(0, 1fr) 250px; }
}
@media (max-width: 900px) {
  .room-main { grid-template-columns: minmax(0, 1fr) 205px; gap: 12px; padding: 15px 15px 12px; }
  .screen-grid { gap: 8px; padding: 8px; }
  .screen-tile-header { gap: 6px; padding: 8px; }
  .screen-tile-title { font-size: 11px; }
  .screen-tile-status { font-size: 9px; }
  .participant { gap: 7px; padding: 8px; }
  .participant-avatar { width: 29px; height: 29px; }
  .participant-name { font-size: 11px; }
  .participant-badge { font-size: 8px; }
}
@media (max-width: 700px) {
  .entry-header { height: 63px; padding: 0 20px; gap: 15px; }
  .entry-header .app-name { font-size: 21px; }
  .app-description { font-size: 12px; padding-left: 15px; }
  .entry-main { padding: 35px 16px; }
  .entry-card { padding: 25px 22px; }
  .entry-card h1 { font-size: 23px; }
  .entry-description { font-size: 12px; }
  .entry-modes { margin: 22px 0; }
  .room-header { min-height: 61px; padding: 14px 15px; gap: 15px; }
  .room-header .app-name { font-size: 19px; }
  .room-header h1 { font-size: 12px; padding-left: 15px; }
  .connection-status { font-size: 10px; }
  .room-main { display: flex; flex-direction: column; gap: 12px; padding: 12px 10px; }
  .screens-panel, .people-panel { width: 100%; border-radius: 8px; }
  .screens-toolbar { padding: 11px 12px; min-height: 43px; }
  .screens-toolbar h2 { font-size: 12px; }
  .transmission-status { font-size: 10px; }
  .screen-empty { min-height: 290px; padding: 35px 18px; }
  .screen-empty h2 { font-size: 16px; }
  .screen-empty p { font-size: 12px; }
  .screen-grid { grid-template-columns: minmax(0, 1fr); padding: 7px; gap: 9px; }
  .screen-grid > :only-child .screen-tile-video { max-height: none; }
  .screen-tile-title { font-size: 12px; }
  .screen-tile-status { font-size: 10px; }
  .people-panel { padding: 14px 12px; }
  .people-heading { margin-bottom: 12px; }
  .people-heading h2 { font-size: 12px; }
  .participant-count { font-size: 11px; }
  .participants { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .participant-meta { font-size: 9px; }
  .participant-badge { font-size: 8px; }
  .room-footer { padding: 0 10px max(15px, env(safe-area-inset-bottom)); gap: 8px; }
  .status-message { font-size: 11px; }
  .room-controls { width: 100%; max-width: 470px; padding: 6px; gap: 4px; border-radius: 8px; }
  .control-button { flex: 1; flex-direction: column; min-height: 51px; gap: 6px; font-size: 11px; padding: 8px 6px; }
  .control-button svg { width: 18px; height: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
[hidden] { display: none !important; }
.screen-tile-waiting {
  min-height: 200px;
  margin: 0;
  padding: 24px;
  display: grid;
  place-content: center;
  color: #dce8e1;
  text-align: center;
}

body.screen-viewing-open { overflow: hidden; }
.screens-panel.is-screen-viewing {
  position: fixed; inset: 0; z-index: 1000; width: 100%; height: 100dvh;
  max-width: none; max-height: none; margin: 0; border: 0; border-radius: 0;
  background: #101a15;
}
.screens-panel::backdrop { background: #101a15; }
.is-screen-viewing .screens-toolbar { flex-shrink: 0; background: var(--surface); }
.is-screen-viewing .viewer-message { flex-shrink: 0; }
.is-screen-viewing .screen-grid {
  flex: 1; min-height: 0; align-content: stretch; overflow: auto;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 8px;
}
.is-screen-viewing .screen-tile[data-fullscreen-visible="false"] { display: none; }
.is-screen-viewing .screen-grid[data-view-layout="single"] { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
.is-screen-viewing .screen-grid[data-view-layout="pair"] { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: minmax(0, 1fr); }
.is-screen-viewing .screen-grid[data-view-layout="many"] { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: none; grid-auto-rows: minmax(180px, 1fr); }
.is-screen-viewing .screen-tile { min-height: 0; grid-column: auto; }
.is-screen-viewing .screen-tile-header { flex-shrink: 0; }
.is-screen-viewing .screen-tile-video, .is-screen-viewing .screen-grid > :only-child .screen-tile-video {
  flex: 1 1 0; width: 100%; height: 100%; min-height: 0; max-height: none;
  aspect-ratio: auto; object-fit: contain;
}
.is-screen-viewing .screen-tile-waiting { flex: 1; min-height: 0; padding: 12px; }
@media (max-width: 700px) {
  .screens-toolbar { flex-wrap: wrap; }
  .screen-view-actions { margin-left: auto; }
  .screen-tile-header { flex-wrap: wrap; }
  .screen-tile-status { margin-left: auto; }
  .screen-tile-tools { gap: 6px; }
  .is-screen-viewing .screen-tile-status { display: none; }
  .is-screen-viewing .screen-tile-tools { gap: 4px; }
  .is-screen-viewing .screen-grid[data-view-layout="many"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-aspect-ratio: 3/4) {
  .is-screen-viewing .screen-grid[data-view-layout="pair"] { grid-template-columns: minmax(0, 1fr); grid-template-rows: repeat(2, minmax(0, 1fr)); }
}
