/* ===== База ===== */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: linear-gradient(160deg, #fff7f2 0%, #fdeee7 45%, #fbe3e8 100%);
  color: #3a2430;
  min-height: 100vh;
  -webkit-text-size-adjust: 100%;
}

.screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
}

.hidden { display: none !important; }

/* ===== Карточка ===== */
.card {
  width: 100%;
  max-width: 420px;
  background: rgba(255, 255, 255, .85);
  border: 1px solid rgba(190, 120, 140, .18);
  border-radius: 28px;
  padding: 36px 28px;
  text-align: center;
  box-shadow: 0 18px 50px rgba(140, 60, 90, .14);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.hearts { font-size: 34px; letter-spacing: 10px; }

h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 600;
  font-size: 26px;
  line-height: 1.3;
  margin: 14px 0 8px;
  color: #572a3a;
}

h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 24px;
  color: #572a3a;
  margin: 10px 0 6px;
}

.sub {
  color: #8a6470;
  font-size: 15px;
  line-height: 1.5;
  margin: 8px 0 22px;
}

.tiny { color: #b1939d; font-size: 12px; line-height: 1.4; margin-top: 16px; }

.error { color: #c0392b; font-size: 14px; line-height: 1.4; margin: 12px 0 0; }

/* ===== Кнопки ===== */
.btn {
  display: block;
  width: 100%;
  padding: 16px 18px;
  margin: 10px 0;
  border: none;
  border-radius: 999px;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  background: linear-gradient(135deg, #e06f8b, #c94f6d);
  color: #fff;
  box-shadow: 0 8px 20px rgba(201, 79, 109, .35);
  transition: transform .08s, box-shadow .15s;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

.btn:active { transform: scale(.97); }

.btn.ghost {
  background: #fff;
  color: #b23a5b;
  box-shadow: 0 4px 14px rgba(140, 60, 90, .12);
  border: 1.5px solid rgba(178, 58, 91, .25);
}

.btn.big { padding: 18px 18px; font-size: 18px; }

/* ===== Экран камеры ===== */
#screen-camera { padding: 0; justify-content: flex-end; background: #111; }

#camera-preview {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}

.camera-ui {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 18px 20px calc(28px + env(safe-area-inset-bottom));
  background: linear-gradient(transparent, rgba(0, 0, 0, .6));
}

.cam-top {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: calc(12px + env(safe-area-inset-top)) 16px 8px;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, .45);
  color: #fff;
  font-size: 17px;
  cursor: pointer;
  touch-action: manipulation;
}

.timer {
  font-variant-numeric: tabular-nums;
  font-size: 15px;
  color: #fff;
  background: rgba(0, 0, 0, .45);
  padding: 6px 14px;
  border-radius: 999px;
}

.cam-buttons { display: flex; gap: 30px; }

.shutter {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  border: 4px solid #fff;
  background: rgba(255, 255, 255, .22);
  color: #fff;
  font-size: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform .08s, background .15s;
}

.shutter:active { transform: scale(.94); }

.shutter.recording { background: #e5484d; animation: pulse 1.2s infinite; }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(229, 72, 77, .55); }
  50%      { box-shadow: 0 0 0 16px rgba(229, 72, 77, 0); }
}

.cam-status {
  color: #fff;
  font-size: 14px;
  min-height: 18px;
  margin: 0;
  text-shadow: 0 1px 4px rgba(0, 0, 0, .6);
}

.cam-note {
  color: #ffd9e2;
  font-size: 13px;
  text-align: center;
  margin: 0;
}

.native-link {
  border: none;
  background: rgba(255, 255, 255, .18);
  color: #fff;
  font-size: 14px;
  padding: 10px 18px;
  border-radius: 999px;
  cursor: pointer;
  touch-action: manipulation;
}

/* ===== Экран загрузки ===== */
.progress-track {
  height: 12px;
  background: rgba(140, 60, 90, .12);
  border-radius: 999px;
  overflow: hidden;
  margin: 18px 0 6px;
}

.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #e06f8b, #b23a5b);
  transition: width .2s ease;
}

#file-list {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  text-align: left;
  max-height: 220px;
  overflow-y: auto;
}

#file-list li {
  font-size: 13px;
  color: #7c5563;
  padding: 5px 2px;
  border-bottom: 1px dashed rgba(140, 60, 90, .15);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===== Скрытые input'ы ===== */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  clip: rect(0 0 0 0);
  overflow: hidden;
  white-space: nowrap;
}