* {
  box-sizing: border-box;
}

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

body {
  background:
    radial-gradient(circle at 14% 8%, rgba(229, 75, 75, 0.3), transparent 32%),
    radial-gradient(circle at 86% 0%, rgba(255, 204, 77, 0.22), transparent 34%),
    #08192d;
  color: #f9f4e8;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

.challengeApp {
  display: grid;
  gap: 12px;
  margin: 0 auto;
  max-width: 980px;
  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;
}

.helper,
.eyebrow,
.status,
.historyMeta {
  color: #c9d5e3;
}

.roomBadge {
  background: rgba(255, 250, 240, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  color: #ffffff;
  min-width: 84px;
  padding: 8px 10px;
  text-align: center;
}

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

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

.surface,
.scoreboard,
.history {
  background: rgba(255, 250, 240, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.28);
  color: #142033;
}

.surface {
  display: grid;
  gap: 14px;
  padding: 14px;
}

.modeGrid,
.playGrid,
.scoreGrid {
  display: grid;
  gap: 10px;
}

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

.playGrid {
  grid-template-columns: minmax(0, 1.35fr) minmax(220px, 0.65fr);
}

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

.modeButton {
  background: #102b47;
  color: #ffffff;
  padding: 14px;
  text-align: left;
}

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

.primaryButton,
.judgeGood {
  background: linear-gradient(180deg, #3bbf73, #258553);
  color: #ffffff;
  font-weight: 800;
}

.secondaryButton {
  background: #e9dfcd;
  color: #24303c;
}

.judgeMiss {
  background: linear-gradient(180deg, #ff685b, #c64242);
  color: #ffffff;
  font-weight: 800;
}

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

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

.field span {
  color: #566476;
  font-size: 13px;
}

input,
select {
  border: 1px solid #c9bda8;
  border-radius: 8px;
  color: #15202b;
  min-height: 42px;
  padding: 9px 11px;
  width: 100%;
}

.promptCard {
  align-content: center;
  background: #fff8e8;
  border: 1px solid #e2d3b9;
  border-radius: 8px;
  display: grid;
  gap: 10px;
  min-height: 244px;
  padding: 18px;
  text-align: center;
}

.eyebrow {
  color: #e54b4b;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.prompt {
  font-size: 34px;
  font-weight: 850;
  line-height: 1.08;
  margin: 0;
}

.timer {
  background: #0c2038;
  border: 7px solid #ffcc4d;
  border-left-color: #e54b4b;
  border-radius: 50%;
  color: #ffffff;
  font-size: 56px;
  font-weight: 900;
  height: 112px;
  line-height: 96px;
  margin: 0 auto;
  width: 112px;
}

.timer.idle {
  border-color: #4ca7e8;
}

.sidePanel {
  display: grid;
  gap: 10px;
}

.scoreboard,
.history {
  padding: 12px;
}

.scoreboard h2,
.history h2 {
  font-size: 16px;
  margin: 0 0 10px;
}

.scoreRow,
.historyRow {
  align-items: center;
  border-top: 1px solid #e6dccb;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  padding: 8px 0;
}

.scoreRow:first-of-type,
.historyRow:first-of-type {
  border-top: 0;
}

.scoreName,
.historyPrompt {
  min-width: 0;
  overflow-wrap: anywhere;
}

.scoreValue {
  font-weight: 900;
}

.status {
  background: rgba(16, 43, 71, 0.08);
  border-radius: 8px;
  color: #445367;
  margin: 0;
  padding: 10px 12px;
}

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

@media (max-width: 720px) {
  .challengeApp {
    padding: 12px;
  }

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

  .playGrid,
  .joinGrid {
    grid-template-columns: 1fr;
  }

  .prompt {
    font-size: 28px;
  }

  .timer {
    font-size: 48px;
    height: 100px;
    line-height: 84px;
    width: 100px;
  }
}
