/* Денежный поток — GDN Apps / Luxe Parchment V0.4
   Embossed gold, fine parchment, premium editorial cards.
   Layout only: session logic / author texts unchanged. */
:root{
  color-scheme:light;
  --bg:#efe1ca; --navy:#232a34; --ivory:#fff7e8; --cream:#f7ebd7;
  --gold:#ba8743; --ink:#302920; --muted:#71634e;
  font-family: Georgia, "Times New Roman", serif;
}
html{scrollbar-color:#bda37f #f7ecde}
body{
  color:#392c24;
  background:
    radial-gradient(ellipse at 50% -12%,rgba(255,255,255,.94) 5%,rgba(255,255,255,0) 58%),
    radial-gradient(ellipse at 8% 70%,rgba(213,169,107,.34),transparent 57%),
    radial-gradient(ellipse at 100% 100%,rgba(187,148,99,.38),transparent 66%),
    linear-gradient(135deg,#e6cfad 0%,#fbf3e7 27%,#e9d3b6 65%,#fff5e6 100%);
  background-attachment:scroll;
  -webkit-font-smoothing:antialiased;
}
body::before{
  content:"";position:fixed;inset:0;pointer-events:none;z-index:0;opacity:.13;
  background-image:url("./grain.png");background-size:240px 240px;
}
.shell{position:relative;z-index:1;max-width:1000px;padding:14px clamp(11px,2.6vw,30px) 44px}
header.luxury-head{padding:1px 0 17px;text-align:center;position:relative}
.logo-symbol{
  height:84px;width:90px;display:grid;place-items:center;margin:auto;
  filter:drop-shadow(0 1px 0 #fff4d6) drop-shadow(0 3px 3px #95704477);
}
.logo-symbol img{width:100%;height:100%;object-fit:contain}
.brand-flourish{height:1px;max-width:350px;margin:0 auto 8px;background:linear-gradient(90deg,transparent,#b48a51 25%,#fff5d4 48%,#b48a51 70%,transparent);box-shadow:0 1px 0 #fff}
header.luxury-head h1{
  font:italic 600 clamp(29px,6vw,48px)/1.08 Georgia,"Times New Roman",serif;
  letter-spacing:-.03em;color:#423026;text-shadow:0 1px 0 #fff9ec,0 3px 4px #9f79572b;
}
.brand-subtitle{margin:6px 0 0;font:700 clamp(9px,1.8vw,11px)/1.4 system-ui,sans-serif;text-transform:uppercase;letter-spacing:.19em;color:#926b3d}
.tabs{gap:8px;margin:1px auto 22px;border:1px solid #c9aa7b;background:linear-gradient(160deg,#fdf5e9,#e9d4b6);box-shadow:inset 0 2px 3px #fff,0 4px 12px #ad88623b;padding:5px;border-radius:28px;width:max-content}
.tabs button{
  color:#675037;border-color:transparent;background:transparent;border-radius:22px;
  padding:9px 22px;font-family:system-ui,sans-serif;font-size:13px;letter-spacing:.02em;
}
.tabs button.active{
  color:#fff4d6;background:linear-gradient(155deg,#343c43,#1b2128);
  border:1px solid #ad8249;box-shadow:inset 0 1px 0 #a18b5b,0 3px 6px #332b254a;
}
.matrix{gap:16px}
.field{
  min-height:278px;border-radius:22px;overflow:hidden;
  border:2px solid #b58b56;
  background-image:
    linear-gradient(145deg,rgba(255,255,255,.58),rgba(255,255,255,0) 37%),
    radial-gradient(ellipse at 50% 17%,rgba(255,255,255,.86),transparent 57%),
    url("./grain.png"),
    linear-gradient(145deg,#fff9eb 0%,#f6e5c9 62%,#ebd0a8 100%);
  background-size:auto,auto,210px 210px,auto;
  box-shadow:
    inset 0 0 0 3px #fffae9,inset 0 0 0 5px #d6b17e,
    inset 0 0 0 7px #fffaef70,inset 3px 5px 14px #fff9ebcc,
    inset -5px -6px 16px #a97d4939,
    0 11px 0 -7px #886138b3,0 16px 26px #74563840;
  transition:box-shadow .25s ease, transform .25s ease;
  padding:21px 16px 15px;
}
.field.completed{border-color:#a67d4a}
.field::before,.field::after{
  width:53px;height:53px;border:0;border-radius:0;
  left:4px;top:4px;bottom:auto;right:auto;transform:none;
  background:url("./engraved-corner.svg") top left / contain no-repeat;
  opacity:.85;filter:drop-shadow(1px 1px 1px #8b68384d);pointer-events:none
}
.field::after{
  left:auto;top:auto;bottom:4px;right:4px;transform:rotate(180deg);
}
.field .question{flex-direction:column;align-items:center;gap:7px;text-align:center;z-index:1}
.field .question-symbol{
  width:53px;height:53px;padding:9px;border-radius:50%;color:#9f7137;
  background:
    radial-gradient(circle at 35% 30%,#fffef7 0%,#f4e1b9 67%,#ba8d4b 100%);
  border:1.5px solid #b28c52;
  box-shadow:inset 0 2px 3px #fff,inset 0 -3px 6px #a67b4b61,
  0 1px 0 #fff,0 4px 8px #a0774766;
  filter:drop-shadow(0 1px 1px #f8e8c5);
}
.field .question-title{
  max-width:96%;font:700 clamp(16px,2.2vw,23px)/1.09 Georgia,"Times New Roman",serif;
  color:#473428;text-shadow:0 1px 0 #fffaf0;
}
.field-main{padding:10px 0 3px}
.field-icons{gap:9px;grid-template-columns:repeat(2,48px)}
.field-icons>span{
  border:1.5px solid #b58c50;border-radius:12px;color:#8b6437;width:48px;height:48px;
  padding:9px;
  background:linear-gradient(145deg,#fffdf2 0%,#f6e7c9 59%,#d7b688 100%);
  box-shadow:inset 0 2px 0 #fff9f0,inset 0 -2px 3px #b28c57a1,
  0 4px 6px #7c5d3749,1px 1px 0 #f6e9d1;
}
.field-icons>span .ico{filter:drop-shadow(0 1px 0 #fff7e1) drop-shadow(0 -1px .4px #76543177)}
.pick-card{
  border:1.5px solid #bc955b;border-radius:14px;width:min(100%,236px);
  min-height:107px;gap:8px;
  background:
    radial-gradient(ellipse at 50% -15%,#fffefa,#fff9e6 48%,transparent 83%),
    url("./grain.png"),linear-gradient(145deg,#fef6e7,#ecd2a9);
  box-shadow:inset 0 0 0 3px #fff8ea,inset 0 0 0 4px #d6ad77,
  inset 0 -5px 8px #a67b4441,0 6px 10px #89623d66;
  position:relative;
}
.pick-card::before,.pick-card::after{
  content:"❧";position:absolute;top:4px;left:7px;font-size:15px;color:#b78c50;opacity:.8;
  text-shadow:0 1px 0 #fff6e2,0 2px 1px #a47a4466
}
.pick-card::after{left:auto;right:7px;transform:scaleX(-1)}
.pick-id{color:#9e4043;font-size:31px;text-shadow:0 1px 0 #fff6e4,0 2px 3px #9a504138}
.pick-name{color:#443126;font-size:14px;text-shadow:0 1px 0 #fff8eb}
.dice-area{
  position:relative;margin:26px auto 0;max-width:510px;padding:25px 24px 17px;
  border:1.5px solid #c6a16b;border-radius:24px;
  background:
   radial-gradient(ellipse at 50% -12%,rgba(255,255,255,.93),transparent 75%),
   url("./grain.png"),linear-gradient(145deg,#fef7e9,#e4c69e);
  box-shadow:inset 0 0 0 3px #fff9eb,inset 0 0 0 4px #ceae7f,
  inset 0 -8px 11px #ab85565e,0 12px 23px #8363403a;
}
.dice-area::before{
  content:"";position:absolute;top:7px;left:50%;transform:translateX(-50%);
  width:55%;height:1px;background:linear-gradient(90deg,transparent,#b18b51,transparent);box-shadow:0 1px 0 #fff
}
.dice-row{position:relative;gap:31px;margin-bottom:22px;perspective:600px}
.dice-row::before{
  content:"";position:absolute;z-index:0;left:50%;bottom:-14px;transform:translateX(-50%);
  width:265px;height:45px;border-radius:50%;border:1px solid #d2ab6f;
  box-shadow:0 0 11px #b9813a38,inset 0 1px 4px #fff5d8;pointer-events:none
}
.die{
  position:relative;width:104px;height:104px;padding:14px;border-radius:22px;z-index:1;
  transform:rotate(-7deg) skewY(-3deg);transition:transform .4s ease;
  border:2px solid #f2d5a7;
  background:linear-gradient(138deg,#fffefa 3%,#f6e4c7 44%,#d6ae72 89%,#b88f55 100%);
  box-shadow:
    inset 4px 4px 8px #ffffffed,inset -8px -8px 12px #a77d48a6,
    1px 1px 0 #fffbea,0 6px 0 -3px #946d3c,0 13px 13px #61432782,
    0 19px 27px #644d3970;
}
.die.blue{transform:rotate(8deg) skewY(3deg)}
.die.red,.die.blue{background:linear-gradient(138deg,#fffdfa,#f4e3c8 51%,#d9b47c 86%,#b5874e 100%)}
.die::before{
  content:"";position:absolute;pointer-events:none;inset:4px;border-radius:16px;
  border:1px solid #fdf4db99;box-shadow:inset 1px 1px 3px #fff,inset -2px -2px 4px #b5976788
}
.die .pip{
  width:15px;height:15px;max-width:15px;max-height:15px;border:1px solid #d6ba7b;
  background:radial-gradient(circle at 35% 31%,#c16c70 0%,#882c3b 45%,#5e1b2a 100%);
  box-shadow:inset 1px 1px 2px #39151a9c,inset -1px -1px 0 #ffd9be8c,0 1px 1px #fff8df8f;
}
.die.blue .pip{background:radial-gradient(circle at 32% 28%,#82a4c7 0%,#31597c 53%,#142b43 100%);border-color:#c8b277}
.die.rolling{animation:luxury-shake .21s linear infinite}
@keyframes luxury-shake{0%{transform:rotate(-13deg) translateY(-4px)}50%{transform:rotate(15deg) translateY(2px)}100%{transform:rotate(-13deg) translateY(-4px)}}
.dice-names{color:#755939;font:700 11px/1.1 system-ui,sans-serif;letter-spacing:.08em;margin-top:-12px;margin-bottom:18px;gap:36px}
.dice-names span{width:104px}
.action{
  border:1.5px solid #b58a48;border-radius:30px;
  background:linear-gradient(175deg,#50515a 0%,#222a34 44%,#151b23 100%);
  color:#f9db9f;font:700 16px/1.2 Georgia,serif;letter-spacing:.04em;
  box-shadow:inset 0 1px 1px #ffe4a878,inset 0 -3px 6px #080d15,
  0 2px 0 #f8ead4,0 6px 10px #71522d72;
  text-shadow:0 1px 2px #000;
}
.action:active{transform:translateY(2px)}
.step{color:#856843;font:700 12px Georgia,serif;letter-spacing:.15em;min-height:17px}
.library{
  background:radial-gradient(ellipse at 50% 0%,#fffdf1,#e8d0ac);
  border:1.8px solid #b9905c;box-shadow:inset 0 0 0 4px #fff9eb,0 12px 25px #5b492c32;
}
.find-controls input,.find-controls select{background:#fff8eb;color:#453424;border:1px solid #c8a673;box-shadow:inset 1px 2px 3px #b3997152}
.lib-card{
  border:1.5px solid #c8a36e;border-radius:15px;
  background:radial-gradient(ellipse at 50% 0%,#fffdf5,transparent 75%),url("./grain.png"),linear-gradient(145deg,#fff5e1,#ead1a9);
  box-shadow:inset 0 0 0 3px #fff9e9,inset 0 0 0 4px #d5b17b,inset 0 -5px 9px #af865454,0 7px 12px #926a3c4d;
  transition:transform .18s,box-shadow .18s;
}
.lib-card:hover{transform:translateY(-3px);box-shadow:inset 0 0 0 3px #fff9e9,inset 0 0 0 4px #d5b17b,0 9px 15px #926a3c66}
.lib-card strong{color:#984548;font-size:33px}
.lib-card span{color:#463329;font-size:14px}
dialog{width:min(685px,96vw);max-width:min(685px,96vw);max-height:96svh;overflow:visible}
dialog::backdrop{background:rgba(29,22,18,.71);backdrop-filter:blur(5px)}
.folio{
  position:relative;min-height:min(820px,91svh);height:min(820px,91svh);max-height:91svh;
  display:flex;flex-direction:column;justify-content:center;
  padding:74px clamp(42px,10%,95px) 55px;overflow-y:auto;
  border:2px solid #ba9258;border-radius:26px;
  background:
    radial-gradient(ellipse at 50% 24%,rgba(255,255,255,.65),transparent 53%),
    linear-gradient(135deg,rgba(255,255,255,.3),transparent 26%,rgba(134,90,48,.14) 98%),
    url("./grain.png"),linear-gradient(155deg,#fff7e9,#f3e1c5 66%,#ebd4af);
  box-shadow:
    inset 0 0 0 4px #fff4dc,
    inset 0 0 0 6px #b3874c,
    inset 0 0 0 9px #fcf3df,
    inset 0 0 0 11px #ddbc86,
    inset 1px 2px 20px #fffef4ad,
    inset -7px -12px 19px #99714355,
    0 8px 0 -4px #876039,
    0 27px 60px #090b1599;
}
.folio::before,.folio::after{top:35px;bottom:35px;width:1px;background:linear-gradient(transparent,#d8b47c 12%,#c5a475 86%,transparent);opacity:.7;box-shadow:1px 0 0 #fff5d9}
.folio::before{left:25px}.folio::after{right:25px}
.folio-logo{
  position:relative;flex:none;margin:0 auto 4px;width:78px;height:72px;
  background:url("./sh-monogram.svg") center/contain no-repeat;
  filter:drop-shadow(0 1px 0 #fff8e7) drop-shadow(0 2px 2px #9770436e);
}
.folio .ornament{
  top:21%;bottom:12%;width:65px;left:3px;opacity:.85;overflow:visible;
  background:url("./engraved-vine.svg") center / 100% 100% no-repeat;
  filter:drop-shadow(1px 2px 2px #855f3755) drop-shadow(-1px -1px .8px #fffae8)
}
.folio .ornament.right{left:auto;right:3px;transform:scaleX(-1)}
.folio .ornament svg{display:none}
.folio .folio-corner{
  position:absolute;pointer-events:none;width:100px;height:100px;
  background:url("./engraved-corner.svg") top left / contain no-repeat;
  filter:drop-shadow(2px 2px 1px #8e673d66) drop-shadow(-1px -1px 1px #fff9df);
  opacity:.89;
}
.folio .folio-corner.tl{left:16px;top:13px}
.folio .folio-corner.tr{right:16px;top:13px;transform:scaleX(-1)}
.folio .folio-corner.bl{left:16px;bottom:13px;transform:scaleY(-1)}
.folio .folio-corner.br{right:16px;bottom:13px;transform:scale(-1)}
.folio-close{
  position:sticky;top:0;right:0;float:none;align-self:flex-end;z-index:5;flex:none;
  margin:-55px -61px 0 0;width:41px;height:41px;
  background:linear-gradient(145deg,#fff9e9,#ead4ad);
  color:#5b4831;border:1.5px solid #a98350;
  box-shadow:inset 0 2px 1px #fff,inset 0 -2px 4px #bb9868,0 3px 7px #6648275c;
  text-shadow:0 1px 0 #fff;font-size:27px;
}
.folio-id{
  font:700 clamp(51px,10vw,77px)/1 Georgia,serif;padding:10px 0 14px;
  color:#994448;text-shadow:0 1px 0 #fff7ea,0 3px 4px #754d4841
}
.folio-title{
  font:italic 700 clamp(24px,5.4vw,37px)/1.14 Georgia,"Times New Roman",serif;
  letter-spacing:.012em;color:#5b342d;text-shadow:0 1px 0 #fff9ed;
}
.folio-rule{width:68%;margin:25px auto 25px;height:2px;background:linear-gradient(90deg,transparent,#ad8447 15%,#e2c78f 44%,#a67a40 54%,transparent);box-shadow:0 1px 0 #fff}
.folio-text{
  font:400 clamp(16px,3.7vw,20px)/1.58 Georgia,"Times New Roman",serif;
  color:#392d27;text-align:left;white-space:normal;
  text-shadow:0 1px 0 #fff7eb99;
}
.folio-text p{margin:0}
.folio-text p+p{margin-top:13px}
.folio::selection,.folio-text::selection{background:#f5dfaf}
@media(max-width:680px){
 .matrix{gap:10px}
 .field{min-height:240px;padding:17px 10px 13px;border-radius:20px}
 .field .question-symbol{height:44px;width:44px;padding:7px}
 .field .question-title{font-size:clamp(15px,4.1vw,20px)}
 .field-icons{grid-template-columns:repeat(2,42px);gap:7px}
 .field-icons>span{width:42px;height:42px;padding:8px}
 .field::before,.field::after{width:43px;height:43px}
 .pick-card{min-height:96px}
 .folio{padding:70px clamp(47px,12vw,70px) 38px}
 .folio .ornament{width:47px}
 .folio-close{margin:-53px -35px 0 0}
 .folio .folio-corner{width:75px;height:75px}
}
@media(max-width:420px){
 .shell{padding:11px 10px 28px}
 .logo-symbol{height:68px;width:75px}
 .brand-flourish{max-width:260px}
 header.luxury-head h1{font-size:35px}
 .brand-subtitle{font-size:9px}
 .tabs{margin-bottom:15px}
 .field{min-height:234px;padding:13px 6px 9px}
 .field .question-symbol{height:40px;width:40px;padding:6px}
 .field .question-title{font-size:clamp(14px,4vw,17px);line-height:1.09}
 .field-icons{grid-template-columns:repeat(2,38px);gap:5px}
 .field-icons>span{width:38px;height:38px;padding:6px}
 .field::before,.field::after{width:34px;height:34px}
 .pick-card{min-height:92px;padding:8px 4px}
 .pick-id{font-size:26px}.pick-name{font-size:12px}
 .dice-area{margin-top:17px;padding:19px 15px 15px}
 .die{width:90px;height:90px;padding:11px}
 .dice-names{gap:16px}.dice-names span{width:90px}
 .dice-row::before{width:220px}
 .folio{min-height:90svh;height:90svh;padding:65px 48px 27px;border-radius:23px}
 .folio-logo{height:64px;width:65px}
 .folio-close{width:36px;height:36px;margin:-51px -33px 0 0}
 .folio .ornament{width:46px;top:20%;bottom:10%;opacity:.72}
 .folio .folio-corner{width:64px;height:64px}
 .folio .folio-corner.tl{left:10px;top:8px}.folio .folio-corner.tr{right:10px;top:8px}
 .folio .folio-corner.bl{left:10px;bottom:8px}.folio .folio-corner.br{right:10px;bottom:8px}
 .folio::before{left:20px}.folio::after{right:20px}
 .folio-id{font-size:clamp(49px,14vw,64px);padding:7px 0 10px}
 .folio-title{font-size:clamp(22px,6.4vw,28px)}
 .folio-rule{margin:17px auto}
 .folio-text{font-size:clamp(16px,4.2vw,18px);line-height:1.5}
}
@media(max-height:750px){
 .folio{justify-content:flex-start}
 .folio-logo{height:48px;width:52px}
 .folio-id{font-size:45px}
 .folio-title{font-size:23px}
}
@media(prefers-reduced-motion:reduce){
 .die,.pick-card,.lib-card{transition:none}
}
/* Keep the close control at the top right, regardless of content height. */
.folio-close{position:absolute;top:18px;right:18px;float:none;margin:0;align-self:auto}
@media(max-width:420px){.folio-close{top:15px;right:14px;margin:0}}
