/* The game screen: layout, story, choices, panels, dialogs, update notice.
   One of the stylesheets in css/, loaded in the order listed in index.html (order matters). */

/* =====================================================================
   Herni obrazovka
   ===================================================================== */
.game-layout{position:relative;flex:1;min-height:0;display:flex;}
.game-main{flex:1;min-width:0;display:flex;flex-direction:column;padding:0 var(--gutter);}
.desk-only{display:none !important;}

.game-bar{display:flex;align-items:center;gap:10px;padding:calc(10px + var(--safe-top)) 0 10px;flex-shrink:0;}
.game-bar-title{flex:1;min-width:0;display:flex;flex-direction:column;}
.game-bar-title strong{font-weight:400;font-size:18px;color:var(--text-hi);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
#storyMeta{font-size:14px;color:var(--dim);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.hp-chip{display:inline-flex;align-items:center;gap:6px;height:44px;padding:0 10px;font-size:18px;color:var(--text-hi);}
.hp-chip.low{animation:blink 1s steps(1) infinite;}
@keyframes blink{50%{opacity:.4;}}
.px-heart{
  display:inline-block;
  width:24px;
  height:21px;
  background:var(--hp);
  -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 7 6' shape-rendering='crispEdges'%3E%3Cpath d='M1 0h2v1h1V0h2v1h1v2H6v1H5v1H4v1H3V5H2V4H1V3H0V1h1z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 7 6' shape-rendering='crispEdges'%3E%3Cpath d='M1 0h2v1h1V0h2v1h1v2H6v1H5v1H4v1H3V5H2V4H1V3H0V1h1z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.px-heart.big{width:48px;height:42px;}
.badge{position:absolute;top:-4px;right:-4px;min-width:20px;height:20px;padding:0 4px;display:flex;align-items:center;justify-content:center;background:var(--hp);color:#000;font-size:13px;}

.scene-banner{position:relative;display:block;width:100%;padding:0;text-align:left;height:clamp(130px, 24vh, 220px);min-height:calc((100vw - 2 * var(--gutter)) * .45);flex-shrink:0;overflow:hidden;background:var(--panel);transition:height .24s ease;}
.scene-banner::after{content:'▴';position:absolute;top:8px;right:12px;font-size:16px;color:#fff;text-shadow:2px 2px 0 #000;}
.scene-banner.collapsed{height:46px;min-height:0;}
.scene-banner.collapsed::after{content:'▾';top:50%;transform:translateY(-50%);}
.scene-banner.collapsed .scene-cap{padding:0 40px 0 14px;top:0;display:flex;align-items:center;background:rgba(0,0,0,.55);}
.scene-banner.collapsed .scene-loc{font-size:20px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.scene-box{position:relative;aspect-ratio:4 / 3;overflow:hidden;margin-bottom:14px;}
.scene-img{position:absolute;inset:3px;width:calc(100% - 6px);height:calc(100% - 6px);object-fit:cover;}
.scene-cap{position:absolute;left:0;right:0;bottom:0;padding:22px 14px 10px;background:linear-gradient(0deg,rgba(0,0,0,.85),transparent);}
.scene-loc{display:block;font-size:26px;line-height:1;color:#fff;text-shadow:3px 3px 0 #000;}
.scene-cap small{display:block;margin-top:4px;font-size:14px;color:var(--text-hi);text-shadow:2px 2px 0 #000;}



.story-box{flex:1;min-height:0;margin-top:10px;display:flex;flex-direction:column;padding:6px;}
#chatLog{
  flex:1;
  overflow-y:auto;
  padding:14px 14px 10px;
  display:flex;
  flex-direction:column;
  gap:14px;
  font-family:var(--font-story);
  font-size:17px;
  line-height:1.6;
  -webkit-overflow-scrolling:touch;
}
.msg{white-space:pre-wrap;overflow-wrap:anywhere;animation:msgIn .28s ease-out;}
@keyframes msgIn{from{opacity:0;transform:translateY(5px);}to{opacity:1;transform:none;}}
.choice-list{animation:msgIn .28s ease-out .06s backwards;}
.msg.narrator{color:var(--text);}
.place-card{margin-top:10px;padding:8px 12px;white-space:pre-wrap;font-family:var(--font-ui);font-size:16px;line-height:1.45;color:var(--text);background:var(--bg-deep);box-shadow:inset 3px 0 0 var(--accent);}
.place-card::first-line{color:var(--text-hi);font-size:18px;}
.msg.player{color:var(--accent-2);}
.msg.player::before{content:'> ';color:var(--accent);font-family:var(--font-ui);}
.msg-retry{align-self:center;}
/* Příběh po scénách: volby pod textem */
.choice-list{display:flex;flex-direction:column;gap:6px;margin-top:2px;}
.choice-options{display:flex;flex-direction:column;gap:6px;}
.option-grid.story-grid{grid-template-columns:1fr;}
.choice-list .choice{text-align:left;justify-content:flex-start;font-family:var(--font-ui);font-size:16px;line-height:1.35;min-height:38px;padding:6px 12px;}
.choice-list .choice::before{content:"▸ ";color:var(--accent);}
.choice-list.used .choice{opacity:.45;pointer-events:none;}
.choice-list .choice.picked{opacity:1;color:var(--accent-2);}
.choice-hint{font-family:var(--font-ui);font-size:14px;color:var(--text-dim, var(--text));opacity:.75;}
.choice-options.hidden{display:none;}
.kind-klid .choice-hint{display:flex;align-items:center;gap:10px;flex-wrap:wrap;}
.choice-toggle{font-size:14px;min-height:30px;}
.choice-toggle.open{box-shadow:inset 0 0 0 2px var(--accent);}
.choice-continue{font-size:14px;min-height:30px;color:var(--accent);}
/* Napětí: volby na čas */
.kind-napeti .choice{box-shadow:inset 0 0 0 2px var(--k-danger);}
.choice-timer{height:8px;background:var(--bg-deep);box-shadow:inset 0 0 0 2px var(--line);margin-bottom:4px;overflow:hidden;}
.choice-timer i{display:block;height:100%;width:100%;background:var(--accent);transition:width .1s linear;}
.choice-timer.urgent i{background:var(--k-danger);animation:timerPulse .5s steps(2) infinite;}
@keyframes timerPulse{50%{opacity:.5;}}
.choice-list.used .choice-timer{opacity:.4;}
/* Oznámení motoru pod textem */
.msg.note{font-family:var(--font-ui);font-size:15px;color:var(--accent-2);opacity:.9;}
.msg.note-pamet{font-style:italic;}
.msg.note-pamet::before{content:"◆ ";color:var(--accent);}
.msg.note-predtucha{color:var(--k-npc, var(--accent-2));}
.msg.note-kapitola{text-align:center;font-size:20px;letter-spacing:1px;color:var(--text-hi);padding:6px 0;}
.ending-summary{display:flex;flex-direction:column;gap:4px;padding:14px 16px;font-family:var(--font-ui);font-size:16px;}
.ending-summary strong{font-size:22px;color:var(--accent);}
#partnerBox.dead strong{text-decoration:line-through;opacity:.6;}
.partner-line{font-family:var(--font-ui);font-size:16px;}
.omen-list li{font-style:italic;}
.msg.system{align-self:center;text-align:center;font-family:var(--font-ui);font-size:15px;color:var(--dim);}
.kw-place{color:var(--k-place);}
.kw-npc{color:var(--k-npc);}
.kw-item{color:var(--k-item);}
.kw-danger{color:var(--k-danger);}
.msg-text.typing{cursor:pointer;}
.type-cursor{display:inline-block;width:9px;height:1.05em;margin-left:2px;background:var(--accent);vertical-align:-2px;animation:blink 1s steps(1) infinite;}
#thinking{display:none;align-items:center;gap:6px;padding:2px 16px 8px;font-size:15px;color:var(--accent-2);flex-shrink:0;}
#thinking.active{display:flex;}
.dot{width:6px;height:6px;background:var(--accent-2);animation:blink 1s steps(1) infinite;}
.dot:nth-child(2){animation-delay:.33s;}
.dot:nth-child(3){animation-delay:.66s;}

#inputBar{
  display:flex;
  align-items:flex-end;
  gap:8px;
  margin:4px;
  padding:8px 8px 8px 12px;
  background:var(--bg-deep);
  box-shadow:inset 0 0 0 2px var(--line);
  flex-shrink:0;
}
#inputBar:focus-within{box-shadow:inset 0 0 0 2px var(--accent);}
.prompt-gt{font-size:22px;line-height:40px;color:var(--accent);}
#playerInput{
  flex:1;
  min-height:40px;
  max-height:150px;
  padding:9px 2px;
  background:transparent;
  border:none;
  color:var(--text-hi);
  font-family:var(--font-story);
  font-size:16px;
  line-height:1.4;
  resize:none;
}
#playerInput:focus{outline:none;}
#playerInput:disabled{opacity:.6;}
.send-btn{height:40px;min-width:52px;padding:0 14px;flex-shrink:0;background:var(--accent);color:var(--accent-ink);font-size:30px;line-height:1;}
.send-btn:active:not(:disabled){transform:translateY(2px);}
.send-btn:disabled{opacity:.4;cursor:not-allowed;}

.quick-bar{display:grid;grid-template-columns:repeat(6,1fr);gap:6px;padding:10px 0 calc(10px + var(--safe-bottom));flex-shrink:0;}
.quick-btn{display:flex;flex-direction:column;align-items:center;gap:2px;padding:6px 0 4px;background:var(--panel-2);box-shadow:inset 0 0 0 2px var(--line-hi);color:var(--text);font-size:12px;}
.quick-btn svg{width:26px;height:26px;}
.quick-btn:hover,.quick-btn:focus-visible{box-shadow:inset 0 0 0 2px var(--accent);color:var(--accent);outline:none;}
.quick-btn:active{transform:translateY(2px);}
.quick-btn:disabled{opacity:.4;cursor:not-allowed;}

/* ---------- Panely (postava/denik, druzina, pauza) ---------- */
.sheet-backdrop{position:absolute;inset:0;z-index:20;background:rgba(0,0,0,.6);}
.sheet{
  position:absolute;
  left:0;
  right:0;
  bottom:0;
  z-index:21;
  height:84%;
  display:flex;
  flex-direction:column;
  padding:8px var(--gutter) calc(14px + var(--safe-bottom));
  background:var(--bg);
  box-shadow:0 -3px 0 var(--line-hi), 0 -12px 30px rgba(0,0,0,.5);
  transform:translateY(105%);
  visibility:hidden;
  transition:transform .24s cubic-bezier(.4,0,.6,1), visibility 0s linear .24s;
}
.sheet.open{transform:none;visibility:visible;transition:transform .28s cubic-bezier(.2,.8,.2,1);}
.sheet-handle{width:44px;height:5px;margin:2px auto 12px;background:var(--line-hi);flex-shrink:0;}
.sheet-scroll{flex:1;min-height:0;overflow-y:auto;}
.sheet.modal{
  top:50%;
  left:50%;
  right:auto;
  bottom:auto;
  width:min(360px, calc(100% - 32px));
  height:auto;
  padding:20px 20px 16px;
  transform:translate(-50%, -50%);
  opacity:0;
  transition:opacity .16s ease-in, visibility 0s linear .16s;
}
.sheet.modal.open{opacity:1;transition:opacity .2s ease-out;}
.sheet-actions{display:flex;flex-direction:column;}

.quest-list{list-style:none;display:flex;flex-direction:column;gap:6px;font-family:var(--font-story);font-size:15.5px;line-height:1.4;}
.quest-list li{position:relative;padding-left:18px;color:var(--text);}
.quest-list li::before{content:'◆';position:absolute;left:0;top:1px;font-size:11px;color:var(--accent);}
.quest-list li.done{color:var(--dim);text-decoration:line-through;}
.quest-list li.done::before{content:'✔';color:var(--dim);}
.tag-list{list-style:none;display:flex;flex-wrap:wrap;gap:6px;}
.tag-list .mini-item,.tag{display:inline-block;padding:2px 8px;font-size:15px;background:var(--bg-deep);box-shadow:inset 0 0 0 2px var(--line);color:var(--text);}
#inventoryList .mini-item{color:var(--k-item);}
.empty-hint{font-family:var(--font-story);font-size:14px;color:var(--dim);font-style:italic;}
.char-head{display:flex;align-items:center;justify-content:space-between;gap:10px;}
.char-head .box-title{margin-bottom:6px;}
.kv-grid{display:grid;grid-template-columns:auto 1fr;gap:4px 12px;margin:12px 0;font-size:16px;}
.kv-grid .k{color:var(--dim);}
.stat-chips{display:flex;flex-direction:column;gap:6px;}
.stat-line{display:flex;align-items:center;justify-content:space-between;gap:12px;font-size:17px;}
.stat-pips{display:flex;gap:4px;}
.stat-pips i{width:12px;height:12px;background:var(--bg-deep);box-shadow:inset 0 0 0 2px var(--line);}
.stat-pips i.on{background:var(--accent);box-shadow:inset 0 -3px 0 rgba(0,0,0,.25);}
.body-block{display:flex;gap:14px;align-items:flex-start;margin-top:4px;}
.body-figure-wrap{padding:10px;margin-top:12px;background:var(--bg-deep);box-shadow:inset 0 0 0 2px var(--line);}
.body-figure-wrap svg rect{stroke:#000;stroke-width:3;}
.body-lists{flex:1;min-width:0;}
.vital-label{display:flex;justify-content:space-between;font-size:14px;color:var(--dim);margin:8px 0 4px;}
.meter{height:12px;background:#000;box-shadow:0 0 0 2px var(--line);}
.meter i{display:block;height:100%;width:100%;transition:width .4s ease-out;}
.meter.hp i{background:repeating-linear-gradient(90deg,var(--hp) 0 8px,var(--hp-dark) 8px 10px);}
.meter.fate i{background:repeating-linear-gradient(90deg,var(--fate) 0 8px,var(--fate-dark) 8px 10px);}


.fx-flash{position:absolute;inset:0;z-index:30;pointer-events:none;background:var(--hp);opacity:0;}
.fx-flash.on{animation:hurtFlash .45s steps(3);}
@keyframes hurtFlash{0%{opacity:.35;}100%{opacity:0;}}
.game-layout.shake{animation:shake .32s steps(6);}
@keyframes shake{0%,100%{transform:none;}20%{transform:translate(-6px,2px);}40%{transform:translate(5px,-2px);}60%{transform:translate(-4px,0);}80%{transform:translate(3px,1px);}}
.px-heart.pop{animation:heartPop .4s steps(4);}
@keyframes heartPop{50%{transform:scale(1.35);}}
.day-card{position:absolute;inset:0;z-index:31;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:0 var(--gutter);text-align:center;pointer-events:none;background:rgba(0,0,0,.86);opacity:0;visibility:hidden;}
.day-card.on{visibility:visible;animation:dayCard 2.2s steps(10) forwards;}
.day-card strong{font-family:var(--font-title);font-weight:400;font-size:clamp(56px, 18vw, 96px);line-height:1;color:var(--accent);text-shadow:4px 4px 0 #000;}
.day-card span{margin-top:6px;font-size:18px;letter-spacing:3px;color:var(--text-hi);}
@keyframes dayCard{0%{opacity:0;}15%,75%{opacity:1;}100%{opacity:0;}}
.toast-stack{position:absolute;left:50%;top:calc(64px + var(--safe-top));z-index:32;transform:translateX(-50%);width:min(440px, calc(100% - 28px));display:flex;flex-direction:column;gap:8px;pointer-events:none;}
.toast{padding:10px 14px;background:var(--panel);box-shadow:inset 0 0 0 3px var(--accent), 0 8px 20px rgba(0,0,0,.5);font-size:17px;color:var(--text-hi);animation:toast 3.2s ease forwards;}
.toast b{font-weight:400;color:var(--accent);margin-right:6px;}
#questBox.flash{animation:questFlash .9s steps(3) 2;}
@keyframes questFlash{50%{box-shadow:inset 0 0 0 3px var(--accent), inset 0 0 0 6px var(--panel);}}
@keyframes toast{0%{opacity:0;transform:translateY(-8px);}10%,85%{opacity:1;transform:none;}100%{opacity:0;}}

/* ---------- Dialog ---------- */
.dialog-layer{position:absolute;inset:0;z-index:50;display:flex;align-items:center;justify-content:center;padding:20px var(--gutter);background:rgba(0,0,0,.7);}
.dialog{width:100%;max-width:400px;padding:22px 22px 18px;text-align:center;}
.dialog-text{margin:4px 0 18px;font-family:var(--font-story);font-size:16px;line-height:1.5;color:var(--text);white-space:pre-line;}
.dialog-actions{display:grid;grid-template-columns:1fr 1fr;gap:10px;}
.dialog-actions.single{grid-template-columns:1fr;}

/* ---------- Oznameni o aktualizaci ---------- */
.update-notice{
  position:fixed;
  left:50%;
  bottom:calc(14px + var(--safe-bottom));
  transform:translateX(-50%);
  z-index:40;
  width:min(500px, calc(100vw - 28px));
  padding:14px 16px;
  background:var(--panel);
  box-shadow:inset 0 0 0 3px var(--accent), 0 10px 30px rgba(0,0,0,.6);
}
.update-notice-text{font-family:var(--font-story);font-size:15px;line-height:1.45;}
.update-notice-actions{display:flex;gap:8px;justify-content:flex-end;margin-top:10px;}

::-webkit-scrollbar{width:10px;}
::-webkit-scrollbar-track{background:transparent;}
::-webkit-scrollbar-thumb{background:var(--line);}

@media (prefers-reduced-motion: reduce){
  *,*::before,*::after{animation-duration:.001ms !important;animation-iteration-count:1 !important;transition-duration:.001ms !important;}
}
