:root {
  --ink: #062a3a;
  --muted: #5b6870;
  --line: #082c3b;
  --paper: #fbfcfd;
  --soft: #eaf8ef;
  --accent: #2b8c67;
  --accent-dark: #146147;
  --wrong: #b3261e;
  --right: #18794e;
  --shadow: 0 18px 50px rgba(7, 42, 58, 0.12);
  --page-header-height: 80px;
  --game-max-width: 1000px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

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

body {
  color: var(--ink);
  background: #f4f7f8;
  font-family: Arial, Helvetica, sans-serif;
}

button,
input {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

#head1 {
  flex: 0 0 var(--page-header-height);
  min-height: var(--page-header-height);
}

.banner-space {
  flex: 0 0 var(--page-header-height);
  height: var(--page-header-height);
  width: 100%;
  background: #fff;
  border-bottom: 1px dashed #c9d2d6;
}

.screen {
  display: none;
  flex: 1;
  width: 100%;
}

.screen.is-active {
  display: flex;
}

.title-screen,
.finished-screen {
  align-items: center;
  justify-content: center;
  padding: 28px;
}

.title-panel,
.finish-panel {
  width: min(520px, 100%);
  text-align: center;
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 34px 28px 30px;
}

.kicker {
  margin: 0 0 10px;
  color: var(--accent-dark);
  font-size: 18px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}

#promo{margin-bottom:5px;margin-top:5px;text-align:center;}

h1 {
  margin: 0;
  font-size: clamp(42px, 9vw, 82px);
  line-height: 1;
}

h2 {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: clamp(28px, 6vw, 52px);
  line-height: 1.1;
}

.settings {
  display: grid;
  gap: 18px;
  justify-items: center;
  margin: 30px 0;
}

.language-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-width: min(360px, 100%);
  margin: 0;
  padding: 13px 16px 15px;
  border: 2px solid #d4dee2;
  border-radius: 8px;
}

.language-group legend {
  padding: 0 8px;
  color: var(--muted);
  font-weight: 700;
}

.language-group label,
.checkbox-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 18px;
}

.primary-button {
  min-width: 180px;
  min-height: 56px;
  padding: 0 28px;
  color: #fff;
  background: var(--accent);
  border: 2px solid var(--accent-dark);
  border-radius: 8px;
  font-weight: 800;
  text-transform: uppercase;
  cursor: pointer;
}

.primary-button:hover,
.primary-button:focus-visible {
  background: var(--accent-dark);
}

.game-screen {
  flex-direction: column;
  justify-content: center;
  min-height: calc(100vh - var(--page-header-height));
  padding: 20px 28px max(18px, calc((100vh - var(--page-header-height)) / 3));
  gap: 18px;
}

.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: min(var(--game-max-width), 100%);
  margin: 0 auto;
}

.small-label {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}

.progress {
  margin: 3px 0 0;
  font-size: 24px;
  font-weight: 800;
}

.game-board {
  display: grid;
  grid-template-columns: minmax(240px, 435px) minmax(360px, 1fr);
  align-items: center;
  gap: 26px;
  width: min(var(--game-max-width), 100%);
  margin: 0 auto;
}

.game-board.is-long-word {
  grid-template-columns: minmax(220px, 360px) minmax(0, 1fr);
}

.image-frame {
  width: 100%;
  aspect-ratio: 1 / 1.06;
  display: grid;
  place-items: center;
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.image-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: crisp-edges;
}

.answer-area {
  min-width: 0;
}

.letter-slots {
  --slot-count: 1;
  --slot-gap: 14px;
  display: grid;
  grid-template-columns: repeat(var(--slot-count), minmax(0, 1fr));
  justify-content: start;
  gap: var(--slot-gap);
  width: 100%;
  max-width: min(100%, calc((var(--slot-count) * 132px) + ((var(--slot-count) - 1) * var(--slot-gap))));
  overflow: visible;
  padding: 8px 0 10px;
}

.slot {
  aspect-ratio: 0.93 / 1;
  min-width: 0;
  display: grid;
  place-items: center;
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 20px;
  font-size: clamp(32px, calc(340px / var(--slot-count)), 86px);
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
}

.slot.is-given {
  background: var(--soft);
}

.slot.is-active {
  box-shadow: inset 0 0 0 5px rgba(43, 140, 103, 0.18);
}

.feedback {
  min-height: 34px;
  margin: 18px 0 0;
  font-size: clamp(22px, 4vw, 36px);
  font-weight: 800;
}

.feedback.is-right {
  color: var(--right);
}

.feedback.is-wrong {
  color: var(--wrong);
}

.keyboard {
  display: none;
  width: min(720px, 100%);
  margin: 0 auto;
  grid-template-columns: repeat(10, 1fr);
  gap: 6px;
}

.key {
  min-width: 0;
  height: 44px;
  border: 2px solid #94a3aa;
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font-size: 17px;
  font-weight: 800;
  text-transform: uppercase;
  cursor: pointer;
}

.key[data-action="backspace"],
.key[data-action="next"] {
  grid-column: span 2;
  font-size: 14px;
}

.final-score {
  margin: 22px 0 28px;
  font-size: clamp(34px, 8vw, 68px);
  font-weight: 800;
}

@media (min-width: 761px) and (max-width: 860px) {
  .game-board.is-long-word {
    grid-template-columns: minmax(200px, 300px) minmax(0, 1fr);
    gap: 22px;
  }

  .game-board.is-long-word .letter-slots {
    --slot-gap: 10px;
  }

  .game-board.is-long-word .slot {
    font-size: clamp(28px, calc(280px / var(--slot-count)), 76px);
  }
}

@media (max-width: 760px) {
  .title-screen,
  .finished-screen {
    padding: 18px;
  }

  .title-panel,
  .finish-panel {
    padding: 28px 18px 24px;
  }

  .game-screen {
    padding: 20px 12px 8px;
    gap: 8px;
    justify-content: flex-start;
  }

  .game-board {
    grid-template-columns: 1fr;
    align-content: start;
    gap: 8px;
    margin: 0 auto;
  }

  .game-board.is-long-word {
    grid-template-columns: 1fr;
  }

  .image-frame {
    width: min(280px, 72vw);
    justify-self: center;
  }

  .letter-slots {
    --slot-gap: 7px;
    justify-content: center;
  }

  .slot {
    border-radius: 12px;
    font-size: clamp(24px, calc(270px / var(--slot-count)), 56px);
  }

  .feedback {
    margin-top: 8px;
    min-height: 28px;
    text-align: center;
  }

  .keyboard {
    display: grid;
    gap: 4px;
  }
}

@media (max-width: 430px) {
  .banner-space {
    flex-basis: 80px;
  }

  .language-group {
    flex-wrap: wrap;
  }

  .key {
    height: 36px;
    font-size: 15px;
  }
}
