:root {
  color-scheme: dark;
  --sand: #f7ead1;
  --muted: #e5cda9;
  --gold: #deb16d;
  --line: #927148;
  --stone: #211a16;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  min-height: 100vh;
  isolation: isolate;
  background: #171919;
  color: var(--sand);
  font: 1rem/1.55 system-ui, sans-serif;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, #151211ec 0%, #161311b8 45%, #1613111c 100%),
    url("arte/prova.jpg") center 48% / cover;
}
body:has(#reveal:not([hidden]))::before {
  background:
    linear-gradient(90deg, #171514ec 0%, #18161498 47%, #15151610 100%),
    url("arte/rivelazione.jpg") center 48% / cover;
}
main {
  width: min(100% - 2rem, 82rem);
  margin: 0 auto;
  padding: clamp(2.1rem, 7vw, 6rem) 0 2rem;
}
#game { width: min(100%, 44rem); }
.intro { margin-bottom: 1.4rem; }
h1, h2 { font-family: Georgia, serif; line-height: 1.12; }
h1 {
  font-weight: 500;
  font-size: clamp(2.55rem, 7vw, 4.6rem);
  letter-spacing: -.045em;
  margin: 0 0 .7rem;
  text-wrap: balance;
  text-shadow: 0 3px 20px #0008;
}
.intro p { color: var(--muted); margin: 0; }
h2 { font-size: 1.4rem; margin: 0; }
form#answers, .clue {
  background: #211916ee;
  border: 1px solid var(--line);
  border-radius: .65rem;
  padding: clamp(.85rem, 3vw, 1.55rem);
  box-shadow: 0 14px 60px #0b07078c;
}
fieldset {
  margin: 0 0 .95rem;
  padding: 0 0 .95rem;
  border: 0;
  border-bottom: 1px solid #83644485;
  min-width: 0;
}
legend { font-weight: 600; padding: 0; margin-bottom: .55rem; }
.slots { display: flex; flex-wrap: wrap; gap: .375rem; }
button { cursor: pointer; color: inherit; font: inherit; }
button:focus-visible { outline: 3px solid #ffe6b8; outline-offset: 2px; }
.slot, .glyph, .close {
  display: grid;
  place-items: center;
  padding: .2rem;
  background: #3b2d22;
  border: 1px solid var(--line);
  border-radius: .3rem;
  min-height: 2.75rem;
}
.slot { width: 2.75rem; box-shadow: inset 0 1px 4px #110d0a9d; }
.slot:empty:hover, .close:hover { background: #544030; }
.slot:has(img), .glyph {
  background: #f5e6c9;
  isolation: isolate;
  box-shadow: inset 0 0 12px #a5753d35;
}
.slot img, .glyph img {
  width: 100%;
  height: 2.15rem;
  object-fit: contain;
  mix-blend-mode: multiply;
}
.glyph:hover, .slot:has(img):hover { background: #fbeed5; }
.action {
  background: #dbad67;
  color: #21170e;
  border: 1px solid #f0c484;
  border-radius: .35rem;
  font-weight: 750;
  min-height: 2.75rem;
  padding: .55rem 1.25rem;
}
.action:hover:not(:disabled) { background: #edc687; }
.action:disabled { opacity: .5; cursor: default; }
#feedback { color: #f9d699; margin: .7rem 0 0; }
#feedback:empty { margin: 0; }
dialog {
  width: min(100% - 1.25rem, 29rem);
  max-height: 85dvh;
  border: 1px solid var(--line);
  border-radius: .6rem;
  padding: 1rem;
  color: var(--sand);
  background: var(--stone);
  box-shadow: 0 15px 50px #000a;
}
dialog::backdrop { background: #141010c9; }
.symbol-banks { display: grid; gap: .8rem; }
.picker-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .6rem;
  position: sticky;
  z-index: 1;
  top: -1rem;
  background: var(--stone);
  padding: .65rem 0;
  margin: -.65rem 0 .5rem;
}
.close { width: 2.75rem; font-size: 1.5rem; }
.symbols { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .35rem; }
.glyph { min-height: 3rem; }
#reveal { width: min(100%, 39rem); }
#reveal h1:focus { outline: none; }
.plaque {
  width: min(18rem, 100%);
  margin: 1.3rem 0 1.2rem;
  padding: .75rem 1rem .9rem;
  border: 4px double #977042;
  background: radial-gradient(ellipse at center, #ffefcc, #d8b983);
  color: #261d17;
  text-align: center;
  isolation: isolate;
  box-shadow: 0 10px 40px #0a0607aa;
}
#reveal-symbol {
  display: block;
  width: min(12rem, 100%);
  margin: 0 auto;
  mix-blend-mode: multiply;
}
.plaque figcaption {
  color: #412815;
  font: 700 1.25rem Georgia, serif;
  letter-spacing: .24em;
  padding-left: .24em;
}
.clue p { margin: 0; }
.clue p + p { margin-top: .9rem; }
.clue strong { color: #f7d59b; }
@media (max-width: 38rem) {
  body::before {
    background: linear-gradient(180deg, #17131028, #171310d0 16rem, #171310fa 35rem),
      url("arte/prova.jpg") center top / 100% auto no-repeat;
  }
  body:has(#reveal:not([hidden]))::before {
    background: linear-gradient(180deg, #14121535, #141215cf 14rem, #141215fa 36rem),
      url("arte/rivelazione.jpg") 64% top / 120% auto no-repeat;
  }
  main { padding-top: clamp(5rem, 24vw, 9rem); }
}
