:root {
  --green: #07351f;
  --green-2: #0f6f46;
  --lime: #d7f28c;
  --gold: #bd8f2f;
  --gold-2: #f1c85d;
  --ink: #10100f;
  --muted: #5d665f;
  --paper: #f7f5ef;
  --surface: rgba(255, 255, 255, 0.94);
  --line: rgba(23, 23, 23, 0.14);
  --shadow: 0 24px 70px rgba(14, 37, 28, 0.18);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  background:
    linear-gradient(90deg, rgba(7, 53, 31, 0.10), transparent 20%),
    radial-gradient(circle at 10% 10%, rgba(189, 143, 47, 0.20), transparent 24rem),
    linear-gradient(135deg, #f4f1e8, #ffffff 52%, #eef5ed);
}

button,
input,
textarea {
  font: inherit;
}

.app {
  min-height: 100vh;
}

.screen {
  min-height: 100vh;
  padding: 28px;
  display: grid;
  gap: 20px;
}

.host {
  /* 260px left no margin for the QR row (2 cards x ~110px min-content + gap = 228px +
     16px side-panel padding each side = 260px exactly) -> it bled into the main panel
     at 1920x1080 (prod incident, 2026-10). 320px keeps the same visual layout with slack. */
  /* Widened again 2026-10-02: 320px still let the QR row's content overflow the panel by
     12-14px (measured on prod) - 350px gives real slack, main panel still keeps its
     540px+ minimum comfortably at 1280px and up. */
  grid-template-columns: 350px minmax(540px, 1fr);
}

.participant {
  max-width: 720px;
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand img {
  width: 74px;
  height: 74px;
  object-fit: contain;
  border-radius: 50%;
}

.brand-compact {
  gap: 10px;
}

.brand-compact img {
  width: 46px;
  height: 46px;
}

.brand-compact .brand-title strong {
  font-size: 16px;
}

.brand-compact .brand-title span {
  font-size: 12px;
}

.brand-title {
  display: grid;
  gap: 2px;
}

.brand-title strong {
  font-size: 20px;
  font-weight: 600;
}

.brand-title span {
  color: var(--muted);
  font-size: 14px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 24px;
}

.main-panel {
  min-height: calc(100vh - 56px);
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 24px;
}

.side-panel {
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 16px;
  /* Fixed-width grid track (see .host) does not shrink its item to fit; without this the
     item keeps its content's min-content width and can bleed into the next column. */
  min-width: 0;
}

.kicker {
  color: var(--green-2);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0;
  font-size: 13px;
}

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

h1 {
  font-size: clamp(38px, 4.7vw, 72px);
  line-height: 1.04;
  max-width: 16ch;
  letter-spacing: 0;
}

h2 {
  font-size: clamp(28px, 3.5vw, 48px);
  line-height: 1.1;
  letter-spacing: 0;
}

h3 {
  font-size: 20px;
  line-height: 1.2;
}

.lead {
  color: var(--muted);
  font-size: clamp(18px, 1.6vw, 24px);
  line-height: 1.42;
  max-width: 54rem;
}

.nobel-layout,
.fund-title-block,
.final-actions {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 28px;
  align-items: center;
}

.nobel-photo {
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border-radius: 8px;
  border: 4px solid rgba(189, 143, 47, 0.45);
  background: #fff;
}

.nobel-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: sepia(0.18) contrast(1.06);
}

.fund-title-block img {
  width: 220px;
  border-radius: 50%;
}

.qr-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.qr-card {
  display: grid;
  gap: 6px;
  justify-items: center;
  background: #fff;
  border: 1px solid rgba(189, 143, 47, 0.36);
  border-radius: 8px;
  padding: 8px;
}

.qr-card img {
  /* max-width + width:100% lets the image shrink inside a tight track instead of forcing
     overflow; at the normal side-panel width it still renders at the original 92px. */
  width: 100%;
  max-width: 92px;
  height: auto;
  aspect-ratio: 1;
  display: block;
}

.qr-card b {
  color: var(--green);
  font-size: 12px;
}

.qr-card-large img {
  width: 160px;
  height: 160px;
}

.compact-link {
  font-size: 12px;
  color: var(--green);
  line-height: 1.2;
  word-break: break-all;
}

.mini-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.mini-stats span {
  background: rgba(7, 53, 31, 0.08);
  border-radius: 8px;
  padding: 10px;
  color: var(--muted);
  font-size: 12px;
}

.mini-stats b {
  display: block;
  color: var(--green);
  font-size: 26px;
  line-height: 1;
}

.compact-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.compact-controls .btn {
  width: 100%;
  padding-inline: 8px;
}

.mission {
  color: var(--green);
  font-size: clamp(21px, 2.1vw, 34px);
  line-height: 1.22;
  font-weight: 600;
  max-width: 58rem;
}

.year-big {
  color: var(--gold);
  font-size: clamp(82px, 13vw, 188px);
  font-weight: 600;
  line-height: 0.86;
}

.splash-logo-wrap {
  position: relative;
  width: min(360px, 54vw);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}

.splash-logo {
  width: 78%;
  height: 78%;
  object-fit: contain;
  border-radius: 50%;
  z-index: 1;
}

.orbit {
  position: absolute;
  inset: 4%;
  border-radius: 50%;
  border: 5px solid transparent;
  border-top-color: var(--gold);
  border-right-color: rgba(11, 59, 45, 0.55);
  animation: spin 9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.flow,
.formula {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 12px 0;
}

.flow span,
.formula span {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--green);
  font-weight: 600;
}

.flow b,
.formula b {
  color: var(--gold);
  font-size: 26px;
}

.dashboard,
.strategy-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.metric,
.strategy,
.site-card {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.metric {
  display: grid;
  gap: 8px;
}

.metric span,
.strategy span,
.site-card span {
  color: var(--muted);
  font-size: 14px;
}

.metric strong,
.strategy strong,
.site-card strong {
  color: var(--green);
  font-size: clamp(24px, 2.4vw, 38px);
  line-height: 1;
}

.strategy {
  display: grid;
  gap: 14px;
}

.strategy.active {
  border-color: var(--gold);
  box-shadow: inset 0 0 0 2px rgba(201, 154, 50, 0.28);
}

.strategy div {
  display: grid;
  gap: 4px;
}

.result-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.result-strip span {
  background: rgba(11, 59, 45, 0.08);
  border-radius: 8px;
  padding: 13px;
  color: var(--muted);
}

.result-strip b {
  display: block;
  color: var(--green);
  margin-top: 4px;
}

.community-equation {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  color: var(--green);
  font-weight: 600;
}

.community-equation span,
.community-equation strong {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 18px;
  font-size: clamp(28px, 4vw, 56px);
  line-height: 1;
}

.community-equation strong {
  color: var(--gold);
}

.final-logo {
  width: min(240px, 40vw);
  border-radius: 50%;
}

.idea-wall {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  max-height: 48vh;
  overflow: auto;
}

.idea {
  border-left: 4px solid var(--gold);
  background: rgba(255, 255, 255, 0.78);
  padding: 14px;
  border-radius: 8px;
}

.idea b {
  display: block;
  color: var(--green);
  font-size: 18px;
  line-height: 1.25;
}

.idea span {
  color: var(--muted);
  display: block;
  margin-top: 8px;
}

.site-card {
  width: fit-content;
  min-width: min(100%, 420px);
  display: grid;
  gap: 8px;
}

.controls,
.row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.btn {
  border: 0;
  background: #e8ebe2;
  color: var(--ink);
  border-radius: 8px;
  padding: 12px 16px;
  cursor: pointer;
  min-height: 44px;
}

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

.btn.gold {
  background: linear-gradient(135deg, var(--gold), var(--gold-2));
  color: #201600;
}

.btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.join-box {
  display: grid;
  gap: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.join-link {
  word-break: break-all;
  font-size: 22px;
  font-weight: 600;
  color: var(--green);
}

.join-code {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(189, 241, 92, 0.32);
  color: var(--green);
  font-weight: 600;
}

.stat {
  display: grid;
  gap: 4px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.stat:last-child {
  border-bottom: 0;
}

.stat strong {
  font-size: 34px;
  line-height: 1;
}

.stat span {
  color: var(--muted);
}

.participant-list,
.idea-wall,
.ambassador-list {
  display: grid;
  gap: 10px;
  max-height: 42vh;
  overflow: auto;
  padding-right: 6px;
}

.person,
.idea {
  border-left: 4px solid var(--gold);
  background: rgba(255, 255, 255, 0.72);
  padding: 12px 14px;
  border-radius: 6px;
}

.person b,
.idea b {
  display: block;
  font-weight: 600;
}

.person span,
.idea span {
  color: var(--muted);
}

.bars {
  display: grid;
  gap: 14px;
}

.bar-row {
  display: grid;
  gap: 7px;
}

.bar-label {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  color: var(--green);
  font-weight: 600;
}

.bar-track {
  height: 18px;
  background: rgba(11, 59, 45, 0.12);
  border-radius: 99px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--green), var(--gold));
  transition: width 0.35s ease;
}

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

.field {
  display: grid;
  gap: 7px;
}

.field label {
  font-weight: 600;
  color: var(--green);
}

.field input,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px 14px;
  background: #fff;
  color: var(--ink);
  min-height: 46px;
}

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

.choices {
  display: grid;
  gap: 12px;
}

.choice {
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 16px;
  cursor: pointer;
  display: grid;
  gap: 4px;
  min-height: 72px;
}

.choice strong {
  color: var(--green);
}

.choice span {
  color: var(--muted);
}

.choice.selected {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(189, 241, 92, 0.45);
}

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

.timer {
  font-size: 54px;
  font-weight: 600;
  color: var(--green);
}

.step-dots {
  display: flex;
  gap: 7px;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(11, 59, 45, 0.22);
}

.dot.active {
  background: var(--gold);
}

@media (max-width: 900px) {
  .screen,
  .host {
    grid-template-columns: 1fr;
  }

  .main-panel {
    min-height: auto;
  }

  .dashboard,
  .strategy-grid,
  .result-strip,
  .nobel-layout,
  .fund-title-block,
  .final-actions,
  .idea-wall {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .screen {
    padding: 14px;
  }

  .panel {
    padding: 18px;
  }

  .brand img {
    width: 58px;
    height: 58px;
  }
}

.join-link.compact-link {
  font-size: 12px;
  font-weight: 500;
}

.idea-wall {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-height: 48vh;
}

.idea b {
  color: var(--green);
  font-size: 18px;
}

@media (max-width: 900px) {
  .idea-wall {
    grid-template-columns: 1fr;
  }
}
