:root {
  --bg-top: #e0f2fe;
  --bg-bottom: #eff6ff;
  --card: rgba(255, 255, 255, 0.9);
  --border: rgba(148, 163, 184, 0.25);
  --text: #0f172a;
  --muted: #64748b;
  --blue: #2563eb;
  --blue-strong: #1d4ed8;
  --cyan: #0891b2;
  --orange: #f97316;
  --red: #dc2626;
  --shadow: 0 18px 48px rgba(15, 23, 42, 0.08);
  --radius: 28px;
  --gap: 20px;
  --font: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(circle at top right, rgba(14, 165, 233, 0.14), transparent 26%),
    linear-gradient(180deg, var(--bg-top) 0%, #f8fafc 44%, var(--bg-bottom) 100%);
}

button, input, textarea {
  font: inherit;
}

.shell {
  width: min(1440px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 22px 0 30px;
}

.shell-narrow {
  width: min(1040px, calc(100vw - 24px));
}

.shell-screen {
  width: min(1600px, calc(100vw - 24px));
  padding-bottom: 40px;
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 28px;
  border-radius: 32px;
  color: #f8fafc;
  box-shadow: 0 22px 56px rgba(29, 78, 216, 0.2);
  margin-bottom: 20px;
}

.hero-host {
  background:
    radial-gradient(circle at top right, rgba(34, 211, 238, 0.25), transparent 32%),
    linear-gradient(135deg, #0f172a 0%, #1d4ed8 56%, #0ea5e9 100%);
}

.hero-vote {
  background:
    radial-gradient(circle at top right, rgba(251, 191, 36, 0.18), transparent 32%),
    linear-gradient(135deg, #082f49 0%, #0369a1 58%, #0ea5e9 100%);
}

.hero-screen {
  background:
    radial-gradient(circle at top right, rgba(250, 204, 21, 0.2), transparent 28%),
    linear-gradient(135deg, #082f49 0%, #1d4ed8 58%, #0ea5e9 100%);
}

.hero h1 {
  margin: 0;
  font-size: clamp(34px, 4vw, 54px);
}

.hero-text {
  max-width: 760px;
  margin: 14px 0 0;
  line-height: 1.7;
  color: rgba(248, 250, 252, 0.9);
}

.eyebrow {
  margin: 0 0 10px;
  letter-spacing: 0.35em;
  font-size: 12px;
  color: rgba(248, 250, 252, 0.78);
}

.hero-side {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: stretch;
  min-width: 260px;
}

.compact-side {
  min-width: 180px;
  align-items: flex-end;
}

.layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: var(--gap);
}

.main-panel,
.vote-layout,
.screen-grid {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

.two-column {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gap);
}

.screen-grid {
  display: grid;
  grid-template-columns: 420px minmax(0, 1fr);
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.side-panel,
.room-card,
.status-card,
.access-card,
.form-card,
.queue-card,
.vote-card,
.vote-side-card,
.screen-status-card,
.podium-card,
.screen-ranking-card {
  padding: 24px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.section-head h2,
.section-head h3 {
  margin: 0;
  font-size: 24px;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
  color: var(--text);
  font-weight: 700;
  font-size: 14px;
}

.pill-light {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.pill-muted {
  background: rgba(226, 232, 240, 0.8);
  color: #334155;
}

.pill-active {
  background: rgba(16, 185, 129, 0.16);
  color: #047857;
}

.input,
.textarea {
  width: 100%;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.34);
  background: rgba(248, 250, 252, 0.94);
  color: var(--text);
}

.ghost-input {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.22);
}

.ghost-input::placeholder {
  color: rgba(255, 255, 255, 0.72);
}

.textarea {
  min-height: 130px;
  resize: vertical;
}

.button {
  border: 0;
  border-radius: 999px;
  min-height: 46px;
  padding: 0 18px;
  cursor: pointer;
  font-weight: 700;
  transition: transform 0.18s ease, opacity 0.18s ease, box-shadow 0.18s ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.button-primary {
  background: linear-gradient(135deg, var(--blue), #0ea5e9);
  color: #fff;
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.24);
}

.button-accent {
  background: linear-gradient(135deg, var(--orange), #fb7185);
  color: #fff7ed;
  box-shadow: 0 14px 30px rgba(249, 115, 22, 0.24);
}

.button-secondary {
  background: #e2e8f0;
  color: var(--text);
}

.button-danger {
  background: #fee2e2;
  color: #b91c1c;
}

.button-light {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.block-button {
  width: 100%;
  margin-top: 18px;
}

.actions-row {
  display: flex;
  gap: 12px;
  align-items: center;
}

.wrap-gap {
  flex-wrap: wrap;
}

.info-grid,
.stack-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.empty-state,
.muted {
  color: var(--muted);
  line-height: 1.7;
}

.qr-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 18px;
  margin-top: 18px;
}

.qr-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 220px;
  padding: 16px;
  border-radius: 22px;
  background: rgba(226, 232, 240, 0.35);
}

.qr-card img {
  width: 180px;
  height: 180px;
  border-radius: 20px;
  background: #fff;
}

.form-grid {
  display: grid;
  gap: 14px;
}

.rank-item,
.queue-item,
.podium-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px;
  border-radius: 22px;
  background: rgba(248, 250, 252, 0.92);
  border: 1px solid rgba(226, 232, 240, 0.9);
}

.queue-item.current-item {
  border-color: rgba(37, 99, 235, 0.5);
  box-shadow: inset 0 0 0 2px rgba(37, 99, 235, 0.12);
}

.queue-item.next-item {
  background: linear-gradient(135deg, rgba(219, 234, 254, 0.9), rgba(248, 250, 252, 0.96));
}

.rank-badge,
.queue-order {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  font-weight: 700;
  background: #cbd5e1;
}

.queue-order {
  border-radius: 16px;
  background: #dbeafe;
  color: #1d4ed8;
}

.rank-badge.top-1 {
  background: linear-gradient(135deg, #f59e0b, #facc15);
}

.rank-badge.top-2 {
  background: linear-gradient(135deg, #94a3b8, #e2e8f0);
}

.rank-badge.top-3 {
  background: linear-gradient(135deg, #fb923c, #fdba74);
}

.rank-main,
.queue-main {
  flex: 1;
  min-width: 0;
}

.rank-name,
.queue-name,
.speaker-name,
.podium-name {
  font-weight: 700;
}

.rank-name,
.queue-name {
  font-size: 18px;
}

.rank-project,
.queue-project,
.queue-intro,
.speaker-project,
.speaker-intro,
.podium-project {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.6;
}

.rank-votes,
.speaker-votes,
.podium-votes {
  font-weight: 700;
  color: var(--blue);
}

.speaker-name {
  font-size: clamp(30px, 3vw, 42px);
}

.speaker-project {
  color: var(--blue-strong);
}

.speaker-votes {
  margin-top: 18px;
  font-size: 32px;
  color: var(--orange);
}

.tag-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

.tag-current {
  background: rgba(37, 99, 235, 0.12);
  color: var(--blue-strong);
}

.tag-next {
  background: rgba(14, 165, 233, 0.12);
  color: var(--cyan);
}

.queue-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.queue-action {
  padding: 9px 14px;
  border-radius: 999px;
  border: 0;
  background: #e2e8f0;
  cursor: pointer;
  font-weight: 700;
}

.queue-action.is-primary {
  background: #dbeafe;
  color: var(--blue-strong);
}

.queue-action.is-danger {
  background: #fee2e2;
  color: #b91c1c;
}

.access-box {
  margin-bottom: 16px;
  padding: 16px;
  border-radius: 22px;
  background: rgba(226, 232, 240, 0.4);
}

.hidden-block {
  display: none;
}

.vote-layout {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: var(--gap);
}

.screen-status-grid {
  margin-bottom: var(--gap);
}

.podium-card .stack-list {
  gap: 14px;
}

.podium-item {
  background: linear-gradient(135deg, rgba(250, 204, 21, 0.18), rgba(255, 255, 255, 0.94));
}

.podium-item:nth-child(2) {
  background: linear-gradient(135deg, rgba(203, 213, 225, 0.6), rgba(255, 255, 255, 0.94));
}

.podium-item:nth-child(3) {
  background: linear-gradient(135deg, rgba(251, 146, 60, 0.18), rgba(255, 255, 255, 0.94));
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  max-width: min(320px, calc(100vw - 32px));
  padding: 14px 18px;
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.88);
  color: #fff;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.26);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.toast.error {
  background: rgba(185, 28, 28, 0.92);
}

@media (max-width: 1180px) {
  .layout,
  .vote-layout,
  .screen-grid,
  .two-column {
    grid-template-columns: 1fr;
    display: grid;
  }

  .hero,
  .qr-section {
    grid-template-columns: 1fr;
  }

  .hero {
    flex-direction: column;
  }

  .hero-side,
  .compact-side {
    align-items: stretch;
    min-width: 0;
  }
}

@media (max-width: 768px) {
  .shell {
    width: min(100vw - 20px, 100%);
  }

  .hero,
  .side-panel,
  .room-card,
  .status-card,
  .access-card,
  .form-card,
  .queue-card,
  .vote-card,
  .vote-side-card,
  .screen-status-card,
  .podium-card,
  .screen-ranking-card {
    padding: 18px;
    border-radius: 24px;
  }

  .actions-row {
    flex-direction: column;
    align-items: stretch;
  }

  .button,
  .queue-action {
    width: 100%;
  }
}
