/* ================= БАЗА ================= */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

:root {
  --ios-blue: #0a84ff;
  --ios-yellow: #ffd60a;
  --radius: 54px;
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  background: #17122b;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  overscroll-behavior: none;
  touch-action: manipulation;
}

body {
  position: fixed;
  inset: 0;
}

/* «Телефон»: на десктопе — рамка по центру, на мобильном — весь экран */
#phone {
  position: relative;
  width: 393px;
  height: 852px;
  max-height: 100vh;
  margin: 0 auto;
  top: 50%;
  transform: translateY(-50%);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 0 0 12px #1c1c1e, 0 0 0 14px #3a3a3c, 0 30px 80px rgba(0,0,0,.8);
  background: #000;
}

@media (max-width: 500px), (max-height: 900px) {
  #phone {
    position: fixed;
    inset: 0;
    width: auto; height: auto; max-height: none;
    top: 0; transform: none;
    border-radius: 0; box-shadow: none;
  }
}

/* На настоящем телефоне свой вырез — фейковый островок не нужен */
@media (max-width: 500px) and (pointer: coarse) {
  #statusbar::after { display: none; }
  #statusbar { padding-top: max(16px, env(safe-area-inset-top)); height: auto; }
  .ls-content { padding-top: calc(50px + max(16px, env(safe-area-inset-top))); }
}

/* Запущено с экрана «Домой» (PWA): реальный статус-бар iOS сверху,
   наш фейковый прячем, контент сдвигаем под вырез */
@media (display-mode: standalone) {
  #statusbar { display: none; }
  .ls-content { padding-top: calc(40px + env(safe-area-inset-top)); }
  .app-nav { padding-top: calc(env(safe-area-inset-top) + 14px); }
  .cam-top { padding-top: calc(env(safe-area-inset-top) + 14px); }
  .notes-detail-back { padding-top: calc(env(safe-area-inset-top) + 16px); }
  .hs-content { padding-top: calc(env(safe-area-inset-top) + 24px); }
  .cam-bottom, .msg-inputbar { padding-bottom: calc(env(safe-area-inset-bottom) + 24px); }
  .hs-dock { margin-bottom: calc(env(safe-area-inset-bottom) + 10px); }
  .ls-bottom { padding-bottom: calc(env(safe-area-inset-bottom) + 4px); }
  /* свой home bar не нужен — у айфона настоящий */
  .homebar-global { height: calc(env(safe-area-inset-bottom) + 20px); }
  .homebar-global .homebar, .ls-bottom .homebar { opacity: 0; }
}

/* ================= ЭКРАНЫ ================= */
.screen {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  overflow: hidden;
}
.screen.visible { display: flex; }

.screen.app {
  z-index: 20;
  background: #000;
  color: #fff;
  animation: appOpen .35s cubic-bezier(.2,.9,.3,1);
}
.screen.app.closing { animation: appClose .28s cubic-bezier(.5,0,.8,.4) forwards; }

@keyframes appOpen {
  from { transform: scale(.4); opacity: 0; border-radius: 120px; }
  to   { transform: scale(1);  opacity: 1; border-radius: 0; }
}
@keyframes appClose {
  from { transform: scale(1);  opacity: 1; }
  to   { transform: scale(.4); opacity: 0; border-radius: 120px; }
}

.screen.app.light-app { background: #fff; color: #000; }
#statusbar.dark-text { color: #000; }
.homebar.dark-bar { background: #000; opacity: .8; }

/* ================= СТАТУС-БАР ================= */
#statusbar {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 54px;
  padding: 16px 32px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 100;
  color: #fff;
  font-weight: 600;
  font-size: 16px;
  pointer-events: none;
}
#statusbar.dark-text { color: #000; }
.sb-right { display: flex; align-items: center; gap: 7px; }
.sb-dualtime {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .3px;
  opacity: .95;
}
.sb-city b { font-weight: 700; font-size: 12px; margin-left: 2px; }

/* островок */
#statusbar::after {
  content: "";
  position: absolute;
  top: 12px; left: 50%;
  transform: translateX(-50%);
  width: 122px; height: 36px;
  background: #000;
  border-radius: 20px;
}

/* ================= HOME BAR ================= */
.homebar-global {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 34px;
  display: flex; align-items: center; justify-content: center;
  z-index: 200;
  cursor: pointer;
}
.homebar { width: 140px; height: 5px; border-radius: 3px; background: #fff; opacity: .9; }
.homebar.dark { background: #fff; }
.homebar.light { background: #fff; }

/* ================= ЭКРАН БЛОКИРОВКИ ================= */
#lockscreen { z-index: 50; cursor: pointer; }
.ls-wallpaper {
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 20% 25%, #ff5e8a 0%, transparent 50%),
    radial-gradient(circle at 85% 20%, #a55eff 0%, transparent 55%),
    radial-gradient(circle at 60% 85%, #ff9d5e 0%, transparent 55%),
    linear-gradient(180deg, #2b1055, #7597de);
}
.ls-content {
  position: relative;
  padding-top: 84px;
  text-align: center;
  color: #fff;
  flex: 1;
}
.ls-lock { opacity: .9; margin-bottom: 6px; }
.ls-dualclock {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  margin-top: 4px;
}
.ls-clock-divider {
  width: 1px;
  height: 64px;
  background: rgba(255,255,255,.35);
}
.ls-city {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  opacity: .85;
  margin-bottom: 2px;
}
.ls-clock-time {
  font-size: 58px;
  font-weight: 700;
  letter-spacing: -1px;
  line-height: 1;
  text-shadow: 0 2px 20px rgba(0,0,0,.15);
}
#ls-date { font-size: 20px; font-weight: 500; margin-top: 6px; opacity: .95; }

.ls-notif {
  margin: 46px 14px 0;
  background: rgba(255,255,255,.28);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border-radius: 22px;
  padding: 12px 14px;
  display: flex;
  gap: 12px;
  align-items: center;
  text-align: left;
  animation: notifIn .7s .6s cubic-bezier(.2,.9,.3,1.2) backwards;
}
@keyframes notifIn {
  from { transform: translateY(-30px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
.ls-notif-icon {
  width: 38px; height: 38px;
  border-radius: 9px;
  background: linear-gradient(160deg, #ff375f, #ff2d55);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; color: #fff;
  flex-shrink: 0;
}
.ls-notif-title { font-size: 15px; font-weight: 600; }
.ls-notif-when { font-weight: 400; opacity: .7; font-size: 13px; margin-left: 4px; }
.ls-notif-text { font-size: 15px; margin-top: 1px; }

.ls-bottom {
  position: relative;
  padding-bottom: 12px;
  text-align: center; color: #fff;
}
.ls-hint {
  font-size: 15px; font-weight: 500; opacity: .9;
  margin-bottom: 18px;
  animation: hintPulse 2s infinite;
}
@keyframes hintPulse { 0%,100% { opacity: .5; } 50% { opacity: 1; } }
.ls-bottom .homebar { margin: 0 auto; }

#lockscreen.unlocking { animation: unlock .45s cubic-bezier(.5,0,.7,.4) forwards; }
@keyframes unlock {
  to { transform: translateY(-100%); opacity: .3; }
}

/* ================= ДОМАШНИЙ ЭКРАН ================= */
#homescreen { z-index: 10; }
.hs-wallpaper {
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 80% 15%, rgba(255,94,138,.55) 0%, transparent 50%),
    radial-gradient(circle at 15% 70%, rgba(120,80,255,.5) 0%, transparent 55%),
    linear-gradient(180deg, #0f0c29, #302b63 55%, #24243e);
}
.hs-content {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 80px 8px 20px;
}
.hs-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 106px;
  justify-items: center;
  padding: 10px 10px 0;
}
.hs-dock {
  background: rgba(255,255,255,.16);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border-radius: 32px;
  margin: 0 8px 24px;
  padding: 16px 10px 8px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  justify-items: center;
}
.hs-dock .icon-label { display: none; }
.hs-dock .app-icon { margin-bottom: 8px; }

.app-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  width: 76px;
  transition: transform .12s;
}
.app-icon:active { transform: scale(.88); }
.icon-img {
  width: 62px; height: 62px;
  border-radius: 15px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,.35);
  overflow: hidden;
}
.icon-img svg { width: 100%; height: 100%; }
.icon-label {
  margin-top: 6px;
  font-size: 12px;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,.5);
  font-weight: 400;
  max-width: 74px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ================= НАВБАР ПРИЛОЖЕНИЙ ================= */
.app-nav {
  position: relative;
  padding: 64px 12px 10px;
  display: flex;
  align-items: center;
  z-index: 5;
}
.nav-back {
  background: none; border: none;
  color: #fff; font-size: 17px;
  cursor: pointer;
  font-family: inherit;
  padding: 4px 6px;
}
.nav-back.yellow { color: #d6a800; }
.nav-back.blue { color: var(--ios-blue); font-size: 26px; line-height: 1; }
.nav-back.red { color: #ff375f; }
.nav-title { flex: 1; text-align: center; font-weight: 600; font-size: 17px; }
.nav-spacer { width: 60px; }
.dark-nav { background: transparent; }

/* ================= ФОТО ================= */
#app-photos { background: #000; }
.photos-stage {
  position: absolute; inset: 0;
  overflow: hidden;
}
.photos-slide {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1.2s ease;
}
.photos-slide.active {
  opacity: 1;
  animation: kenburns 7s ease-out forwards;
}
@keyframes kenburns {
  from { transform: scale(1); }
  to   { transform: scale(1.12); }
}
.photos-slide.placeholder {
  display: flex; align-items: center; justify-content: center;
  font-size: 70px;
}
.photos-caption {
  position: absolute;
  bottom: 90px; left: 0; right: 0;
  text-align: center;
  font-size: 22px;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 2px 14px rgba(0,0,0,.8);
  padding: 0 30px;
  z-index: 4;
}
#app-photos .app-nav {
  position: absolute; top: 0; left: 0; right: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.55), transparent);
  z-index: 5;
}
.photos-dots {
  position: absolute;
  bottom: 56px; left: 0; right: 0;
  display: flex; justify-content: center; gap: 7px;
  z-index: 4;
}
.photos-dots span {
  width: 7px; height: 7px; border-radius: 50%;
  background: rgba(255,255,255,.4);
  transition: background .3s;
}
.photos-dots span.on { background: #fff; }

/* ================= МУЗЫКА ================= */
#app-music { background: #1a1a2e; }
.music-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 30% 20%, rgba(255,60,120,.45), transparent 60%),
    radial-gradient(circle at 75% 75%, rgba(90,60,255,.45), transparent 60%),
    #17122b;
}
.music-body {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 32px 60px;
}
.music-cover-wrap { flex: 1; display: flex; align-items: center; }
.music-cover {
  width: 300px; height: 300px;
  max-width: 78vw; max-height: 36vh;
  border-radius: 14px;
  background: linear-gradient(140deg, #ff5e8a, #a55eff);
  background-size: cover;
  background-position: center;
  box-shadow: 0 24px 60px rgba(0,0,0,.6);
  display: flex; align-items: center; justify-content: center;
  font-size: 90px; color: rgba(255,255,255,.85);
  transition: transform .4s cubic-bezier(.2,.9,.3,1.2);
  transform: scale(.86);
}
.music-cover.playing { transform: scale(1); }
.music-meta { width: 100%; margin-top: 28px; text-align: left; }
.music-title { font-size: 22px; font-weight: 700; }
.music-artist { font-size: 17px; color: rgba(255,255,255,.55); margin-top: 2px; }

.music-progress { width: 100%; margin-top: 18px; }
#music-seek {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 5px;
  border-radius: 3px;
  background: linear-gradient(to right, #fff var(--p, 0%), rgba(255,255,255,.25) var(--p, 0%));
  outline: none;
}
#music-seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #fff;
}
.music-times {
  display: flex; justify-content: space-between;
  font-size: 12px; color: rgba(255,255,255,.5);
  margin-top: 6px;
}
.music-controls {
  display: flex; align-items: center; gap: 52px;
  margin-top: 20px;
}
.music-controls button {
  background: none; border: none; color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: transform .1s;
}
.music-controls button:active { transform: scale(.85); }
.music-note {
  margin-top: 26px;
  font-size: 14px;
  color: rgba(255,255,255,.65);
  text-align: center;
  font-style: italic;
}

/* ================= КАМЕРА ================= */
#app-camera { background: #000; }
.cam-top {
  position: relative;
  padding: 64px 20px 8px;
  display: flex; justify-content: space-between; align-items: center;
  z-index: 5;
}
.cam-close, .cam-flip {
  background: rgba(255,255,255,.12);
  border: none; color: #fff;
  width: 38px; height: 38px;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.cam-flash { color: #ffd60a; font-size: 18px; }
.cam-viewfinder {
  position: relative;
  flex: 1;
  margin: 4px 0;
  overflow: hidden;
  background: #111;
}
.cam-photo {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center;
  transition: opacity .2s;
  display: flex; align-items: center; justify-content: center;
  font-size: 60px;
}
.cam-photo.flipping { animation: camFlip .5s; }
@keyframes camFlip {
  0% { transform: rotateY(0); opacity: 1; }
  50% { transform: rotateY(90deg); opacity: .3; }
  100% { transform: rotateY(0); opacity: 1; }
}
.cam-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.18) 1px, transparent 1px);
  background-size: 33.4% 33.4%;
  pointer-events: none;
}
.cam-flash-overlay {
  position: absolute; inset: 0;
  background: #fff;
  opacity: 0;
  pointer-events: none;
}
.cam-flash-overlay.flash { animation: flashAnim .35s; }
@keyframes flashAnim { 0% { opacity: 0; } 30% { opacity: 1; } 100% { opacity: 0; } }
.cam-caption {
  position: absolute;
  bottom: 16px; left: 0; right: 0;
  text-align: center;
  color: #fff;
  font-size: 16px; font-weight: 600;
  text-shadow: 0 2px 10px rgba(0,0,0,.9);
  padding: 0 24px;
}
.cam-modes {
  display: flex; justify-content: center; gap: 26px;
  padding: 10px 0 4px;
  font-size: 13px; font-weight: 600;
  color: rgba(255,255,255,.5);
  letter-spacing: .5px;
}
.cam-modes .active { color: #ffd60a; }
.cam-bottom {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 34px 46px;
}
.cam-thumb {
  width: 44px; height: 44px;
  border-radius: 8px;
  background: #333 center/cover;
  border: 1px solid rgba(255,255,255,.3);
}
.cam-shutter {
  width: 74px; height: 74px;
  border-radius: 50%;
  border: 4px solid #fff;
  background: transparent;
  cursor: pointer;
  padding: 3px;
}
.cam-shutter span {
  display: block;
  width: 100%; height: 100%;
  border-radius: 50%;
  background: #fff;
  transition: transform .1s;
}
.cam-shutter:active span { transform: scale(.85); }

/* ================= ЗАМЕТКИ ================= */
#app-notes { background: #f2f2f7; }
.notes-nav { background: #f2f2f7; }
.notes-list-view { flex: 1; overflow-y: auto; padding: 0 20px 40px; }
.notes-h1 { font-size: 34px; font-weight: 700; margin: 4px 0 12px; }
.notes-search {
  background: #e3e3e8;
  border-radius: 10px;
  padding: 8px 12px;
  color: #8e8e93;
  font-size: 16px;
  margin-bottom: 18px;
}
.notes-list {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
}
.note-row {
  padding: 12px 16px;
  border-bottom: 1px solid #ececf0;
  cursor: pointer;
}
.note-row:last-child { border-bottom: none; }
.note-row:active { background: #f0f0f4; }
.note-row-title { font-weight: 600; font-size: 16px; }
.note-row-sub { font-size: 14px; color: #8e8e93; margin-top: 2px; display: flex; gap: 8px; }

.notes-detail-view {
  position: absolute; inset: 0;
  background: #fff;
  display: none;
  flex-direction: column;
  z-index: 6;
}
.notes-detail-view.open { display: flex; animation: slideInRight .3s cubic-bezier(.2,.9,.3,1); }
@keyframes slideInRight { from { transform: translateX(100%); } to { transform: translateX(0); } }
.notes-detail-back {
  background: none; border: none;
  text-align: left;
  font-size: 17px;
  padding: 66px 16px 10px;
  cursor: pointer;
  font-family: inherit;
}
.notes-detail-scroll { flex: 1; overflow-y: auto; padding: 8px 24px 60px; }
.notes-detail-date { text-align: center; color: #8e8e93; font-size: 13px; margin-bottom: 14px; }
#note-title { font-size: 26px; font-weight: 700; margin-bottom: 14px; }
#note-text {
  font-family: inherit;
  font-size: 18px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.yellow { color: #d6a800; }

/* ================= СООБЩЕНИЯ ================= */
#app-messages { background: #fff; }
.msg-nav {
  background: rgba(249,249,249,.94);
  border-bottom: 1px solid #e0e0e0;
  padding-bottom: 8px;
}
.msg-contact {
  flex: 1;
  display: flex; flex-direction: column; align-items: center;
  gap: 3px;
  font-size: 12px;
}
.msg-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: linear-gradient(160deg, #ff9d5e, #ff375f);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  background-size: cover; background-position: center;
}
.msg-thread {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.bubble {
  max-width: 74%;
  padding: 9px 14px;
  border-radius: 20px;
  font-size: 16px;
  line-height: 1.35;
  animation: bubbleIn .3s cubic-bezier(.2,.9,.3,1.2) backwards;
  word-wrap: break-word;
}
@keyframes bubbleIn { from { transform: scale(.7) translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }
.bubble.me {
  align-self: flex-end;
  background: var(--ios-blue);
  color: #fff;
  border-bottom-right-radius: 6px;
}
.bubble.her {
  align-self: flex-start;
  background: #e9e9eb;
  color: #000;
  border-bottom-left-radius: 6px;
}
.bubble.typing { color: #8e8e93; letter-spacing: 2px; }
.msg-inputbar {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px 44px;
}
.msg-input {
  flex: 1;
  border: 1px solid #d1d1d6;
  border-radius: 18px;
  padding: 7px 14px;
  color: #8e8e93;
  font-size: 16px;
}
.msg-send {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--ios-blue);
  color: #fff; font-size: 18px;
  cursor: default;
}

/* ================= МЫ ВМЕСТЕ ================= */
#app-us { background: #17122b; }
.us-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 50% 30%, rgba(255,55,95,.35), transparent 55%),
    radial-gradient(circle at 20% 85%, rgba(120,80,255,.35), transparent 55%),
    #17122b;
}
.us-body {
  position: relative;
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  padding: 0 30px 80px;
  color: #fff;
}
.us-heart {
  font-size: 58px;
  color: #ff375f;
  animation: heartbeat 1.4s infinite;
}
@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  12% { transform: scale(1.22); }
  24% { transform: scale(1); }
  36% { transform: scale(1.14); }
  48% { transform: scale(1); }
}
.us-days {
  font-size: 96px;
  font-weight: 800;
  letter-spacing: -3px;
  margin-top: 10px;
  background: linear-gradient(90deg, #ff5e8a, #ffb45e);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.us-label { font-size: 22px; font-weight: 600; margin-top: 4px; }
.us-since { font-size: 15px; color: rgba(255,255,255,.55); margin-top: 14px; }
.us-extra { font-size: 15px; color: rgba(255,255,255,.75); margin-top: 30px; font-style: italic; }

/* ================= ПОГОДА ================= */
#app-weather { background: #3f7cc9; }
.weather-bg {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, #2e5f9e 0%, #4a90d9 45%, #79b4e8 100%);
}
.weather-body {
  position: relative;
  flex: 1;
  overflow-y: auto;
  padding: 4px 20px 60px;
  color: #fff;
  text-align: center;
}
.weather-city { font-size: 32px; font-weight: 500; }
.weather-temp { font-size: 92px; font-weight: 200; line-height: 1.1; margin-left: 14px; }
.weather-desc { font-size: 18px; opacity: .9; }
.weather-hl { font-size: 16px; opacity: .85; margin-top: 4px; }
.weather-card {
  margin-top: 18px;
  background: rgba(255,255,255,.14);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 16px;
  padding: 12px 14px;
  text-align: left;
}
.weather-card-title {
  font-size: 12px; font-weight: 600;
  opacity: .7; letter-spacing: .5px;
  border-bottom: 1px solid rgba(255,255,255,.25);
  padding-bottom: 8px;
}
.weather-hours {
  display: flex;
  gap: 22px;
  overflow-x: auto;
  padding: 12px 2px 4px;
  scrollbar-width: none;
}
.weather-hours::-webkit-scrollbar { display: none; }
.weather-hour {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  font-size: 14px;
  flex-shrink: 0;
}
.weather-hour .wh-icon { font-size: 20px; }
.weather-hour .wh-temp { font-weight: 600; }
.weather-week { display: flex; flex-direction: column; }
.weather-day {
  display: grid;
  grid-template-columns: 1fr 40px 1.2fr;
  align-items: center;
  padding: 11px 2px;
  font-size: 16px;
  border-bottom: 1px solid rgba(255,255,255,.15);
}
.weather-day:last-child { border-bottom: none; }
.weather-day span:last-child { text-align: right; opacity: .95; }
.wd-icon { text-align: center; }

/* ================= КАЛЬКУЛЯТОР ================= */
#app-calc { background: #000; }
.calc-top { padding: 64px 12px 0; }
.calc-display {
  flex: 1;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 0 28px 6px;
  font-size: 76px;
  font-weight: 300;
  color: #fff;
  overflow: hidden;
  white-space: nowrap;
}
.calc-display.love { font-size: 56px; }
.calc-note {
  text-align: right;
  padding: 0 30px 10px;
  font-size: 14px;
  color: #ff9f0a;
  min-height: 22px;
}
.calc-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 0 16px 46px;
}
.calc-btn {
  aspect-ratio: 1;
  border-radius: 50%;
  border: none;
  font-size: 30px;
  font-family: inherit;
  color: #fff;
  background: #333;
  cursor: pointer;
  transition: filter .1s;
}
.calc-btn:active { filter: brightness(1.6); }
.calc-btn.gray { background: #a5a5a5; color: #000; }
.calc-btn.orange { background: #ff9f0a; }
.calc-btn.zero {
  grid-column: span 2;
  aspect-ratio: auto;
  border-radius: 40px;
  text-align: left;
  padding-left: 28px;
}

/* ================= ИГРА ================= */
#app-game { background: #1d1135; }
.game-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 25% 25%, rgba(255,55,95,.35), transparent 55%),
    radial-gradient(circle at 80% 75%, rgba(120,80,255,.4), transparent 55%),
    #1d1135;
}
.game-body {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 26px 90px;
  color: #fff;
}
.game-question {
  font-size: 34px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 46px;
}
.game-buttons { display: flex; gap: 26px; }
.game-yes, .game-no {
  border: none;
  border-radius: 18px;
  padding: 16px 42px;
  font-size: 22px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}
.game-yes { background: #ff375f; color: #fff; box-shadow: 0 10px 30px rgba(255,55,95,.45); }
.game-yes:active { transform: scale(.94); }
.game-no {
  background: rgba(255,255,255,.14);
  color: #fff;
  transition: top .25s, left .25s, transform .25s;
}
.game-no.fleeing { position: absolute; z-index: 3; }
.game-win {
  position: absolute; inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 30px;
  z-index: 5;
}
.game-win.show { display: flex; }
.game-win-text {
  white-space: pre-line;
  font-size: 30px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 4px 30px rgba(255,55,95,.6);
  animation: winPop .6s cubic-bezier(.2,.9,.3,1.4);
}
@keyframes winPop { from { transform: scale(.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.heart-fall {
  position: absolute;
  top: -40px;
  font-size: 26px;
  animation: heartFall linear forwards;
  pointer-events: none;
  z-index: 4;
}
@keyframes heartFall {
  to { transform: translateY(110vh) rotate(360deg); }
}

/* ================= ПИСЬМО ================= */
#app-letter { background: #fdf6ee; }
.letter-nav { background: #fdf6ee; }
.letter-body {
  flex: 1;
  overflow-y: auto;
  padding: 10px 22px 60px;
}
.letter-paper {
  background: #fff;
  border-radius: 18px;
  padding: 34px 26px;
  box-shadow: 0 10px 40px rgba(160,110,60,.18);
  text-align: center;
}
.letter-heart { font-size: 44px; margin-bottom: 18px; }
#letter-text {
  font-family: inherit;
  font-size: 18px;
  line-height: 1.65;
  white-space: pre-wrap;
  text-align: left;
  color: #3a3129;
}
.letter-sign {
  margin-top: 26px;
  font-size: 19px;
  font-style: italic;
  color: #ff375f;
  text-align: right;
}
