@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;0,700&family=MedievalSharp&display=swap');

:root{
  --night:#130e0b;
  --ink:#34241b;
  --red:#873027;
  --gold:#ca9d42;
  --gold-light:#efd48a;
  --green:#526e43;
  --vellum:#f7e7c0;
  --serif:"Cormorant Garamond",Georgia,serif;
  --display:"MedievalSharp","Palatino Linotype",serif;
  --ui:Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif;
}

*{box-sizing:border-box}
html{min-width:320px;background:var(--night)}
body{
  min-width:320px;
  min-height:100vh;
  margin:0;
  color:#f4ead3;
  font-family:var(--serif);
  font-size:18px;
  background:
    radial-gradient(circle at 50% -8rem,rgba(159,96,31,.25),transparent 44rem),
    linear-gradient(135deg,#100c0a,#291911 58%,#0e0b09);
}
button,input{font:inherit}
button{cursor:pointer}
button:focus-visible,a:focus-visible{outline:3px solid var(--gold-light);outline-offset:3px}

.game-header{
  position:sticky;
  top:0;
  z-index:60;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  min-height:78px;
  padding:10px max(16px,calc((100vw - 1540px)/2 + 16px));
  border-top:3px solid #d1a34b;
  border-bottom:3px solid #8b5e29;
  background:
    linear-gradient(90deg,rgba(17,9,9,.93),rgba(45,22,24,.74),rgba(17,9,9,.94)),
    url("/file_0000000001288210a70a192fad171c67.png") center 88%/cover;
  box-shadow:0 9px 25px rgba(0,0,0,.48);
}
.game-brand{display:flex;align-items:center;gap:10px;color:#fff1c8;text-decoration:none}
.game-brand>span:first-child{display:grid;place-items:center;width:41px;height:41px;color:var(--gold-light);border:1px solid var(--gold);background:rgba(107,31,29,.78);font-size:1.25rem}
.game-brand b,.game-brand small{display:block}
.game-brand b{font:400 1.03rem var(--display)}
.game-brand small{margin-top:4px;color:#d7bc86;font-size:.68rem;letter-spacing:.1em;text-transform:uppercase}
.game-header nav{display:flex;align-items:center;gap:6px}
.game-header nav a,.game-header nav button{min-height:39px;padding:7px 10px;color:#f6e5bb;border:1px solid rgba(226,183,91,.52);background:rgba(25,14,10,.66);font:750 .67rem var(--ui);text-decoration:none}
.game-header nav a:hover,.game-header nav button:hover{background:rgba(121,38,32,.78)}

.game-shell{width:min(1540px,100%);margin:0 auto;padding:20px 16px 60px}
.game-intro{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:25px;
  padding:20px 25px;
  border:1px solid rgba(210,167,73,.42);
  background:linear-gradient(105deg,rgba(91,29,25,.86),rgba(41,26,18,.76)),radial-gradient(circle at 82% 12%,rgba(221,177,72,.2),transparent 24rem);
  box-shadow:0 16px 38px rgba(0,0,0,.3);
}
.eyebrow{margin:0 0 5px;color:#9b352b;font:800 .65rem/1.3 var(--ui);letter-spacing:.12em;text-transform:uppercase}
.game-intro .eyebrow{color:#f0ce78}
.game-intro h1{margin:0;color:#fff5d8;font:400 clamp(1.55rem,3vw,2.55rem)/1.08 var(--display)}
.game-intro>div>p:last-child{max-width:800px;margin:7px 0 0;color:#e1d1ae;font-size:.98rem}
.game-metrics{display:grid;grid-template-columns:repeat(4,minmax(88px,1fr));flex:0 0 475px;border:1px solid rgba(231,193,101,.28);background:rgba(18,11,8,.3)}
.game-metrics div{padding:9px 12px;border-right:1px solid rgba(231,193,101,.19)}
.game-metrics div:last-child{border:0}
.game-metrics span,.game-metrics strong{display:block}
.game-metrics span{color:#cbb78e;font:750 .57rem var(--ui);letter-spacing:.08em;text-transform:uppercase}
.game-metrics strong{margin-top:3px;color:#fff0c4;font:800 .83rem var(--ui)}

.hidden-layout{display:grid;grid-template-columns:minmax(0,1fr) 310px;gap:17px;margin-top:17px}
.scene-card,.objects-panel{border:1px solid #9d733b;box-shadow:0 16px 38px rgba(0,0,0,.3)}
.scene-card{min-width:0;padding:12px;background:linear-gradient(145deg,#f8e9c5,#d9bb7e)}
.scene-toolbar{display:flex;align-items:center;justify-content:space-between;gap:15px;padding:2px 2px 11px;color:var(--ink)}
.scene-toolbar-copy{flex:0 0 auto}
.scene-toolbar .eyebrow{margin:0}
.scene-toolbar strong{display:block;color:#5b3528;font:750 .73rem var(--ui)}
.scene-tools{display:flex;align-items:flex-end;justify-content:flex-end;gap:10px;min-width:0}
.scene-choice{display:grid;grid-template-columns:minmax(175px,245px) auto;gap:4px 6px;align-items:center}
.scene-choice label{grid-column:1/-1;color:#765d45;font:750 .56rem var(--ui);letter-spacing:.07em;text-transform:uppercase}
.scene-choice select,.scene-choice button{
  min-height:34px;
  color:#5c2a22;
  border:1px solid #aa824d;
  background:#fff1cf;
  font:800 .63rem var(--ui);
}
.scene-choice select{min-width:0;padding:4px 29px 4px 9px}
.scene-choice button{padding:4px 9px;white-space:nowrap}
.zoom-controls{display:flex;align-items:center;gap:5px}
.zoom-controls button{min-height:34px;padding:4px 10px;color:#5c2a22;border:1px solid #aa824d;background:#fff1cf;font:800 .66rem var(--ui)}
.zoom-controls button:first-child,.zoom-controls button:nth-child(3){width:36px;padding:0;font-size:1rem}
.zoom-controls span{min-width:52px;color:#765d45;font:750 .6rem var(--ui);text-align:center}

.scene-scroll{
  position:relative;
  width:100%;
  max-height:calc(100vh - 225px);
  overflow:auto;
  border:5px double #68432a;
  outline:2px solid #c1984d;
  outline-offset:2px;
  background:#1c120e;
  scrollbar-color:#9b713b #2a1a12;
}
.scene-layer{position:relative;width:100%;min-width:100%;aspect-ratio:3/2;overflow:hidden;transition:width .25s ease}
.scene-layer>img{position:absolute;inset:0;display:block;width:100%;height:100%;object-fit:contain;user-select:none;-webkit-user-drag:none}
.scene-layer.is-loading>img{filter:brightness(.45) blur(2px)}
.hotspot-layer{position:absolute;inset:0;z-index:3}
.hotspot{
  position:absolute;
  padding:0;
  border:0;
  border-radius:50%;
  background:transparent;
  cursor:crosshair;
}
.hotspot::before,.hotspot::after{content:"";position:absolute;pointer-events:none;opacity:0;transition:opacity .2s,transform .2s}
.hotspot::before{inset:5%;border:3px solid #f8df83;border-radius:50%;box-shadow:0 0 0 5px rgba(123,39,31,.78),0 0 22px rgba(255,223,115,.85)}
.hotspot::after{content:"✓";left:50%;top:50%;display:grid;place-items:center;width:30px;height:30px;color:#fff8d9;border:2px solid #f0d176;border-radius:50%;background:#526e43;font:900 .8rem var(--ui);transform:translate(-50%,-50%) scale(.5)}
.hotspot.is-found{cursor:default}
.hotspot.is-found::before,.hotspot.is-found::after{opacity:1}
.hotspot.is-found::after{transform:translate(-50%,-50%) scale(1)}
.hotspot.is-hint::before{opacity:1;animation:hintPulse .7s ease-in-out infinite}
@keyframes hintPulse{50%{transform:scale(1.22);box-shadow:0 0 0 11px rgba(123,39,31,.22),0 0 30px #ffe08a}}
.scene-layer.is-mistake{animation:sceneMistake .24s ease 2}
@keyframes sceneMistake{50%{filter:sepia(.5) saturate(1.7);transform:translateX(3px)}}

.start-overlay{
  position:absolute;
  inset:0;
  z-index:5;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  padding:30px;
  color:#f6e9cb;
  background:linear-gradient(rgba(27,15,10,.68),rgba(35,18,13,.78));
  text-align:center;
  backdrop-filter:blur(2px);
}
.start-overlay.is-hidden{display:none}
.start-overlay>span{color:#f0cf75;font-size:2.5rem}
.start-overlay .eyebrow{margin-top:8px;color:#f0cf75}
.start-overlay h2{margin:0;color:#fff4d2;font:400 clamp(1.45rem,3.2vw,2.5rem) var(--display)}
.start-overlay>p:not(.eyebrow){max-width:500px;margin:9px 0 18px;color:#dbc8a3}
.start-overlay button,.primary-button{
  min-height:47px;
  padding:9px 17px;
  color:#fff6dc;
  border:1px solid #d2a64e;
  background:linear-gradient(#9d392f,#6d241f);
  font:800 .73rem var(--ui);
}
.scene-tip{margin:10px 2px 0;color:#715b45;font:650 .65rem var(--ui)}

.objects-panel{align-self:start;padding:18px;color:var(--ink);background:linear-gradient(145deg,#fff8e3,#e6ce9c)}
.objects-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;padding-bottom:12px;border-bottom:1px solid rgba(105,68,33,.22)}
.objects-heading .eyebrow{margin:0}
.objects-heading h2{margin:1px 0 0;color:#52261f;font:400 1.35rem var(--display)}
.objects-heading>span{color:#8a332a;font:800 .61rem var(--ui);text-transform:uppercase}
.objects-panel ul{display:grid;grid-template-columns:1fr;gap:6px;margin:12px 0 14px;padding:0;list-style:none}
.object-item{display:grid;grid-template-columns:30px 1fr 22px;align-items:center;gap:8px;min-height:43px;padding:6px 8px;border:1px solid rgba(108,71,36,.17);background:#f3e1b9;transition:opacity .2s,background .2s}
.object-item>span:first-child{display:grid;place-items:center;width:27px;height:27px;color:#793128;border:1px solid #c6a66d;border-radius:50%;background:#fff5d8;font-size:.95rem}
.object-item b{color:#543426;font:750 .7rem var(--ui)}
.object-item i{color:#4f6d42;font-style:normal;font-weight:900;opacity:0}
.object-item.is-found{opacity:.56;background:#dfe2c4}
.object-item.is-found b{text-decoration:line-through}
.object-item.is-found i{opacity:1}
.game-actions{padding-top:13px;border-top:1px solid rgba(105,68,33,.22)}
.hint-button{display:flex;align-items:center;justify-content:center;gap:7px;width:100%;min-height:46px;padding:7px;color:#fff3d0;border:1px solid #ae7f38;background:#4d3827;font:800 .67rem var(--ui)}
.hint-button span{color:#e8c35f;font-size:1.1rem}
.hint-button small{color:#d8bd87;font-size:.58rem}
.hint-button:disabled{cursor:not-allowed;opacity:.48}
.feedback-card{display:grid;grid-template-columns:35px 1fr;gap:8px;margin-top:12px;padding:10px;color:#f2dfb8;background:#4d2c20}
.feedback-card>span{color:#e7c461;font-size:1.3rem;text-align:center}
.feedback-card strong,.feedback-card p{display:block;margin:0}
.feedback-card strong{font:750 .68rem var(--ui)}
.feedback-card p{margin-top:2px;color:#cfb993;font-size:.7rem}
.feedback-card.is-success{background:#405739}
.feedback-card.is-error{background:#792d27}
.progression-card{margin-top:12px;padding:12px;border:1px solid rgba(108,71,36,.27);background:rgba(255,246,217,.62)}
.progression-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:10px}
.progression-heading .eyebrow{margin:0}
.progression-heading h2{margin:1px 0 0;color:#52261f;font:400 1.12rem var(--display)}
.progression-heading>strong{color:#9a7029;font:850 .75rem var(--ui);white-space:nowrap}
.global-progress{height:8px;margin-top:10px;overflow:hidden;border:1px solid #b6965e;background:#d8c291}
.global-progress i{display:block;width:0;height:100%;background:linear-gradient(90deg,#7f2d28,#c99534,#efd477);transition:width .4s ease}
.progression-card>p{margin:6px 0 10px;color:#6f5944;font:650 .64rem var(--ui)}
.progression-card>button,.next-scene-button{width:100%;min-height:40px;padding:7px 10px;color:#fff0cb;border:1px solid #9f7435;background:#4d3827;font:800 .64rem var(--ui)}
.progression-card>button:hover,.next-scene-button:hover{background:#6a4930}
.historical-note{margin:15px 3px 0;color:#c5b392;font-size:.73rem;text-align:center}

.scene-scroll:fullscreen{display:flex;align-items:center;width:100vw;height:100vh;max-height:none;border:0;outline:0;background:#0d0907}
.scene-scroll:fullscreen .scene-layer{flex:0 0 auto}

.parchment-dialog{
  position:fixed;
  inset:0;
  margin:auto;
  width:min(620px,calc(100% - 24px));
  max-height:calc(100vh - 24px);
  padding:28px;
  overflow:auto;
  color:var(--ink);
  border:2px solid #9b7035;
  background:linear-gradient(110deg,rgba(255,255,255,.42),transparent 42%),#f1ddb0;
  box-shadow:0 25px 80px rgba(0,0,0,.64),inset 0 0 0 6px rgba(112,71,30,.08);
}
.parchment-dialog::backdrop{background:rgba(12,8,6,.76);backdrop-filter:blur(3px)}
.parchment-dialog h2{margin:0;color:#54241d;font:400 clamp(1.45rem,4vw,2.1rem) var(--display)}
.dialog-close{position:absolute;right:12px;top:10px;width:38px;height:38px;color:#6d3026;border:1px solid #b78e53;background:#fff0cd;font:700 1.4rem/1 var(--ui)}
.parchment-dialog ol{display:grid;gap:10px;margin:18px 0;padding-left:24px;color:#5d4736}
.parchment-dialog form>.primary-button{width:100%}
.victory-dialog{text-align:center}
.victory-seal{color:#b88b31;font-size:3.8rem;animation:sealGlow 1.5s ease-in-out infinite}
.victory-dialog>p:not(.eyebrow){color:#66503e}
.victory-stars{margin:4px 0;color:#bf8c27;font:800 2rem/1 var(--ui);letter-spacing:.12em;text-shadow:0 2px #fff2bd}
.unlock-message{min-height:1.25em;margin:8px 0!important;color:#49633e!important;font:750 .72rem var(--ui)}
.score-card{display:inline-block;min-width:140px;margin:7px auto;padding:10px 24px;color:#fff0c7;background:#54251e}
.score-card span,.score-card strong{display:block}
.score-card span{font:750 .59rem var(--ui);letter-spacing:.1em;text-transform:uppercase}
.score-card strong{font:800 1.4rem var(--ui)}
.victory-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));justify-content:center;gap:8px;margin-top:19px}
.victory-actions button{width:auto}
.scene-menu-button{width:100%;min-height:47px;padding:8px 14px;color:#652c23;border:1px solid #a47b45;background:#fff2d0;font:750 .7rem var(--ui)}
.parchment-dialog form>.scene-menu-button{margin-bottom:8px}
.victory-actions a{display:grid;place-items:center;min-height:47px;padding:8px 14px;color:#652c23;border:1px solid #a47b45;background:#fff2d0;font:750 .7rem var(--ui);text-decoration:none}
.next-scene-button{min-height:47px;background:#4d633f}
.next-scene-button[hidden]{display:none}
.records-dialog{width:min(720px,calc(100% - 24px));text-align:left}
.records-dialog form{margin:0}
.records-lead{margin:7px 38px 15px 0;color:#66503e}
.records-summary{display:grid;grid-template-columns:repeat(2,1fr);gap:8px;margin-bottom:13px}
.records-summary span{padding:10px;color:#fff0cb;background:#552820;text-align:center}
.records-summary b,.records-summary small{display:block}
.records-summary b{font:850 1rem var(--ui)}
.records-summary small{margin-top:2px;color:#dac297;font:650 .6rem var(--ui);text-transform:uppercase}
.records-list{display:grid;gap:6px;margin:0;padding:0;list-style:none}
.record-row{display:grid;grid-template-columns:30px minmax(0,1fr) 78px 82px;align-items:center;gap:8px;width:100%;min-height:44px;padding:6px 9px;text-align:left;border:1px solid rgba(103,68,35,.18);background:#f8e8c4}
.record-row:hover,.scene-menu-button:hover{background:#fff5da}
.record-row:focus-visible,.scene-menu-button:focus-visible{outline:3px solid #793128;outline-offset:2px}
.record-index{display:grid;place-items:center;width:26px;height:26px;color:#fff0cb;border-radius:50%;background:#6f3028;font:800 .62rem var(--ui)}
.record-name{color:#503326;font:750 .69rem var(--ui);overflow-wrap:anywhere}
.record-stars{color:#b37f22;font:800 .71rem var(--ui);letter-spacing:.05em;white-space:nowrap}
.record-time{color:#6e5946;font:800 .66rem var(--ui);text-align:right;white-space:nowrap}
.star-legend{margin:13px 0;color:#6a5542;font-size:.72rem;text-align:center}
.star-legend b{color:#aa7621;letter-spacing:.06em}
.records-dialog .primary-button{width:100%}
@keyframes sealGlow{50%{transform:scale(1.08);text-shadow:0 0 25px #dfbb53}}
.screen-reader-live{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}

@media (max-width:1050px){
  .hidden-layout{grid-template-columns:1fr}
  .scene-scroll{max-height:none}
  .objects-panel ul{grid-template-columns:repeat(2,1fr)}
  .objects-panel{width:100%}
}

@media (max-width:1180px){
  .scene-toolbar{align-items:flex-start}
  .scene-tools{align-items:stretch;flex-direction:column}
  .scene-choice{grid-template-columns:minmax(190px,1fr) auto}
  .zoom-controls{justify-content:flex-end}
}

@media (max-width:760px){
  .game-header{position:static;align-items:flex-start;padding:10px 12px}
  .game-header nav{flex-wrap:wrap;justify-content:flex-end}
  .game-header nav a,.game-header nav button{min-height:35px;padding:5px 7px;font-size:.61rem}
  .game-shell{padding:12px 8px 45px}
  .game-intro{align-items:flex-start;flex-direction:column;padding:17px;gap:14px}
  .game-metrics{width:100%;flex-basis:auto}
  .scene-toolbar{align-items:stretch;flex-direction:column}
  .scene-tools{width:100%}
  .scene-choice{grid-template-columns:minmax(0,1fr) auto}
  .zoom-controls{width:100%;justify-content:flex-end}
}

@media (max-width:520px){
  body{font-size:16px}
  .game-header{display:block}
  .game-brand{width:max-content;margin:0 auto 9px}
  .game-header nav{justify-content:center}
  .game-metrics{grid-template-columns:repeat(2,1fr)}
  .game-metrics div{padding:8px 6px}
  .scene-card{padding:7px}
  .scene-scroll{border-width:3px;outline-width:1px;outline-offset:1px}
  .zoom-controls button:last-child{margin-left:auto}
  .scene-choice{grid-template-columns:1fr}
  .scene-choice label{grid-column:auto}
  .scene-choice select,.scene-choice button{width:100%}
  .objects-panel{padding:14px}
  .objects-panel ul{grid-template-columns:1fr}
  .start-overlay{padding:18px}
  .start-overlay>p:not(.eyebrow){font-size:.82rem}
  .parchment-dialog{padding:24px 18px}
  .victory-actions{grid-template-columns:1fr}
  .record-row{grid-template-columns:27px minmax(0,1fr) 62px}
  .record-time{grid-column:2/-1;text-align:left}
}

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