:root {
  color-scheme: light;
  --navy: #14223d;
  --paper: #fffdf6;
  --red: #b32941;
  --muted: #536079;
  --line: #d7dce5;
  --gold: #ffce70;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--navy);
  background: #111d35;
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
body {
  margin: 0;
  background:
    radial-gradient(ellipse at 95% 10%, #38326d 0, transparent 38%),
    radial-gradient(ellipse at 0 65%, #15404a 0, transparent 40%), #111d35;
  min-height: 100vh;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
summary,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button,
a,
summary {
  touch-action: manipulation;
}
button {
  cursor: pointer;
  border: 0;
  border-radius: 12px;
  min-height: 46px;
  padding: 12px 18px;
  font-weight: 700;
  line-height: 1.3;
}
button:disabled {
  cursor: default;
  opacity: 0.5;
}
button:hover:not(:disabled) {
  filter: brightness(1.08);
}
:focus-visible {
  outline: 3px solid #df7c08;
  outline-offset: 4px;
}
a {
  color: inherit;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: clamp(1.8rem, 4vw, 3.7rem);
  line-height: 1.04;
  letter-spacing: -0.045em;
}
h2 {
  font-size: clamp(1.65rem, 3vw, 2.4rem);
  letter-spacing: -0.04em;
  line-height: 1.08;
  margin-bottom: 18px;
}
h3 {
  font-size: 1.15rem;
  line-height: 1.25;
}
p {
  line-height: 1.6;
}
strong {
  font-weight: 750;
}
small,
.small {
  font-size: 0.84rem;
  line-height: 1.55;
}
small {
  display: block;
}
.eyebrow,
.edition {
  font-size: 0.71rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  line-height: 1.5;
}
.eyebrow {
  color: #655276;
}
.primary {
  background: var(--red);
  color: white;
}
.secondary {
  background: var(--navy);
  color: white;
}
.quiet {
  background: transparent;
  color: inherit;
  border: 1px solid currentColor;
}
.wide {
  width: 100%;
}
.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 16px 0;
}
.skip {
  position: fixed;
  top: -100px;
  background: white;
  padding: 14px;
  z-index: 50;
}
.skip:focus {
  top: 12px;
}
body > header {
  max-width: 1250px;
  margin: auto;
  padding: 24px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  color: white;
}
.brand {
  display: flex;
  align-items: center;
  text-decoration: none;
  gap: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  font-size: 0.8rem;
}
.brand img {
  width: 48px;
  height: 48px;
  border-radius: 12px;
}
.brand small {
  font-size: 0.63rem;
  letter-spacing: 0.18em;
  margin-top: 4px;
  color: #c3cde1;
}
main {
  max-width: 1186px;
  margin: auto;
  padding: 20px 24px 50px;
  outline: none;
}
body > footer {
  max-width: 1186px;
  margin: auto;
  padding: 28px 24px;
  color: #c5cfe3;
  font-size: 0.8rem;
  display: flex;
  gap: 20px;
  justify-content: space-between;
  flex-wrap: wrap;
}
#network {
  max-width: 1138px;
  margin: 0 auto;
  color: #d4e9dc;
  padding: 0 16px;
  line-height: 1.5;
  font-size: 0.85rem;
  min-height: 24px;
}
#network.offline,
#network.pending {
  background: #ffe1a1;
  color: #352707;
  border-radius: 10px;
  padding: 12px 16px;
}
.welcome {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  min-height: 710px;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 24px 90px #030a2050;
}
.welcome-art {
  color: white;
  background:
    linear-gradient(180deg, #101b38cc 0%, #101b3833 48%, #101b3866 100%),
    url("../midnight-mix-up/assets/festival.png") center/cover;
  padding: 40px 34px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.welcome-art h1 {
  margin: 35px 0 18px;
  text-shadow: 0 2px 20px #0006;
}
.welcome-art h1 em {
  color: var(--gold);
  font-style: normal;
}
.welcome-art p {
  max-width: 370px;
  font-size: 1.05rem;
  background: #14223dcc;
  padding: 16px;
  border-radius: 12px;
}
.edition {
  border: 1px solid #ffffff80;
  border-radius: 40px;
  padding: 8px 12px;
  color: var(--gold);
}
.entry-panel {
  background: var(--paper);
  padding: 40px 34px;
}
.entry-panel > p {
  color: var(--muted);
}
form {
  margin: 22px 0;
}
label {
  display: block;
  font-weight: 700;
  margin: 15px 0;
  font-size: 0.9rem;
}
input:not([type="radio"]),
select,
textarea {
  display: block;
  background: white;
  width: 100%;
  border: 1.5px solid #a8b2c3;
  border-radius: 10px;
  padding: 13px;
  margin-top: 8px;
  color: var(--navy);
  min-height: 48px;
}
fieldset {
  border: 0;
  padding: 0;
  margin: 22px 0;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
legend {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 10px;
}
.choice {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #bbc3d0;
  border-radius: 10px;
  padding: 12px;
  margin: 0;
  cursor: pointer;
}
.choice:has(:checked) {
  background: #e6edf6;
  border-color: var(--navy);
}
input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: var(--red);
  margin: 0;
}
.resume {
  padding: 16px;
  background: #e7ecf6;
  border-radius: 12px;
  font-size: 0.9rem;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}
.resume button {
  font-size: 0.85rem;
}
#entry-error {
  color: #a42133;
  margin-top: 12px;
}
.text-link {
  font-size: 0.85rem;
  font-weight: 700;
  text-underline-offset: 4px;
}
.room-top {
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 24px;
}
.room-top .eyebrow {
  color: var(--gold);
}
.room-top h1 {
  font-size: 2rem;
  margin: 10px 0 0;
}
.room-top h1 span {
  font-family: monospace;
  letter-spacing: 0.08em;
}
.room-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.room-controls button {
  font-size: 0.8rem;
}
.crew {
  display: flex;
  gap: 14px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.crew-person {
  flex: 1;
  min-width: 190px;
  background: #26354f;
  border: 1px solid #46546f;
  color: #e5ebf8;
  border-radius: 14px;
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.crew-person.is-you {
  border-color: #f4cb75;
}
.avatar {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 1.3rem;
  font-weight: 800;
  border-radius: 50%;
  background: #ffc39d;
  color: #342336;
}
.av-1 {
  background: #b9b4fa;
}
.av-2 {
  background: #9cdccc;
}
.crew-person strong {
  font-size: 0.95rem;
  overflow-wrap: anywhere;
}
.crew-person small {
  font-size: 0.75rem;
  color: #d0d9eb;
  margin-top: 4px;
}
.dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #9cabc3;
  margin-right: 5px;
}
.dot.on {
  background: #82e4ba;
}
.paper,
.board,
.private-box,
.mission {
  background: var(--paper);
  border-radius: 20px;
  padding: 28px;
  margin-bottom: 22px;
  box-shadow: 0 12px 30px #030a2018;
}
.paper > p,
.private-box > div > p {
  color: var(--muted);
}
.lobby-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 22px;
}
.lobby-grid .paper > button {
  margin: 0 8px 12px 0;
}
.room-code {
  font-family: monospace;
  font-size: clamp(2.4rem, 7vw, 4.2rem);
  letter-spacing: 0.12em;
  font-weight: 800;
  padding: 20px 0;
}
.mission {
  background: #edc8b9;
}
.mission ol {
  padding-left: 22px;
  line-height: 1.65;
}
.mission li {
  padding: 0 0 16px 8px;
}
.mission strong {
  display: block;
}
.case-meter {
  color: #dbe3f3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.82rem;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.case-meter b {
  letter-spacing: 4px;
  color: var(--gold);
  font-size: 1.1rem;
}
.briefing {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 30px;
  overflow: hidden;
  align-items: center;
}
.briefing img {
  width: 100%;
  max-height: 410px;
  object-fit: cover;
  border-radius: 14px;
}
.briefing .lead {
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.waiting {
  color: #d2dcf0;
  padding: 14px 0;
}
.paper .waiting {
  color: var(--muted);
}
.private-box {
  border: 2px solid #b8adf8;
  background: #eae5ff;
  position: relative;
}
.private-box h2 {
  font-size: 1.7rem;
}
.private-box:not(.open) {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
}
.private-box:not(.open) p {
  margin-bottom: 0;
}
.private-box.open {
  border-color: #7060c2;
}
.private-clues {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin: 24px 0;
}
.private-clues article {
  background: #fffefa;
  border-radius: 12px;
  padding: 22px;
  border: 1px solid #c8c1e3;
}
.clue {
  font-size: 1.2rem;
  line-height: 1.55;
  margin: 12px 0;
}
.read-list {
  list-style: none;
  padding: 0;
  line-height: 2.2;
}
.board-title {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  justify-content: space-between;
}
.board-title > button {
  flex-shrink: 0;
}
.board-title h2 {
  max-width: 700px;
}
.board-title p {
  color: var(--muted);
}
.pencil-note {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  background: #edf0f6;
  border-radius: 10px;
  padding: 12px 16px;
  margin: 10px 0 22px;
}
.pencil-note p {
  font-size: 0.84rem;
  margin: 0;
  max-width: 680px;
}
.pencil-note button {
  font-size: 0.8rem;
  flex-shrink: 0;
}
.options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.hypothesis {
  background: white;
  border: 2px solid #b8c2d2;
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}
.hypothesis.picked {
  border: 3px solid var(--red);
  box-shadow: 0 0 0 3px #b329411a;
}
.option {
  background: transparent;
  border-radius: 0;
  color: var(--navy);
  text-align: left;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  padding: 18px;
  flex: 1;
  width: 100%;
}
.option:disabled {
  opacity: 1;
}
.option-title {
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.3;
  min-height: 2.5em;
}
.fact {
  display: block;
  font-weight: 400;
  font-size: 0.93rem;
  line-height: 1.5;
}
.fact small {
  font-size: 0.63rem;
  letter-spacing: 0.08em;
  color: #59667f;
  text-transform: uppercase;
  font-weight: 800;
  margin-bottom: 3px;
}
.pencil {
  font-size: 0.8rem;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 0;
  background: #edf0f6;
  border-top: 1px solid #d8deea;
  text-align: left;
  color: var(--navy);
}
.hypothesis.marked {
  background: repeating-linear-gradient(
    -20deg,
    #fff 0,
    #fff 18px,
    #e8eaf1 19px,
    #fff 20px
  );
  border-style: dashed;
}
.hypothesis.marked .option-title {
  text-decoration: line-through;
}
.hypothesis.gone {
  background: #e4e7ed;
  border-color: #c6cedc;
}
.hypothesis.gone .fact {
  color: #525e73;
}
.elimination {
  font-size: 0.76rem;
  color: #983044;
}
.map-side {
  padding: 18px;
  border: 1px solid #b7c9c9;
  background: #eaf0ed;
  border-radius: 14px;
  margin-bottom: 14px;
}
.map-side h3 {
  letter-spacing: 0.12em;
  font-size: 0.8rem;
}
details {
  border-top: 1px solid #cbd1df;
  padding-top: 12px;
  margin-top: 16px;
}
summary {
  cursor: pointer;
  min-height: 44px;
  padding: 10px 4px;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.5;
}
details p {
  font-size: 0.93rem;
  margin-bottom: 12px;
}
details p:first-of-type {
  margin-top: 10px;
}
.translations {
  margin: 20px 0;
}
.relay {
  border-top: 1px solid var(--line);
  padding-top: 25px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.relay > h3 {
  grid-column: 1/-1;
  margin-bottom: 5px;
}
.relay > article {
  border: 1px solid var(--line);
  padding: 15px;
  border-radius: 12px;
  font-size: 0.9rem;
}
.relay details {
  margin-top: 8px;
  padding-top: 0;
}
.relay summary {
  font-size: 0.8rem;
}
.relay p {
  color: #5f448b;
}
.contributions {
  background: #eaf3ed;
  border-radius: 14px;
  padding: 22px;
  margin: 24px 0;
}
.contributions p {
  font-size: 0.9rem;
}
.contribution {
  display: inline-block;
  border: 1px solid #78998a;
  padding: 8px 12px;
  border-radius: 30px;
  margin: 0 8px 12px 0;
  font-size: 0.85rem;
}
.contribution.yes {
  background: #235848;
  color: white;
}
.decision {
  border-top: 2px solid #c7cdd9;
  padding-top: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.decision strong {
  display: block;
  font-size: 1.35rem;
  margin-top: 8px;
}
.decision p {
  font-size: 0.9rem;
  max-width: 550px;
  margin-bottom: 0;
  color: var(--muted);
}
.decision button {
  flex-shrink: 0;
}
.feedback {
  border-left: 8px solid #dfa93c;
}
.feedback blockquote {
  font-size: 1.3rem;
  color: #6e4e12;
  background: #fff2cf;
  padding: 20px;
  border-radius: 12px;
  margin: 24px 0;
}
.evidence article {
  background: #edf2ef;
  padding: 18px;
  border-radius: 12px;
  margin: 12px 0;
}
.evidence article > p {
  margin: 10px 0 0;
  font-size: 1.1rem;
}
.result {
  background: #fff1d3;
}
.stars {
  color: #8b5100;
  font-size: 3rem;
  letter-spacing: 5px;
  margin: 12px 0;
}
.radio {
  margin: 30px 0 20px;
  padding: 22px;
  background: #172744;
  color: white;
  border-radius: 14px;
}
.radio p:last-child {
  color: #ffdb8f;
}
.room-bottom {
  color: #cbd5e9;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 28px;
}
.room-bottom .small {
  flex-basis: 100%;
  margin: 0;
}
.watch-note,
.warning {
  background: #ffdf9f;
  color: #4c320a;
  border-radius: 12px;
  padding: 16px;
  font-size: 0.9rem;
}
dialog {
  border: 0;
  border-radius: 20px;
  background: var(--paper);
  color: var(--navy);
  padding: 30px;
  max-width: 540px;
  width: calc(100% - 32px);
  max-height: 85vh;
  overflow: auto;
  box-shadow: 0 20px 90px #0008;
}
dialog::backdrop {
  background: #071026c9;
}
dialog li {
  line-height: 1.6;
  margin: 14px 0;
}
dialog ol {
  padding-left: 22px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.guide {
  max-width: 850px;
  margin: auto;
}
.guide h1 {
  font-size: 2.5rem;
}
.guide li {
  line-height: 1.65;
  margin-bottom: 14px;
}
.guide table {
  border-collapse: collapse;
  width: 100%;
}
.guide td,
.guide th {
  padding: 12px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.guide h2 {
  margin-top: 30px;
}
@media (max-width: 850px) {
  .welcome {
    grid-template-columns: 1fr;
  }
  .welcome-art {
    min-height: 340px;
    background-position: center 45%;
    padding: 30px;
  }
  .welcome-art h1 {
    margin-top: 22px;
  }
  .welcome-art p {
    max-width: 500px;
  }
  .entry-panel {
    padding: 30px;
  }
  .lobby-grid {
    grid-template-columns: 1fr;
  }
  .briefing {
    grid-template-columns: 1.1fr 1fr;
    padding: 22px;
    gap: 20px;
  }
  .options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .relay {
    grid-template-columns: 1fr;
  }
  .crew-person {
    min-width: 150px;
  }
  .private-box:not(.open) {
    display: block;
  }
  .private-box:not(.open) button {
    margin-top: 18px;
  }
  .board-title {
    display: block;
  }
  .board-title > button {
    margin-bottom: 14px;
  }
  .decision {
    align-items: stretch;
    flex-direction: column;
  }
  .decision button {
    width: 100%;
  }
}
@media (max-width: 520px) {
  body > header {
    padding: 18px 16px;
  }
  .brand small {
    font-size: 0.58rem;
  }
  .brand img {
    width: 40px;
    height: 40px;
  }
  .brand {
    gap: 8px;
    font-size: 0.72rem;
  }
  body > header button {
    font-size: 0.78rem;
    padding: 10px 12px;
  }
  main {
    padding: 14px 12px 30px;
  }
  .welcome {
    border-radius: 18px;
  }
  .welcome-art {
    padding: 26px 22px;
    min-height: 340px;
  }
  .welcome-art h1 {
    font-size: 2.4rem;
  }
  .entry-panel {
    padding: 26px 22px;
  }
  .room-top {
    display: block;
    margin-bottom: 18px;
  }
  .room-top h1 {
    font-size: 1.8rem;
  }
  .room-controls {
    margin-top: 18px;
  }
  .crew {
    gap: 8px;
  }
  .crew-person {
    min-width: 100%;
    padding: 10px 12px;
  }
  .crew-person .avatar {
    width: 32px;
    height: 32px;
    font-size: 1rem;
  }
  .crew-person small {
    display: inline;
    margin-left: 8px;
  }
  .crew-person strong {
    font-size: 0.86rem;
  }
  .paper,
  .board,
  .private-box,
  .mission {
    padding: 20px 16px;
    border-radius: 16px;
  }
  .briefing {
    display: flex;
    flex-direction: column-reverse;
    gap: 22px;
  }
  .briefing img {
    height: 190px;
    object-position: center 50%;
  }
  .case-meter {
    font-size: 0.72rem;
    gap: 8px;
  }
  .case-meter b {
    font-size: 0.95rem;
    letter-spacing: 2px;
  }
  .private-clues {
    grid-template-columns: 1fr;
  }
  .private-clues article {
    padding: 18px;
  }
  .board h2 {
    font-size: 1.55rem;
  }
  .pencil-note {
    align-items: flex-start;
    flex-direction: column;
    padding: 12px;
  }
  .options {
    gap: 10px;
  }
  .option {
    padding: 13px 10px;
    gap: 10px;
  }
  .option-title {
    font-size: 0.93rem;
    min-height: 2.8em;
  }
  .fact {
    font-size: 0.82rem;
  }
  .fact small {
    font-size: 0.58rem;
    letter-spacing: 0.04em;
  }
  .pencil {
    font-size: 0.71rem;
    padding: 10px;
    min-height: 46px;
  }
  .map-side {
    padding: 12px;
  }
  .map-side .options {
    grid-template-columns: 1fr;
  }
  .map-side .option {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }
  .map-side .option-title {
    grid-column: 1/-1;
    min-height: 0;
  }
  .contributions {
    padding: 18px 14px;
  }
  .room-code {
    font-size: 2.5rem;
  }
  .guide h1 {
    font-size: 2rem;
  }
  .guide table {
    font-size: 0.8rem;
  }
}
@media (prefers-reduced-motion: no-preference) {
  .paper,
  .board,
  .private-box {
    animation: arrive 0.2s ease-out;
  }
  @keyframes arrive {
    from {
      opacity: 0.9;
      transform: translateY(3px);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }
}
/* Investigation edition: quiet support, tactile map, and readable English. */
.welcome-art {
  background-image:
    linear-gradient(
      180deg,
      #101b38ed 0%,
      #101b3870 40%,
      #101b3822 68%,
      #101b38c9 100%
    ),
    url("assets/duck-alibi.webp");
  background-position: 58% center;
  min-height: 740px;
}
.welcome-art p {
  margin-top: auto;
  margin-bottom: 0;
  backdrop-filter: blur(4px);
}
.story-en {
  font-size: 1.13rem;
  line-height: 1.85;
  color: var(--navy) !important;
  text-wrap: pretty;
}
.word {
  display: inline;
  min-height: 0;
  padding: 2px 1px;
  border-radius: 3px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-decoration: underline dotted #6b618f;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 4px;
}
.word:hover:not(:disabled),
.word:focus-visible {
  background: #e8e1ff;
  text-decoration-style: solid;
}
.recovery {
  background: #fff0cc;
  border: 2px solid #dfba68;
  border-radius: 16px;
  padding: 22px;
  margin: 0 0 24px;
  line-height: 1.5;
}
.recovery small {
  margin-top: 10px;
}
.recovery .actions {
  margin-bottom: 12px;
}
.recovery p {
  margin-bottom: 0;
}
.journal {
  background: #26384e;
  color: #f3efde;
  border: 1px solid #576878;
  border-radius: 14px;
  padding: 6px 18px;
  margin: 0 0 22px;
}
.journal > summary {
  letter-spacing: 0.02em;
}
.journal article {
  border-top: 1px solid #657383;
  padding: 18px 0 4px;
}
.journal article:last-child {
  padding-bottom: 12px;
}
.journal .story-en {
  color: #f5f1e8 !important;
}
.journal .word:hover {
  color: var(--navy);
}
.phrase-pocket {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 24px 0;
}
.phrase-pocket article {
  background: #eae5ff;
  padding: 16px;
  border-radius: 12px;
}
.phrase-pocket article p {
  margin: 8px 0;
}
.phrase-pocket article small {
  color: var(--muted);
}
.relay-wrap {
  margin: 24px 0;
}
.relay-wrap .relay {
  padding-top: 12px;
  border: 0;
}
.board-title details {
  margin-bottom: 18px;
}
.board-title details p {
  max-width: 760px;
}
.map-section {
  border: 1px solid #b5c4b5;
  background: #f0f2e5;
  border-radius: 18px;
  padding: 18px;
}
.map-instruction {
  font-size: 0.9rem;
  margin-bottom: 16px;
}
.festival-map {
  position: relative;
  isolation: isolate;
  width: 100%;
  aspect-ratio: 8/7;
  max-width: 800px;
  margin: auto;
  background: #dce7d6;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: inset 0 0 0 2px #617762;
}
.map-ground {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}
.map-pin {
  position: absolute;
  left: var(--x);
  top: var(--y);
  transform: translate(-50%, -50%);
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0 6px;
  width: 24%;
  max-width: 180px;
  min-height: 54px;
  border: 2px solid #36584f;
  border-radius: 10px;
  padding: 7px 10px;
  background: #fff9e6;
  color: #193d35;
  box-shadow: 0 5px 0 #25473926;
  font-size: clamp(0.72rem, 1.7vw, 1rem);
  z-index: 2;
}
.map-building {
  grid-column: 1/-1;
  display: block;
  font-size: clamp(1.15rem, 3vw, 2rem);
  line-height: 1.1;
}
.map-pin-title {
  line-height: 1.2;
}
.map-sign {
  font-size: 1.6em;
  color: #775922;
  line-height: 1;
}
.map-pin.picked {
  background: #7b2439;
  border-color: #481326;
  color: white;
  box-shadow: 0 0 0 4px #fff3ce;
}
.map-pin.picked .map-sign {
  color: #ffdd94;
}
.map-pin.marked {
  border-style: dashed;
  opacity: 0.72;
}
.map-pin.marked .map-pin-title {
  text-decoration: line-through;
}
.map-pin.gone {
  filter: grayscale(1);
  opacity: 0.5;
}
.pin-check {
  position: absolute;
  top: -12px;
  right: -10px;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background: #7b2439;
  color: white;
  border: 2px solid #fff3ce;
  font-size: 0.8rem;
  display: grid;
  place-items: center;
}
.map-compass,
.map-south {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: clamp(0.55rem, 1.4vw, 0.8rem);
  letter-spacing: 0.09em;
  font-weight: 800;
  white-space: nowrap;
  color: #294c40;
}
.map-compass {
  top: 2%;
}
.map-south {
  bottom: 2%;
}
.map-landmark {
  position: absolute;
  top: 57.5%;
  transform: translate(-50%, -50%);
  font-size: clamp(0.56rem, 1.45vw, 0.88rem);
  font-weight: 800;
  background: #fff9e6e8;
  padding: 4px 6px;
  border-radius: 5px;
  white-space: nowrap;
}
.fountain-label {
  left: 42.5%;
}
.stage-label {
  left: 74%;
}
.path-label {
  position: absolute;
  left: 2%;
  top: 48.5%;
  font-size: clamp(0.42rem, 0.95vw, 0.6rem);
  font-weight: 700;
  color: #665f4f;
  width: 24%;
  line-height: 1.4;
}
.map-caption {
  margin: 14px 0 0;
  color: #3e574f;
}
.map-accessible {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.map-accessible button {
  text-align: left;
  font-size: 0.85rem;
}
.map-accessible small {
  font-weight: 400;
  margin-top: 6px;
}
@media (max-width: 850px) {
  .welcome-art {
    min-height: 460px;
    background-position: center 55%;
  }
  .welcome-art p {
    max-width: 380px;
    margin-top: 110px;
  }
  .map-pin {
    max-width: 170px;
  }
  .briefing {
    grid-template-columns: 1fr;
  }
  .briefing img {
    max-height: 320px;
  }
}
@media (max-width: 520px) {
  .welcome-art {
    min-height: 410px;
    padding: 24px 22px;
    background-position: 57% center;
  }
  .welcome-art h1 {
    font-size: 2.15rem;
    margin: 22px 0;
  }
  .welcome-art p {
    font-size: 0.92rem;
    margin-top: 100px;
    padding: 12px;
  }
  .story-en {
    font-size: 1.04rem;
    line-height: 1.85;
  }
  .crew {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }
  .crew-person {
    min-width: 0;
    display: block;
    padding: 10px 8px;
  }
  .crew-person .avatar {
    width: 27px;
    height: 27px;
    font-size: 0.8rem;
    margin-bottom: 6px;
  }
  .crew-person strong {
    font-size: 0.75rem;
    line-height: 1.3;
    display: block;
  }
  .crew-person small {
    display: block;
    font-size: 0.61rem;
    margin: 5px 0 0;
    line-height: 1.5;
  }
  .crew:has(.crew-person:nth-child(2):last-child) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .room-controls {
    gap: 6px;
  }
  .room-controls button {
    font-size: 0.75rem;
    padding: 10px;
    flex-grow: 1;
  }
  .map-section {
    padding: 12px 8px;
  }
  .map-pin {
    padding: 4px 5px;
    gap: 0 2px;
    min-height: 49px;
    width: 30%;
    font-size: 0.63rem;
    box-shadow: 0 3px 0 #25473926;
  }
  .map-building {
    font-size: 1rem;
  }
  .map-sign {
    font-size: 1.6em;
  }
  .map-landmark {
    padding: 3px;
    font-size: 0.53rem;
  }
  .path-label {
    font-size: 0.4rem;
    width: 22%;
  }
  .map-caption {
    font-size: 0.76rem;
  }
  .map-accessible {
    grid-template-columns: 1fr;
  }
  .phrase-pocket {
    grid-template-columns: 1fr;
  }
  dialog {
    padding: 24px 20px;
  }
  .briefing img {
    height: auto;
    max-height: 260px;
  }
  .private-clues .clue {
    font-size: 1.1rem;
  }
}
@media print {
  body {
    background: white;
  }
  .room-controls,
  .room-bottom,
  body > header button,
  #network {
    display: none;
  }
  .paper {
    box-shadow: none;
  }
  .private-box {
    display: none;
  }
}

@media (max-width: 520px) {
  .festival-map {
    min-height: 360px;
  }
  .fountain-label {
    top: 54%;
  }
}
