/* Экран «Подгляд» — чаша воды (леканомантия). Сток экономики астрагалов:
   ночью игрок копит косточки в яхтзе, тут тратит их, чтобы увидеть, где сейчас
   человек и что с ним. Дизайн — пакет design_handoff_podglyad (high-fidelity):
   цвета, размеры, тайминги повторены по макету. Префикс классов pg-.
   Геометрия (чаша, лица по эллипсу) считается в JS от размеров экрана. */

#podglyad-root { display: none; }
#podglyad-root.show { display: block; }

.pg-wrap {
  position: fixed; inset: 0; z-index: 62;   /* поверх кадра и топбара, как бой/яхтза */
  overflow: hidden; background: #100a05;
  font-family: 'EB Garamond', Georgia, serif;
}

/* ---------- стол гадателя ---------- */
.pg-table {
  position: absolute; inset: 0;
  background-size: cover; background-position: 50% 44%;
  filter: saturate(.6) brightness(.42) contrast(1.05);
}
.pg-veil {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 62% 52% at 50% 50%, rgba(10,6,3,.32), rgba(8,5,3,.86) 78%),
    linear-gradient(180deg, rgba(8,5,3,.72), rgba(8,5,3,.3) 42%, rgba(6,4,2,.9));
}
.pg-vignette { position: absolute; inset: 0; box-shadow: inset 0 0 240px 70px rgba(0,0,0,.9); pointer-events: none; }

.pg-select { position: absolute; inset: 0; overflow-y: auto; }
.pg-select.blurred { filter: blur(2px); }

/* ---------- шапка ---------- */
.pg-head {
  position: relative; display: flex; align-items: baseline; justify-content: space-between;
  gap: 20px; padding: 20px 30px 0;
}
.pg-day {
  font-family: 'Cormorant Garamond', 'Cormorant SC', serif; font-weight: 700;
  font-size: clamp(20px, 1.7vw, 29px); letter-spacing: .15em; text-transform: uppercase;
  color: #f2ce82; text-shadow: 0 2px 12px rgba(0,0,0,.8);
}
.pg-day-hint {
  font-size: clamp(12px, .95vw, 15px); letter-spacing: .2em; text-transform: uppercase;
  color: #9c8a68; margin-top: 4px;
}
.pg-head-right { display: flex; align-items: center; gap: 18px; }
.pg-archive-link {
  font-family: 'Cormorant Garamond', serif; font-style: italic;
  font-size: clamp(14px, 1.1vw, 18px); color: #b7a583;
  border-bottom: 1px solid rgba(224,179,87,.3); padding-bottom: 2px; cursor: pointer;
  background: none; border-left: none; border-right: none; border-top: none;
}
.pg-archive-link:hover { color: #f2ce82; border-bottom-color: rgba(242,206,130,.7); }
.pg-purse { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.pg-purse-cap { font-size: 11px; letter-spacing: .24em; text-transform: uppercase; color: #9c8a68; }
.pg-purse-row { display: flex; gap: 6px; min-height: 19px; }

/* косточка-астрагал */
.pg-bone {
  width: 13px; height: 19px; border-radius: 7px 5px 6px 8px;
  background: linear-gradient(150deg, #f0e4c9, #d3bf98 62%, #bfa87e);
  box-shadow: inset 0 -3px 5px rgba(90,66,34,.35), 0 2px 5px rgba(0,0,0,.55);
}
/* валюта — очки партии: одна косточка-значок рядом с числом */
.pg-price { display: inline-flex; align-items: center; gap: 6px; }
.pg-price b {
  font-family: 'Cormorant Garamond', serif; font-weight: 600; font-size: 19px;
  letter-spacing: .04em; color: #f0dcb0;
}
.pg-price.poor b { color: #a2947a; }
.pg-price.poor .pg-bone { opacity: .5; }
.pg-purse-row { align-items: center; gap: 7px; }
.pg-purse-num {
  font-family: 'Cormorant Garamond', serif; font-weight: 600; font-size: 21px;
  letter-spacing: .04em; color: #f2ce82;
}

/* ---------- чаша ---------- */
.pg-bowl { position: absolute; }
.pg-bowl.stacked { position: relative; margin: 26px auto 0; }
.pg-bowl-rim {
  position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from 210deg, #7a5a2c, #c69a52 12%, #8a6634 26%, #e4c07a 40%,
    #7c5a2d 55%, #b78f4c 70%, #6d4f27 86%, #c39a54);
  box-shadow: 0 26px 60px rgba(0,0,0,.75), inset 0 0 40px rgba(0,0,0,.5);
}
.pg-bowl-wall {
  position: absolute; inset: 5.5%; border-radius: 50%;
  background: linear-gradient(160deg, #5d4322, #8e6b36 45%, #3f2d16);
}
.pg-water {
  position: absolute; inset: 9%; border-radius: 50%; overflow: hidden;
  background: radial-gradient(circle at 42% 34%, #16211f, #080d0e 62%, #030607);
  box-shadow: inset 0 12px 34px rgba(0,0,0,.9), inset 0 -8px 26px rgba(93,143,136,.14);
}
.pg-shimmer {
  position: absolute; left: 50%; top: 50%; width: 56%; height: 34%;
  transform: translate(-50%,-50%); border-radius: 50%;
  background: radial-gradient(ellipse at 40% 35%, rgba(242,190,100,.2), rgba(93,143,136,.08) 55%, transparent 72%);
  animation: pgShimmer 7s ease-in-out infinite; pointer-events: none;
}
.pg-lampglint {
  position: absolute; left: 14%; top: 22%; width: 30%; height: 13%; border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255,226,168,.3), transparent 70%);
  filter: blur(6px); pointer-events: none;
}
/* отражение того, на кого навели — единственная награда за наведение */
.pg-reflection {
  position: absolute; left: 50%; top: 52%; width: 78%; height: 88%;
  transform: translate(-50%,-50%);
  background-size: contain; background-position: center; background-repeat: no-repeat;
  filter: blur(7px) saturate(.35) brightness(.8); opacity: .3;
  mix-blend-mode: screen; animation: pgBreathe 3.4s ease-in-out infinite;
  pointer-events: none;
}
.pg-rings { position: absolute; left: 50%; top: 50%; width: 100%; height: 100%; transform: translate(-50%,-50%); pointer-events: none; }
.pg-rings i { position: absolute; inset: 0; border-radius: 50%; display: block; }
.pg-rings i:nth-child(1) { border: 2px solid rgba(180,220,214,.5); animation: pgRing 1.1s ease-out forwards; }
.pg-rings i:nth-child(2) { border: 2px solid rgba(224,179,87,.4);  animation: pgRing 1.1s .18s ease-out forwards; }
.pg-rings i:nth-child(3) { border: 1px solid rgba(180,220,214,.35); animation: pgRing 1.1s .36s ease-out forwards; }

/* подсказка под чашей */
.pg-hint {
  font-family: 'Cormorant Garamond', serif; font-style: italic; color: #a99a7c;
  letter-spacing: .05em; text-shadow: 0 2px 12px rgba(6,4,2,.95);
}
.pg-hint.floating { position: absolute; left: 50%; transform: translateX(-50%); font-size: clamp(16px, 1.25vw, 21px); white-space: nowrap; }
.pg-hint.stacked { position: relative; text-align: center; margin-top: 18px; font-size: 17px; }

/* ---------- лица по кругу ---------- */
.pg-cards { position: absolute; inset: 0; pointer-events: none; }
.pg-cards.stacked {
  position: relative; display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 26px 12px; padding: 30px 18px 40px;
}
.pg-card {
  pointer-events: auto; cursor: pointer; text-align: center;
  transition: transform .35s cubic-bezier(.2,.7,.3,1), opacity .35s ease;
}
.pg-cards.stacked .pg-card { position: relative; display: flex; flex-direction: column; align-items: center; }
.pg-card:hover { transform: translateY(-7px); }
.pg-card.poor { opacity: .62; cursor: not-allowed; }
.pg-card.poor:hover { opacity: .72; transform: none; }
.pg-disc {
  position: relative; margin: 0 auto; border-radius: 50%; overflow: hidden;
  background: radial-gradient(circle at 46% 32%, #20282a, #0a0f10 78%);
  border: 1px solid rgba(224,179,87,.45); box-shadow: 0 12px 30px rgba(0,0,0,.7);
}
.pg-card.poor .pg-disc { border: 1px solid rgba(140,160,158,.28); box-shadow: 0 10px 26px rgba(0,0,0,.6); }
/* уже открытый: портрет проявлен, рамка светится */
.pg-card.open .pg-disc {
  border: 2px solid rgba(224,179,87,.7);
  box-shadow: 0 0 22px rgba(224,179,87,.22), 0 12px 28px rgba(0,0,0,.65);
}
.pg-face {
  position: absolute; inset: 0; background-size: 126% auto; background-position: 50% 12%;
  background-repeat: no-repeat;
  filter: brightness(.2) contrast(1.5) saturate(.25); opacity: .95;   /* силуэт до оплаты */
}
.pg-card.poor .pg-face { opacity: .8; }
.pg-card.open .pg-face { filter: saturate(.9) brightness(.95) contrast(1.02); opacity: 1; }
.pg-face.blank {
  background: radial-gradient(circle at 50% 66%, rgba(93,143,136,.22), transparent 62%),
              linear-gradient(180deg, #131a1b, #080c0d);
  filter: none;
}
.pg-disc-shade {
  position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  box-shadow: inset 0 -18px 30px rgba(6,10,10,.7), inset 0 8px 18px rgba(255,226,168,.08);
}
.pg-name {
  font-family: 'Cormorant Garamond', serif; font-weight: 600; letter-spacing: .06em; color: #f0dcb0;
}
.pg-card.poor .pg-name { color: #a2947a; }
.pg-place {
  margin-top: 2px; font-family: 'Cormorant Garamond', serif; font-style: italic;
  line-height: 1.3; color: #9aa9a2;
}
.pg-card.poor .pg-place { color: #7d7360; }
.pg-cost { min-height: 22px; display: flex; align-items: center; justify-content: center; gap: 5px; margin-top: 7px; }
.pg-reread { font-family: 'Cormorant Garamond', serif; font-style: italic; font-size: 15px; color: #8fae9f; letter-spacing: .04em; }

/* ---------- перелив воды при переходе ---------- */
.pg-flood {
  position: fixed; border-radius: 50%;
  background: radial-gradient(circle, #0c1516, #04080a 70%);
  transform-origin: center; animation: pgFlood .56s cubic-bezier(.4,.05,.6,1) both;
  z-index: 5; pointer-events: none;
}

/* ---------- экран раскрытия ---------- */
.pg-reveal { position: absolute; inset: 0; overflow: hidden; z-index: 4; animation: pgFade .8s ease both; }
.pg-reveal-bg { position: absolute; inset: 0; background-size: cover; background-position: center; transform: scale(1.04); filter: saturate(.72) brightness(.55); }
.pg-reveal-bg.dead { filter: saturate(.45) brightness(.4) hue-rotate(-14deg); }
.pg-reveal-veil { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(6,8,9,.62), rgba(5,7,8,.5) 30%, rgba(4,6,7,.9)); }
.pg-reveal-body {
  position: relative; height: 100%; display: flex; flex-direction: column;
  align-items: center; justify-content: flex-end; padding: 6vh 24px; box-sizing: border-box;
}
.pg-reveal-col { width: min(100%, 52ch); animation: pgRise .9s ease both; }
.pg-reveal-name-row { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.pg-reveal-name-row span.line { height: 1px; flex: 1; }
.pg-reveal-name-row span.line.l { background: linear-gradient(90deg, transparent, rgba(224,179,87,.45)); }
.pg-reveal-name-row span.line.r { background: linear-gradient(90deg, rgba(224,179,87,.45), transparent); }
.pg-reveal-name {
  font-family: 'Cormorant Garamond', serif; font-weight: 600; font-size: clamp(17px, 1.4vw, 23px);
  letter-spacing: .1em; text-transform: uppercase; color: #f2ce82;
}
.pg-reveal-place {
  text-align: center; font-family: 'Cormorant Garamond', serif; font-style: italic;
  font-size: clamp(14px, 1.05vw, 17px); color: #9db3ac; letter-spacing: .06em; margin-bottom: 20px;
}
.pg-prose {
  margin: 0; font-size: clamp(17px, 1.35vw, 22px); line-height: 1.66; color: #ece0c8;
  text-wrap: pretty; text-shadow: 0 2px 14px rgba(0,0,0,.85); white-space: pre-wrap;
}
.pg-caret { color: #7fa39c; animation: pgCaret 1s step-end infinite; }
.pg-coda {
  margin: 18px 0 0; font-family: 'Cormorant Garamond', serif; font-style: italic;
  font-size: clamp(16px, 1.25vw, 21px); line-height: 1.5; color: #c98a68;
  animation: pgRise 1.2s ease both;
}
.pg-away {
  margin: 30px auto 0; display: block; width: max-content;
  font-family: 'Cormorant Garamond', serif; font-weight: 600; font-size: clamp(16px, 1.2vw, 19px);
  letter-spacing: .06em; color: #cbbb98; background: none;
  border: 1px solid rgba(224,179,87,.3); border-radius: 999px; padding: 11px 28px; cursor: pointer;
  transition: opacity .6s ease, border-color .3s ease, color .3s ease; opacity: .45;
}
.pg-away.ready { opacity: 1; }
.pg-away:hover { border-color: rgba(242,206,130,.65); color: #f2ce82; }

/* ---------- архив ---------- */
.pg-archive {
  position: fixed; inset: 0; background: rgba(5,7,8,.8); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; padding: 5vh 20px;
  box-sizing: border-box; animation: pgFade .5s ease both; z-index: 6;
}
.pg-archive-panel {
  width: min(100%, 700px); max-height: 88vh; overflow: auto;
  background: linear-gradient(180deg, #1a1409, #130d07);
  border: 1px solid rgba(224,179,87,.24); border-radius: 12px;
  padding: 32px clamp(20px, 3vw, 40px) 30px; box-shadow: 0 34px 90px rgba(0,0,0,.85);
}
.pg-arch-tag { font-size: 11px; letter-spacing: .3em; text-transform: uppercase; color: #9c8a68; }
.pg-arch-title {
  font-family: 'Cormorant Garamond', serif; font-weight: 700;
  font-size: clamp(26px, 2.2vw, 34px); color: #f2ce82; margin-top: 6px;
}
.pg-arch-rule { height: 1px; background: linear-gradient(90deg, rgba(224,179,87,.35), transparent); margin: 18px 0 6px; }
.pg-arch-empty { font-family: 'Cormorant Garamond', serif; font-style: italic; font-size: 19px; color: #8c7c5e; padding: 22px 0 10px; }
.pg-arch-row {
  display: flex; gap: 16px; align-items: flex-start; padding: 16px 6px;
  border-bottom: 1px solid rgba(224,179,87,.1); cursor: pointer;
}
.pg-arch-row:hover { background: rgba(224,179,87,.05); }
.pg-arch-face {
  flex: 0 0 auto; width: 54px; height: 54px; border-radius: 50%;
  border: 1px solid rgba(224,179,87,.35);
  background-size: 126% auto; background-position: 50% 12%; filter: saturate(.85) brightness(.9);
}
.pg-arch-face.blank { border-color: rgba(224,179,87,.2); background: linear-gradient(180deg, #131a1b, #080c0d); filter: none; }
.pg-arch-name { font-family: 'Cormorant Garamond', serif; font-weight: 600; font-size: 19px; letter-spacing: .06em; color: #f0dcb0; }
.pg-arch-place { font-family: 'Cormorant Garamond', serif; font-style: italic; font-size: 14px; color: #8fa39d; margin-top: 2px; }
.pg-arch-excerpt {
  font-size: 16px; line-height: 1.5; color: #b7a583; margin-top: 6px; overflow: hidden;
  text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.pg-pill {
  margin-top: 24px; display: inline-block; font-family: 'Cormorant Garamond', serif;
  font-weight: 600; font-size: 18px; letter-spacing: .06em; color: #d8c39a; background: none;
  border: 1px solid rgba(224,179,87,.35); border-radius: 999px; padding: 11px 26px; cursor: pointer;
}
.pg-pill:hover { color: #f2ce82; border-color: rgba(242,206,130,.7); background: rgba(224,179,87,.09); }

@keyframes pgRing { 0% { transform: scale(.18); opacity: 0; } 18% { opacity: .55; } 100% { transform: scale(1.5); opacity: 0; } }
@keyframes pgFlood { 0% { transform: scale(.1); opacity: .2; } 55% { opacity: 1; } 100% { transform: scale(1); opacity: 1; } }
@keyframes pgRise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes pgFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pgShimmer { 0%,100% { opacity: .22; transform: translate(-50%,-50%) scale(1); } 50% { opacity: .4; transform: translate(-50%,-50%) scale(1.06); } }
@keyframes pgBreathe { 0%,100% { opacity: .5; } 50% { opacity: .85; } }
@keyframes pgCaret { 0%,45% { opacity: 1; } 55%,100% { opacity: 0; } }
