* {
  box-sizing: border-box;
}

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

body {
  background: #0d1715;
  color: #fff9ed;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

.sfcApp {
  display: grid;
  gap: 12px;
  margin: 0 auto;
  max-width: 1120px;
  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.25);
  height: 46px;
  width: 46px;
}

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

.helper,
.status,
.meta {
  color: #cddbd6;
}

.roomBadge {
  background: rgba(255, 249, 237, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  color: #ffffff;
  min-width: 92px;
  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,
.panel,
.card,
.answerCard,
.submissionCard {
  background: rgba(255, 249, 237, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.24);
  color: #16231f;
}

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

.modeGrid,
.joinGrid,
.tableGrid,
.answerGrid,
.submissionGrid,
.scoreList,
.controlStack {
  display: grid;
  gap: 10px;
}

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

.joinGrid,
.tableGrid {
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.55fr);
}

.answerGrid,
.submissionGrid {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.modeButton,
.primaryButton,
.secondaryButton,
.answerCard,
.submissionCard {
  border-radius: 8px;
  cursor: pointer;
}

.modeButton,
.primaryButton,
.secondaryButton {
  border: 0;
  min-height: 46px;
  padding: 0 14px;
}

.modeButton {
  background: #11362d;
  color: #ffffff;
  padding: 14px;
  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;
}

.primaryButton {
  background: #15814e;
  color: #ffffff;
  font-weight: 850;
}

.secondaryButton {
  background: #eadcc5;
  color: #26352f;
}

.primaryButton:disabled,
.secondaryButton:disabled {
  cursor: default;
  opacity: 0.48;
}

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

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

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

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

.promptCard {
  background: linear-gradient(135deg, #fff9ed 0%, #fff2d5 100%);
  border: 1px solid #e4ccb0;
  border-radius: 8px;
  display: grid;
  gap: 12px;
  padding: 16px;
}

.promptTitle {
  color: #15734a;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.promptText {
  font-size: 28px;
  font-weight: 850;
  line-height: 1.16;
  margin: 0;
}

.blank {
  background: #f9c74f;
  border-radius: 6px;
  box-decoration-break: clone;
  color: #241b0a;
  padding: 0 7px 2px;
  -webkit-box-decoration-break: clone;
}

.answerCard,
.submissionCard {
  border: 1px solid #ded0bb;
  display: grid;
  gap: 9px;
  min-height: 118px;
  padding: 13px;
  text-align: left;
}

.answerCard.selected {
  background: #ffd166;
  border-color: #d69112;
  box-shadow: 0 0 0 3px rgba(214, 145, 18, 0.18);
}

.answerCard.used,
.answerCard:disabled {
  cursor: default;
  opacity: 0.45;
}

.answerText,
.submissionText {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.22;
}

.tag {
  color: #66766f;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.scoreRow,
.submissionMeta {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.scoreChip,
.stateChip {
  background: #16483b;
  border-radius: 999px;
  color: #ffffff;
  font-size: 13px;
  font-weight: 850;
  min-width: 40px;
  padding: 5px 9px;
  text-align: center;
}

.stateChip {
  background: #d94f42;
}

.winner {
  background: #e9f7ef;
  border: 1px solid #a8dcc0;
  border-radius: 8px;
  color: #123c2a;
  font-weight: 850;
  padding: 12px;
}

@media (max-width: 720px) {
  .joinGrid,
  .tableGrid {
    grid-template-columns: 1fr;
  }

  .brand h1 {
    font-size: 19px;
  }

  .promptText {
    font-size: 22px;
  }
}
