:root {
  --bg-start: #fff5d6;
  --bg-end: #ffd7a8;
  --card-bg: rgba(255, 252, 244, 0.92);
  --text-main: #3b2f2f;
  --text-soft: #7a6556;
  --accent: #ff8a5b;
  --accent-dark: #e2683f;
  --good: #4f9d69;
  --bad: #d95b5b;
  --letter-bg: #fff;
  --letter-border: #f3c597;
  --shadow: 0 18px 40px rgba(123, 76, 33, 0.18);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Comfortaa", sans-serif;
  color: var(--text-main);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.8), transparent 28%),
    radial-gradient(circle at bottom right, rgba(255, 184, 107, 0.45), transparent 25%),
    linear-gradient(160deg, var(--bg-start), var(--bg-end));
}

.game {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
}

.card {
  width: min(920px, 100%);
  padding: 28px;
  border-radius: 28px;
  background: var(--card-bg);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.eyebrow,
.subtitle,
.label,
.attempts-text {
  color: var(--text-soft);
}

.eyebrow {
  margin: 0 0 12px;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.1;
}

.subtitle {
  margin: 12px 0 0;
  max-width: 42rem;
  line-height: 1.5;
}

.top-panel {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 18px;
  margin-top: 28px;
}

.riddle-box,
.mascot-box,
.word-box,
.status-box,
.keyboard-box {
  border: 2px solid rgba(243, 197, 151, 0.7);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.72);
  padding: 18px;
}

.label {
  display: inline-block;
  margin-bottom: 12px;
  font-size: 0.85rem;
}

.riddle-text {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.6;
}

.mascot-box {
  text-align: center;
}

.hangman-emoji {
  min-height: 84px;
  font-size: 4rem;
  display: grid;
  place-items: center;
}

.attempts-text {
  margin: 8px 0 0;
  line-height: 1.5;
}

.word-box {
  margin-top: 18px;
}

.word-display {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.letter-slot {
  width: 42px;
  height: 52px;
  border-radius: 14px;
  border: 2px dashed var(--letter-border);
  background: rgba(255, 247, 234, 0.95);
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  font-weight: 700;
}

.status-box {
  margin-top: 18px;
  min-height: 78px;
  display: grid;
  align-items: center;
}

.status-text {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.5;
}

.status-text.win {
  color: var(--good);
}

.status-text.lose {
  color: var(--bad);
}

.controls {
  margin-top: 18px;
}

.primary-button,
.key-button {
  border: none;
  font: inherit;
  cursor: pointer;
  transition: transform 0.16s ease, background-color 0.16s ease, opacity 0.16s ease;
}

.primary-button {
  padding: 14px 22px;
  border-radius: 999px;
  color: #fffaf4;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  box-shadow: 0 10px 18px rgba(226, 104, 63, 0.25);
}

.primary-button:hover,
.key-button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.keyboard-box {
  margin-top: 22px;
}

.keyboard {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(46px, 1fr));
  gap: 10px;
}

.key-button {
  min-height: 46px;
  border-radius: 14px;
  background: var(--letter-bg);
  color: var(--text-main);
  border: 2px solid var(--letter-border);
  font-weight: 700;
}

.key-button.correct {
  background: rgba(79, 157, 105, 0.16);
  border-color: var(--good);
  color: var(--good);
}

.key-button.wrong {
  background: rgba(217, 91, 91, 0.14);
  border-color: var(--bad);
  color: var(--bad);
}

.key-button:disabled {
  cursor: default;
  opacity: 0.8;
}

@media (max-width: 720px) {
  .card {
    padding: 20px;
    border-radius: 22px;
  }

  .top-panel {
    grid-template-columns: 1fr;
  }

  .hangman-emoji {
    min-height: 64px;
    font-size: 3.2rem;
  }

  .letter-slot {
    width: 38px;
    height: 48px;
    font-size: 1.3rem;
  }
}
