/* The desk look of the game screen: wood, diary paper, photograph, candle, things on the desk.
   One of the stylesheets in css/, loaded in the order listed in index.html (order matters). */

/* =====================================================================
   The desk (game screen)
   The player is writing a diary at a desk. The diary is a sheet of light
   paper in the middle; everything else is written straight onto the wood
   for now and will become drawn objects later. The wood itself is a small
   pixel tile made in js/app.js (--desk-img); each genre can bring its own.
   ===================================================================== */
#app{
  background-color:#3a2620;
  background-image:radial-gradient(ellipse at 50% 40%, transparent 30%, rgba(0,0,0,.55) 100%), var(--desk-img, none);
  background-size:auto, 288px 288px;
  image-rendering:pixelated;
}
/* Two inks: what is written on the wood, and what is written on paper. */
#app,
.screen-game .sheet.side-left .pbox:not(.scene-box),
.screen-game .game-side,
.screen-game .game-side .pbox{
  --text:#e2d3b4;--text-hi:#f6ecd4;--dim:#b09674;--accent:#f0c36a;--accent-ink:#241612;--accent-2:#d9c7a0;
  --line:#2a1a15;--line-hi:#5c3f33;--panel:#3a2620;--panel-2:#452e26;--bg-deep:#241612;
  --k-place:#a8ca58;--k-npc:#df84a5;--k-item:#e8c170;--k-danger:#cf573c;
  color:var(--text);
}
.pbox,.toast{
  --text:#2e2820;--text-hi:#17130e;--dim:#7d7360;--accent:#9b2d20;--accent-ink:#f3ead3;--accent-2:#5d5647;
  --panel:#ece3cc;--panel-2:#e4dac0;--line:#b7ab8e;--line-hi:#8d8167;--bg-deep:#ddd2b6;
  --k-place:#2f5d3a;--k-npc:#7a2d4a;--k-item:#8a5a12;--k-danger:#9b2d20;
  color:var(--text);
  clip-path:none;
  box-shadow:inset 0 0 0 3px var(--line), inset 0 0 0 6px var(--panel), inset 0 0 0 7px rgba(0,0,0,.2), 5px 6px 0 rgba(0,0,0,.45);
}
.pbox .box-title,.pbox .btn{text-shadow:none;}
.toast{background:var(--panel);box-shadow:inset 0 0 0 3px var(--accent), 4px 5px 0 rgba(0,0,0,.45);}
.btn.danger{background:#9b2d20;color:#f3ead3;box-shadow:inset 0 0 0 3px rgba(0,0,0,.25);}

/* ---------- Screens outside the game: the same desk ---------- */
.screen-bg{display:none;}
.logo-title{text-shadow:4px 4px 0 rgba(0,0,0,.7);}
.screen-header h2{text-shadow:3px 3px 0 rgba(0,0,0,.7);}
.title-foot{text-shadow:1px 1px 0 rgba(0,0,0,.7);}
.fine-print{color:var(--dim);}
.screen-footer{background:linear-gradient(0deg, rgba(0,0,0,.55), transparent);box-shadow:none;border:none;}
.sheet.modal{background:var(--panel);}
.sheet.modal .box-title{text-shadow:none;}
/* The main menu is the diary itself, lying closed on the desk. */
.menu-box{
  --text:#e8d9b6;--text-hi:#f6ecd4;--dim:#b7977a;--accent:#f0c36a;--accent-ink:#241612;
  --panel:#5a1f1c;--line:#3b1211;
  background:var(--panel);
  color:var(--text);
  padding:34px 30px 30px 44px;
  box-shadow:inset 14px 0 0 #3b1211, inset 16px 0 0 #7a2d28, inset 0 0 0 3px #3b1211, 6px 7px 0 rgba(0,0,0,.5);
  position:relative;
}
.menu-box::before{content:'';position:absolute;inset:12px 12px 12px 28px;border:2px dashed rgba(240,195,106,.35);pointer-events:none;}
.menu-box .menu-item{position:relative;z-index:1;text-shadow:2px 2px 0 rgba(0,0,0,.45);}
.selected-genre-art{box-shadow:0 0 0 4px #f6ecd4, 3px 4px 0 4px rgba(0,0,0,.3);transform:rotate(-2deg);}
.story-card .sc-art,.story-card img{image-rendering:pixelated;}
.screen-game .game-bar-title strong,.screen-game #storyMeta{text-shadow:2px 2px 0 rgba(0,0,0,.6);}

/* ---------- The diary page ---------- */
.screen-game .story-box{
  position:relative;
  margin-bottom:8px;
  /* a red margin line down the left, as in a school exercise book */
  background-image:linear-gradient(90deg, transparent 30px, rgba(155,45,32,.35) 30px, rgba(155,45,32,.35) 32px, transparent 32px);
}
.screen-game #chatLog{padding-left:46px;}
.screen-game .msg.player{font-family:var(--font-ui);font-size:17px;color:var(--accent);}
.screen-game .msg.player::before{content:'— ';color:var(--accent);}
.screen-game .msg.system{color:var(--dim);}
/* Choices are lines on the page, not buttons. */
.screen-game .choice-list{gap:0;margin-top:6px;border-top:2px solid var(--line);}
.screen-game .choice-list .choice{background:transparent;box-shadow:none;border-bottom:2px dotted var(--line);font-family:var(--font-story);font-size:17px;color:var(--text-hi);min-height:42px;padding:8px 4px;}
.screen-game .choice-list .choice:hover,.screen-game .choice-list .choice:focus-visible{background:var(--panel-2);outline:none;filter:none;}
.screen-game .choice-list .choice.look-btn{color:var(--dim);font-style:italic;}
.screen-game .choice-list .choice.side{border-left:2px dotted var(--line);padding:8px 14px;color:var(--accent);font-family:var(--font-ui);}
.screen-game .look-held{color:var(--dim);border-bottom:2px dotted var(--line);}
.screen-game .choice-hint{color:var(--dim);opacity:1;padding:8px 4px 6px;}
.screen-game .ending-summary{background:var(--panel-2);box-shadow:inset 0 0 0 2px var(--line-hi);clip-path:none;}
.screen-game .kw-em{color:var(--text-hi);}

/* ---------- Written on the wood ---------- */
.screen-game .sheet.side-left .pbox:not(.scene-box),
.screen-game .game-side{background:none;box-shadow:none;}
.screen-game .sheet.side-left .box-title,.screen-game .game-side .box-title{text-shadow:2px 2px 0 rgba(0,0,0,.55);}
.screen-game .box-title{text-shadow:2px 2px 0 rgba(0,0,0,.55);}
.screen-game .box-copy,.screen-game .kv-grid,.screen-game .stat-line,.screen-game .side-link,.screen-game .side-heart,.screen-game .vital-label{text-shadow:1px 1px 0 rgba(0,0,0,.6);}
.screen-game .tag-list li{background:rgba(0,0,0,.28);box-shadow:inset 0 0 0 2px var(--line-hi);color:var(--text-hi);}
.screen-game .notebook-btn{padding:4px 0;}
.screen-game #sideBoxes .section + .section{border-top:2px solid rgba(0,0,0,.35);}

/* ---------- The photograph of the place ---------- */
.screen-game .scene-box{
  background:#ece3cc;box-shadow:none;clip-path:none;overflow:visible;
  aspect-ratio:4 / 3;margin:6px 14px 26px 8px;
  transform:rotate(-2deg);
  filter:drop-shadow(4px 5px 0 rgba(0,0,0,.45));
}
.screen-game .scene-box .scene-img{inset:10px;width:calc(100% - 20px);height:calc(100% - 20px);}
.screen-game .scene-box .scene-cap{left:10px;right:10px;bottom:10px;padding:22px 10px 8px;}
.screen-game .scene-box .scene-loc{font-size:22px;}
.screen-game .scene-box .scene-cap small{display:none;}
.screen-game .stat-pips i{box-shadow:inset 0 0 0 2px var(--line-hi);}

/* ---------- Phone and tablet: the diary fills the screen ---------- */
.screen-game .sheet.side-left{background-color:#3a2620;background-image:var(--desk-img, none);background-size:288px 288px;box-shadow:0 -4px 0 rgba(0,0,0,.5);}
.screen-game .scene-banner{box-shadow:inset 0 0 0 4px #ece3cc, 4px 5px 0 rgba(0,0,0,.45);}

/* ---------- The light on the desk: it burns down as the day goes ---------- */
.desk-light{display:flex;flex-direction:column;align-items:center;gap:6px;padding:10px 14px 4px;}
.desk-light canvas{width:96px;height:160px;image-rendering:pixelated;}
.desk-light span{font-family:var(--font-ui);font-size:16px;color:var(--dim);text-shadow:1px 1px 0 rgba(0,0,0,.6);}
@media (max-width: 1179px){
  .desk-light{flex-direction:row;justify-content:center;gap:14px;}
  .desk-light canvas{width:48px;height:80px;}
}
@media (min-width: 1180px){
  .screen-game .sheet.side-left{background:none;}
  .screen-game .game-side{padding-top:22px;}
  .screen-game .sheet.side-left .section{padding:10px 14px;margin-bottom:8px;}
}

/* The notebook is paper too. */
.notebook-dialog .note-list li{box-shadow:inset 2px 0 0 var(--accent);}

/* Dialogs and the notebook fade in instead of popping. */
.dialog-layer:not(.hidden){animation:layerIn .18s ease-out;}
.dialog-layer:not(.hidden) .dialog{animation:dialogIn .22s cubic-bezier(.2,.8,.2,1);}
.sheet-backdrop:not(.hidden){animation:layerIn .2s ease-out;}
@keyframes layerIn{from{opacity:0;}to{opacity:1;}}
@keyframes dialogIn{from{opacity:0;transform:translateY(10px);}to{opacity:1;transform:none;}}

/* ---------- Things on the desk ---------- */
.pocket-item{font:inherit;color:inherit;text-align:left;cursor:pointer;}
.pocket-item:hover,.pocket-item:focus-visible{color:var(--accent);outline:none;}
.pocket-item.drawn{display:block;line-height:0;}
.pocket-item.drawn img{width:64px;height:64px;image-rendering:pixelated;filter:drop-shadow(3px 3px 0 rgba(0,0,0,.45));}
.screen-game .tag-list li:has(.pocket-item.drawn){background:none;box-shadow:none;padding:0;}
.desk-light img{width:96px;height:160px;image-rendering:pixelated;}
.desk-props{list-style:none;display:flex;flex-wrap:wrap;gap:10px 16px;padding:8px 14px;margin:0;}
.desk-prop{font-family:var(--font-story);font-size:14px;line-height:1.4;font-style:italic;color:var(--dim);text-shadow:1px 1px 0 rgba(0,0,0,.6);flex:1 1 100%;}
.desk-prop:has(img){flex:0 0 auto;line-height:0;}
.desk-prop img{width:96px;height:96px;image-rendering:pixelated;filter:drop-shadow(3px 3px 0 rgba(0,0,0,.45));}
.desk-prop.state-trembling{animation:tremble .28s steps(2) infinite;}
@keyframes tremble{50%{transform:translate(1px,-1px);}}
/* More photographs under the top one as the story goes on. */
.screen-game .scene-box[data-pile="1"]{box-shadow:5px 4px 0 -1px #d8cdb0;}
.screen-game .scene-box[data-pile="2"]{box-shadow:5px 4px 0 -1px #d8cdb0, -6px 7px 0 -1px #cfc3a4;}
.screen-game .scene-box[data-pile="3"]{box-shadow:5px 4px 0 -1px #d8cdb0, -6px 7px 0 -1px #cfc3a4, 9px 10px 0 -1px #c5b998;}
@media (max-width: 1179px){ .desk-light img{width:48px;height:80px;} }
.screen-game .tag-list{align-items:center;}
/* In the Look around list, a thing already looked at is crossed out (it can still be looked at again). */
.screen-game .look-row .choice.seen{color:var(--dim);text-decoration:line-through;text-decoration-thickness:2px;text-decoration-color:var(--accent);}
.screen-game .look-row .choice.seen{position:relative;padding-left:20px;}
/* out of the flow, so the line through the name does not run through the marker */
.screen-game .look-row .choice.seen::before{color:var(--dim);position:absolute;left:4px;}
