:root {
  font-family: "Microsoft YaHei UI", "PingFang SC", "Noto Sans SC", system-ui, sans-serif;
  color: #182d32;
  background: #e8eee9;
  --paper: #f8fbf8;
  --muted: #4a615f;
  --line: #c6d3ce;
  --teal: #07584d;
  --stage: #14292e;
  --stage-text: #ddeddf;
  --danger: #922d33;
  font-size: 16px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 280px; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .6; }
:focus-visible { outline: 3px solid #0c7b7d; outline-offset: 3px; }
h1, h2, p { margin: 0; }

.entry {
  min-height: 100svh;
  max-width: 1020px;
  margin: auto;
  padding: 40px 24px;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: clamp(28px, 6vw, 84px);
  align-items: center;
}
.entry-screen {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: end;
  gap: 8px;
  padding: 22% 14%;
  background: var(--stage);
  aspect-ratio: 5 / 4;
  border-radius: 22px;
  box-shadow: inset 0 0 0 1px #31484d;
}
.entry-screen span { background: #b9e2c2; aspect-ratio: 1 / 1.2; border-radius: 40% 40% 12px 12px; }
.entry-screen span + span { background: #84b9ac; margin-bottom: 17%; }
.entry-form { max-width: 380px; width: 100%; justify-self: center; }
.wordmark { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.05rem; color: var(--teal); }
.room-symbol { display: inline-block; width: 23px; height: 18px; border: 2px solid currentColor; border-radius: 4px; position: relative; }
.room-symbol::after { content: ""; position: absolute; inset: 3px 8px 3px 3px; border-radius: 2px; background: currentColor; }
.entry-form h1 { margin: 22px 0 10px; font-size: clamp(2.15rem, 4vw, 3.2rem); letter-spacing: -.055em; line-height: 1.1; }
.entry-form > p { color: var(--muted); line-height: 1.6; margin-bottom: 28px; }
form { display: grid; gap: 10px; }
label { font-weight: 650; font-size: .9rem; }
input:not([type="file"]), select {
  display: block;
  width: 100%;
  min-height: 44px;
  color: #182d32;
  background: var(--paper);
  border: 1px solid #a9beb5;
  border-radius: 7px;
  padding: 9px 11px;
}
input::placeholder { color: #526963; }
.primary, .stop {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 44px;
  padding: 8px 16px;
  background: var(--teal);
  border: 1px solid transparent;
  border-radius: 7px;
  color: white;
  font-weight: 650;
  text-decoration: none;
}
form > .primary { margin-top: 6px; }
.primary:hover { background: #064b42; }
.stop { background: var(--danger); }
.quiet { color: var(--teal); border: 1px solid var(--line); background: transparent; border-radius: 7px; min-height: 40px; padding: 7px 11px; }
.quiet:hover { background: #dae6dd; }
.message { color: var(--teal); font-size: .9rem; line-height: 1.45; }
.message.is-error, #login-error { color: var(--danger); }

.room { width: min(100% - 40px, 1440px); margin: 0 auto; }
.topbar { display: flex; align-items: center; justify-content: space-between; min-height: 76px; gap: 12px; }
.top-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.layout { padding-bottom: 24px; }
.layout.with-admin { display: grid; grid-template-columns: minmax(0, 1fr) 315px; align-items: start; gap: 22px; }
.screen { overflow: hidden; border-radius: 17px; border: 1px solid #aabdaf; background: var(--paper); }
.screen-bar, .screen-footer { padding: 12px 17px; display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 58px; }
.screen-bar > div { display: flex; gap: 8px; align-items: center; }
.screen h2, .console h2 { font-size: 1.05rem; }
.mode-label, .screen-footer { color: var(--muted); font-size: .9rem; }
.live-dot { width: 9px; height: 9px; background: #b22649; border-radius: 50%; }
.stage {
  min-height: 250px;
  height: min(67svh, 760px);
  background: var(--stage);
  color: var(--stage-text);
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
}
.stage:fullscreen { height: 100%; }
.stage > .shared-image, .stage > .shared-video { width: 100%; height: 100%; max-height: 100%; min-height: 0; object-fit: contain; }
.stage > .shared-image { padding: clamp(12px, 2vw, 36px); }
.stage > .qr-image { background: #fff; padding: clamp(12px, 2vw, 24px); }
.stage-card { text-align: center; display: grid; justify-items: center; gap: 12px; padding: 22px; max-width: min(100%, 540px); overflow-wrap: anywhere; }
.stage-card strong { font-size: clamp(1.2rem, 2vw, 1.55rem); }
.stage-card p { line-height: 1.55; color: #c0d8ce; }
.stage .primary { color: #103c31; background: #b9e2c2; }
.player-start { position: absolute; inset: auto auto 38px; z-index: 1; }
.network-note { color: var(--danger); padding: 0 17px 13px; }

.console { background: var(--paper); padding: 18px; border: 1px solid var(--line); border-radius: 13px; }
.console h2 { margin-bottom: 16px; }
.switcher { display: grid; grid-template-columns: 1.2fr .65fr 1.05fr; gap: 3px; border-bottom: 1px solid var(--line); margin: 0 0 17px; }
.switcher > button { border: 0; border-bottom: 2px solid transparent; border-radius: 0; color: var(--muted); background: transparent; min-height: 41px; padding: 6px 3px; font-size: .86rem; white-space: nowrap; }
.switcher > button[aria-pressed="true"] { color: var(--teal); border-color: var(--teal); font-weight: 700; }
.dropzone { display: grid; gap: 4px; justify-items: center; text-align: center; padding: 20px 10px; border: 1px dashed #779f8d; border-radius: 7px; background: #edf5ef; color: var(--teal); cursor: pointer; min-height: 83px; }
.dropzone.over, .dropzone:hover, .dropzone:has(+ input:focus-visible) { background: #dfefe3; outline: 2px solid #408271; }
.file-name { overflow-wrap: anywhere; max-width: 100%; }
.file-hint { font-size: .8rem; font-weight: 400; color: var(--muted); }
.panel-help { color: var(--muted); line-height: 1.6; margin-bottom: 14px; }
.console .message { margin-top: 12px; }
.console-footer { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--line); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

@media (max-width: 860px) {
  .layout.with-admin { grid-template-columns: minmax(0, 1fr); }
  .console { max-width: 530px; width: 100%; }
  .stage { height: min(58svh, 620px); }
}
@media (max-width: 560px) {
  .entry { grid-template-columns: 1fr; gap: 22px; padding: 32px 20px; align-content: center; }
  .entry-screen { justify-self: center; width: min(340px, 100%); max-height: 138px; padding: 15px 27%; align-items: center; }
  .room { width: calc(100% - 24px); }
  .topbar { min-height: 62px; }
  .top-actions .quiet { padding-inline: 7px; font-size: .8rem; }
  .screen-bar, .screen-footer { padding-inline: 12px; }
  .stage { height: min(56svh, 470px); min-height: 215px; }
}
