@import url("/studio-credit.css");

:root {
  color-scheme: dark;
  font-family: Inter, system-ui, sans-serif;
  color: #e7eef8;
  background: #091324;
  --amber: #f4bd69;
  --muted: #afbed3;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-height: 100svh;
  background: radial-gradient(ellipse at 70% 15%, #1b3654 0, transparent 65%);
}
a {
  color: var(--amber);
  text-underline-offset: 0.25em;
}
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 5px;
}
main.landing,
main.document {
  max-width: 58rem;
  padding: clamp(1.5rem, 6vw, 5rem) 1.5rem;
  margin: auto;
}
h1 {
  font-size: clamp(2.5rem, 7vw, 5.5rem);
  letter-spacing: -0.055em;
  line-height: 1.05;
  margin: 1rem 0 1.5rem;
}
h2 {
  font-size: 1.3rem;
  margin-top: 2.5rem;
}
p {
  color: var(--muted);
  line-height: 1.7;
}
.document li {
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 0.4rem;
}
.premise {
  font-size: clamp(1.1rem, 2.5vw, 1.35rem);
  max-width: 42rem;
}
.eyebrow {
  color: var(--amber);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.8rem;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.5rem;
  margin: 2rem 0 1rem;
}
.button {
  display: inline-flex;
  gap: 3rem;
  padding: 1rem 1.5rem;
  color: #091324;
  background: var(--amber);
  font-weight: bold;
  text-decoration: none;
  border-radius: 3px;
}
.warning {
  color: #ffd18b;
  border-left: 3px solid var(--amber);
  padding-left: 1rem;
  font-size: 0.9rem;
}
.controls {
  border-top: 1px solid #2c405c;
  margin-top: 3rem;
}
kbd {
  display: inline-block;
  padding: 0 0.35rem;
  margin: 0 0.1rem;
  border: 1px solid #506480;
  border-radius: 3px;
  color: #e7eef8;
}
footer {
  padding: 2rem 1.5rem;
  max-width: 58rem;
  margin: auto;
  border-top: 1px solid #2c405c;
  font-size: 0.85rem;
}
/* The play page is the game and nothing else. The painted title art, blurred
   and darkened, fills whatever the game's 16:9 frame leaves; a closed menu in
   the corner holds the rest. */
.play-page {
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  overscroll-behavior: none;
  background: #050d1a;
}
.play-page::before {
  content: "";
  position: fixed;
  inset: -28px;
  background: var(--art-key, none) center / cover no-repeat;
  filter: blur(16px) brightness(0.55) saturate(0.9);
  pointer-events: none;
}
#game {
  position: fixed;
  inset: 0;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  touch-action: none;
}
#game canvas {
  display: block;
}
#game-status {
  position: fixed;
  top: 50%;
  left: 50%;
  margin: 0;
  padding: 0.6rem 1rem;
  transform: translate(-50%, -50%);
  text-align: center;
  text-shadow: 0 1px 14px #000;
}
.play-corner {
  position: fixed;
  top: max(10px, env(safe-area-inset-top));
  left: max(10px, env(safe-area-inset-left));
  z-index: 20;
  font-size: 0.8rem;
  transition: opacity 0.25s;
}
.play-corner[data-asleep]:not(:hover, :focus-within, :has([open])) {
  opacity: 0;
  pointer-events: none;
}
.play-menu summary {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0.8rem;
  border: 1px solid rgba(231, 238, 248, 0.2);
  border-radius: 999px;
  background: rgba(5, 13, 26, 0.6);
  backdrop-filter: blur(8px);
  color: #e7eef8;
  font-weight: 600;
  list-style: none;
  opacity: 0.8;
  cursor: pointer;
  transition: opacity 0.2s;
}
.play-menu summary::-webkit-details-marker {
  display: none;
}
.play-menu summary::after {
  content: "▾";
  font-size: 0.7rem;
}
.play-menu summary:hover,
.play-menu summary:focus-visible,
.play-menu[open] summary {
  opacity: 1;
}
.play-channel {
  color: var(--amber);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.play-panel {
  width: min(380px, calc(100vw - 20px));
  max-height: calc(100dvh - 70px);
  margin-top: 8px;
  padding: 2px 16px 14px;
  overflow-y: auto;
  border: 1px solid #2c405c;
  border-radius: 10px;
  background: rgba(8, 18, 34, 0.96);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
  overflow-wrap: anywhere;
}
.play-panel h1,
.play-panel h2 {
  margin: 1rem 0 0.3rem;
  color: var(--amber);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.play-panel p,
.play-panel ul,
.play-panel ol {
  margin: 0.35rem 0;
  font-size: 0.8rem;
  line-height: 1.45;
}
.play-panel ul,
.play-panel ol {
  padding-left: 1.1rem;
  color: var(--muted);
}
.play-notes h3,
.play-notes h4 {
  margin: 0.8rem 0 0.2rem;
  font-size: 0.85rem;
  line-height: 1.3;
}
.play-notes h4 {
  font-size: 0.8rem;
}
.play-panel .warning {
  padding: 0.3rem 0 0.3rem 0.7rem;
  font-size: 0.78rem;
}
.play-missions summary {
  margin: 0.35rem 0;
  color: var(--muted);
  font-size: 0.8rem;
  cursor: pointer;
}
.play-home {
  display: inline-block;
  margin-top: 0.8rem;
  font-weight: 600;
  text-decoration: none;
}
.play-foot {
  margin-top: 1rem;
  padding-top: 0.7rem;
  border-top: 1px solid #1c2e48;
}
/* The notice sits on top of the game until the player closes it. */
.play-notice {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  left: 50%;
  z-index: 15;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  width: max-content;
  max-width: calc(100vw - 440px);
  padding: 0.5rem 0.6rem 0.5rem 0.9rem;
  transform: translateX(-50%);
  border: 1px solid rgba(244, 189, 105, 0.45);
  border-radius: 8px;
  background: rgba(5, 13, 26, 0.9);
  color: #ffd18b;
  font-size: 0.78rem;
  line-height: 1.4;
}
.play-notice[hidden] {
  display: none;
}
.play-notice p {
  margin: 0;
}
.play-notice button {
  flex-shrink: 0;
  padding: 0.3rem 0.7rem;
  border: 1px solid rgba(244, 189, 105, 0.6);
  border-radius: 6px;
  background: transparent;
  color: #ffd18b;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.play-notice button:hover,
.play-notice button:focus-visible {
  background: rgba(244, 189, 105, 0.15);
}
/* The human check before the next-mission screen sends a sign-in link. */
.play-challenge {
  position: fixed;
  bottom: max(16px, env(safe-area-inset-bottom));
  left: 50%;
  z-index: 20;
  max-width: calc(100vw - 32px);
  padding: 0.7rem 0.9rem;
  transform: translateX(-50%);
  border: 1px solid rgba(244, 189, 105, 0.45);
  border-radius: 8px;
  background: rgba(5, 13, 26, 0.94);
  color: #ffd18b;
  font-size: 0.85rem;
}
.play-challenge p {
  margin: 0 0 0.5rem;
}
@media (max-width: 520px) {
  /* Leave room for the game's own save panel: the channel shrinks to a dot. */
  .play-channel {
    font-size: 0;
  }
  .play-channel::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--amber);
  }
}
@media (max-width: 760px) {
  .play-notice {
    top: auto;
    bottom: max(12px, env(safe-area-inset-bottom));
    max-width: calc(100vw - 24px);
  }
  /* The play-data question puts its two answers under the text. */
  #play-ask {
    flex-wrap: wrap;
    row-gap: 0.6rem;
  }
  #play-ask p {
    flex-basis: 100%;
  }
}

.host-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 1rem;
  font-size: 0.75rem;
  flex-shrink: 0;
}
.host-controls button {
  font: inherit;
  color: #e7eef8;
  background: #213955;
  border: 1px solid #506480;
  padding: 0.3rem 0.5rem;
  cursor: pointer;
}

.document button {
  font: inherit;
  color: #e7eef8;
  background: #213955;
  border: 1px solid #506480;
  padding: 0.6rem 0.8rem;
  margin: 0.25rem 0;
  cursor: pointer;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.document label {
  display: grid;
  gap: 0.4rem;
  margin: 1rem 0;
}
.document input,
.document textarea {
  font: inherit;
  padding: 0.6rem;
  width: 100%;
}
.document input:focus-visible,
.document textarea:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
}
#receipt-status,
#contact-status,
#sharing-status {
  overflow-wrap: anywhere;
}
