:root {
  --ink: #17223b;
  --paper: #fbfaf7;
  --blue: #2456d6;
  --blue-dark: #123a9e;
  --amber: #f2a33c;
  --teal: #17a398;
  --red: #d64545;
  --line: #d9dce3;
  --muted: #6b7280;
  --soft: #eef2fb;
  --shadow: 0 12px 34px rgba(23, 34, 59, 0.10);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "PingFang SC", "Songti SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-size: 18px;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

.hidden {
  display: none !important;
}

.btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 8px;
  padding: 10px 16px;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(23, 34, 59, 0.12);
}

.btn.primary {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

.btn.primary:hover {
  background: var(--blue-dark);
}

.btn.big {
  font-size: 22px;
  font-weight: 700;
  padding: 14px 26px;
}

.error-text {
  color: var(--red);
  min-height: 22px;
  margin-top: 8px;
}

.ok-text {
  color: var(--teal);
  font-weight: 700;
}

/* Login */

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 16px;
  background:
    radial-gradient(circle at 15% 15%, rgba(36, 86, 214, 0.10), transparent 30%),
    radial-gradient(circle at 85% 20%, rgba(242, 163, 60, 0.18), transparent 32%),
    linear-gradient(160deg, #f4f7ff, #fffdf8);
}

.login-panel {
  width: min(760px, 100%);
  height: min(calc(100vh - 36px), 1180px);
  max-height: calc(100vh - 36px);
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 26px 28px;
  box-shadow: var(--shadow);
}

.login-title {
  font-size: 32px;
  font-weight: 900;
  text-align: center;
}

.login-sub {
  text-align: center;
  color: var(--muted);
  margin: 6px 0 26px;
}

.field-label {
  display: block;
  margin: 14px 0 6px;
  font-weight: 700;
}

select,
input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 12px;
  background: #fff;
}

select:focus,
input:focus,
textarea:focus {
  outline: 2px solid rgba(36, 86, 214, 0.28);
  border-color: var(--blue);
}

.login-panel .btn {
  width: 100%;
  margin-top: 22px;
}

.login-panel input,
.login-panel select {
  min-height: 52px;
  font-size: 17px;
  touch-action: manipulation;
}

.login-class-display {
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef2fb;
  color: var(--blue-dark);
  font-size: 19px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
}

.login-roster {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(var(--cols, 7), minmax(0, 1fr));
  grid-auto-rows: minmax(0, 1fr);
  gap: 8px;
  padding: 6px;
  margin: 4px 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f7f9fd;
  overflow: hidden;
}

.login-num {
  border: 1px solid #d7dcea;
  background: #ffffff;
  border-radius: 8px;
  padding: 0;
  min-height: 0;
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 900;
  color: #253250;
  cursor: pointer;
  touch-action: manipulation;
}

.login-num.picked {
  background: #2456d6;
  border-color: #2456d6;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(36, 86, 214, 0.35);
}

.login-picked {
  font-size: 16px;
  font-weight: 800;
  color: #2456d6;
  margin-bottom: 12px;
  min-height: 22px;
}

@media (max-height: 780px) {
  .login-panel {
    padding: 18px 22px;
  }

  .login-title {
    font-size: 26px;
  }

  .login-sub {
    margin: 4px 0 14px;
  }

  .field-label {
    margin: 8px 0 5px;
  }
}

/* App shell */

#app {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  padding: 10px 18px;
  backdrop-filter: blur(10px);
}

.brand {
  font-size: 21px;
  font-weight: 900;
  color: var(--blue-dark);
  letter-spacing: 0;
}

.top-info {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
}

.stage-pill {
  display: inline-block;
  background: var(--soft);
  color: var(--blue-dark);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 16px;
}

.card-btn {
  border: 1px solid #f2b45c;
  background: #fff4de;
  color: #9a5b06;
  border-radius: 999px;
  padding: 6px 12px;
  font-weight: 800;
  cursor: pointer;
  font-size: 16px;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  border: 1px solid #a8d9d0;
  background: #e8faf6;
  color: #0d6558;
  border-radius: 999px;
  padding: 6px 12px;
  font-weight: 800;
  cursor: pointer;
  font-size: 16px;
}

.share-btn.active {
  background: #17a398;
  border-color: #17a398;
  color: #fff;
}

.share-btn.unsupported {
  border-color: #d8dee9;
  background: #f2f4f8;
  color: #6b7280;
}

.stage-shell {
  width: min(1280px, calc(100% - 28px));
  margin: 0 auto;
  padding: 20px 0 40px;
}

.stage-panel {
  display: none;
}

.stage-panel.active {
  display: block;
  animation: fadeIn 0.22s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.panel-head {
  margin-bottom: 18px;
}

.panel-head h2 {
  font-size: 32px;
  margin: 4px 0 8px;
  letter-spacing: 0;
}

.panel-head p {
  color: var(--muted);
  margin: 0;
  font-size: 18px;
}

.eyebrow {
  display: inline-block;
  color: var(--blue-dark);
  background: var(--soft);
  border-radius: 6px;
  padding: 4px 10px;
  font-weight: 800;
}

.two-col {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 16px;
}

.info-card,
.class-wall,
.student-info-card,
.build-panel,
.director-feedback,
.process-box,
.question-box {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.info-card h3,
.class-wall h3,
.build-panel h3,
.process-box h3 {
  margin: 0 0 12px;
}

.student-avatar-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 0 12px;
  margin-bottom: 10px;
  border-bottom: 1px dashed #d9dce3;
}

.student-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(145deg, #e7edff, #f7e9c9);
  display: grid;
  place-items: center;
  font-size: 40px;
  border: 3px solid #d6e0f7;
  flex: 0 0 auto;
}

.avatar-label {
  color: var(--muted);
  font-size: 16px;
  font-weight: 800;
}

.avatar-name {
  font-size: 26px;
  font-weight: 900;
  color: var(--blue-dark);
}

.manual-tip {
  color: var(--muted);
  line-height: 1.7;
  margin: 0 0 14px;
}

.code-input {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 1px;
  margin-bottom: 16px;
}

.info-choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(122px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.info-choice-card {
  border: 1px solid var(--line);
  background: #fafbfc;
  border-radius: 8px;
  padding: 10px 6px;
  cursor: pointer;
  text-align: center;
  font-weight: 900;
  color: var(--ink);
  font-size: 20px;
  transition: background 0.12s ease, transform 0.12s ease;
}

.info-choice-card span {
  display: block;
  margin-top: 4px;
  font-size: 15px;
  color: var(--muted);
  font-weight: 500;
}

.info-choice-card:hover {
  transform: translateY(-2px);
}

.info-choice-card.chosen {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

.info-choice-card.chosen span {
  color: rgba(255, 255, 255, 0.78);
}

.round3-board {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.round3-row {
  display: grid;
  grid-template-columns: 300px minmax(320px, 1fr);
  gap: 14px;
  align-items: start;
}

.round3-form {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.round3-name {
  margin-bottom: 8px;
  color: var(--blue-dark);
  font-size: 18px;
  font-weight: 800;
}

.round3-status {
  color: #17a398;
  font-size: 18px;
  font-weight: 800;
}

@media (max-width: 760px) {
  .round3-row {
    grid-template-columns: 1fr;
  }
}

.build-subject {
  margin: 6px 0 10px;
  padding: 8px 12px;
  border-radius: 8px;
  background: #eef3ff;
  color: #1b3a7a;
  font-size: 18px;
  font-weight: 800;
}

.pick-board {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

.pick-col {
  border: 1px dashed #c9d5ec;
  border-radius: 10px;
  padding: 10px;
  background: #f8fafd;
  min-height: 210px;
}

.pick-col-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--muted);
  margin-bottom: 8px;
}

.pick-col .info-choice-grid {
  margin-bottom: 0;
}

.chosen-zone {
  border-color: #9db6f0;
  background: #eef3ff;
}

.pick-order {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin-right: 6px;
  border-radius: 50%;
  background: #ffffff;
  color: var(--blue);
  font-size: 15px;
  font-style: normal;
}

@media (max-width: 760px) {
  .pick-board {
    grid-template-columns: 1fr;
  }
}

.chosen-info-list {
  min-height: 34px;
  border: 1px dashed #c9d2e8;
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 16px;
  background: #f8faff;
  color: var(--blue-dark);
  font-weight: 800;
  line-height: 1.5;
}

.info-row {
  display: grid;
  grid-template-columns: 116px 1fr;
  gap: 6px;
  padding: 7px 0;
  border-bottom: 1px dashed #e5e7eb;
}

.info-row:last-child {
  border-bottom: 0;
}

.info-label {
  color: var(--muted);
}

.info-value {
  font-weight: 800;
}

.roster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 8px;
}

.roster-cell {
  border: 1px solid var(--line);
  border-radius: 6px;
  text-align: center;
  padding: 10px 4px;
  font-weight: 800;
  background: #fafbfc;
}

.roster-cell.me {
  border-color: var(--blue);
  background: var(--soft);
  color: var(--blue-dark);
}

.think-note {
  margin-top: 14px;
  color: var(--blue-dark);
  background: #fff8e8;
  border: 1px solid #f2d59f;
  border-radius: 8px;
  padding: 14px 16px;
  font-weight: 700;
}

/* Short film */

.short-film {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.film-stage {
  display: none;
  min-height: 96px;
  align-items: center;
  gap: 18px;
  background: linear-gradient(120deg, #17223b, #2456d6);
  color: #fff;
  border-radius: 10px;
  padding: 18px 24px;
}

.film-stage.active {
  display: flex;
  animation: sceneIn 0.5s ease;
}

@keyframes sceneIn {
  from {
    opacity: 0;
    transform: translateX(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.film-emoji {
  font-size: 52px;
}

.film-text {
  font-size: 21px;
  font-weight: 800;
}

.question-box label {
  font-weight: 800;
  display: block;
  margin-bottom: 8px;
}

/* Builder */

.builder-layout {
  display: grid;
  grid-template-columns: 300px minmax(420px, 1fr);
  gap: 14px;
  align-items: start;
}

.info-card-stack {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.student-info-card.active {
  border-color: #2456d6;
  box-shadow: 0 0 0 3px rgba(36, 86, 214, 0.18);
}

.student-info-card {
  cursor: default;
}

.info-card-stack.pair-mode .student-info-card {
  cursor: pointer;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.info-card-stack.pair-mode .student-info-card:hover {
  border-color: #9db6f0;
}

.process-status {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f4f7ff;
  color: var(--blue-dark);
  font-size: 18px;
}

.student-info-card .info-row {
  grid-template-columns: 104px 1fr;
}

.chip-pool {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 16px;
}

.chip {
  border: 1px solid #c9d2e8;
  background: #f5f8ff;
  color: var(--blue-dark);
  border-radius: 999px;
  padding: 9px 14px;
  cursor: pointer;
  font-weight: 700;
}

.chip:hover {
  background: #e4ecff;
  transform: translateY(-1px);
}

.chip .code-hint {
  color: var(--muted);
  font-weight: 500;
  font-size: 15px;
}

.chosen-title {
  font-weight: 800;
  margin-bottom: 8px;
}

.chosen-parts {
  min-height: 58px;
  border: 2px dashed #c9d2e8;
  border-radius: 8px;
  padding: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.chosen-tag {
  background: var(--blue);
  color: #fff;
  border-radius: 6px;
  padding: 6px 10px;
  font-weight: 700;
  cursor: pointer;
}

.code-preview {
  margin: 14px 0;
  min-height: 62px;
  border-radius: 8px;
  background: #0f1b33;
  color: #fff;
  font-size: 26px;
  font-weight: 900;
  letter-spacing: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  word-break: break-all;
  text-align: center;
}

.btn-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.director-feedback {
  grid-column: 1 / -1;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: linear-gradient(120deg, #fff8e8, #fff);
}

.director-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #17223b;
  display: grid;
  place-items: center;
  font-size: 42px;
  flex: 0 0 auto;
}

.director-avatar.big {
  width: 96px;
  height: 96px;
  font-size: 60px;
  margin: 0 auto;
}

.director-name {
  font-weight: 900;
  font-size: 17px;
  margin-bottom: 4px;
}

.feedback-text {
  line-height: 1.7;
  font-size: 20px;
  white-space: pre-line;
}

.process-box {
  margin-top: 16px;
}

.student-history {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.history-row {
  border-left: 4px solid var(--blue);
  background: #fafbfc;
  border-radius: 6px;
  padding: 10px 12px;
  line-height: 1.6;
}

.history-row .round {
  color: var(--muted);
  font-size: 15px;
}

/* Review */

.review-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.detective-banner {
  grid-column: 1 / -1;
  background: #eef7ff;
  border: 1px solid #bfd7f2;
  color: var(--blue-dark);
  border-radius: 8px;
  padding: 12px 16px;
  font-weight: 800;
}

.review-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  position: relative;
  min-height: 190px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  border-top: 5px solid #2456d6;
}

.review-card::before {
  content: "";
  position: absolute;
  right: -34px;
  top: -34px;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: rgba(36, 86, 214, 0.06);
}

.review-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.review-sticker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 900;
  color: var(--blue-dark);
}

.review-emoji {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #eef2fb;
  display: grid;
  place-items: center;
  font-size: 22px;
  border: 2px solid #c9d5f2;
}

.anonymous-stamp {
  transform: rotate(-8deg);
  color: #b45309;
  border: 2px dashed #f2b45c;
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 13px;
  font-weight: 900;
  background: #fff8e8;
}

.review-card .work-code {
  font-size: 30px;
  font-weight: 900;
  letter-spacing: 1px;
  color: var(--blue-dark);
  word-break: break-all;
  margin: 14px 0;
  font-family: "SFMono-Regular", "Menlo", monospace;
}

.review-card .work-parts {
  color: var(--muted);
  margin-bottom: 12px;
}

.review-card:nth-child(3n + 1) {
  border-top-color: #f2a33c;
}

.review-card:nth-child(3n + 1) .review-emoji {
  background: #fff4de;
  border-color: #f4d29c;
}

.review-card:nth-child(3n + 2) {
  border-top-color: #17a398;
}

.review-card:nth-child(3n + 2) .review-emoji {
  background: #e2f7f4;
  border-color: #a8ddd6;
}

.like-count {
  animation: heartBeat 1.4s ease-in-out infinite;
}

@keyframes heartBeat {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.06);
  }
}

.like-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.like-btn {
  border: 1px solid #f2b8c3;
  background: #fff5f7;
  color: #c9375a;
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 800;
  cursor: pointer;
}

.like-btn.liked {
  background: #f73d6b;
  border-color: #f73d6b;
  color: #fff;
}

.approve-btn {
  border: 1px solid #3da38d;
  background: #e6f8f4;
  color: #0d5f52;
  border-radius: 8px;
  padding: 9px 12px;
  font-weight: 900;
  cursor: pointer;
  width: 100%;
  margin-top: 10px;
}

.approve-btn:hover {
  background: #cdeee6;
}

.like-count {
  font-weight: 900;
  color: var(--blue-dark);
}

/* District panel is rendered inside shared builder partial */

.district-copy {
  background: #eefaf8;
  border: 1px solid #bde8e2;
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 14px;
  color: #0d5f58;
  font-weight: 700;
}

/* ID comparison */

.id-ladder {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}

.id-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.id-card.mini {
  border-left: 6px solid var(--amber);
}

.id-card b {
  display: block;
  color: var(--muted);
  margin-bottom: 8px;
}

.id-card span {
  font-size: 24px;
  font-weight: 900;
  word-break: break-all;
}

.id-question {
  margin-top: 16px;
  background: var(--soft);
  border-radius: 8px;
  padding: 16px 18px;
  font-size: 17px;
  line-height: 1.7;
}

/* Lock & modal */

.lock-layer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 90;
  background: rgba(15, 27, 51, 0.86);
  /* 老平板兜底：不支持 grid 时用 flex 居中 */
  display: flex;
  align-items: center;
  justify-content: center;
  display: grid;
  place-items: center;
}

.projection-overlay {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 120;
  background: #0e1730;
}

.vote-overlay {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
  overflow-y: auto;
  background: #0e1730;
}

.vote-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
}

.vote-title {
  color: #ffffff;
  font-size: 26px;
  font-weight: 900;
}

.vote-hint {
  color: rgba(255, 255, 255, 0.66);
  font-size: 15px;
  font-weight: 700;
}

.vote-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 14px;
  align-content: start;
}

.vote-item {
  padding: 14px;
  border-radius: 12px;
  border-top: 6px solid var(--cat, #2456d6);
  background: #ffffff;
}

.vote-item-cat {
  color: #5b6785;
  font-size: 15px;
  font-weight: 800;
  word-break: break-all;
}

.vote-item-code {
  margin: 8px 0 12px;
  color: #10203f;
  font-size: 40px;
  font-weight: 900;
  letter-spacing: 0.02em;
  word-break: break-all;
}

.vote-actions {
  display: flex;
  gap: 10px;
}

.vote-btn {
  flex: 1;
  padding: 14px 10px;
  border: 2px solid #d8dee9;
  border-radius: 10px;
  background: #f5f7fb;
  color: #1b2745;
  font-size: 20px;
  font-weight: 900;
  cursor: pointer;
}

.vote-btn.ok.chosen {
  border-color: #2f9e6e;
  background: #e6f7ef;
  color: #1f8a5f;
}

.vote-btn.bad.chosen {
  border-color: #e2554f;
  background: #fdeceb;
  color: #c94f4f;
}

.vote-done {
  margin-top: 10px;
  color: #1f8a5f;
  font-size: 15px;
  font-weight: 800;
}

.projection-overlay iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  pointer-events: none;
}

.lock-card {
  color: #fff;
  text-align: center;
  font-size: clamp(26px, 5.5vh, 76px);
  font-weight: 800;
  line-height: 1.35;
  padding: 0 24px;
}

.lock-emoji {
  font-size: clamp(48px, 12vh, 140px);
  margin-bottom: 18px;
}

/* 第一环节提交完成，锁屏上只有「已提交」三个字，给足尺寸 */
.lock-layer.is-done .lock-card {
  font-size: clamp(56px, 17vh, 220px);
  font-weight: 900;
}

.lock-layer.is-done .lock-emoji {
  font-size: clamp(64px, 18vh, 220px);
}

.modal-layer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 80;
  background: rgba(15, 27, 51, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal-card {
  width: min(560px, 100%);
  background: #fff;
  border-radius: 10px;
  padding: 28px;
  position: relative;
  box-shadow: var(--shadow);
}

.director-modal-card {
  text-align: center;
  background: linear-gradient(180deg, #fff8e8, #fff 42%);
}

.director-matches {
  margin: 16px auto 0;
  max-width: 470px;
  background: #fff;
  border: 1px solid #f2d59f;
  border-radius: 8px;
  padding: 12px 14px;
  text-align: left;
}

.director-matches .match-title {
  font-weight: 900;
  color: var(--blue-dark);
  margin-bottom: 8px;
}

.match-surnames {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.match-surname {
  border: 1px solid #c9d5f2;
  background: #eef2fb;
  color: var(--blue-dark);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 14px;
  font-weight: 800;
}

.director-modal-text {
  margin: 14px auto 0;
  font-size: 20px;
  line-height: 1.8;
  font-weight: 700;
  white-space: pre-line;
  max-width: 470px;
}

.card-modal-card {
  width: min(620px, 100%);
  text-align: center;
}

.card-modal-title {
  font-size: 24px;
  font-weight: 900;
  margin-bottom: 12px;
  color: var(--blue-dark);
}

.detective-card-img {
  width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
}

.card-download {
  display: inline-block;
  margin-top: 12px;
  text-decoration: none;
}

.close-btn {
  position: absolute;
  top: 10px;
  right: 12px;
  border: 0;
  background: transparent;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
}

@media (max-width: 1000px) {
  .two-col,
  .builder-layout {
    grid-template-columns: 1fr;
  }

  .director-feedback {
    grid-column: auto;
  }

  .panel-head h2 {
    font-size: 26px;
  }
}

@media (max-width: 640px) {
  .top-info {
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
  }

  .stage-shell {
    width: calc(100% - 18px);
  }

  .film-text {
    font-size: 17px;
  }

  .code-preview {
    font-size: 20px;
  }
}
