/* ══════════════════════════════════════
   VARIABLES
══════════════════════════════════════ */
:root {
  --bg:         #EBF3FB;
  --surface:    #FFFFFF;
  --border:     rgba(0,0,0,0.07);
  --text:       #1A1A1A;
  --sub:        #6B7280;
  --muted:      #9CA3AF;
  --blue:       #2B9FEA;
  --blue-dark:  #1A7FD4;
  --blue-light: #E8F4FD;
  --green:      #34C759;
  --r:          16px;
  --r-sm:       12px;
  --shadow:     0 2px 12px rgba(43,159,234,0.10);
}

/* ══════════════════════════════════════
   BASE
══════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.app {
  max-width: 480px;
  margin: 0 auto;
  padding-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ══════════════════════════════════════
   HEADER
══════════════════════════════════════ */
.header {
  padding: 16px 16px 0;
  animation: fadeDown .4s ease both;
}

.logo-block {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 44px !important;
  height: 44px !important;
  max-width: 44px !important;
  max-height: 44px !important;
  flex-shrink: 0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(43,159,234,.30);
}

.logo-icon svg {
  width: 44px !important;
  height: 44px !important;
  display: block;
}

.logo-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.logo-sub {
  font-size: 12px;
  color: var(--sub);
  font-weight: 400;
  margin-top: 1px;
}

/* ══════════════════════════════════════
   SECTION
══════════════════════════════════════ */
.section {
  padding: 0 16px;
  animation: fadeUp .4s .05s ease both;
}

.section-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--sub);
  letter-spacing: .03em;
  text-transform: uppercase;
}

.icon-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--blue);
  box-shadow: var(--shadow);
  transition: transform .2s;
}

.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:active { transform: scale(.92); }
.icon-btn.spinning svg { animation: spin .6s linear 1; }

/* ══════════════════════════════════════
   GALLERY
══════════════════════════════════════ */
.gallery-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.gallery-scroll::-webkit-scrollbar { display: none; }

.gallery-scroll img,
.gallery-placeholder {
  width: 88px;
  height: 88px;
  flex-shrink: 0;
  border-radius: var(--r-sm);
  object-fit: cover;
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform .18s;
}

.gallery-placeholder {
  background: var(--surface);
  position: relative;
  overflow: hidden;
}

.gallery-placeholder::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40' fill='none'%3E%3Crect x='5' y='9' width='30' height='22' rx='3' stroke='%234A9FE0' stroke-width='1.5' stroke-opacity='.4'/%3E%3Ccircle cx='14' cy='18' r='3' stroke='%234A9FE0' stroke-width='1.5' stroke-opacity='.4'/%3E%3Cpath d='M5 26l7-5 5 4 4-3 9 7' stroke='%234A9FE0' stroke-width='1.5' stroke-opacity='.4' stroke-linecap='round'/%3E%3C/svg%3E")
    center/56% no-repeat;
}

.gallery-empty-msg {
  width: 100%;
  padding: 20px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  background: var(--surface);
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
}

.gallery-scroll img:active { transform: scale(.94); }

/* ══════════════════════════════════════
   PREVIEW
══════════════════════════════════════ */
.preview-zone {
  padding: 0 16px;
  animation: fadeUp .3s ease both;
}

.preview-frame {
  position: relative;
  border-radius: var(--r);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.preview-img {
  width: 100%;
  max-height: 260px;
  object-fit: cover;
  display: block;
}

.preview-veil {
  position: absolute;
  inset: 0;
  background: rgba(26,127,212,.55);
  backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border-radius: var(--r);
}

.veil-text {
  font-size: 14px;
  font-weight: 500;
  color: #fff;
}

/* ══════════════════════════════════════
   RESULT CARD
══════════════════════════════════════ */
.result-card {
  margin: 0 16px;
  background: var(--surface);
  border-radius: var(--r);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: fadeUp .3s ease both;
}

.result-success {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 16px;
  background: #F0FBF4;
  font-size: 13px;
  font-weight: 600;
  color: #1A7A3A;
  border-bottom: 1px solid rgba(52,199,89,.15);
}

.result-rows { padding: 4px 0; }

.result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 16px;
  gap: 12px;
}

.r-key {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  flex-shrink: 0;
}

.r-val {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  text-align: right;
}

.r-line { height: 1px; background: var(--border); margin: 0 16px; }

/* ══════════════════════════════════════
   BUTTON ZONE
══════════════════════════════════════ */
.btn-zone {
  padding: 0 16px;
  animation: fadeUp .4s .15s ease both;
}

.pick-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px;
  background: linear-gradient(135deg, #3AAEF5 0%, #1A7FD4 100%);
  border: none;
  border-radius: var(--r);
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(43,159,234,.35);
  transition: transform .15s, box-shadow .15s;
}

.pick-btn:active {
  transform: scale(.97);
  box-shadow: 0 2px 8px rgba(43,159,234,.2);
}

.pick-btn span {
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
}

/* ══════════════════════════════════════
   BOT NAME
══════════════════════════════════════ */
.bot-name {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  padding-bottom: 8px;
}

/* ══════════════════════════════════════
   SPINNER
══════════════════════════════════════ */
.ring-spinner {
  width: 34px;
  height: 34px;
  border: 2.5px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .75s linear infinite;
}

/* ══════════════════════════════════════
   FEEDBACK — лайк/дизлайк
══════════════════════════════════════ */
.feedback-zone {
  margin: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  animation: fadeUp .3s ease both;
}

.feedback-label {
  font-size: 13px;
  color: var(--sub);
  font-weight: 500;
  white-space: nowrap;
}

.feedback-btns {
  display: flex;
  gap: 8px;
}

.feedback-btn {
  padding: 8px 16px;
  border: none;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: transform .15s, opacity .15s;
}

.feedback-btn:active   { transform: scale(.95); }
.feedback-btn:disabled { opacity: .5; cursor: default; }
.feedback-btn.like     { background: #F0FBF4; color: #1A7A3A; }
.feedback-btn.dislike  { background: #FFF0F0; color: #C0392B; }

/* ══════════════════════════════════════
   ФОРМА ИСПРАВЛЕНИЯ
══════════════════════════════════════ */
.correct-form {
  margin: 0 16px;
  background: var(--surface);
  border-radius: var(--r);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: fadeUp .25s ease both;
}

.correct-form-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.correct-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.correct-field label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.correct-field input,
.correct-field select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  color: var(--text);
  background: var(--bg);
  outline: none;
  transition: border-color .2s;
}

.correct-field input:focus,
.correct-field select:focus { border-color: var(--blue); }

.correct-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.btn-cancel {
  flex: 1;
  padding: 11px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--sub);
  font-size: 14px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: background .15s;
}

.btn-confirm {
  flex: 2;
  padding: 11px;
  border: none;
  border-radius: var(--r-sm);
  background: linear-gradient(135deg, #3AAEF5 0%, #1A7FD4 100%);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(43,159,234,.3);
  transition: transform .15s;
}

.btn-confirm:active { transform: scale(.97); }
.btn-cancel:active  { background: var(--bg); }

/* ══════════════════════════════════════
   UTILS
══════════════════════════════════════ */
.hidden { display: none !important; }

@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes spin { to { transform: rotate(360deg); } }
