/* evo — проигрыватель. Все цвета — переменные темы проекта. */

@font-face { font-family: "Golos"; src: url("/fonts/golos-text-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Golos"; src: url("/fonts/golos-text-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Golos"; src: url("/fonts/golos-text-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }

.evo-player {
  --accent: #c9d3e6;
  --bg: #07080c;
  --text: #eef0f5;
  --box: rgba(10, 12, 20, .78);
  --box-border: rgba(201, 211, 230, .22);
  --choice: rgba(14, 17, 28, .86);
  --choice-text: #eef0f5;
  --paid: #e6c270;
  --font: "Golos", system-ui, sans-serif;
  --title-font: "Cormorant Garamond", "Georgia", "Times New Roman", serif;
  --radius: 14px;
  --fs: 1;
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  container-type: size;
}
.evo-player * { box-sizing: border-box; }
.evo-player button { font: inherit; color: inherit; }
.gone { display: none !important; }
.dim { opacity: .6; }

/* ── сцена ── */
.evo-stage-host { position: absolute; inset: 0; z-index: 0; }
.evo-stage { position: absolute; inset: 0; overflow: hidden; background: #000; }
.evo-cam { position: absolute; inset: 0; transform-origin: 50% 60%; }
.evo-bg { position: absolute; inset: 0; background-size: cover; background-position: 50% 50%; opacity: 0; }
.evo-bg:first-child { opacity: 1; }
.evo-ph-label {
  position: absolute; left: 50%; top: 18%; transform: translateX(-50%);
  padding: 6px 12px; border: 1px dashed rgba(255,255,255,.35); border-radius: 8px;
  font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: rgba(255,255,255,.55); white-space: nowrap;
}
.evo-chars { position: absolute; inset: 0; }
.evo-char {
  position: absolute; bottom: 0; left: 0; aspect-ratio: 200 / 520; pointer-events: none;
  will-change: transform, opacity;
}
.evo-char.hidden { opacity: 0 !important; }
.evo-char-img { position: absolute; inset: 0; transition: opacity .3s; }
.evo-char-img.out { opacity: 0; }
.evo-char-img img { position: absolute; bottom: 0; left: 50%; height: 100%; width: auto; max-width: none; transform: translateX(-50%); }
.evo-char-img svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.evo-ph-char {
  position: absolute; left: 50%; top: 30%; transform: translateX(-50%); text-align: center; white-space: nowrap;
  font-size: 13px; line-height: 1.3; color: rgba(255,255,255,.85); text-shadow: 0 1px 3px rgba(0,0,0,.6);
}
.evo-ph-char b { display: block; font-size: 15px; }
.evo-ph-char span { opacity: .75; }
.evo-cg { position: absolute; inset: 0; opacity: 0; pointer-events: none; }
.evo-cg.on { opacity: 1; }
.evo-cg-img { position: absolute; inset: 0; background-size: cover; }
.evo-weather { position: absolute; inset: 0; pointer-events: none; }
.evo-fade { position: absolute; inset: 0; background: #000; opacity: 0; pointer-events: none; }

/* ── интерфейс ── */
.evo-ui { position: absolute; inset: 0; z-index: 1; }
.evo-tap { position: absolute; inset: 0; }
.evo-ui:not(.ingame) .evo-tap, .evo-ui:not(.ingame) .evo-quick { display: none; }

.evo-box {
  position: absolute; left: 12px; right: 12px; bottom: calc(14px + env(safe-area-inset-bottom));
  min-height: 132px; padding: 22px 18px 18px;
  background: var(--box); border: 1px solid var(--box-border); border-radius: var(--radius);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  pointer-events: none;
  font-size: calc(17px * var(--fs)); line-height: 1.5;
}
[data-orient="landscape"] ~ .evo-ui .evo-box, .evo-player[data-orient="landscape"] .evo-box {
  left: 50%; right: auto; width: min(920px, calc(100% - 40px)); transform: translateX(-50%); min-height: 120px;
}
.evo-box.thought .evo-text { font-style: italic; color: color-mix(in srgb, var(--text) 85%, var(--accent)); }
.evo-box.narration { padding-top: 18px; }
.evo-name {
  position: absolute; top: -14px; left: 16px;
  padding: 4px 14px; border-radius: 999px;
  background: color-mix(in srgb, var(--c, var(--accent)) 26%, #0b0d15); border: 1px solid color-mix(in srgb, var(--c, var(--accent)) 70%, transparent);
  color: color-mix(in srgb, var(--c, var(--accent)) 60%, white);
  font-weight: 600; font-size: calc(14px * var(--fs)); letter-spacing: .02em;
}
.evo-text { min-height: 3em; }
.evo-text .c { opacity: 0; }
.evo-text .c.on { opacity: 1; }
.evo-next { position: absolute; right: 14px; bottom: 8px; width: 10px; height: 10px; opacity: 0; }
.evo-next.on { opacity: .7; animation: evo-bob 1.2s ease-in-out infinite; }
.evo-next::after { content: ""; position: absolute; inset: 0; border-right: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(45deg); }
@keyframes evo-bob { 50% { transform: translateY(3px); } }

.evo-quick {
  position: absolute; right: 12px; bottom: calc(154px + env(safe-area-inset-bottom));
  display: flex; gap: 4px;
}
.evo-qb {
  width: 34px; height: 30px; border: 0; border-radius: 8px; cursor: pointer;
  background: rgba(10, 12, 20, .55); color: var(--text); font-size: 14px; opacity: .75;
}
.evo-qb:hover { opacity: 1; }
.evo-qb.on { background: var(--accent); color: #0b0d15; opacity: 1; }
.evo-qb:disabled { opacity: .3; }

.evo-wallet {
  position: absolute; top: calc(10px + env(safe-area-inset-top)); right: 10px;
  display: flex; gap: 6px; cursor: pointer;
}
.evo-cur { padding: 4px 10px; border-radius: 999px; background: rgba(10,12,20,.6); font-size: 14px; font-weight: 600; }

/* выборы */
.evo-choices { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; padding: 0 18px 160px; }
.evo-choice-list { display: flex; flex-direction: column; gap: 10px; width: min(460px, 100%); pointer-events: auto; animation: evo-in .35s ease-out; }
.evo-choice {
  display: flex; align-items: center; gap: 10px; justify-content: space-between;
  padding: 14px 18px; border-radius: var(--radius); cursor: pointer; text-align: left;
  background: var(--choice); color: var(--choice-text); border: 1px solid var(--box-border);
  font-size: calc(16px * var(--fs)); line-height: 1.35;
  transition: transform .12s, border-color .2s;
}
.evo-choice:hover { border-color: var(--accent); }
.evo-choice:active { transform: scale(.98); }
.evo-choice.paid { border-color: color-mix(in srgb, var(--paid) 60%, transparent); }
.evo-choice.paid .cost { color: var(--paid); font-weight: 600; white-space: nowrap; }
.evo-choice.poor { opacity: .7; }
.evo-timer { height: 4px; border-radius: 2px; background: rgba(255,255,255,.15); overflow: hidden; }
.evo-timer i { display: block; height: 100%; width: 100%; background: var(--accent); }
@keyframes evo-in { from { opacity: 0; transform: translateY(8px); } }

/* глава / концовка */
.evo-chapter {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  background: radial-gradient(closest-side, rgba(0,0,0,.55), rgba(0,0,0,.2));
  opacity: 0; pointer-events: none; transition: opacity .6s; text-align: center; padding: 24px;
}
.evo-chapter.on { opacity: 1; pointer-events: auto; }
.evo-chapter-kicker { font-size: 13px; letter-spacing: .3em; text-transform: uppercase; opacity: .7; }
.evo-chapter-title { font-family: var(--title-font); font-size: clamp(30px, 9cqw, 56px); line-height: 1.1; }
.evo-chapter-note { font-size: 13px; opacity: .6; }
.evo-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* главное меню */
.evo-main {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  padding: 24px 24px calc(48px + env(safe-area-inset-bottom)); gap: 10px;
  background: linear-gradient(180deg, rgba(0,0,0,0) 30%, rgba(0,0,0,.75));
}
.evo-main-title { font-family: var(--title-font); font-size: clamp(38px, 13cqw, 72px); line-height: 1; text-align: center; letter-spacing: .02em; margin-bottom: 4px; }
.evo-main-sub { opacity: .7; margin-bottom: 18px; text-align: center; }
.evo-main-btns { display: flex; flex-direction: column; gap: 8px; width: min(320px, 100%); }

.evo-btn {
  padding: 12px 18px; border-radius: var(--radius); border: 1px solid var(--box-border);
  background: rgba(12, 14, 24, .7); cursor: pointer; font-size: 16px;
}
.evo-btn:hover { border-color: var(--accent); }
.evo-btn.primary { background: var(--accent); color: #0b0d15; border-color: var(--accent); font-weight: 600; }

/* оверлеи */
.evo-overlays { position: absolute; inset: 0; pointer-events: none; }
.evo-ov {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: rgba(3, 4, 8, .6); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  opacity: 0; transition: opacity .2s; pointer-events: auto;
}
.evo-ov.on { opacity: 1; }
.evo-modal, .evo-panel {
  width: min(440px, 100%); max-height: 100%; overflow: auto;
  background: #0c0e17; border: 1px solid var(--box-border); border-radius: calc(var(--radius) + 4px);
  padding: 18px; display: flex; flex-direction: column; gap: 10px;
}
.evo-panel { width: min(640px, 100%); height: min(760px, 100%); }
.evo-modal-title { font-family: var(--title-font); font-size: 26px; text-align: center; }
.evo-modal p { margin: 0; text-align: center; line-height: 1.45; }
.evo-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 18px; position: sticky; top: -18px; background: #0c0e17; padding: 4px 0 8px; z-index: 1; }
.evo-tab { background: none; border: 1px solid var(--box-border); border-radius: 8px; padding: 4px 10px; cursor: pointer; font-size: 14px; }
.evo-input { padding: 12px 14px; border-radius: 10px; border: 1px solid var(--box-border); background: #05060b; color: var(--text); font: inherit; font-size: 17px; }

.evo-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.evo-slot { position: relative; padding: 0; border-radius: 10px; border: 1px solid var(--box-border); background: #05060b; cursor: pointer; overflow: hidden; text-align: left; display: flex; flex-direction: column; }
.evo-slot .evo-thumb { width: 100%; aspect-ratio: 9 / 12; }
.evo-slot.empty { min-height: 90px; justify-content: center; }
.evo-slot-meta { padding: 6px 8px; font-size: 12px; display: flex; flex-direction: column; gap: 2px; }
.evo-slot-meta span { opacity: .6; }
.evo-slot-text { padding: 0 8px 8px; font-size: 11px; opacity: .6; line-height: 1.3; }

.evo-set { display: grid; grid-template-columns: 1fr 1.3fr 64px; align-items: center; gap: 10px; font-size: 15px; }
.evo-set .v { text-align: right; opacity: .7; font-size: 13px; }
.evo-set input[type=range] { width: 100%; accent-color: var(--accent); }
.evo-set.check { grid-template-columns: auto 1fr; }
.evo-set.check input { width: 20px; height: 20px; accent-color: var(--accent); }

.evo-log { display: flex; flex-direction: column; gap: 10px; overflow: auto; }
.evo-log-row { line-height: 1.45; padding: 6px 8px; border-radius: 8px; font-size: 15px; }
.evo-log-row b { display: block; font-size: 13px; }
.evo-log-row.jump { cursor: pointer; }
.evo-log-row.jump:hover { background: rgba(255,255,255,.05); }
.evo-log-row.choice { color: var(--accent); opacity: .85; }
.evo-sub { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; }

.evo-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; }
.evo-gal { aspect-ratio: 3 / 4; border-radius: 10px; border: 1px solid var(--box-border); background: #05060b; overflow: hidden; padding: 0; cursor: pointer; }
.evo-gal img { width: 100%; height: 100%; object-fit: cover; }
.evo-gal.locked { opacity: .5; cursor: default; }
.evo-view { width: 100%; height: 100%; background-size: contain; background-position: center; background-repeat: no-repeat; }

.evo-shop { display: flex; flex-direction: column; gap: 6px; }
.evo-shop-row { display: flex; justify-content: space-between; padding: 8px 10px; border-radius: 8px; background: rgba(255,255,255,.04); }

/* тосты */
.evo-toasts { position: absolute; top: calc(52px + env(safe-area-inset-top)); left: 0; right: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; }
.evo-toast { padding: 8px 14px; border-radius: 999px; background: rgba(10,12,20,.88); border: 1px solid var(--box-border); font-size: 14px; opacity: 0; transform: translateY(-6px); transition: opacity .3s, transform .3s; }
.evo-toast.on { opacity: 1; transform: none; }

/* телефон героини */
.evo-phone {
  position: absolute; left: 50%; top: 50%; width: min(330px, calc(100% - 40px)); height: min(560px, 72%);
  transform: translate(-50%, -46%) scale(.96); opacity: 0; transition: opacity .3s, transform .3s;
  background: #0e1018; border: 6px solid #1c1f2b; border-radius: 34px; box-shadow: 0 20px 60px rgba(0,0,0,.6);
  display: flex; flex-direction: column; overflow: hidden; pointer-events: none;
}
.evo-phone.on { opacity: 1; transform: translate(-50%, -50%); }
.evo-phone-top { padding: 16px; text-align: center; font-weight: 600; border-bottom: 1px solid rgba(255,255,255,.07); }
.evo-phone-msgs { flex: 1; overflow: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.evo-msg { max-width: 80%; padding: 8px 12px; border-radius: 16px 16px 16px 4px; background: #232735; font-size: 15px; line-height: 1.35; align-self: flex-start; animation: evo-in .25s; }
.evo-msg b { display: block; font-size: 12px; margin-bottom: 2px; }
.evo-msg.me { align-self: flex-end; background: color-mix(in srgb, var(--accent) 35%, #1a1d28); border-radius: 16px 16px 4px 16px; }
.evo-msg.typing { opacity: .6; letter-spacing: 2px; }

/* миниатюры (сохранения, холст) */
.evo-thumb { position: relative; overflow: hidden; background: #000; }
.evo-thumb-bg { position: absolute; inset: 0; background-size: cover; background-position: center; }
.evo-thumb-label { position: absolute; left: 6%; right: 6%; top: 10%; text-align: center; font-size: 9px; letter-spacing: .06em; text-transform: uppercase; color: rgba(255,255,255,.5); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.evo-thumb-char { position: absolute; bottom: 0; height: 84%; aspect-ratio: 200 / 520; transform: translateX(-50%); }
.evo-thumb-char:not(.f) { height: 76%; filter: brightness(.6); }
.evo-thumb-char.f { z-index: 1; }
.evo-thumb-char img, .evo-thumb-char svg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: bottom; }

/* предметы, надписи, выборы по экрану */
.evo-char.prop { aspect-ratio: 1 / 1; }
.evo-char.prop .evo-char-img img { left: 0; width: 100%; height: 100%; object-fit: contain; transform: none; }
.evo-ph-prop { position: absolute; inset: 0; border-radius: 14px; border: 2px dashed color-mix(in srgb, var(--pc) 80%, white); background: color-mix(in srgb, var(--pc) 35%, transparent); display: grid; place-items: center; text-align: center; padding: 4px; }
.evo-ph-prop b { font-size: 12px; color: #fff; text-shadow: 0 1px 3px #000; }
.evo-captions { position: absolute; inset: 0; pointer-events: none; }
.evo-caption { position: absolute; transform: translate(-50%, -50%); white-space: pre; font-family: var(--title-font); font-weight: 600; text-shadow: 0 2px 12px rgba(0,0,0,.7); color: #fff; line-height: 1.1; }
.evo-choice-free { position: absolute; inset: 0; pointer-events: none; }
.evo-choice-at, .evo-choice-tag { position: absolute; transform: translate(-50%, -50%); pointer-events: auto; width: auto; max-width: 70%; animation: evo-in .35s ease-out; }
.evo-choice-tag { transform: translate(-50%, -110%); padding: 8px 14px; font-size: 14px; }
.evo-choice-at.st-bubble { border-radius: 22px 22px 22px 6px; }
.evo-choice-at.st-plain { background: none; border: 0; text-shadow: 0 2px 8px #000; text-decoration: underline dotted; }
.evo-hot { cursor: pointer; pointer-events: auto !important; animation: evo-hot 1.4s ease-in-out infinite; }
@keyframes evo-hot { 50% { filter: drop-shadow(0 0 12px rgba(255,255,255,.85)); } }
.evo-fly { position: absolute; pointer-events: none; font-size: calc(17px * var(--fs)); line-height: 1.5; color: var(--text); z-index: 5; }
.evo-fly .c { opacity: 1; }
.evo-box[data-fx=big] .evo-text { font-size: 1.35em; font-weight: 600; }
.evo-box[data-fx=whisper] .evo-text { font-size: .88em; opacity: .75; font-style: italic; letter-spacing: .02em; }
.evo-box[data-fx=shout] .evo-text { font-size: 1.25em; font-weight: 700; text-transform: uppercase; }
