:root {
  --soft: #f4f7f1;
  --hero-start: #4a628a;
  --hero-end: #2f425f;
}

.setup {
  height: 100%;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(12px, 2vw, 16px);
  overflow: hidden;
}

.hero {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
  background: linear-gradient(145deg, #95cd85, #67a95a);
  position: relative;
  overflow: hidden;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.heroInner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  flex: 1 1 auto;
}

.heroTitle {
  margin: 0;
  font-size: clamp(20px, 3.2vw, 34px);
  font-weight: 400;
  font-family: "CMB", "Segoe UI", system-ui, sans-serif;
  letter-spacing: 0.2px;
  color: #f7f9f2;
  text-shadow: 0 1px 0 rgba(8, 20, 14, 0.45);
}

.heroDesc {
  margin: 0;
  max-width: 60ch;
  font-weight: 750;
  line-height: 1.35;
  color: #f7f9f2;
}

input,
select {
  width: 100%;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  font-weight: 850;
  font-size: 14px;
  background: #fff;
  outline: none;
}

.spacer {
  flex: 1 1 auto;
  min-height: 10px;
}

.startRow {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  align-items: center;
}

.game {
  height: 100%;
  display: grid;
  grid-template-columns: 1.45fr 0.55fr;
  gap: clamp(12px, 2vw, 16px);
  overflow: hidden;
  align-items: stretch;
}

.main {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  background: #fff;
}

.mainTop {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  margin-bottom: 10px;
  flex: 0 0 auto;
}

.wordZone {
  flex: 1 1 auto;
  display: grid;
  gap: 10px;
  margin-bottom: 10px;
  min-height: 0;
  grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
}

.box {
  border: 1px solid var(--border);
  background: var(--soft);
  border-radius: 18px;
  padding: clamp(12px, 1.8vw, 16px);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.scrambled {
  font-family: "CMB", "Segoe UI", system-ui, sans-serif;
  font-weight: 400;
  text-align: center;
  color: #0b1220;
  white-space: nowrap;
  max-width: 100%;
  overflow: visible;
  text-overflow: clip;
  font-size: 52px;
  transform-origin: center;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  gap: clamp(5px, 0.9vw, 14px);
}

.revealed {
  font-family: "CMB", "Segoe UI", system-ui, sans-serif;
  font-weight: 400;
  text-align: center;
  color: #111827;
  white-space: nowrap;
  max-width: 100%;
  overflow: visible;
  text-overflow: clip;
  letter-spacing: 0;
  font-size: 42px;
  transform-origin: center;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  gap: clamp(4px, 0.7vw, 10px);
}

.letterToken {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0.7em;
}

.letterToken.isHint {
  color: #c43c2f;
}

.spaceToken {
  width: 0.5em;
}

.dashToken {
  min-width: 0.5em;
}

.actionsWrap {
  flex: 0 0 148px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
}

.actions {
  width: min(520px, 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 100%;
  gap: 12px;
}

.actionGroupTop,
.actionGroupBottom {
  display: grid;
  gap: 10px;
}

.side {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 12px;
  background: #fff;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.stat.hidden {
  display: none;
}

.msg {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--soft);
  padding: 10px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 850;
  line-height: 1.25;
  min-height: 64px;
}

.msg strong {
  color: var(--text);
  font-family: "CMB", "Segoe UI", system-ui, sans-serif;
  font-weight: 400;
}

.sideButtons {
  display: grid;
  gap: 10px;
  margin-top: auto;
}

@media (max-width: 980px) {
  .setup {
    grid-template-columns: 1fr;
  }

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

  .side {
    min-height: 220px;
  }
}
