:root {
  --card-radius: 16px;
  --bottom-bar-space: clamp(124px, 16vh, 196px);
}

html {
  background-color: #f8fafc;
}

html,
body {
  height: 100%;
}

.app-body {
  min-height: 100vh;
  background-color: #f8fafc;
  /* Один непрерывный фон на всю высоту без повтора и без «обрезанных» px-бликов */
  background-image:
    radial-gradient(ellipse 135% 52% at 10% -6%, rgba(99, 102, 241, 0.13), transparent 72%),
    radial-gradient(ellipse 125% 48% at 92% 6%, rgba(16, 185, 129, 0.11), transparent 68%),
    linear-gradient(178deg, #f8fafc 0%, #eef2ff 42%, #f6faf9 78%, #f8fafc 100%);
  background-repeat: no-repeat;
  background-size: 100% 100%;
}

.app-main {
  padding-bottom: calc(var(--bottom-bar-space) + env(safe-area-inset-bottom, 0px)) !important;
}

.app-hero {
  padding: 14px 14px;
  border-radius: var(--card-radius);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(0, 0, 0, 0.06);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.card {
  border-radius: var(--card-radius);
  border-color: rgba(0, 0, 0, 0.06);
}

.card-body {
  padding: 14px 14px;
}

.btn-lg {
  border-radius: 14px;
}

textarea.form-control {
  border-radius: 14px;
}

.app-bottom-bar {
  position: fixed !important;
  left: 0;
  right: 0;
  bottom: 0 !important;
  width: 100%;
  padding: 8px 0 calc(8px + env(safe-area-inset-bottom, 0px));
  background: rgba(248, 250, 252, 0.70);
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 1030;
}

/* --- Компонент лайка (сердце) --- */

.heart-like__btn {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 0;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  appearance: none;
  -webkit-appearance: none;
  box-shadow: none;
}

.heart-like__btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.heart-like__btn:focus {
  outline: none;
}

.heart-like__btn:focus-visible {
  outline: 2px solid rgba(239, 68, 68, 0.45);
  outline-offset: 3px;
}

.heart-like__path {
  transition:
    fill 0.28s ease,
    stroke 0.28s ease,
    stroke-width 0.28s ease;
}

.heart-like__btn:not(.heart-like__btn--active) .heart-like__path {
  fill: none;
  stroke: #9ca3af;
  stroke-width: 1.65;
  stroke-linejoin: round;
}

.heart-like__btn:not(.heart-like__btn--active):hover .heart-like__path {
  stroke: #6b7280;
}

.heart-like__btn--active .heart-like__path {
  fill: #ef4444;
  stroke: none;
}

.heart-like__icon {
  --heart-base: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transform: scale(var(--heart-base));
  transition:
    transform 0.28s ease,
    filter 0.28s ease;
}

.heart-like__btn--active .heart-like__icon {
  --heart-base: 1.06;
  filter: drop-shadow(0 3px 10px rgba(239, 68, 68, 0.42));
}

.heart-like__btn:not(.heart-like__btn--active) .heart-like__icon {
  filter: none;
}

@keyframes heart-like-bounce {
  0% {
    transform: scale(var(--heart-base));
  }
  32% {
    transform: scale(calc(var(--heart-base) * 1.2));
  }
  58% {
    transform: scale(calc(var(--heart-base) * 0.92));
  }
  82% {
    transform: scale(calc(var(--heart-base) * 1.06));
  }
  100% {
    transform: scale(var(--heart-base));
  }
}

.heart-like__icon--bounce {
  animation: heart-like-bounce 0.48s cubic-bezier(0.34, 1.45, 0.64, 1);
}

.app-cta-btn {
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.2px;
  border: 0;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.22);
}

.app-cta-btn:active {
  transform: translateY(1px);
}

/* --- Touch screen page --- */

html.touch-html {
  overflow: hidden;
  height: 100%;
  max-height: 100dvh;
}

.touch-body {
  margin: 0;
  height: 100%;
  max-height: 100dvh;
  width: 100%;
  background: #f8fafc;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.touch-screen {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  max-width: 100%;
  display: flex;
  padding:
    calc(24px + env(safe-area-inset-top, 0px))
    calc(16px + env(safe-area-inset-right, 0px))
    calc(24px + env(safe-area-inset-bottom, 0px))
    calc(16px + env(safe-area-inset-left, 0px));
  box-sizing: border-box;
}

.touch-screen__inner {
  position: relative;
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  text-align: center;
  max-height: none;
  overflow: hidden;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.touch-timer {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 3;
  padding: 8px 12px;
  font-variant-numeric: tabular-nums;
  font-size: clamp(22px, 3.2vw, 44px);
  font-weight: 800;
  line-height: 1;
  color: #000;
  letter-spacing: 0.02em;
  user-select: none;
  pointer-events: none;
}

.touch-timer__value {
  display: inline-block;
}

.touch-main {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.touch-screen__question {
  flex: 0 1 auto;
  min-height: 0;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: #000;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
}

.touch-screen__likes {
  flex-shrink: 0;
  margin-top: 18px;
  font-size: 32px;
  color: rgba(0, 0, 0, 0.72);
}

.touch-screen__likes-count {
  font-weight: 800;
  color: #000;
}

.touch-screen__empty {
  flex: 0 1 auto;
  min-height: 0;
  font-size: 18px;
  font-weight: 700;
  color: #000;
  letter-spacing: -0.02em;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.touch-footer {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-top: 14px;
  font-size: 18px;
  line-height: 1.15;
  color: #000;
  letter-spacing: 0.1px;
  user-select: none;
}

.touch-footer__left,
.touch-footer__right {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.touch-footer__left {
  text-align: left;
}

.touch-footer__right {
  text-align: right;
}

/* Admin: make modal backdrop a bit stronger so content doesn't mix */
.modal-backdrop.show {
  opacity: 0.65;
}

/* Admin: highlight answered questions */
.admin-q--answered {
  border-color: rgba(34, 197, 94, 0.55) !important;
  background: rgba(34, 197, 94, 0.08);
}
