* {
  box-sizing: border-box;
}

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

body {
  background:
    radial-gradient(circle at 12% 4%, rgba(53, 183, 121, 0.26), transparent 32%),
    radial-gradient(circle at 88% 0%, rgba(255, 204, 77, 0.24), transparent 34%),
    #08192d;
  color: #f9f4e8;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

.activityApp {
  display: grid;
  gap: 12px;
  margin: 0 auto;
  max-width: 1080px;
  min-height: 100vh;
  padding: 14px;
}

.topbar {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.brand {
  align-items: center;
  display: flex;
  gap: 10px;
  min-width: 0;
}

.brand img {
  border-radius: 8px;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.24);
  height: 46px;
  width: 46px;
}

.brand h1 {
  font-size: 22px;
  line-height: 1.1;
  margin: 0;
}

.roomCode {
  background: rgba(255, 250, 240, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  color: #ffffff;
  padding: 8px 10px;
}

.hero {
  border-radius: 8px;
  max-height: 230px;
  overflow: hidden;
}

.heroImage {
  display: block;
  height: 100%;
  max-height: 230px;
  object-fit: cover;
  width: 100%;
}

.surface,
.toolPanel,
.candidatePanel,
.lotteryResult,
.status {
  background: rgba(255, 250, 240, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 8px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.24);
  color: #142033;
}

.surface {
  padding: 14px;
}

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

.modeButton,
.primaryButton,
.secondaryButton,
.optionButton {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  min-height: 46px;
}

.modeButton {
  background: linear-gradient(180deg, #2457b7, #173e78);
  color: #ffffff;
  padding: 16px;
  text-align: left;
}

.modeButton strong {
  display: block;
  font-size: 18px;
  margin-bottom: 4px;
}

.modeButton span {
  color: rgba(255, 255, 255, 0.78);
  display: block;
  line-height: 1.35;
}

.joinRow,
.hostGrid,
.toolStack,
.liveStack {
  display: grid;
  gap: 12px;
}

.hostGrid {
  grid-template-columns: minmax(0, 1.25fr) minmax(260px, 0.85fr);
}

.toolTabs {
  background: rgba(255, 250, 240, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  display: grid;
  gap: 4px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 4px;
}

.toolTab {
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: #d8e2ed;
  cursor: pointer;
  min-height: 40px;
}

.toolTab.active {
  background: #fff8e8;
  color: #142033;
  font-weight: 800;
}

.toolPanel,
.candidatePanel,
.lotteryResult {
  padding: 14px;
}

.toolPanel h2,
.candidatePanel h2,
.lotteryResult h2 {
  font-size: 17px;
  margin: 0 0 10px;
}

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}

.field span,
.muted,
.finePrint,
.resultMeta {
  color: #5a687a;
  font-size: 13px;
}

input,
textarea {
  background: #fffdf7;
  border: 1px solid #cfc1aa;
  border-radius: 8px;
  color: #142033;
  padding: 10px 12px;
  width: 100%;
}

textarea {
  min-height: 76px;
  resize: vertical;
}

.primaryButton {
  background: linear-gradient(180deg, #35b779, #237a57);
  color: #ffffff;
  font-weight: 800;
  padding: 0 14px;
}

.secondaryButton {
  background: #e9dfcd;
  color: #24303c;
  padding: 0 14px;
}

.dangerButton {
  background: linear-gradient(180deg, #ff685b, #c64242);
}

.buttonRow {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.status {
  color: #445367;
  padding: 10px 12px;
}

.optionButton {
  background: #fff8e8;
  border: 1px solid #d8cbb6;
  color: #142033;
  padding: 10px 12px;
  text-align: left;
}

.optionButton.selected {
  background: #ffcc4d;
  border-color: #e8ab20;
  font-weight: 800;
}

.meter {
  background: #e8dfd0;
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
}

.meter span {
  background: linear-gradient(90deg, #4ca7e8, #35b779);
  display: block;
  height: 100%;
}

.chipList,
.winnerList,
.resultList {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
}

.chip,
.resultRow {
  background: #eef4fb;
  border: 1px solid #d7e2ef;
  border-radius: 8px;
  color: #142033;
  padding: 8px 10px;
}

.mutedChip {
  color: #6a7788;
}

.resultRow {
  display: grid;
  gap: 2px;
  min-width: 180px;
}

@media (max-width: 760px) {
  .activityApp {
    padding: 12px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .hostGrid {
    grid-template-columns: 1fr;
  }
}
