/* =========================================================================
   Хоррор-стиль телефона для «Твоей последней вписки»
   ========================================================================= */

body.horror-phone,
body.horror-phone .game {
  background-color: #0a0106 !important;
  background-image:
    radial-gradient(70% 40% at 50% 0%, rgba(150,10,26,.34) 0%, transparent 60%),
    linear-gradient(180deg, #24040c 0%, #12020a 46%, #080105 100%) !important;
  color: #f0dede;
}
/* шапка телефона тоже в теме */
body.horror-phone .topline,
body.horror-phone .game > header { background: rgba(20,2,7,.6); }
/* Хозяин на телефоне */
body.horror-phone .mr { height: 130px; }
body.horror-phone::after {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 40;
  background: radial-gradient(110% 90% at 50% 45%, transparent 40%, rgba(20,0,4,.72) 100%);
}
body.horror-phone .h1,
body.horror-phone .h2 { text-shadow: 0 0 22px rgba(255,50,70,.45); }
body.horror-phone .promptcard {
  background: linear-gradient(180deg, rgba(62,10,18,.96), rgba(24,3,9,.96));
  border: 1px solid rgba(255,90,110,.34);
  color: #ffeceb;
  text-shadow: 0 0 18px rgba(255,60,80,.3);
  box-shadow: 0 6px 0 rgba(0,0,0,.5), inset 0 0 40px rgba(200,12,32,.14);
}
body.horror-phone .note { color: #d2a2a8; opacity: .9; }
body.horror-phone .pill { background: #8e0f1d; color: #ffe3e3; }
body.horror-phone .waitbox,
body.horror-phone .center { color: #f4dede; }
body.horror-phone .p { color: #d9b6b8; }
body.horror-phone .result-good { color: #6ff09a; }
body.horror-phone .result-bad  { color: #ff5f6f; }
body.horror-phone .gain { color: #ffd166; }
body.horror-phone .btn,
body.horror-phone .answer-btn {
  background: linear-gradient(180deg, #38101a, #1b060c);
  border: 1px solid rgba(255,90,110,.3);
  color: #ffe6e6;
  box-shadow: 0 4px 0 rgba(0,0,0,.6);
}
body.horror-phone .btn:active,
body.horror-phone .answer-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,.6); }
body.horror-phone .btn.no  { background: linear-gradient(180deg, #7a0e1c, #3d040c); }
body.horror-phone .btn.ok  { background: linear-gradient(180deg, #1f6b36, #0c3018); border-color: rgba(90,255,140,.3); }
body.horror-phone .answer  { background: rgba(20,3,8,.9); border: 1px solid rgba(255,90,110,.3); color: #ffe6e6; }

/* пелена «ты мёртв» */
.deadveil {
  position: fixed; inset: 0; z-index: 44; pointer-events: none;
  background: radial-gradient(70% 50% at 50% 40%, rgba(120,0,16,.32), rgba(4,0,2,.92));
  animation: deadveil 1.1s ease forwards;
}
@keyframes deadveil { from { opacity: 0; } to { opacity: 1; } }

/* отрезанный вариант ответа */
.answer-btn.cutoff {
  opacity: .3; filter: grayscale(1); position: relative; pointer-events: none;
}
.answer-btn.cutoff::after {
  content: ''; position: absolute; left: 6%; right: 6%; top: 50%; height: 3px;
  background: #c4142a; box-shadow: 0 0 8px rgba(200,12,32,.8);
}
.cutchip {
  display: inline-block; padding: .3em .8em; border-radius: 999px; margin-top: 8px;
  background: rgba(196,20,42,.2); border: 1px solid rgba(255,80,100,.42);
  color: #ff9aa5; font-size: 12px; letter-spacing: .08em;
}

/* ------- чаши на телефоне ------- */

/* ------- память на телефоне ------- */
.ph-mem { display: grid; gap: 6px; margin: 12px auto; width: min(300px, 86vw); }
.ph-memcell {
  aspect-ratio: 1/1; border-radius: 6px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14);
  transition: background .15s ease, transform .15s ease;
}
.ph-memcell.sel {
  background: linear-gradient(180deg, #ff4d5f, #8e0f1d);
  box-shadow: 0 0 18px rgba(255,60,80,.65); transform: scale(1.05);
}

/* ------- жадность: ползунок ------- */

/* ------- пальцы ------- */
.ph-hand { display: flex; gap: 8px; justify-content: center; align-items: flex-end; height: 90px; margin: 8px 0 0; }
.ph-palm {
  width: 168px; height: 42px; margin: 0 auto 6px; border-radius: 4px 4px 26px 26px;
  background: linear-gradient(180deg, #cfa2a4, #a97b80);
  box-shadow: inset 0 -10px 14px rgba(0,0,0,.3);
}
.ph-fing {
  width: 34px; border-radius: 17px 17px 4px 4px; border: none; padding: 0;
  background: linear-gradient(180deg, #e9c6c6, #a97b80);
  color: #4a1c22; font-weight: 800; font-size: 15px;
  display: flex; align-items: flex-end; justify-content: center; padding-bottom: 6px;
}
.ph-fing:nth-child(1) { height: 62px; }
.ph-fing:nth-child(2) { height: 84px; }
.ph-fing:nth-child(3) { height: 76px; }
.ph-fing:nth-child(4) { height: 54px; }
.ph-fing:disabled { background: linear-gradient(180deg, #8e0f1d, #4d0510); color: #ffb3ba; height: 26px !important; }
.ph-fing:active { transform: translateY(3px); }

/* ------- арена ------- */
.ph-moves { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 10px; }
.ph-move {
  padding: 16px 6px; border-radius: 12px; text-align: center;
  background: linear-gradient(180deg, #38101a, #1b060c);
  border: 1px solid rgba(255,90,110,.3); color: #ffe6e6;
}
.ph-move .ic { font-size: 30px; display: block; }
.ph-move .lb { font-size: 12px; letter-spacing: .08em; margin-top: 4px; color: #ffb3ba; }
.ph-move:active { transform: translateY(2px); }

/* ------- кости ------- */
@keyframes ph-roll { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
}

/* ---------- ДОМ ДЫШИТ · ПРОКЛЯТИЕ · ПОСЛЕДНЯЯ ВОЛЯ ---------- */

.ev-pill {
  background: #7a0c18 !important; color: #ffd9d9 !important;
  letter-spacing: .16em; animation: ev-blink 2s steps(2) infinite;
}
@keyframes ev-blink { 50% { opacity: .5; } }
.curse-pill { background: linear-gradient(90deg, #2b4a8b, #7fb4ff) !important; color: #04101f !important; }

.house-ev { animation: house-in .6s cubic-bezier(.2,1.2,.3,1) both; }
@keyframes house-in { from { transform: scale(.8); opacity: 0; filter: blur(4px); } }

/* шёпот дома */
.whisperbox {
  margin: 10px 0; padding: 12px; border-radius: 10px;
  background: rgba(120,8,20,.18); border: 1px dashed rgba(255,120,140,.45);
}
.whisperbox .wt { font-size: 11px; letter-spacing: .22em; color: #ff8a99; }
.whisperbox .wv { font-size: 16px; margin-top: 4px; color: #ffe6e6; font-style: italic; }
.whisperbox .wn { font-size: 11px; margin-top: 4px; color: #8f6a6a; }

/* голос призрака */
.ghost-h { color: #a9c4e8 !important; text-shadow: 0 0 20px rgba(120,180,255,.5) !important; }
.curse-btn {
  background: linear-gradient(180deg, #24406e, #101f38) !important;
  border-color: rgba(150,190,255,.4) !important; color: #dbe8ff !important;
}

/* последняя воля */
.lwbox {
  margin-top: 16px; padding: 14px; border-radius: 12px;
  background: rgba(40,30,26,.6); border: 1px solid rgba(200,190,180,.28);
}
.lwbox.done { border-style: dashed; }
.lwt { font-size: 11px; letter-spacing: .22em; color: #cbbfb2; }
.lwn { font-size: 12px; color: #9b9188; margin: 4px 0 8px; }
.lwv { font-size: 17px; color: #ffe6e6; font-style: italic; margin-top: 6px; }
.lwbox .answer { margin-bottom: 8px; }

@media (prefers-reduced-motion: reduce) {
  .ev-pill, .house-ev { animation: none !important; }
}

/* ---- поломки вопроса: телефон ---- */
.gl-erased{color:transparent!important;position:relative}
.gl-erased::after{content:'';position:absolute;inset:18% 6%;background:repeating-linear-gradient(90deg,#1a0308 0 8px,#2a060d 8px 16px);border-radius:3px}
.gl-flip{transform:rotate(180deg)}
.gl-ghost{opacity:.14}
.gl-tiny{font-size:9px!important;letter-spacing:0}
.gl-rev{letter-spacing:.02em}
.gl-static{letter-spacing:.04em;text-shadow:1px 0 rgba(255,60,80,.6),-1px 0 rgba(60,180,255,.5)}
.gl-gap b,.gl-gap{font-family:inherit}
.gl-chip{
  display:inline-block;background:#5c0a16;color:#ffd9d9;border-radius:3px;
  padding:2px 7px;font-family:var(--display);font-size:10px;letter-spacing:.14em;
  margin-bottom:6px;animation:glbl 1.6s steps(2) infinite;
}
@keyframes glbl{50%{opacity:.35}}
@media (prefers-reduced-motion: reduce){.gl-chip{animation:none}}

/* КОД ОТ ДВЕРИ: своя цифра подсвечена, чужие — прочерки */
.cd-strip { display: flex; gap: 8px; justify-content: center; margin: 12px 0 6px; }
.cd-slot {
  width: 40px; height: 52px; display: flex; align-items: center; justify-content: center;
  font-family: var(--display); font-size: 26px; color: rgba(255,255,255,.35);
  background: rgba(0,0,0,.35); border: 2px solid rgba(255,255,255,.14); border-radius: 8px;
}
.cd-slot.mine { color: #ffd166; border-color: #ffd166; box-shadow: 0 0 16px rgba(255,209,102,.35); }

/* ЖАДНАЯ СПИЧКА: огонёк и счётчик */
.mt-flame {
  font-size: 64px; text-align: center; margin: 6px 0 2px; line-height: 1;
  transform-origin: 50% 80%; filter: drop-shadow(0 0 18px rgba(255,140,40,.7));
  animation: mt-flicker .55s ease-in-out infinite alternate;
}
@keyframes mt-flicker { from { opacity: .85; } to { opacity: 1; } }
.mt-money {
  font-family: var(--display); font-size: 40px; text-align: center; color: #ffd166;
  font-variant-numeric: tabular-nums; letter-spacing: .02em;
}
@media (prefers-reduced-motion: reduce) { .mt-flame { animation: none; } }

/* Спичка: кто уже отпустил — видно сразу, строкой на каждого. */
.mt-others { display: flex; flex-direction: column; gap: 5px; margin-top: 10px; }
.mt-other {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 8px 11px; border-radius: 8px;
  background: rgba(255,140,40,.1); border: 1px solid rgba(255,140,40,.3);
}
.mt-other b { font-family: var(--display); font-size: 15px; color: #ffe0c4; }
.mt-other span { font-size: 13px; color: #ffbf80; font-variant-numeric: tabular-nums; }
.mt-other.out { background: rgba(255,255,255,.05); border-color: rgba(255,255,255,.14); }
.mt-other.out span { color: #ffd166; font-weight: 700; }

/* ЗЕРКАЛО: буквы вариантов отражены — и на телефоне тоже. */
.vp-mirror .answer-btn b, .vp-mirror .answer-btn .mtx { display: inline-block; transform: scaleX(-1); }
.vp-mirror-scr { transform: scaleX(-1); }

/* СЕМЕЙНЫЙ АЛЬБОМ: карты-портреты. */
.tw-head {
  display: flex; justify-content: space-between; align-items: center;
  width: min(320px, 90vw); margin: 4px auto 0; font-size: 14px; color: #ffd9d9;
}
.tw-lives { display: flex; gap: 5px; }
.tw-lives i {
  width: 14px; height: 14px; border-radius: 50%;
  background: #ff4d5f; box-shadow: 0 0 8px rgba(255,60,80,.6);
}
.tw-lives i.gone { background: rgba(255,255,255,.12); box-shadow: none; }
.tw-grid { display: grid; gap: 8px; width: min(320px, 90vw); margin: 10px auto; }
.tw-card {
  position: relative; aspect-ratio: 3/4; border-radius: 9px; padding: 0;
  border: 1px solid rgba(255,120,130,.35); background: none; cursor: pointer;
  perspective: 600px; -webkit-tap-highlight-color: transparent;
}
.tw-card .tw-back, .tw-card .tw-face {
  position: absolute; inset: 0; border-radius: 8px; display: flex; align-items: center; justify-content: center;
  backface-visibility: hidden; -webkit-backface-visibility: hidden; transition: transform .28s ease;
}
.tw-card .tw-back {
  background: repeating-linear-gradient(45deg, #3a0a12 0 7px, #2a060d 7px 14px);
  box-shadow: inset 0 0 0 2px rgba(255,120,130,.25);
}
.tw-card .tw-face { transform: rotateY(180deg); background: #f3e6d8; font-size: 34px; line-height: 1; }
.tw-card.up .tw-back { transform: rotateY(180deg); }
.tw-card.up .tw-face { transform: rotateY(0deg); }
.tw-card.found .tw-face { background: #cfe9d6; box-shadow: inset 0 0 0 3px #25c05a; }
.tw-card.found { opacity: .7; }
.tw-card.open .tw-face { box-shadow: inset 0 0 0 3px #ffd166; }
/* Промах: пара видна секунду и сама переворачивается обратно. */
.tw-card.miss .tw-face { box-shadow: inset 0 0 0 3px #ff4d5f; animation: tw-hide 1.1s ease forwards; }
.tw-card.miss .tw-back { animation: tw-show 1.1s ease forwards; }
@keyframes tw-hide { 0%, 70% { transform: rotateY(0deg); } 100% { transform: rotateY(180deg); } }
@keyframes tw-show { 0%, 70% { transform: rotateY(180deg); } 100% { transform: rotateY(0deg); } }
.tw-card.pending .tw-face { background: #e9dccd; }

/* ГОРЯЧАЯ КАРТОШКА: когда она у тебя, это должно быть видно сразу */
.mt-hot {
  color: #ff9a3c; text-shadow: 0 0 18px rgba(255,120,40,.7);
  animation: mt-hotpulse .45s ease-in-out infinite alternate;
}
@keyframes mt-hotpulse { from { transform: scale(1); } to { transform: scale(1.05); } }
@media (prefers-reduced-motion: reduce) { .mt-hot { animation: none; } }
/* Ключ у тебя — это должно быть видно, не читая */
.key-pill { background: #ffd166; color: #2a1a05; font-weight: 700; }

/* ВСЕЛЕНИЕ — то, ради чего призраку стоит копить */
.pos-box {
  margin: 12px 0 4px; padding: 11px 13px; border-radius: 12px;
  background: rgba(120,60,180,.18); border: 1px solid rgba(170,110,230,.45);
  color: #e8d5ff; font-size: 13px;
}
.pos-box .t { font-family: var(--display); font-size: 16px; letter-spacing: .08em; }
.pos-box .n { opacity: .72; margin-top: 3px; }
.pos-box.mine { background: rgba(120,60,180,.32); border-color: #b06ee6; }
.pos-box .btns { margin-top: 9px; }
