/*
 * Confetti design system — utility classes
 * Depends on --c-* tokens defined in gfh-core/assets/tokens.css
 * and Caprasimo + Outfit loaded in header.php.
 */

/* ── Base page override ─────────────────────────────────────────────────── */

body {
  background-color: var(--c-bg);
  color: var(--c-ink);
  font-family: var(--font-confetti-body);
}

/* ── Sticker primitive ──────────────────────────────────────────────────── */
/*
 * The single most important Confetti component.
 * A colored rounded rect with an offset solid ink "card" behind it.
 *
 * CSS custom properties (set inline on the element):
 *   --sticker-color    fill color (default: --c-pink)
 *   --sticker-offset   shadow offset in px (default: 5px)
 *   --sticker-radius   border-radius (default: 18px)
 *   --sticker-rot      rotation (default: 0deg)
 *   --sticker-padding  internal padding (default: 14px 18px)
 *
 * Usage:
 *   <span class="gfh-sticker" style="--sticker-color:var(--c-pink);">games</span>
 *   <button class="gfh-sticker gfh-sticker--btn" style="--sticker-color:var(--c-yellow);">＋ new room</button>
 */

.gfh-sticker {
  display: inline-block;
  background: var(--sticker-color, var(--c-pink));
  color: #fff;
  border: 2px solid var(--c-ink);
  border-radius: var(--sticker-radius, 18px);
  padding: var(--sticker-padding, 14px 18px);
  font-family: var(--font-confetti-display);
  line-height: 1;
  box-shadow: var(--sticker-offset, 5px) var(--sticker-offset, 5px) 0 0 var(--c-ink);
  transform: rotate(var(--sticker-rot, 0deg));
  /* margin-right/bottom to prevent layout overlap with the shadow tail */
  margin-right: var(--sticker-offset, 5px);
  margin-bottom: var(--sticker-offset, 5px);
  position: relative;
}

/* Interactive sticker (button/link) — adds press animation */
.gfh-sticker--btn {
  cursor: pointer;
  transition: transform 70ms ease, box-shadow 70ms ease;
  user-select: none;
  -webkit-user-select: none;
  text-decoration: none;
}

.gfh-sticker--btn:hover {
  box-shadow:
    calc(var(--sticker-offset, 5px) - 1px)
    calc(var(--sticker-offset, 5px) - 1px)
    0 0 var(--c-ink);
  transform: rotate(var(--sticker-rot, 0deg)) translate(1px, 1px);
}

.gfh-sticker--btn:active {
  box-shadow: 0 0 0 0 var(--c-ink);
  transform: rotate(var(--sticker-rot, 0deg))
    translate(var(--sticker-offset, 5px), var(--sticker-offset, 5px));
}

.gfh-sticker--btn:focus-visible {
  outline: 2px solid var(--c-pink);
  outline-offset: 3px;
}

/* Sticker on a dark/colored card — no offset drop-shadow */
.gfh-sticker--flat {
  box-shadow: none;
  margin-right: 0;
  margin-bottom: 0;
  background: var(--c-ink);
  color: #fff;
}

/* ── Sticker card (block-level) ─────────────────────────────────────────── */
/*
 * Block-level card variant. Wraps an element and adds the offset ink shadow.
 * Uses a pseudo-element so no extra markup is needed.
 *
 * Usage: <div class="gfh-sticker-card" style="--sticker-color:#fff;--sticker-offset:5px;">…</div>
 */

.gfh-sticker-card {
  position: relative;
  background: var(--sticker-color, #fff);
  border: 2px solid var(--c-ink);
  border-radius: var(--sticker-radius, 16px);
}

.gfh-sticker-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--c-ink);
  border-radius: inherit;
  transform: translate(var(--sticker-offset, 5px), var(--sticker-offset, 5px));
  z-index: -1;
}

/* ── Wordmark ───────────────────────────────────────────────────────────── */
/*
 * "games from homes" — three-part inline wordmark.
 * "games" = pink sticker, "from" = plain ink body text at half size, "homes" = blue sticker.
 *
 * Usage: <div class="gfh-wordmark" data-size="28">…</div>
 * The --wordmark-size custom prop scales all elements.
 */

.gfh-wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-confetti-display);
  font-size: var(--wordmark-size, 28px);
  line-height: 1;
}

.gfh-wordmark__games,
.gfh-wordmark__homes {
  display: inline-block;
  color: #fff;
  padding: 2px 12px 4px;
  border: 2px solid var(--c-ink);
  border-radius: 8px;
}

.gfh-wordmark__games {
  background: var(--c-pink);
  transform: rotate(-2deg);
}

.gfh-wordmark__homes {
  background: var(--c-blue);
  transform: rotate(2deg);
}

.gfh-wordmark__from {
  font-family: var(--font-confetti-body);
  font-weight: 700;
  color: var(--c-ink);
  font-size: calc(var(--wordmark-size, 28px) * 0.6);
}

/* ── Avatar ─────────────────────────────────────────────────────────────── */
/*
 * Initial-in-circle avatar. Display font for the chunky-bubble brand feel.
 *
 * Usage: <div class="gfh-avatar" style="--avatar-size:36px;--avatar-bg:var(--c-pink);">M</div>
 */

.gfh-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--avatar-size, 36px);
  height: var(--avatar-size, 36px);
  border-radius: 50%;
  background: var(--avatar-bg, var(--c-pink));
  color: var(--avatar-color, #fff);
  font-family: var(--font-confetti-display);
  font-size: calc(var(--avatar-size, 36px) * 0.42);
  line-height: 1;
  flex-shrink: 0;
}

/* ── Code chip ──────────────────────────────────────────────────────────── */
/*
 * Room code displayed in mono font on yellow background.
 * Usage: <span class="gfh-code-chip">TACO-42</span>
 */

.gfh-code-chip {
  display: inline-block;
  font-family: ui-monospace, monospace;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  background: var(--c-yellow);
  color: var(--c-ink);
  border: 2px solid var(--c-ink);
  border-radius: 6px;
}

/* ── Eyebrow / kicker ───────────────────────────────────────────────────── */

.gfh-eyebrow {
  font-family: var(--font-confetti-body);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c-ink-soft);
}

/* ── Confetti display headings ──────────────────────────────────────────── */

.gfh-display {
  font-family: var(--font-confetti-display);
  color: var(--c-ink);
  line-height: 1;
}

/* ── Buttons ────────────────────────────────────────────────────────────── */
/*
 * Primary: filled accent, white text, ink border + offset shadow.
 * Secondary: white fill, ink text.
 * Both use the sticker visual.
 */

.gfh-btn-confetti {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border: 2px solid var(--c-ink);
  border-radius: 12px;
  font-family: var(--font-confetti-body);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 4px 4px 0 0 var(--c-ink);
  transition: transform 70ms ease, box-shadow 70ms ease;
  user-select: none;
  -webkit-user-select: none;
}

.gfh-btn-confetti--primary {
  background: var(--c-pink);
  color: #fff;
}

.gfh-btn-confetti--secondary {
  background: #fff;
  color: var(--c-ink);
}

.gfh-btn-confetti:hover {
  box-shadow: 3px 3px 0 0 var(--c-ink);
  transform: translate(1px, 1px);
}

.gfh-btn-confetti:active {
  box-shadow: 0 0 0 0 var(--c-ink);
  transform: translate(4px, 4px);
}

.gfh-btn-confetti:focus-visible {
  outline: 2px solid var(--c-pink);
  outline-offset: 3px;
}

/* ── Inputs ─────────────────────────────────────────────────────────────── */

.gfh-input-confetti {
  display: block;
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--c-ink);
  border-radius: 12px;
  background: #fff;
  font-family: var(--font-confetti-body);
  font-size: 16px;
  font-weight: 600;
  color: var(--c-ink);
  outline: none;
  box-sizing: border-box;
}

.gfh-input-confetti:focus {
  outline: 2px solid var(--c-pink);
  outline-offset: 2px;
}

/* ── Confetti dot field ─────────────────────────────────────────────────── */
/*
 * Decorative scatter of small geometric shapes over the background.
 * Implemented as a CSS-only layered background pattern that tiles across
 * the element. Not animated (to avoid CPU drain on TV/cast views).
 *
 * Usage: add class to a position:relative container.
 * The dots are rendered via a pseudo-element that covers the full element.
 */

.gfh-confetti-bg {
  position: relative;
  overflow: hidden;
}

.gfh-confetti-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    /* pink circles */
    radial-gradient(circle, #ff3d8a 0, #ff3d8a 4px, transparent 4px),
    radial-gradient(circle, #ff3d8a 0, #ff3d8a 5px, transparent 5px),
    /* blue circles */
    radial-gradient(circle, #3b6dff 0, #3b6dff 4px, transparent 4px),
    radial-gradient(circle, #3b6dff 0, #3b6dff 3px, transparent 3px),
    /* yellow circles */
    radial-gradient(circle, #ffce2b 0, #ffce2b 5px, transparent 5px),
    radial-gradient(circle, #ffce2b 0, #ffce2b 3px, transparent 3px),
    /* mint circles */
    radial-gradient(circle, #37d29d 0, #37d29d 4px, transparent 4px),
    radial-gradient(circle, #37d29d 0, #37d29d 6px, transparent 6px),
    /* lilac circles */
    radial-gradient(circle, #a98cff 0, #a98cff 4px, transparent 4px),
    radial-gradient(circle, #a98cff 0, #a98cff 3px, transparent 3px);
  background-size:
    480px 360px, 620px 500px,
    540px 420px, 380px 580px,
    500px 380px, 660px 520px,
    580px 460px, 420px 340px,
    520px 600px, 360px 480px;
  background-position:
    60px 40px, 200px 220px,
    120px 180px, 300px 80px,
    380px 160px, 100px 300px,
    240px 120px, 480px 280px,
    320px 360px, 160px 460px;
  background-repeat: repeat;
  opacity: 0.55;
}

.gfh-confetti-bg > * {
  position: relative;
  z-index: 1;
}

/* Dense variant for celebration screens */
.gfh-confetti-bg--dense::before {
  opacity: 0.75;
  background-size:
    240px 180px, 320px 260px,
    280px 220px, 200px 300px,
    260px 200px, 340px 280px,
    300px 240px, 220px 180px,
    270px 320px, 190px 250px;
}

/* ── Site header (Confetti version) ─────────────────────────────────────── */

.gfh-site-header--confetti {
  background: var(--c-bg);
  border-bottom: 2px solid var(--c-ink);
  padding: 0;
}

.gfh-site-header--confetti .gfh-container {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-inline: 40px;
  max-width: 1440px;
}

/* ── Utility overrides ──────────────────────────────────────────────────── */

.gfh-text-pink    { color: var(--c-pink); }
.gfh-text-blue    { color: var(--c-blue); }
.gfh-text-yellow  { color: var(--c-yellow); }
.gfh-text-mint    { color: var(--c-mint); }
.gfh-text-lilac   { color: var(--c-lilac); }
.gfh-text-ink     { color: var(--c-ink); }
.gfh-text-soft    { color: var(--c-ink-soft); }
