:root {
  color-scheme: light;
  --ink: #17201b;
  --muted: #5d6a62;
  --line: #d8ded8;
  --paper: #fafaf7;
  --panel: #ffffff;
  --mint: #bfe8d4;
  --coral: #ff8f70;
  --sky: #8dc7ff;
  --yellow: #ffd76a;
  --shadow: 0 18px 50px rgba(23, 32, 27, 0.11);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(135deg, rgba(191, 232, 212, 0.55), transparent 42%),
    linear-gradient(315deg, rgba(255, 143, 112, 0.35), transparent 38%),
    var(--paper);
  color: var(--ink);
}

a,
button,
input {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
}

[data-view] {
  display: none;
}

body.view-vote [data-view="vote"],
body.view-display [data-view="display"] {
  display: block;
}

.vote-view {
  width: min(100%, 520px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 22px;
}

.topbar,
.display-header,
.display-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar {
  padding-top: 12px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1 {
  max-width: 14ch;
  margin: 0;
  font-size: clamp(2.4rem, 14vw, 4.4rem);
  line-height: 0.93;
  letter-spacing: 0;
}

.mode-link,
.ghost-button,
.send-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--ink);
  border-radius: 8px;
  padding: 0 16px;
  background: var(--ink);
  color: white;
  text-decoration: none;
  cursor: pointer;
}

.ghost-button,
.mode-link {
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
}

.vote-form {
  margin-top: 44px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow);
}

.emoji-label,
.panel-title {
  display: block;
  margin: 0 0 10px;
  color: var(--muted);
  font-weight: 750;
}

.emoji-entry {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.emoji-input {
  width: 100%;
  min-height: 76px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  padding: 8px 14px;
  background: white;
  color: var(--ink);
  font-size: 2.9rem;
  line-height: 1;
  text-align: center;
}

.send-button {
  min-width: 108px;
  min-height: 76px;
  border-color: var(--coral);
  background: var(--coral);
  color: #25110c;
  font-weight: 850;
}

.status {
  min-height: 24px;
  margin: 12px 0 0;
  color: var(--muted);
  font-weight: 700;
}

.recent-panel {
  margin-top: 20px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.64);
}

.mini-cloud {
  display: flex;
  min-height: 88px;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.mini-cloud span {
  display: inline-flex;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: white;
  box-shadow: 0 6px 18px rgba(23, 32, 27, 0.08);
}

.display-view {
  min-height: 100vh;
  padding: 28px;
}

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

.display-header h1 {
  max-width: none;
  font-size: clamp(3rem, 8vw, 7.4rem);
}

.qr-panel {
  display: grid;
  width: min(23vw, 210px);
  min-width: 150px;
  justify-items: center;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
}

.qr-panel img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
}

.qr-panel span {
  width: 100%;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.72rem;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cloud {
  position: relative;
  min-height: 52vh;
  overflow: hidden;
  border-block: 1px solid rgba(23, 32, 27, 0.14);
}

.cloud-item {
  position: absolute;
  display: inline-flex;
  width: 1.35em;
  height: 1.35em;
  align-items: center;
  justify-content: center;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 14px 24px rgba(23, 32, 27, 0.12));
  line-height: 1;
  transition: font-size 220ms ease, left 220ms ease, top 220ms ease;
}

.empty-cloud {
  display: grid;
  height: 100%;
  min-height: 52vh;
  place-items: center;
  color: var(--muted);
  font-size: clamp(1.4rem, 4vw, 3rem);
  font-weight: 800;
  text-align: center;
}

.display-actions {
  justify-content: flex-end;
}

@media (max-width: 680px) {
  .display-view {
    padding: 16px;
  }

  .display-stage {
    min-height: calc(100vh - 32px);
  }

  .display-header {
    align-items: flex-start;
  }

  .qr-panel {
    width: 118px;
    min-width: 118px;
  }

  .qr-panel span {
    display: none;
  }

  .emoji-entry {
    grid-template-columns: 1fr;
  }

  .send-button {
    width: 100%;
  }
}
