:root {
  color-scheme:light;
  --ink:#17394f;
  --blue:#234b65;
  --sky:#e1edf2;
  --paper:#fffdf5;
  --pink:#eaa5b2;
  --yellow:#f4b54d;
  --exact:#126353;
  --present:#f2c35d;
  --absent:#586675;
  font-family:Trebuchet MS,Arial,sans-serif;
  color:var(--ink);
  background:var(--sky);
  font-size:16px;
}
* {
  box-sizing:border-box;
}
body {
  margin:0;
  background:radial-gradient(ellipse at 12% 10%,#f9fcff 0,transparent 45%),var(--sky);
}
button,input,textarea {
  font:inherit;
}
button,a,input,summary,textarea {
  -webkit-tap-highlight-color:transparent;
}
button {
  cursor:pointer;
  border:2px solid var(--ink);
  border-radius:6px;
  font-weight:700;
  min-height:44px;
  padding:11px 15px;
}
button:disabled {
  cursor:default;
  opacity:.65;
}
button:hover:not(:disabled) {
  filter:brightness(.94);
}
:focus-visible {
  outline:3px solid #b51e64;
  outline-offset:4px;
}
a {
  color:inherit;
  text-underline-offset:4px;
}
h1,h2,p {
  margin:0;
}
h1 {
  font-family:Georgia,serif;
  font-size:clamp(30px,4vw,52px);
  font-weight:700;
  letter-spacing:-1.5px;
  line-height:1.08;
}
h2 {
  font-family:Georgia,serif;
  font-size:31px;
  line-height:1.1;
  margin:7px 0 14px;
}
p {
  line-height:1.5;
}
.small {
  font-size:13px;
  line-height:1.5;
}
.masthead {
  max-width:1120px;
  margin:auto;
  padding:23px 36px;
  display:flex;
  justify-content:space-between;
  gap:16px;
  font-size:13px;
}
.masthead a {
  font-weight:bold;
}
.masthead span {
  color:#425e70;
}
main {
  max-width:1048px;
  margin:0 auto;
  padding:15px 24px 35px;
}
.heading {
  display:flex;
  align-items:end;
  justify-content:space-between;
  gap:20px;
  margin:5px 0 30px;
}
.heading .small {
  margin-bottom:7px;
}
.edition {
  text-align:right;
  font-size:13px;
  max-width:150px;
}
.street {
  display:grid;
  grid-template-columns:minmax(0,620px) minmax(250px,1fr);
  gap:32px;
  align-items:start;
}
.shop {
  background:var(--blue);
  border:3px solid var(--ink);
  border-radius:9px 9px 2px 2px;
  box-shadow:8px 10px 0 #bfd0dc;
  overflow:hidden;
}
.shop-sign {
  display:flex;
  align-items:center;
  justify-content:space-around;
  gap:12px;
  background:#f8d06d;
  color:var(--ink);
  margin:14px 18px 10px;
  padding:15px 10px;
  border:3px double var(--ink);
  font-family:Georgia,serif;
  font-size:clamp(21px,2.7vw,31px);
  font-weight:bold;
  text-align:center;
}
.sign-flower {
  font-family:Georgia,serif;
  font-size:27px;
}
.awning {
  height:45px;
  background:repeating-linear-gradient(90deg,var(--pink) 0,var(--pink) 36px,var(--paper) 36px,var(--paper) 72px);
  border-top:3px solid var(--ink);
  border-bottom:6px solid #17394f;
  clip-path:polygon(0 0,100% 0,100% 88%,96% 100%,92% 88%,88% 100%,84% 88%,80% 100%,76% 88%,72% 100%,68% 88%,64% 100%,60% 88%,56% 100%,52% 88%,48% 100%,44% 88%,40% 100%,36% 88%,32% 100%,28% 88%,24% 100%,20% 88%,16% 100%,12% 88%,8% 100%,4% 88%,0 100%);
}
.shop-window {
  margin:14px 18px 0;
  border:3px solid #142e40;
  background:repeating-linear-gradient(0deg,#325c76 0,#325c76 30px,#2b536d 30px,#2b536d 33px);
  min-height:530px;
}
.intro {
  text-align:center;
  padding:30px 26px 20px;
  color:#fffdf5;
}
.hanging-sign {
  position:relative;
  transform:rotate(-4deg);
  margin:8px auto 12px;
  padding:17px;
  background:var(--paper);
  color:var(--ink);
  width:220px;
  border:3px solid var(--ink);
  box-shadow:4px 5px 0 #142e40;
  font-size:16px;
}
.hanging-sign:before {
  content:'';
  position:absolute;
  left:54px;
  right:54px;
  height:29px;
  border:2px solid #e3bc78;
  border-bottom:0;
  top:-31px;
  border-radius:60% 60% 0 0;
}
.hanging-sign strong {
  font-family:Georgia,serif;
  font-size:28px;
}
.intro-art {
  width:min(100%,360px);
  height:145px;
}
.intro p {
  margin:8px 0 19px;
}
.intro button {
  display:block;
  width:100%;
  max-width:320px;
  margin:10px auto;
}
.primary {
  background:var(--yellow);
  color:var(--ink);
}
.secondary {
  background:var(--paper);
  color:var(--ink);
}
.intro .intro-note {
  margin:18px 0 0;
  color:#e1edf2;
}
.sill {
  background:#17394f;
  color:#f5f4e9;
  display:flex;
  justify-content:space-between;
  padding:15px 24px;
  font-size:13px;
  gap:12px;
}
#play {
  padding:16px 18px 18px;
}
.round-meta {
  display:flex;
  justify-content:space-between;
  gap:8px;
  color:#fffdf5;
  font-size:13px;
  margin-bottom:14px;
}
.board {
  display:grid;
  gap:6px;
}
.ticket {
  display:grid;
  grid-template-columns:24px repeat(5,1fr);
  gap:5px;
  align-items:center;
}
.ticket-number {
  color:#dae7ec;
  font-size:12px;
  text-align:center;
}
.tile {
  min-height:43px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  background:#d6e2e9;
  color:#17394f;
  border:1px solid #c1d3dd;
  border-radius:2px;
  font-size:22px;
  font-weight:bold;
}
.tile small {
  font-size:11px;
}
.ticket.current .tile {
  background:#fffdf5;
  outline:1px solid #e7c77e;
  outline-offset:1px;
}
.tile.exact,.sample.exact,button.key.exact {
  background:var(--exact);
  color:white;
  border-color:#b2d5c7;
}
.tile.present,.sample.present,button.key.present {
  background:var(--present);
  color:#17394f;
  border-color:#e6ca92;
}
.tile.absent,.sample.absent,button.key.absent {
  background:var(--absent);
  color:white;
  border-color:#8b9eaf;
}
#guess-form {
  margin-top:15px;
}
label {
  display:block;
  font-size:13px;
  font-weight:bold;
  margin-bottom:6px;
}
#guess-form label {
  color:#fffdf5;
}
.entry {
  display:flex;
  gap:9px;
}
.entry input {
  min-width:0;
  width:100%;
  border:2px solid var(--ink);
  border-radius:5px;
  background:var(--paper);
  height:46px;
  font-size:23px;
  letter-spacing:6px;
  text-transform:uppercase;
  padding:7px 12px;
  color:var(--ink);
}
.entry button {
  padding:6px 14px;
}
.message {
  color:white;
  min-height:42px;
  font-size:13px;
  padding:9px 0 5px;
  line-height:1.35;
}
.keyboard {
  display:grid;
  gap:6px;
  margin-top:3px;
}
.key-row {
  display:flex;
  gap:4px;
  justify-content:center;
}
.key {
  min-width:0;
  flex:1;
  min-height:43px;
  padding:5px 0;
  background:#f6f1df;
  color:var(--ink);
  border:1px solid #17394f;
  border-bottom:3px solid #132e40;
  border-radius:4px;
  font-size:15px;
}
.key small {
  display:block;
  font-size:9px;
  height:10px;
  line-height:10px;
}
.key.wide {
  flex:1.6;
  font-size:11px;
}
.key-row:nth-child(2) {
  padding:0 12px;
}
aside {
  padding-top:3px;
}
.rules {
  background:var(--paper);
  border-top:5px solid var(--pink);
  padding:19px 21px;
  box-shadow:3px 4px 0 #bfd0dc;
  font-size:14px;
}
.rules summary {
  font-family:Georgia,serif;
  font-size:21px;
  font-weight:bold;
  cursor:pointer;
}
.rules p {
  margin-top:16px;
}
.legend {
  padding:0;
  list-style:none;
  margin:21px 0;
}
.legend li {
  display:flex;
  align-items:center;
  gap:12px;
  margin:13px 0;
  font-size:13px;
  line-height:1.5;
}
.sample {
  width:40px;
  height:46px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  font-size:21px;
  font-weight:bold;
  border-radius:2px;
  flex-shrink:0;
}
.sample small {
  font-size:9px;
}
.street-note {
  font-family:Georgia,serif;
  font-style:italic;
  font-size:18px;
  text-align:center;
  margin:25px 0;
}
.story {
  background:var(--paper);
  border-top:5px solid var(--yellow);
  padding:21px;
  margin-bottom:22px;
  box-shadow:3px 4px 0 #bfd0dc;
}
.story-art svg {
  width:100%;
  height:155px;
}
.story p {
  font-size:14px;
}
.story .small {
  font-size:12px;
}
.answer-line {
  font-size:20px!important;
  font-weight:bold;
  margin-bottom:10px;
}
.score {
  margin-top:14px;
  font-weight:bold;
}
.result-actions {
  display:grid;
  gap:9px;
  margin-top:18px;
}
.result-actions button {
  font-size:13px;
}
.story textarea {
  width:100%;
  margin-top:5px;
  padding:8px;
  font-size:12px;
}
#share-fallback {
  margin-top:15px;
}
#copy-status {
  margin-top:10px;
}
footer {
  text-align:center;
  font-size:12px;
  padding:0 20px 25px;
  color:#425e70;
}
[hidden] {
  display:none!important;
}
@media(max-width:740px) {
  .masthead {
    padding:16px 18px;
  }
  .masthead span {
    font-size:12px;
  }
  main {
    padding:10px 14px 28px;
  }
  .heading {
    margin-bottom:20px;
    gap:8px;
  }
  .heading h1 {
    font-size:33px;
    letter-spacing:-1px;
  }
  .heading .small {
    font-size:12px;
  }
  .edition {
    max-width:90px;
    font-size:11px;
  }
  .street {
    grid-template-columns:1fr;
    gap:24px;
    max-width:530px;
    margin:auto;
  }
  .shop-window {
    margin:12px 10px 0;
    min-height:0;
  }
  .shop-sign {
    margin:12px 10px 10px;
    padding:12px 6px;
  }
  .intro {
    padding:32px 20px 22px;
  }
  #play {
    padding:13px 9px 14px;
  }
  .ticket {
    grid-template-columns:18px repeat(5,1fr);
    gap:4px;
  }
  .tile {
    min-height:39px;
    font-size:20px;
    gap:4px;
  }
  .tile small {
    font-size:9px;
  }
  .board {
    gap:5px;
  }
  .key {
    min-height:43px;
    font-size:14px;
  }
  .key-row {
    gap:3px;
  }
  .sill {
    padding:14px 18px;
  }
  .rules {
    padding:18px 21px;
  }
  .story-art svg {
    height:155px;
  }
  .story {
    scroll-margin-top:16px;
  }
  .awning {
    height:36px;
  }
  .round-meta {
    margin-bottom:11px;
  }
  h2 {
    font-size:29px;
  }
}
@media(prefers-reduced-motion:no-preference) {
  .story {
    animation:reveal .3s ease-out;
  }
  @keyframes reveal {
    from {
      opacity:0;
      transform:translateY(8px);
    }
    to {
      opacity:1;
      transform:translateY(0);
    }
  }
}
.shop.is-open .shop-window {
  background:#edf4ee;
}
.shop.is-open .round-meta,.shop.is-open .ticket-number,.shop.is-open .message {
  color:var(--ink);
}

/* Small action feedback; the board remains the focus. */
.sound-switch { font: inherit; font-size: 13px; min-height: 40px; padding: 6px 10px; white-space: nowrap; cursor: pointer; }
.sound-switch[aria-pressed=true] { box-shadow: inset 0 0 0 2px currentColor; }
.sound-switch:focus-visible { outline: 3px solid currentColor; outline-offset: 3px; }
@media(max-width: 600px) { .masthead { flex-wrap: wrap; gap: 8px; } }
