/* Real or Fake Emoji Name.
 *
 * The referent is a conference name badge on a pinboard, not a quiz card. Flat
 * printed colour, one hard shadow, nothing rounded that would not be rounded
 * by a die cutter. The palette is loud on purpose: electric blue, badge red,
 * highlighter yellow. There is no warm off-white anywhere in this file, no
 * book serif, no earth tone and no soft gradient - PLAYBOOK §12.
 */

:root {
  --blue:   #1B31D8;
  --blue-d: #14259F;
  --red:    #E8262C;
  --white:  #FFFFFF;
  --ink:    #14161C;
  --yellow: #FFE800;
  --green:  #00B54A;

  --card:   #FFFFFF;
  --gutter: 20px;
  --wrap:   680px;

  --marker: "Permanent Marker", "Segoe Print", cursive;
  --heavy:  "Archivo Black", system-ui, sans-serif;
  --body:   Archivo, system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body.board {
  margin: 0;
  padding: 0 0 64px;
  background-color: var(--blue);
  /* The board itself. Two layers of dots at different sizes read as printed
     card rather than as a CSS pattern, which one size alone does not. */
  background-image:
    radial-gradient(rgba(255, 255, 255, .11) 1.4px, transparent 1.5px),
    radial-gradient(rgba(0, 0, 0, .14) 1px, transparent 1.1px);
  background-size: 22px 22px, 9px 9px;
  background-position: 0 0, 4px 6px;
  color: var(--white);
  font-family: var(--body);
  line-height: 1.5;
  overflow-x: hidden;
}

main { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

/* ------------------------------------------------------------------- top */

.top {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 44px var(--gutter) 8px;
  text-align: center;
}

h1 {
  margin: 0;
  font-family: var(--heavy);
  font-size: clamp(2rem, 9vw, 3.4rem);
  line-height: .96;
  letter-spacing: -.02em;
  text-transform: uppercase;
  color: var(--white);
  text-shadow: 3px 3px 0 var(--blue-d);
}

.intro {
  margin: 14px auto 0;
  max-width: 30ch;
  font-size: 1.02rem;
  color: rgba(255, 255, 255, .82);
}

/* ----------------------------------------------------------------- badge */

.stage {
  position: relative;
  margin: 26px auto 0;
  padding-top: clamp(96px, 30vw, 150px);
  max-width: 420px;
}

/* The emoji sits behind and above the badge, big enough to read as an object
   in the room rather than an icon in a list. */
.wearer {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%) rotate(-4deg);
  font-size: clamp(112px, 34vw, 168px);
  line-height: 1;
  filter: drop-shadow(0 10px 0 rgba(0, 0, 0, .22));
  animation: sway 5.5s ease-in-out infinite;
  user-select: none;
}

@keyframes sway {
  0%, 100% { transform: translateX(-50%) rotate(-4deg); }
  50%      { transform: translateX(-50%) rotate(3deg); }
}

.badge {
  position: relative;
  margin: 0;
  background: var(--card);
  color: var(--ink);
  border-radius: 4px;
  box-shadow: 10px 10px 0 rgba(0, 0, 0, .28);
  transform: rotate(-1.4deg);
  overflow: hidden;
}

.band {
  background: var(--red);
  color: var(--white);
  padding: 12px 16px 10px;
  text-align: center;
}

.hello {
  display: block;
  font-family: var(--heavy);
  font-size: clamp(1.9rem, 8vw, 2.6rem);
  line-height: .9;
  letter-spacing: .06em;
}

.mnis {
  display: block;
  margin-top: 4px;
  font-family: var(--body);
  font-weight: 600;
  font-size: .82rem;
  letter-spacing: .22em;
  text-transform: uppercase;
}

.blank {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: clamp(128px, 34vw, 164px);
  padding: 18px 18px 26px;
  /* The ruled line the name is written on. */
  background-image: linear-gradient(var(--ink), var(--ink));
  background-size: calc(100% - 36px) 2px;
  background-position: 18px calc(100% - 20px);
  background-repeat: no-repeat;
}

.claim {
  margin: 0;
  font-family: var(--marker);
  font-size: clamp(1.5rem, 7.2vw, 2.3rem);
  line-height: 1.12;
  text-align: center;
  color: var(--ink);
  /* Written, so it is never perfectly square to the card. */
  transform: rotate(-1deg);
  overflow-wrap: break-word;
  hyphens: none;
}

/* The badge is pinned, and the pin is the only circle on the page. In the
   corner, not the middle: centred it lands squarely on the O of HELLO, which
   at a glance reads as a rendering fault rather than as a pin. */
.pin {
  position: absolute;
  z-index: 2;
  top: 10px;
  left: 14px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: inset -2px -2px 0 rgba(0, 0, 0, .28), 0 2px 3px rgba(0, 0, 0, .35);
}

/* The verdict, drawn over the whole badge in marker. */
.mark {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.mark path {
  fill: none;
  stroke-width: 11;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: var(--len, 600);
  stroke-dashoffset: var(--len, 600);
}

.badge.drawn .mark path {
  animation: draw .42s cubic-bezier(.2, .7, .3, 1) forwards;
}

.badge.drawn .mark path:nth-child(2) { animation-delay: .2s; }

@keyframes draw { to { stroke-dashoffset: 0; } }

.badge.is-right .mark path { stroke: var(--green); }
.badge.is-wrong .mark path { stroke: var(--red); }

/* Answering knocks the badge a little crooked, the way a real one goes when
   somebody writes on it. */
.badge.drawn { transform: rotate(-3deg) translateY(2px); transition: transform .3s ease-out; }

/* --------------------------------------------------------------- answers */

.answer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 34px auto 0;
  max-width: 420px;
}

.ans {
  appearance: none;
  padding: 18px 10px;
  border: 0;
  border-radius: 4px;
  font-family: var(--heavy);
  font-size: clamp(1rem, 4.4vw, 1.2rem);
  text-transform: uppercase;
  letter-spacing: .01em;
  color: var(--ink);
  background: var(--white);
  box-shadow: 0 6px 0 rgba(0, 0, 0, .3);
  cursor: pointer;
  transition: transform .09s ease-out, box-shadow .09s ease-out;
}

.ans-real { background: var(--yellow); }
.ans-fake { background: var(--white); }

.ans:hover { transform: translateY(-2px); box-shadow: 0 8px 0 rgba(0, 0, 0, .3); }
.ans:active { transform: translateY(4px); box-shadow: 0 2px 0 rgba(0, 0, 0, .3); }
.ans:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }

.answer.spent { display: none; }

/* --------------------------------------------------------------- verdict */

.verdict { margin: 30px auto 0; max-width: 420px; text-align: center; }

.verdict-word {
  margin: 0;
  font-family: var(--heavy);
  font-size: clamp(2.2rem, 11vw, 3.2rem);
  line-height: .92;
  text-transform: uppercase;
  color: var(--yellow);
  text-shadow: 3px 3px 0 var(--blue-d);
}

.verdict.is-wrong .verdict-word { color: var(--white); }

.verdict-line { margin: 10px 0 0; font-size: 1.04rem; color: rgba(255, 255, 255, .9); }

/* The real name, when the claimed one was not it. Set in the marker face so
   it reads as the correction written underneath, not as a second claim. */
.truth {
  margin: 8px 0 0;
  font-family: var(--marker);
  font-size: clamp(1.4rem, 6.4vw, 1.9rem);
  line-height: 1.14;
  color: var(--yellow);
}

.truth:empty { display: none; }

.tally {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin: 22px 0 0;
  font-size: .9rem;
  color: rgba(255, 255, 255, .8);
}

.tally p { margin: 0; }

.streak { font-family: var(--heavy); color: var(--white); }

.share-run {
  appearance: none;
  margin: 18px 0 0;
  padding: 13px 26px;
  border: 0;
  border-radius: 4px;
  background: var(--red);
  color: var(--white);
  font-family: var(--heavy);
  font-size: .98rem;
  text-transform: uppercase;
  box-shadow: 0 5px 0 rgba(0, 0, 0, .3);
  cursor: pointer;
}

.share-run:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(0, 0, 0, .3); }
.share-run:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }
.share-run.done { background: var(--green); }

.tomorrow { margin: 16px 0 0; font-size: .86rem; color: rgba(255, 255, 255, .62); }

/* ------------------------------------------------------------------ deep */

.deep { margin: 56px auto 0; max-width: 620px; }

.deep-eyebrow {
  margin: 0;
  font-family: var(--body);
  font-weight: 600;
  font-size: .76rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--yellow);
}

.deep-head {
  margin: 6px 0 20px;
  font-family: var(--heavy);
  font-size: clamp(1.3rem, 5vw, 1.7rem);
  line-height: 1.12;
  color: var(--white);
}

.deep-item {
  border-top: 2px solid rgba(255, 255, 255, .22);
  padding: 4px 0;
}

.deep-item:last-of-type { border-bottom: 2px solid rgba(255, 255, 255, .22); }

.deep-item summary {
  padding: 14px 30px 14px 0;
  font-family: var(--body);
  font-weight: 600;
  font-size: 1.02rem;
  color: var(--white);
  cursor: pointer;
  list-style: none;
  position: relative;
}

.deep-item summary::-webkit-details-marker { display: none; }

.deep-item summary::after {
  content: "+";
  position: absolute;
  right: 2px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--heavy);
  font-size: 1.3rem;
  color: var(--yellow);
}

.deep-item[open] summary::after { content: "–"; }

.deep-body { padding: 0 0 18px; color: rgba(255, 255, 255, .84); }
.deep-body p { margin: 0 0 12px; }
.deep-body b { color: var(--yellow); font-weight: 600; }

/* ---------------------------------------------------------------- footer */

footer { margin: 56px auto 0; max-width: 620px; text-align: center; }

.foot-nav { display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; }

.foot-nav a,
footer a { color: var(--white); font-size: .9rem; }

.credit,
.disclaimer {
  margin: 14px 0 0;
  font-size: .8rem;
  color: rgba(255, 255, 255, .58);
}

/* --------------------------------------------------------------- motion */

@media (prefers-reduced-motion: reduce) {
  .wearer { animation: none; }
  .badge.drawn .mark path { animation: none; stroke-dashoffset: 0; }
  .badge.drawn { transition: none; }
  .ans { transition: none; }
}

/* ------------------------------------------------------------------ wide */

@media (min-width: 720px) {
  .stage { max-width: 460px; }
  .answer { max-width: 460px; }
  .verdict { max-width: 520px; }
}
