:root {
  --primary: #0b6e8a;
  --primary-dark: #08546a;
  --primary-soft: #e3f2f7;
  --accent: #e5484d;
  --best: #f5a524;
  --best-soft: #fff4dc;
  --bg: #f3f6f9;
  --surface: #ffffff;
  --text: #17212b;
  --muted: #64748b;
  --line: #dbe3ea;
  --danger: #c62828;
  --radius: 16px;
  --shadow: 0 2px 10px rgba(15, 40, 60, 0.08);
  font-family: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo',
    'Malgun Gothic', sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  font-size: 18px;
  line-height: 1.5;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

h1,
h2,
h3,
p {
  margin: 0;
}

a {
  color: var(--primary);
}

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

input,
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: #fff;
  font-size: 18px;
}

input:focus,
select:focus,
textarea:focus {
  outline: 3px solid rgba(11, 110, 138, 0.25);
  border-color: var(--primary);
}

input:disabled,
select:disabled,
textarea:disabled {
  background: #eef1f4;
  color: var(--muted);
}

code {
  background: #eef1f4;
  padding: 1px 6px;
  border-radius: 6px;
}

.muted {
  color: var(--muted);
}
.small {
  font-size: 14px;
}

/* ---------- 버튼 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 12px;
  border: 1.5px solid transparent;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  background: #e9eef2;
  transition: transform 0.05s, background 0.15s;
}
.btn:active:not(:disabled) {
  transform: scale(0.98);
}
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover:not(:disabled) {
  background: var(--primary-dark);
}
.btn-outline {
  background: #fff;
  border-color: var(--primary);
  color: var(--primary);
}
.btn-ghost {
  background: transparent;
  color: var(--muted);
}
.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-best-on {
  background: var(--best);
  color: #fff;
}
.btn-sm {
  min-height: 36px;
  padding: 6px 12px;
  font-size: 15px;
}
.btn-lg {
  min-height: 52px;
  font-size: 19px;
}
.btn-xl {
  width: 100%;
  min-height: 60px;
  font-size: 21px;
  margin-top: 12px;
}
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
}
.btn-row.end {
  justify-content: flex-end;
}
.icon-btn {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 10px;
  background: #f1f4f7;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
}

/* ---------- 공통 레이아웃 ---------- */
.page {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 16px calc(100px + env(safe-area-inset-bottom));
}
.panel {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin: 16px 0;
}
.panel h2 {
  font-size: 20px;
  margin-bottom: 12px;
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.panel-head h2 {
  margin: 0;
}
.center-screen {
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  padding: 24px;
}
.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--primary-soft);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 8px auto;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.notice {
  background: var(--primary-soft);
  border-radius: 12px;
  padding: 12px 14px;
  margin: 12px 0;
}
.error-text {
  color: var(--danger);
  font-weight: 600;
  margin-top: 8px;
}
.empty {
  text-align: center;
  color: var(--muted);
  padding: 28px 0;
}
.section-title {
  font-size: 18px;
  margin: 20px 0 8px;
}
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: #1f2d3a;
  color: #fff;
  padding: 12px 20px;
  border-radius: 999px;
  font-weight: 600;
  z-index: 100;
  max-width: calc(100vw - 32px);
  text-align: center;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}
.toast-error {
  background: var(--danger);
}
.emu-badge {
  position: fixed;
  right: 8px;
  bottom: 8px;
  background: #ff9800;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  z-index: 200;
  pointer-events: none;
}

/* ---------- 상단 배너 ---------- */
.sticky-top {
  position: sticky;
  top: 0;
  z-index: 20;
  margin: 0 -16px;
  padding: 8px 16px 10px;
  background: var(--bg);
}
.rules-ribbon {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  padding: 6px 0;
}
.rule-chip {
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  padding: 4px 12px;
  border-radius: 999px;
}
.timer-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #1f2d3a;
  color: #fff;
  border-radius: 14px;
  padding: 8px 14px;
  margin-top: 6px;
}
.timer-idle {
  background: transparent;
  color: var(--text);
  justify-content: center;
  padding: 2px;
}
.stage-pill {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 14px;
  font-weight: 700;
}
.timer-idle .stage-pill {
  background: var(--primary-soft);
  color: var(--primary);
}
.timer-label {
  font-size: 15px;
  opacity: 0.85;
}
.timer-value {
  margin-left: auto;
  font-size: 40px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 1px;
}
.timer-urgent {
  background: var(--accent);
  animation: pulse 1s ease-in-out infinite;
}
.timer-paused {
  background: #6b7a88;
}
@keyframes pulse {
  50% {
    opacity: 0.8;
  }
}
.topic-block {
  padding: 8px 2px 4px;
}
.team-pill {
  display: inline-block;
  background: var(--best-soft);
  color: #8a5a00;
  font-weight: 800;
  padding: 2px 12px;
  border-radius: 999px;
  margin-bottom: 6px;
}
.topic-title {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.3;
}
.topic-desc {
  color: var(--muted);
  margin-top: 6px;
  font-size: 16px;
}
.stage-hint {
  margin-top: 10px;
  font-weight: 600;
  color: var(--primary);
}

/* ---------- 입장 ---------- */
.join-head {
  text-align: center;
  padding: 24px 0 4px;
}
.event-name {
  color: var(--muted);
  font-weight: 600;
  font-size: 15px;
}
.big-label {
  display: block;
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 12px;
  text-align: center;
}
.code-input {
  text-align: center;
  font-size: 44px;
  letter-spacing: 16px;
  font-weight: 800;
  padding: 14px;
}
.team-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.team-btn {
  min-height: 96px;
  border: 2px solid var(--line);
  border-radius: 16px;
  background: #fff;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}
.team-btn.is-mine {
  border-color: var(--primary);
  background: var(--primary-soft);
}
.team-btn:disabled {
  opacity: 0.45;
}
.team-btn-name {
  font-size: 24px;
  font-weight: 800;
}
.team-btn-count {
  color: var(--muted);
  font-size: 15px;
}
.team-btn-tag {
  color: var(--primary);
  font-weight: 700;
  font-size: 15px;
}

/* ---------- 카드 ---------- */
.composer {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  margin: 12px 0;
}
.composer-input {
  font-size: 20px;
  padding: 16px;
}
.composer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
}
.char-count {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.char-count.full {
  color: var(--accent);
  font-weight: 700;
}
.list-meta {
  color: var(--muted);
  font-size: 15px;
  margin: 8px 2px;
}
.card-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.card-list.compact .idea-card {
  padding: 10px 12px;
}
.card-list.compact .idea-text {
  font-size: 17px;
}
.idea-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fffbe6;
  border: 1.5px solid #f2e7b0;
  border-radius: 14px;
  padding: 14px;
  box-shadow: var(--shadow);
}
.idea-card.is-mine {
  border-color: #c9dfe8;
  background: #f5fbfd;
}
.idea-card.is-best {
  border-color: var(--best);
  background: var(--best-soft);
}
.idea-card.selectable {
  cursor: pointer;
}
.idea-card.is-selected {
  outline: 3px solid var(--primary);
  background: var(--primary-soft);
}
.idea-body {
  flex: 1;
  min-width: 0;
}
.idea-text {
  font-size: 19px;
  font-weight: 600;
}
.idea-note {
  color: #6a4b00;
  font-size: 15px;
  margin-top: 4px;
}
.mine-tag {
  font-size: 12px;
  color: var(--primary);
  font-weight: 700;
}
.best-badge {
  display: inline-block;
  background: var(--best);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  padding: 1px 8px;
  border-radius: 6px;
  margin-right: 4px;
  vertical-align: middle;
}
.idea-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.heart-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  min-height: 60px;
  border-radius: 14px;
  border: 2px solid #f3c2c4;
  background: #fff;
  color: var(--accent);
  cursor: pointer;
}
.heart-btn.liked {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.heart-btn .heart {
  font-size: 28px;
  line-height: 1;
}
.heart-count {
  font-size: 14px;
  font-weight: 700;
}
.heart-static {
  color: var(--accent);
  font-weight: 700;
  white-space: nowrap;
}
.hearts-left {
  position: sticky;
  top: 112px;
  z-index: 10;
  background: #fff;
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 10px 14px;
  margin: 10px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 18px;
}
.hearts-row span {
  color: var(--accent);
  font-size: 22px;
  margin-left: 2px;
}
.hearts-row span.used {
  color: #e2e8f0;
}
.wait-box {
  text-align: center;
  padding: 40px 0;
}
.wait-emoji {
  font-size: 56px;
}
.lead-link {
  text-align: center;
  margin: 28px 0;
}
/* 조원 화면 아래 조장 화면 버튼: 눈에 띄되 과하지 않게 (연한 바탕 + 테두리) */
.lead-btn {
  display: inline-block;
  padding: 11px 22px;
  border: 1.5px solid var(--primary);
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 15px;
  text-decoration: none;
}
.lead-btn b {
  font-weight: 800;
}
.lead-btn:active {
  background: var(--primary);
  color: #fff;
}

/* ---------- BEST / 최종 투표 ---------- */
.best-section {
  background: #fff;
  border-radius: var(--radius);
  border: 2px solid var(--best);
  padding: 16px;
  margin: 16px 0;
}
.best-section h2 {
  font-size: 20px;
  margin-bottom: 10px;
}
.final-guide {
  font-weight: 700;
  font-size: 18px;
  background: var(--primary-soft);
  padding: 12px 14px;
  border-radius: 12px;
  margin: 12px 0;
}
.final-option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 64px;
  text-align: left;
  padding: 14px;
  border-radius: 14px;
  border: 2px solid var(--line);
  background: #fff;
  cursor: pointer;
  font-size: 18px;
  font-weight: 600;
}
.final-option.chosen {
  border-color: var(--primary);
  background: var(--primary-soft);
}
.final-check {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 2px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.final-option.chosen .final-check {
  background: var(--primary);
  border-color: var(--primary);
}
.final-text small {
  display: block;
  font-weight: 400;
  color: var(--muted);
  font-size: 14px;
}
.winner-box {
  text-align: center;
  background: linear-gradient(135deg, #fff4dc, #ffe3e3);
  border-radius: var(--radius);
  padding: 24px 16px;
  margin: 16px 0;
}
.winner-label {
  font-weight: 800;
  color: #b45309;
}
.winner-text {
  font-size: 24px;
  font-weight: 800;
  margin: 8px 0 4px;
}

/* ---------- 조장 ---------- */
.steps {
  background: #fff;
  border-radius: 14px;
  padding: 12px 12px 12px 36px;
  margin: 12px 0;
  box-shadow: var(--shadow);
}
.steps li {
  margin: 4px 0;
}
.cluster-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.cluster.is-group {
  border: 2px dashed var(--primary);
  border-radius: 18px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(11, 110, 138, 0.04);
}
.cluster-head {
  font-weight: 700;
  color: var(--primary);
  font-size: 15px;
  padding: 0 4px;
}
.action-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: #fff;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.1);
}
.action-bar span {
  margin-right: auto;
  font-weight: 700;
}
.best-note {
  border-top: 1px solid var(--line);
  padding: 10px 0;
}
.best-note:first-of-type {
  border-top: none;
}
.best-note-card {
  font-weight: 700;
  margin-bottom: 6px;
}
.best-note-row {
  display: flex;
  gap: 8px;
}

/* ---------- 모달 ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 20, 30, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 90;
  padding: 16px;
}
.modal {
  background: #fff;
  border-radius: 20px;
  padding: 24px;
  max-width: min(560px, 100%);
  max-height: 100%;
  overflow: auto;
}
.modal h2 {
  margin-bottom: 12px;
}
.modal p {
  margin-bottom: 10px;
}
.qr-full {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}
.modal:has(.qr-full) {
  max-width: 95vw;
}
.qr-full svg {
  width: min(70vh, 80vw);
  height: auto;
}
.qr-full-event {
  color: var(--muted);
  font-weight: 700;
  font-size: 22px;
}
.qr-full-topic {
  font-size: clamp(24px, 3.4vw, 44px);
}
.qr-full-url {
  font-size: clamp(20px, 2.4vw, 32px);
  font-weight: 700;
}
.qr-full-code {
  font-size: clamp(28px, 3.6vw, 48px);
}
.qr-full-code b {
  color: var(--primary);
  letter-spacing: 8px;
}

/* ---------- 진행자 ---------- */
.admin-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 16px 80px;
}
.admin-narrow {
  max-width: 460px;
  margin: 40px auto;
  padding: 0 16px;
}
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.admin-header h1 {
  font-size: 26px;
}
.admin-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}
.admin-grid .panel {
  margin: 0;
}
.topic-panel h2 {
  margin: 4px 0 0;
  font-size: 22px;
}
.stepper {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
}
.step {
  width: 100%;
  min-height: 52px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  text-align: left;
}
.step.done {
  color: var(--muted);
  background: #f5f7f9;
}
.step.current {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}
.step-no {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.08);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}
.admin-timer {
  font-size: 64px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  text-align: center;
  border-radius: 14px;
  background: #1f2d3a;
  color: #fff;
}
.admin-timer small {
  font-size: 18px;
  font-weight: 600;
  opacity: 0.8;
}
.small-input {
  width: 90px;
}
.bar-chart {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 8px 0;
}
.bar-row {
  display: grid;
  grid-template-columns: 90px 1fr auto;
  align-items: center;
  gap: 12px;
}
.bar-label {
  font-weight: 800;
}
.bar-track {
  position: relative;
  height: 36px;
  background: #eef2f5;
  border-radius: 10px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #19a3c4);
  border-radius: 10px;
  transition: width 0.5s ease;
}
.bar-value {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-weight: 800;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}
.bar-meta {
  color: var(--muted);
  white-space: nowrap;
  font-size: 15px;
}
.qr-inline {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.qr-url {
  font-weight: 700;
  word-break: break-all;
}
.qr-code-small {
  font-size: 28px;
  letter-spacing: 4px;
  color: var(--primary);
}
.uid-box {
  background: #1f2d3a;
  color: #fff;
  padding: 12px;
  border-radius: 10px;
  user-select: all;
  overflow-x: auto;
}

/* ---------- 설정 ---------- */
.settings-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 20px;
  align-items: start;
}
@media (max-width: 960px) {
  .settings-layout {
    grid-template-columns: 1fr;
  }
}
.field {
  display: block;
  margin-bottom: 14px;
}
.field > span {
  display: block;
  font-weight: 700;
  margin-bottom: 6px;
  font-size: 16px;
}
.field-input {
  margin: 8px 0;
}
.inline-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}
.lock-notice {
  background: #fff3e0;
  color: #9a4b00;
  border-radius: 10px;
  padding: 10px 12px;
  font-weight: 700;
  margin-bottom: 12px;
}
.team-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 4px;
}
.team-table th {
  text-align: left;
  font-size: 14px;
  color: var(--muted);
  padding: 4px;
}
.team-table td {
  padding: 4px;
}
.team-table td:first-child {
  width: 30px;
  font-weight: 700;
}
.danger-zone {
  border: 2px solid #f3c2c4;
}
.settings-preview {
  position: sticky;
  top: 16px;
}
.settings-preview h2 {
  font-size: 18px;
  margin-bottom: 8px;
}
.phone-frame {
  width: 360px;
  max-width: 100%;
  border: 10px solid #1f2d3a;
  border-radius: 28px;
  padding: 0 16px 16px;
  background: var(--bg);
  margin-bottom: 16px;
  overflow: hidden;
}
.phone-frame .sticky-top {
  position: static;
}
.mini-slide {
  width: 360px;
  height: 202.5px;
  max-width: 100%;
  overflow: hidden;
  border-radius: 10px;
  box-shadow: var(--shadow);
  position: relative;
}
.mini-slide-inner {
  width: 1920px;
  height: 1080px;
  transform: scale(0.1875);
  transform-origin: top left;
  position: absolute;
  top: 0;
  left: 0;
}

/* ---------- 리포트 ---------- */
.report-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 16px;
}
.report-toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.report-toolbar select {
  flex: 1;
  min-width: 220px;
}
.report {
  background: #fff;
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
}
.report-head {
  border-bottom: 3px solid var(--primary);
  padding-bottom: 16px;
  margin-bottom: 20px;
}
.report-event {
  color: var(--primary);
  font-weight: 800;
}
.report-head h1 {
  font-size: 28px;
  margin: 4px 0;
}
.report-desc {
  color: var(--muted);
}
.report-meta {
  margin-top: 8px;
  font-size: 15px;
  color: var(--muted);
}
.report-section {
  margin-bottom: 28px;
}
.report-section h2 {
  font-size: 21px;
  margin-bottom: 10px;
}
.report-winner {
  background: var(--best-soft);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 10px;
}
.report-winner-text {
  font-size: 22px;
  font-weight: 800;
}
.report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}
.report-table th,
.report-table td {
  border-bottom: 1px solid var(--line);
  padding: 7px 8px;
  text-align: left;
  vertical-align: top;
}
.report-table th {
  background: #f3f6f9;
}
.report-table td:first-child,
.report-table td:last-child {
  white-space: nowrap;
  width: 1%;
}
.report-table td:nth-child(2) {
  white-space: nowrap;
  width: 1%;
}
.row-best {
  background: #fffaf0;
}
.report-teams {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}
.report-team {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
}
.report-team h3 small {
  color: var(--muted);
  font-weight: 400;
  font-size: 14px;
}
.report-team ol {
  padding-left: 20px;
  margin: 8px 0 0;
}
.report-team li {
  margin-bottom: 8px;
}
.report-note {
  color: #6a4b00;
  font-size: 14px;
}

/* ---------- 순수 HTML 버전 추가 ---------- */
.hidden {
  display: none !important;
}
.qr-inline .qr-svg svg {
  width: 160px;
  height: 160px;
  display: block;
}
.qr-full .qr-svg svg {
  width: min(62vh, 80vw);
  height: auto;
  display: block;
}
.seed-zone {
  border: 2px dashed #f0b429;
}
.seed-zone select {
  max-width: 260px;
}
/* 조 선택: 조원 명단 */
.center {
  text-align: center;
  margin-bottom: 10px;
}
.team-btn-head {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.team-grid.with-members {
  grid-template-columns: 1fr;
}
.team-grid.with-members .team-btn {
  min-height: 0;
  padding: 14px 16px;
  align-items: stretch;
  text-align: left;
  gap: 6px;
}
.team-grid.with-members .team-btn-head {
  flex-direction: row;
  justify-content: space-between;
  align-items: baseline;
}
.member {
  white-space: nowrap; /* 이름 중간에서 줄이 바뀌지 않게 */
}
.member.is-me {
  background: var(--best-soft);
  color: #8a5a00;
  font-weight: 800;
  border-radius: 6px;
  padding: 0 4px;
}
.team-btn.is-listed {
  border-color: var(--best);
}
.name-input {
  text-align: center;
  font-size: 26px;
  font-weight: 700;
  padding: 14px;
}
/* 설정: 발표 표지 배경 사진 */
.cover-uploads {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
}
.cover-thumb {
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  background: #e9eef2 center / cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px dashed var(--line);
}
.cover-thumb span {
  font-size: 13px;
  color: var(--muted);
}
.cover-slot-label {
  font-weight: 700;
  font-size: 15px;
  margin-top: 6px;
}
.cover-slot .btn-row {
  margin-top: 4px;
}
.back-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 4px 0 0;
}
.hello {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 19px;
  margin-bottom: 8px;
}
.winner-author {
  font-size: 18px;
  margin: 4px 0;
}
.report-winner-author {
  margin: 2px 0 4px;
}
.team-btn-members {
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
}
.team-grid.with-members .team-btn-tag {
  text-align: right;
}
.team-table .col-name {
  width: 120px;
}
.team-table .col-pin {
  width: 110px;
}
.team-table textarea {
  font-size: 15px;
  padding: 8px 10px;
  resize: vertical;
}
.cover-members {
  font-size: 38px;
  font-weight: 600;
  opacity: 0.95;
  margin: -8px 0 28px;
  max-width: 1700px;
  line-height: 1.5;
}
.code-input::placeholder {
  font-size: 24px;
  letter-spacing: 8px;
  color: #c3ccd5;
}
.admin-entry {
  text-align: center;
  padding: 8px 16px calc(24px + env(safe-area-inset-bottom));
  margin-top: -80px; /* .page 아래 여백 안쪽에 배치 */
}
.admin-entry .btn {
  font-size: 14px;
  font-weight: 600;
}
.report-toolbar .btn,
.best-note-row .btn {
  flex-shrink: 0;
  white-space: nowrap;
}

/* ---------- 사전 접수 · 자유 설명 · 최종 2표 · 1~3위 ---------- */
.timer-deadline {
  margin-left: auto;
  font-weight: 800;
  font-size: 18px;
}
.pre-on {
  color: #c2410c;
}
.idea-note,
.report-note,
.final-text small {
  white-space: pre-line;
}
.best-note-input {
  width: 100%;
  font: inherit;
  font-size: 15px;
  line-height: 1.5;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  resize: vertical;
  margin-bottom: 6px;
}
.best-note-row {
  align-items: center;
  justify-content: space-between;
}
.final-option.is-full {
  opacity: 0.55;
}
.podium-row {
  padding: 8px 0;
  border-top: 1px dashed rgba(180, 83, 9, 0.3);
}
.podium-row:first-of-type {
  border-top: none;
}
.podium-row .podium-team {
  font-size: 15px;
  color: #b45309;
}
.podium-row.rank-1 .podium-team {
  font-size: 20px;
}
.podium-row.is-me {
  background: rgba(255, 255, 255, 0.6);
  border-radius: 8px;
}
.podium-text {
  font-weight: 700;
  margin: 4px 0;
}
/* 체크박스 한 줄 (모달 등) */
.check-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 4px 0 14px;
  font-size: 14px;
  cursor: pointer;
}
.check-row input {
  margin-top: 3px;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* 조 추첨 (참가자) */
.draw-box,
.draw-result {
  text-align: center;
  padding: 18px 8px 8px;
}
.draw-emoji {
  font-size: 56px;
  line-height: 1.1;
}
.draw-emoji.spin {
  display: inline-block;
  animation: draw-spin 0.5s linear infinite;
}
@keyframes draw-spin {
  to {
    transform: rotate(360deg);
  }
}
.draw-slot {
  font-size: 34px;
  font-weight: 900;
  min-height: 1.4em;
  margin: 12px 0;
  color: var(--primary, #0b6e8a);
}
.draw-slot.is-final {
  color: #c2410c;
  animation: draw-pop 0.6s cubic-bezier(0.2, 1.6, 0.4, 1) both;
}
.draw-team {
  font-size: 38px;
  font-weight: 900;
  color: #c2410c;
  margin: 4px 0 8px;
}
.draw-result.is-new .draw-team {
  animation: draw-pop 0.7s cubic-bezier(0.2, 1.6, 0.4, 1) both;
}
@keyframes draw-pop {
  0% {
    transform: scale(0.3);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}
.draw-members {
  margin: 10px 0 16px;
  font-size: 14px;
  line-height: 1.8;
}
.draw-box .btn-xl,
.draw-result .btn-xl {
  margin-top: 14px;
}
/* 조 추첨 (설정) */
.draw-settings {
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 14px;
}
.draw-results .panel-head h3 {
  font-size: 16px;
}
.draw-team-row {
  padding: 6px 0;
  border-top: 1px solid var(--line);
}
.draw-names {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.draw-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #eef4f6;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 13px;
}
.draw-chip.is-pre {
  background: #fff4dc;
}
.draw-chip button {
  border: none;
  background: none;
  cursor: pointer;
  color: #999;
  padding: 0 2px;
}
.draw-chip button:hover {
  color: #e5484d;
}

/* 조별 아이디어 접수 현황 (경쟁) */
.team-race {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  margin: 10px 0 14px;
}
.team-race-title {
  font-weight: 800;
  margin-bottom: 8px;
}
.race-row {
  display: grid;
  grid-template-columns: 30px minmax(0, 7.5em) 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  font-size: 14px;
}
.race-row.is-me {
  font-weight: 800;
}
.race-row.is-me .race-fill {
  background: linear-gradient(90deg, #f5a524, #f97316);
}
.race-rank {
  text-align: center;
}
.race-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.race-name small {
  font-weight: 600;
  color: #b45309;
}
.race-track {
  height: 10px;
  background: #eef2f5;
  border-radius: 5px;
  overflow: hidden;
}
.race-fill {
  display: block;
  height: 100%;
  background: var(--primary, #0b6e8a);
  border-radius: 5px;
  transition: width 0.4s;
}
.race-count {
  font-variant-numeric: tabular-nums;
  min-width: 3em;
  text-align: right;
}

/* 묶음 = 하나의 아이디어 꾸러미 */
.bundle-list {
  margin-top: 6px;
  padding: 6px 10px;
  border-left: 3px solid var(--best, #f5a524);
  background: rgba(245, 165, 36, 0.08);
  border-radius: 6px;
  font-weight: 400;
}
.bundle-title {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #b45309;
  margin-bottom: 2px;
}
.bundle-list p {
  font-size: 13px;
  line-height: 1.4;
  color: #444;
}
.bundle-list p::before {
  content: '· ';
}
.cluster-head.is-best {
  color: #b45309;
  font-weight: 700;
}
.cluster.is-best-group {
  border-color: var(--best, #f5a524);
}
