* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  padding: 32px 16px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  background: linear-gradient(180deg, #f3f0e4 0%, #e7e0c8 100%);
  font-family: Georgia, 'Times New Roman', serif;
  color: #3a3320;
}

.card {
  width: 100%;
  max-width: 680px;
  background: #fffdf5;
  border: 1.5px solid #b8862c;
  border-radius: 14px;
  padding: 28px 32px 32px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

h1 {
  margin: 0 0 6px;
  color: #4a6b2a;
  font-size: 28px;
}

.hint {
  margin: 0 0 20px;
  color: #8a7a4a;
  font-size: 14px;
  line-height: 1.5;
}

.error {
  background: #fbe3df;
  border: 1.5px solid #c0552f;
  color: #8a2f12;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 16px;
  font-size: 14px;
}

label {
  display: block;
  font-weight: 700;
  margin: 14px 0 6px;
  color: #4a6b2a;
}

input[type="text"], textarea {
  width: 100%;
  font-family: inherit;
  font-size: 15px;
  padding: 10px 12px;
  border: 1.5px solid #b8a86c;
  border-radius: 8px;
  background: #fff;
  color: #1a1a1a;
}

input[type="text"]:focus, textarea:focus {
  outline: none;
  border-color: #5a8835;
}

textarea { resize: vertical; line-height: 1.5; }

fieldset {
  margin: 18px 0 0;
  padding: 12px 14px;
  border: 1.5px solid #b8a86c;
  border-radius: 8px;
}

legend {
  font-weight: 700;
  color: #4a6b2a;
  padding: 0 6px;
}

.radio {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 400;
  margin: 8px 0;
  cursor: pointer;
}

.radio b { color: #3a5520; }

.radio.standalone { margin: 16px 0 0; }

.custom-size input[type="number"] {
  width: 56px;
  font-family: inherit;
  font-size: 14px;
  padding: 4px 6px;
  border: 1.5px solid #b8a86c;
  border-radius: 6px;
}

select {
  width: 100%;
  font-family: inherit;
  font-size: 15px;
  padding: 10px 12px;
  border: 1.5px solid #b8a86c;
  border-radius: 8px;
  background: #fff;
  color: #1a1a1a;
}

select:focus { outline: none; border-color: #5a8835; }

button[type="submit"] {
  margin-top: 22px;
  width: 100%;
  font-family: inherit;
  font-size: 17px;
  font-weight: 700;
  padding: 13px;
  border: 1.5px solid #5a8835;
  border-radius: 10px;
  background: #c8d8a4;
  color: #3a5520;
  cursor: pointer;
}

button[type="submit"]:hover { background: #d6e4b6; }

.mode-bar { display: flex; gap: 14px; flex-wrap: wrap; }

.tiles {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tile input { position: absolute; opacity: 0; pointer-events: none; }

.tile span {
  display: block;
  min-width: 36px;
  padding: 7px 8px;
  text-align: center;
  font-size: 16px;
  border: 1.5px solid #b8a86c;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  user-select: none;
}

.tile input:checked + span {
  background: #c8d8a4;
  border-color: #5a8835;
  color: #3a5520;
  font-weight: 700;
}

.tile span:hover { border-color: #5a8835; }

.inline-select {
  width: auto;
  font-family: inherit;
  font-size: 14px;
  padding: 4px 8px;
  border: 1.5px solid #b8a86c;
  border-radius: 6px;
  background: #fff;
}

/* плитки с названиями картинок */
.tiles-wide .tile span { min-width: auto; padding: 6px 10px; font-size: 14px; }

/* пресеты выбора согласных */
.preset-bar { display: flex; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.preset {
  font-family: inherit;
  font-size: 13px;
  padding: 6px 12px;
  border: 1.5px solid #b8a86c;
  border-radius: 8px;
  background: #fff;
  color: #5a4a20;
  cursor: pointer;
}
.preset:hover { border-color: #5a8835; }

/* ---------- экранный режим (English-флешкарточки) ---------- */
.screen {
  width: 100%;
  max-width: 880px;
  margin: 0 auto 40px;
  background: #fffdf5;
  border: 1.5px solid #b8862c;
  border-radius: 14px;
  padding: 20px 24px 28px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}
.screen-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.screen-head span { font-size: 22px; font-weight: 700; color: #4a6b2a; }
.screen-btn {
  font-family: inherit; font-size: 14px;
  padding: 7px 14px; border-radius: 8px;
  border: 1.5px solid #b8a86c; background: #fff; color: #5a4a20; cursor: pointer;
}
.screen-btn:hover { border-color: #5a8835; }
.screen-hint { color: #8a7a4a; font-size: 14px; margin: 6px 0 16px; }
.screen-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
}
.screen-card {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 14px 8px;
  border: 1.5px solid #d8cda8; border-radius: 12px;
  background: linear-gradient(180deg, #fffdf5 0%, #fdf6e3 100%);
  cursor: pointer; user-select: none;
  transition: transform 0.08s, border-color 0.15s;
}
.screen-card:hover { border-color: #5a8835; transform: translateY(-2px); }
.screen-card:active { transform: translateY(0); }
.sc-emoji { font-size: 40px; line-height: 1; }
.sc-en { font-size: 18px; font-weight: 700; color: #1e63b0; }
.sc-trans { font-size: 13px; color: #5a4a20; visibility: hidden; }
.screen-card.revealed .sc-trans { visibility: visible; }
.screen-card.revealed { border-color: #e0762e; }
