/* candy-hole.com -- one stylesheet, linked rather than inlined (the profile says
   inlineStylesheets: "never", which also keeps a <style> element out of the head
   sequence entirely).

   Every class token carries the cdh- prefix. The palette is taken from the game
   itself: a dark olive page, the lime of the play field, the cyan of the loading
   view and the yellow of the action button, which is a different direction from
   the dark blue-grey the neighbouring title of this studio uses. */

:root {
  --cdh-ink: #f2f6ea;
  --cdh-dim: #adbb9c;
  --cdh-page: #16210f;
  --cdh-slab: #1e2c15;
  --cdh-edge: #35492a;
  --cdh-lime: #8fd94a;
  --cdh-cyan: #4ec6e8;
  --cdh-gold: #f6cf3f;
  --cdh-wrap: 44rem;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body.cdh-sheet {
  margin: 0;
  padding: 0 1rem 3rem;
  background: var(--cdh-page);
  color: var(--cdh-ink);
  font: 400 1.0625rem/1.65 Georgia, "Iowan Old Style", "Times New Roman", serif;
}

a { color: var(--cdh-cyan); }
a:hover { color: var(--cdh-lime); }

/* --- header ------------------------------------------------------------- */

.cdh-top {
  max-width: var(--cdh-wrap);
  margin: 0 auto;
  padding: 1.5rem 0 1rem;
  border-bottom: 1px solid var(--cdh-edge);
}

.cdh-mark {
  display: block;
  margin: 0 0 1rem;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--cdh-ink);
  text-decoration: none;
}

.cdh-mark em {
  display: block;
  font: italic 400 0.9rem/1.4 inherit;
  color: var(--cdh-dim);
}

/* The handoff button. Its own surface, readable size, a whole line to itself on
   a phone. The children are pointer-events:none so the click target is always
   the anchor -- the age question dispatches on tagName rather than closest(). */
.cdh-door {
  display: block;
  padding: 0.85rem 1.1rem;
  border: 2px solid var(--cdh-gold);
  border-radius: 0.6rem;
  background: linear-gradient(#2d4019, #223113);
  color: var(--cdh-ink);
  text-decoration: none;
  box-shadow: 0 2px 0 #10190a;
}

.cdh-door:hover { background: linear-gradient(#36501d, #283915); color: var(--cdh-ink); }

.cdh-door b,
.cdh-door i,
.cdh-in > * {
  pointer-events: none;
}

.cdh-door b {
  display: block;
  font-size: 1.1rem;
  color: var(--cdh-gold);
}

.cdh-door i {
  display: block;
  font-size: 0.85rem;
  font-style: normal;
  color: var(--cdh-dim);
}

@media (min-width: 46rem) {
  .cdh-door { display: inline-block; }
}

.cdh-paths { margin-top: 1rem; }

.cdh-order {
  margin: 0;
  padding-left: 1.4rem;
  font-size: 0.95rem;
  color: var(--cdh-dim);
}

.cdh-order li { margin: 0.1rem 0; }
.cdh-order b { color: var(--cdh-lime); }

@media (min-width: 46rem) {
  .cdh-order { columns: 3; }
}

/* --- body --------------------------------------------------------------- */

.cdh-body {
  max-width: var(--cdh-wrap);
  margin: 0 auto;
}

.cdh-open h1 {
  margin: 1.8rem 0 0.6rem;
  font-size: 1.85rem;
  line-height: 1.22;
}

.cdh-lede {
  font-size: 1.1rem;
  color: #dbe6cd;
}

.cdh-steps {
  margin: 0.4rem 0 0;
  font-size: 0.85rem;
  color: var(--cdh-dim);
}

.cdh-steps a { margin-right: 0.6rem; }
.cdh-steps b { font-weight: 400; }

.cdh-part { margin: 2.1rem 0; }

.cdh-part h2 {
  margin: 0 0 0.5rem;
  font-size: 1.3rem;
  line-height: 1.3;
  color: var(--cdh-lime);
}

.cdh-sub {
  margin: 1.1rem 0 0;
  padding-left: 0.9rem;
  border-left: 3px solid var(--cdh-edge);
}

.cdh-sub h3 {
  margin: 0 0 0.3rem;
  font-size: 1.02rem;
  color: var(--cdh-ink);
}

.cdh-ladder {
  margin: 1rem 0 0;
  padding-left: 1.5rem;
  font-size: 0.97rem;
  color: #dbe6cd;
}

.cdh-ladder li { margin: 0.15rem 0; }

@media (min-width: 40rem) {
  .cdh-ladder { columns: 2; }
}

/* --- pictures ----------------------------------------------------------- */

.cdh-frame {
  margin: 1.6rem 0;
  padding: 0;
}

.cdh-frame img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 0.5rem;
  background: var(--cdh-slab);
}

.cdh-frame figcaption {
  margin-top: 0.45rem;
  font-size: 0.85rem;
  color: var(--cdh-dim);
}

.cdh-lead img { border: 1px solid var(--cdh-edge); }

/* --- questions ---------------------------------------------------------- */

.cdh-asks {
  margin: 2.4rem 0;
  padding: 1.1rem 1.2rem;
  border: 1px solid var(--cdh-edge);
  border-radius: 0.6rem;
  background: var(--cdh-slab);
}

.cdh-asks h2 {
  margin: 0 0 0.7rem;
  font-size: 1.2rem;
  color: var(--cdh-cyan);
}

.cdh-asks dl { margin: 0; }

.cdh-asks dt {
  margin-top: 0.9rem;
  font-weight: 700;
}

.cdh-asks dd {
  margin: 0.25rem 0 0;
}

.cdh-who {
  font-size: 0.88rem;
  color: var(--cdh-dim);
}

/* --- onward ------------------------------------------------------------- */

.cdh-end h2 {
  margin: 1.8rem 0 0.4rem;
  font-size: 1.1rem;
  color: var(--cdh-dim);
  font-weight: 400;
}

.cdh-next {
  margin: 0.35rem 0;
  font-size: 0.95rem;
  color: var(--cdh-dim);
}

/* --- foot --------------------------------------------------------------- */

.cdh-foot {
  max-width: var(--cdh-wrap);
  margin: 2.5rem auto 0;
  padding-top: 1.2rem;
  border-top: 1px solid var(--cdh-edge);
  font-size: 0.88rem;
  color: var(--cdh-dim);
}

/* --- the age question --------------------------------------------------- */

.cdh-ask {
  max-width: 30rem;
  padding: 1.3rem;
  border: 2px solid var(--cdh-cyan);
  border-radius: 0.7rem;
  background: var(--cdh-slab);
  color: var(--cdh-ink);
}

.cdh-ask::backdrop { background: rgba(8, 14, 5, 0.78); }

.cdh-ask h2 {
  margin: 0 0 0.6rem;
  font-size: 1.2rem;
  color: var(--cdh-cyan);
}

.cdh-ask p { margin: 0 0 0.9rem; }

.cdh-answer {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.cdh-in,
.cdh-out {
  padding: 0.7rem 1rem;
  border-radius: 0.5rem;
  font: inherit;
  text-align: center;
  cursor: pointer;
}

.cdh-in {
  border: 2px solid var(--cdh-lime);
  background: #2d4019;
  color: var(--cdh-ink);
  text-decoration: none;
  font-weight: 700;
}

.cdh-out {
  border: 1px solid var(--cdh-edge);
  background: transparent;
  color: var(--cdh-dim);
}

.cdh-lines {
  margin: 0.9rem 0 0;
  font-size: 0.85rem;
  color: var(--cdh-dim);
}

/* A remembered refusal does not suppress the question; it promotes the two
   numbers out of the small print the next time the box opens. */
.cdh-told .cdh-lines {
  order: -1;
  font-size: 1rem;
  color: var(--cdh-ink);
  border-left: 3px solid var(--cdh-cyan);
  padding-left: 0.7rem;
}

/* Scoped to [open] on purpose: without the attribute a <dialog> is display:none
   by the user-agent stylesheet, and an unscoped display rule here would put the
   box on the page permanently and cost the layout shift this element avoids. */
.cdh-ask[open].cdh-told {
  display: flex;
  flex-direction: column;
}
