/* Dream Cartographer (play/dreams.html). Uses the tokens from site.css. The map fills the screen under the site
   header: night-blue ground, gold contour lines and old-map lettering on the canvas. A dream opens on a parchment
   card with dark ink, so it reads well over any part of the map. */
.dc-body { --dc-night: #0a0d18; --dc-gold: #e3cf9a; --dc-parch: #f1e8d4; --dc-ink: #1d1a15; --dc-ink-2: #4a4234; }
.dc-stage { position: relative; height: calc(100vh - var(--dc-top, 64px)); height: calc(100svh - var(--dc-top, 64px)); min-height: 520px; overflow: hidden;
  background: var(--dc-night); isolation: isolate; }
.dc-stage [hidden] { display: none !important; }
.dc-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; outline: none; }
.dc-canvas.is-dragging { cursor: grabbing; }
.dc-canvas.is-over { cursor: pointer; }
.dc-canvas:focus-visible { box-shadow: inset 0 0 0 2px var(--dc-gold); }

/* top bar */
.dc-top { position: absolute; top: 0; left: 0; right: 0; z-index: 3; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 8px 16px;
  padding: 12px max(16px, env(safe-area-inset-right, 0px)) 28px max(16px, env(safe-area-inset-left, 0px));
  background: linear-gradient(180deg, rgba(10, 13, 24, 0.85), rgba(10, 13, 24, 0)); pointer-events: none; }
.dc-top > * { pointer-events: auto; }
.dc-stage:not(.is-in) .dc-top, .dc-stage:not(.is-in) .dc-zoom { visibility: hidden; }
.dc-where { font-family: var(--font-data); font-size: var(--step--1); color: var(--ink); line-height: 1.35; margin: 0; padding-top: 11px; max-width: 42ch; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.9); }
.dc-where .label { color: var(--dc-gold); font-size: inherit; margin-right: 6px; }
.dc-top-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; }
.dc-pill { font-family: var(--font-data); font-size: var(--step--1); font-weight: 500; min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid rgba(227, 207, 154, 0.5);
  background: rgba(10, 13, 24, 0.78); color: var(--ink); cursor: pointer; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); touch-action: manipulation;
  display: inline-flex; align-items: center; list-style: none; }
.dc-pill::-webkit-details-marker { display: none; }
.dc-pill.primary { background: var(--dc-gold); color: #15130f; border-color: var(--dc-gold); }
.dc-pill.subtle { border-color: rgba(237, 231, 219, 0.24); }
@media (hover: hover) and (pointer: fine) { .dc-pill:hover { border-color: var(--dc-gold); } .dc-pill.primary:hover { background: #f3e2b4; } }
.dc-pill:focus-visible, .dc-round:focus-visible { outline: 2px solid var(--dc-gold); outline-offset: 2px; }

.dc-regions { position: relative; }
.dc-regions[open] > summary { border-color: var(--dc-gold); }
.dc-region-list { position: absolute; right: 0; top: calc(100% + 6px); z-index: 4; list-style: none; margin: 0; padding: 6px; width: max-content; max-width: min(300px, calc(100vw - 32px));
  max-height: 50vh; overflow-y: auto; background: rgba(12, 15, 28, 0.96); border: 1px solid rgba(227, 207, 154, 0.3); border-radius: 12px; }
.dc-region-list button { width: 100%; text-align: left; min-height: 44px; padding: 6px 12px; border: 0; border-radius: 8px; background: transparent; color: var(--ink); cursor: pointer;
  font-family: var(--font-display); font-style: italic; font-size: 1.05rem; display: grid; }
.dc-region-list button span { font-family: var(--font-data); font-style: normal; font-size: 0.8rem; color: #b9b1a2; }
@media (hover: hover) and (pointer: fine) { .dc-region-list button:hover { background: rgba(227, 207, 154, 0.12); } }
.dc-region-list button:focus-visible { outline: 2px solid var(--dc-gold); outline-offset: -2px; }

/* zoom and compass */
.dc-zoom { position: absolute; z-index: 3; right: max(16px, env(safe-area-inset-right, 0px)); bottom: max(16px, env(safe-area-inset-bottom, 0px)); display: grid; gap: 6px;
  padding: 6px; border-radius: 999px; background: rgba(10, 13, 24, 0.82); border: 1px solid rgba(227, 207, 154, 0.22); }
.dc-round { width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(237, 231, 219, 0.28); background: transparent; color: var(--ink); cursor: pointer; padding: 0;
  font-family: var(--font-data); font-size: 1.3rem; line-height: 1; display: inline-grid; place-items: center; touch-action: manipulation; }
@media (hover: hover) and (pointer: fine) { .dc-round:hover { border-color: var(--dc-gold); color: var(--dc-gold); } }
.dc-compass { position: absolute; z-index: 2; left: max(14px, env(safe-area-inset-left, 0px)); bottom: max(14px, env(safe-area-inset-bottom, 0px)); width: 92px; height: 92px;
  color: var(--dc-gold); pointer-events: none; font-family: var(--font-display); opacity: 0.85; }
@media (max-width: 600px) { .dc-compass { width: 64px; height: 64px; } }

/* notes on the map */
.dc-tip { position: absolute; z-index: 3; margin: 0; max-width: 280px; padding: 8px 12px; pointer-events: none; background: rgba(12, 15, 28, 0.94); border: 1px solid rgba(227, 207, 154, 0.3);
  border-radius: 10px; color: var(--ink); font-size: 0.95rem; line-height: 1.4; }
.dc-focus { position: absolute; z-index: 3; left: 50%; top: 50%; transform: translate(-50%, 26px); margin: 0; max-width: min(320px, calc(100% - 32px)); width: max-content; text-align: center;
  padding: 8px 12px; background: rgba(12, 15, 28, 0.94); border: 1px solid var(--dc-gold); border-radius: 10px; color: var(--ink); font-size: 0.95rem; line-height: 1.4; pointer-events: none; }
.dc-toast { position: absolute; z-index: 8; left: 50%; top: 84px; transform: translateX(-50%); margin: 0; max-width: calc(100% - 32px); width: max-content; text-align: center;
  font-family: var(--font-data); font-size: var(--step--1); color: var(--ink); background: rgba(12, 15, 28, 0.94); border: 1px solid rgba(227, 207, 154, 0.4); border-radius: 12px; padding: 10px 18px; }
@media (max-width: 600px) { .dc-toast { top: 140px; } }

/* the way in */
.dc-intro { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; padding: 16px; overflow-y: auto;
  background: radial-gradient(ellipse at 50% 40%, rgba(10, 13, 24, 0.3), rgba(10, 13, 24, 0.85)); }
.dc-intro-card { max-width: 580px; display: grid; gap: 16px; justify-items: start; background: rgba(14, 17, 30, 0.88); border: 1px solid rgba(227, 207, 154, 0.28);
  padding: clamp(22px, 4vw, 36px); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.dc-intro-card .label { color: var(--dc-gold); }
.dc-intro-card h1 { font-weight: 300; font-size: var(--step-3); letter-spacing: -0.025em; }
.dc-lede { color: #dcd5c8; font-size: var(--step-1); line-height: 1.5; }
.dc-help { font-family: var(--font-data); font-size: var(--step--1); color: #c2bbae; }
.dc-help .dc-touch { display: none; }
.is-touch .dc-help .dc-touch { display: inline; }
.is-touch .dc-help .dc-keys { display: none; }
.dc-intro-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.dc-intro-actions .btn { min-height: 44px; cursor: pointer; }
.dc-intro .btn.primary { background: var(--dc-gold); border-color: var(--dc-gold); color: #15130f; }
.dc-how { font-family: var(--font-data); font-size: var(--step--1); color: #c2bbae; min-height: 44px; display: inline-flex; align-items: center; }

/* a dream: a parchment card */
.dc-card { position: absolute; z-index: 6; top: 76px; right: max(16px, env(safe-area-inset-right, 0px)); bottom: 16px; width: min(420px, calc(100% - 32px)); overflow-y: auto;
  background: var(--dc-parch); color: var(--dc-ink); box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55); overscroll-behavior: contain;
  background-image: radial-gradient(ellipse at 20% 0%, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0) 60%); }
.dc-card-in { padding: 26px 26px 22px; display: grid; gap: 12px; }
.dc-card .label { color: #6a5a3e; font-size: 0.82rem; letter-spacing: 0.08em; text-transform: uppercase; outline: none; }
.dc-c-text { font-family: var(--font-display); font-size: clamp(1.18rem, 2vw, 1.35rem); line-height: 1.5; color: #17140f; }
.dc-c-symbols { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.dc-c-symbols li { font-family: var(--font-data); font-size: 0.85rem; padding: 3px 10px; border-radius: 999px; border: 1px solid #b7a37c; color: #3b3324; }
.dc-c-status { font-family: var(--font-data); font-size: var(--step--1); color: var(--dc-ink-2); font-style: italic; }
.dc-c-status:empty { display: none; }
.dc-c-near-h { font-size: 1.15rem; font-style: italic; padding-top: 10px; border-top: 1px solid #d3c5a6; color: #2b251b; }
.dc-c-near { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.dc-c-near button { width: 100%; text-align: left; cursor: pointer; padding: 10px 12px; min-height: 44px; border: 1px solid #cdbd9a; border-radius: 10px; background: rgba(255, 255, 255, 0.35);
  color: var(--dc-ink); font-family: var(--font-body); font-size: 1rem; line-height: 1.4; display: grid; gap: 4px; }
.dc-c-near button span { font-family: var(--font-data); font-size: 0.78rem; color: #5b4e37; }
@media (hover: hover) and (pointer: fine) { .dc-c-near button:hover { border-color: #7a5a1e; background: rgba(255, 255, 255, 0.6); } }
.dc-c-near button:focus-visible, .dc-card .btn:focus-visible, .dc-c-report:focus-visible { outline: 2px solid #7a4a12; outline-offset: 2px; }
.dc-c-near-empty { font-style: italic; color: var(--dc-ink-2); font-size: 0.98rem; }
.dc-c-actions { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin-top: 4px; }
.dc-card .btn { color: var(--dc-ink); border-color: var(--dc-ink); min-height: 44px; cursor: pointer; }
.dc-card .btn.primary { background: var(--dc-ink); color: var(--dc-parch); }
@media (hover: hover) and (pointer: fine) { .dc-card .btn.primary:hover { background: #6b4612; border-color: #6b4612; } }
.dc-c-report { border: 0; background: none; padding: 0; min-height: 44px; cursor: pointer; font-family: var(--font-data); font-size: 0.85rem; color: #5b4e37; text-decoration: underline;
  text-underline-offset: 3px; }
.dc-c-report:disabled { cursor: default; text-decoration: none; }
@media (max-width: 899px) {
  .dc-card { top: auto; left: 0; right: 0; bottom: 0; width: auto; max-height: 62%; border-radius: 16px 16px 0 0; padding-bottom: env(safe-area-inset-bottom, 0px); }
  .dc-card-in { padding: 20px 18px 18px; gap: 10px; }
}

/* writing a dream */
.dc-write { position: absolute; inset: 0; z-index: 7; display: grid; place-items: center; padding: 16px; overflow-y: auto; background: rgba(6, 8, 15, 0.78); }
.dc-write-in { width: min(560px, 100%); display: grid; gap: 12px; background: #11152a; border: 1px solid rgba(227, 207, 154, 0.3); padding: clamp(20px, 4vw, 30px); }
.dc-write-in .label { color: var(--dc-gold); }
.dc-write-in h2 { font-weight: 300; font-size: clamp(1.6rem, 3.4vw, 2.2rem); }
.dc-w-label { font-family: var(--font-data); font-size: var(--step--1); color: #d3ccbf; }
.dc-w-input { width: 100%; font-family: var(--font-body); font-size: 1.12rem; line-height: 1.5; padding: 12px 14px; min-height: 140px; resize: vertical; background: #090b16; color: var(--ink);
  border: 1px solid #6c6656; border-radius: 8px; }
.dc-w-input::placeholder { color: #8f887a; }
.dc-w-input:focus { outline: 2px solid var(--dc-gold); outline-offset: 1px; border-color: transparent; }
.dc-w-count { justify-self: end; color: #b5ad9f; margin-top: -6px; }
.dc-w-note { font-family: var(--font-data); font-size: var(--step--1); color: #d3ccbf; }
.dc-w-status { color: var(--dc-gold); font-family: var(--font-data); font-size: var(--step--1); }
.dc-w-status:empty { display: none; }
.dc-w-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.dc-w-actions .btn { min-height: 44px; cursor: pointer; }
.dc-write .btn.primary { background: var(--dc-gold); border-color: var(--dc-gold); color: #15130f; }
.dc-w-actions .btn:disabled { opacity: 0.6; cursor: progress; }

/* how it works */
.dc-about { padding-block: 72px; }
.dc-about .page { display: grid; gap: 20px; }
.dc-about .page > .label { color: var(--dc-gold); }
.dc-about h2 { font-weight: 300; font-size: clamp(2rem, 4vw, 3rem); letter-spacing: -0.02em; }
.dc-about-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
@media (max-width: 860px) { .dc-about-grid { grid-template-columns: 1fr; gap: 22px; } }
.dc-about-grid h3, .dc-safe-h { font-size: 1.3rem; margin-bottom: 6px; }
.dc-about-grid p, .dc-safe { color: #cfc6b8; max-width: var(--measure); }
.dc-safe-h { margin-top: 12px; }
.dc-back a { font-family: var(--font-data); font-size: var(--step--1); min-height: 44px; display: inline-flex; align-items: center; }

@media (prefers-reduced-motion: reduce) { .dc-pill, .dc-round { transition: none; } }
@media (forced-colors: active) { .dc-card, .dc-write-in, .dc-intro-card { border: 1px solid CanvasText; } }
