/*
 * FESTIVUS CASINO (Phase 8T): the Games entry card, the #/casino lobby, the
 * shared casino primitives (header, gold trim, marquee lights, light sweep,
 * felt tiles, status badges, premium buttons, the coming-soon treatment), the
 * Festivus 21 "← Festivus Casino" link and the Admin Console page.
 *
 * LINKED BY index.html, so it must stay small and Roulette-free: the wheel,
 * the board and the tray live in roulette.css, which scripts/roulette.js
 * injects only on #/casino/roulette (Part K, 46).
 *
 * PHONE FIRST, 320-1280 px. Nothing has a fixed pixel width (min()/clamp()/
 * fractions only); every control is at least the tap height; inputs are 16 px
 * so iOS does not zoom.
 *
 * NO INLINE STYLES (`style-src 'self'`): every state is a class.
 *
 * MOTION IS DECORATION. The marquee bulbs chase slowly and a soft light sweeps
 * the Games card now and then; under prefers-reduced-motion every animation
 * and transition here is switched off (bottom of this file). Every state is
 * also in WORDS and a symbol -- never colour alone.
 *
 * TOKENS: app.css / game.css / phase6.css ones only, plus the --cas-* ones
 * defined right here on .cas-scope (every casino root carries that class,
 * including the dialog panels the casino screens open).
 */

.cas-scope,
.casa,
.f21-casino-link {
  --cas-burgundy: #6e1129;
  --cas-burgundy-deep: #2b0711;
  --cas-black: #0c0809;
  --cas-felt: #0f4d33;
  --cas-felt-deep: #072a1c;
  --cas-gold: #e6be5a;
  --cas-gold-hi: #f9e5a6;
  --cas-gold-lo: #8f6a22;
  --cas-ivory: #fbf3df;
  --cas-dim: #dccdaa;
  --cas-red: #c8102e;
  --cas-ink: #17121a;
  --cas-green: #12884b;
  --cas-trim: 0 0 0 1px var(--cas-gold-lo) inset, 0 0 0 1px rgb(0 0 0 / 0.6), 0 10px 26px rgb(0 0 0 / 0.45);
}

/* ========================================================================== *
 * Shared primitives
 * ========================================================================== */

.cas-head {
  position: relative;
  display: grid;
  gap: var(--sp-1);
  justify-items: center;
  text-align: center;
  padding: var(--sp-4) var(--sp-3) var(--sp-3);
}

.cas-head__marquee {
  justify-self: stretch;
  margin-bottom: var(--sp-2);
}

.cas-head__kicker {
  margin: 0;
  font-size: var(--fs-eyebrow);
  font-weight: 800;
  letter-spacing: 0.32em;
  color: var(--cas-gold);
}

.cas-head__title {
  margin: 0;
  font-size: clamp(1.45rem, 7vw, 2.1rem);
  font-weight: 900;
  letter-spacing: 0.12em;
  line-height: 1.1;
  color: var(--cas-gold-hi);
  text-shadow: 0 2px 0 rgb(0 0 0 / 0.55), 0 0 18px rgb(230 190 90 / 0.25);
  overflow-wrap: anywhere;
}

.cas-head__subtitle {
  margin: 0;
  max-width: 34em;
  font-size: var(--fs-small);
  color: var(--cas-dim);
}

/* Marquee bulbs: two dot rows, one offset, blinking in turn -- a slow chase. */
.cas-marquee {
  position: relative;
  height: 10px;
  background: radial-gradient(circle at center, var(--cas-gold-hi) 0 2px, rgb(249 229 166 / 0.25) 2.5px, transparent 4px) 0 50% / 16px 10px repeat-x;
  opacity: 0.9;
}

.cas-marquee::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, var(--cas-gold-lo) 0 2px, transparent 2.5px) 8px 50% / 16px 10px repeat-x;
  animation: cas-bulbs 1.8s steps(1, end) infinite;
}

@keyframes cas-bulbs {
  0% { opacity: 1; }
  50% { opacity: 0.15; }
}

.cas-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: var(--tap);
  padding: 0 var(--sp-4);
  border: 1px solid var(--cas-gold-lo);
  border-radius: 999px;
  background: rgb(0 0 0 / 0.35);
  color: var(--cas-ivory);
  font: inherit;
  font-size: var(--fs-small);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  overflow-wrap: anywhere;
  transition: transform var(--motion-fast) var(--ease), box-shadow var(--motion-fast) var(--ease);
}

.cas-btn:active { transform: scale(0.97); }

.cas-btn--gold {
  border-color: var(--cas-gold-hi);
  background: linear-gradient(180deg, var(--cas-gold-hi), var(--cas-gold) 45%, var(--cas-gold-lo));
  color: var(--cas-ink);
  box-shadow: 0 2px 0 rgb(0 0 0 / 0.45), 0 0 14px rgb(230 190 90 / 0.25);
  text-shadow: 0 1px 0 rgb(255 255 255 / 0.35);
}

/* 8W: "2 CHALLENGES WAITING" -- loud, and in words, never colour alone. */
.cas-btn--alert {
  border-color: var(--holly);
  background: var(--holly);
  color: #fff;
  text-shadow: none;
}

.cas-btn:disabled,
.cas-btn[aria-disabled="true"] {
  opacity: 0.45;
  cursor: default;
  box-shadow: none;
}

.cas-btn:focus-visible,
.casino-card:focus-visible,
.cas-scope button:focus-visible,
.cas-scope a:focus-visible {
  outline: 3px solid var(--cas-gold-hi);
  outline-offset: 2px;
}

.cas-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: var(--fs-eyebrow);
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.6;
  border: 1px solid transparent;
}

.cas-badge--ok { background: var(--cas-ivory); color: var(--cas-felt-deep); }
.cas-badge--done { background: var(--cas-gold); color: var(--cas-ink); }
.cas-badge--off { background: rgb(0 0 0 / 0.45); color: var(--cas-dim); border-color: rgb(220 205 170 / 0.35); }
.cas-badge--soon { background: var(--cas-burgundy); color: var(--cas-gold-hi); border-color: var(--cas-gold-lo); }
.cas-badge--alert { background: var(--holly); color: #fff; }

.cas-section {
  display: grid;
  gap: var(--sp-3);
  min-width: 0;
}

.cas-section__title {
  margin: 0;
  font-size: var(--fs-eyebrow);
  font-weight: 900;
  letter-spacing: 0.24em;
  color: var(--cas-gold);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.cas-section__title::before,
.cas-section__title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cas-gold-lo), transparent);
}

.cas-section__text {
  margin: 0;
  color: var(--cas-dim);
  font-size: var(--fs-body);
}

.cas-footnote {
  margin: 0;
  font-size: var(--fs-small);
  color: var(--cas-dim);
  text-align: center;
  opacity: 0.85;
}

.cas-empty {
  display: grid;
  gap: var(--sp-3);
  justify-items: center;
  text-align: center;
}

.cas-empty__text {
  margin: 0;
  color: var(--cas-ivory);
}

/* ========================================================================== *
 * The Games entry card (Part A)
 * ========================================================================== */

.casino-card-host {
  margin: 0 0 var(--sp-3);
  min-width: 0;
}

.casino-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--sp-2) var(--sp-3);
  align-items: center;
  padding: var(--sp-2) var(--sp-3) var(--sp-3);
  border: 2px solid var(--cas-gold);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(120% 90% at 85% 0%, rgb(110 17 41 / 0.95), transparent 60%),
    radial-gradient(90% 80% at 0% 100%, rgb(15 77 51 / 0.9), transparent 65%),
    var(--cas-black);
  box-shadow: var(--cas-trim);
  color: var(--cas-ivory);
  text-decoration: none;
}

.casino-card__marquee {
  grid-column: 1 / -1;
}

.casino-card__sweep {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(105deg, transparent 42%, rgb(249 229 166 / 0.16) 50%, transparent 58%) 160% 0 / 260% 100% no-repeat;
  animation: cas-sweep 8s ease-in-out infinite;
}

@keyframes cas-sweep {
  0%, 55% { background-position: 160% 0; }
  85%, 100% { background-position: -60% 0; }
}

.casino-card__words {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.casino-card__kicker {
  font-size: var(--fs-eyebrow);
  font-weight: 800;
  letter-spacing: 0.38em;
  color: var(--cas-gold);
}

.casino-card__title {
  font-size: clamp(1.7rem, 9vw, 2.4rem);
  font-weight: 900;
  letter-spacing: 0.16em;
  line-height: 1;
  color: var(--cas-gold-hi);
  background: linear-gradient(180deg, var(--cas-gold-hi), var(--cas-gold) 55%, var(--cas-gold-lo));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 0 rgb(0 0 0 / 0.6));
}

.casino-card__tag {
  font-size: var(--fs-small);
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--cas-ivory);
}

.casino-card__games {
  font-size: var(--fs-small);
  color: var(--cas-dim);
}

.casino-card__status {
  margin-top: var(--sp-1);
  font-size: var(--fs-small);
  font-weight: 700;
  color: var(--cas-gold-hi);
  overflow-wrap: anywhere;
}

.casino-card__enter {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap);
  padding: 0 var(--sp-4);
  border: 1px solid var(--cas-gold-hi);
  border-radius: 999px;
  background: linear-gradient(180deg, var(--cas-gold-hi), var(--cas-gold) 45%, var(--cas-gold-lo));
  color: var(--cas-ink);
  font-weight: 900;
  font-size: var(--fs-body);
  letter-spacing: 0.1em;
  text-align: center;
  box-shadow: 0 2px 0 rgb(0 0 0 / 0.5);
}

.casino-card:active .casino-card__enter { transform: scale(0.98); }

/* ========================================================================== *
 * CSS-drawn art (no images): chips, cards, a little wheel
 * ========================================================================== */

.cas-art {
  position: relative;
  display: grid;
  place-items: center;
  min-width: clamp(56px, 18vw, 84px);
  aspect-ratio: 1;
}

.cas-art__card {
  position: absolute;
  display: grid;
  place-items: center;
  width: 46%;
  aspect-ratio: 5 / 7;
  border-radius: 6px;
  background: var(--cas-ivory);
  border: 1px solid var(--cas-dim);
  color: var(--cas-ink);
  font-weight: 900;
  font-size: clamp(0.7rem, 3vw, 0.95rem);
  box-shadow: 0 3px 8px rgb(0 0 0 / 0.5);
}

.cas-art__card--a { transform: translateX(-24%) rotate(-10deg); }
.cas-art__card--b { transform: translateX(24%) rotate(9deg); color: var(--cas-red); }

.cas-art__chip {
  position: absolute;
  width: 58%;
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle, var(--cas-red) 0 46%, transparent 47%),
    repeating-conic-gradient(var(--cas-ivory) 0 15deg, var(--cas-red) 15deg 45deg);
  border: 2px solid var(--cas-gold);
  box-shadow: 0 3px 6px rgb(0 0 0 / 0.55);
  transform: translate(-26%, 18%);
}

.cas-art__chip--b {
  background:
    radial-gradient(circle, var(--cas-felt) 0 46%, transparent 47%),
    repeating-conic-gradient(var(--cas-ivory) 0 15deg, var(--cas-felt) 15deg 45deg);
  transform: translate(-6%, -2%);
}

.cas-art--hero .cas-art__card--b {
  transform: translate(30%, -8%) rotate(12deg);
}

.cas-art__wheel {
  width: 84%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 3px solid var(--cas-gold);
  background:
    radial-gradient(circle, var(--cas-gold) 0 9%, var(--cas-gold-lo) 10% 14%, transparent 15%),
    radial-gradient(circle, transparent 0 52%, rgb(0 0 0 / 0.35) 53% 56%, transparent 57%),
    conic-gradient(var(--cas-green) 0 10deg, var(--cas-red) 10deg 20deg, var(--cas-ink) 20deg 30deg, var(--cas-red) 30deg 40deg, var(--cas-ink) 40deg 50deg, var(--cas-red) 50deg 60deg, var(--cas-ink) 60deg 70deg, var(--cas-red) 70deg 80deg, var(--cas-ink) 80deg 90deg, var(--cas-red) 90deg 100deg, var(--cas-ink) 100deg 110deg, var(--cas-red) 110deg 120deg, var(--cas-ink) 120deg 130deg, var(--cas-red) 130deg 140deg, var(--cas-ink) 140deg 150deg, var(--cas-red) 150deg 160deg, var(--cas-ink) 160deg 170deg, var(--cas-red) 170deg 180deg, var(--cas-ink) 180deg 190deg, var(--cas-red) 190deg 200deg, var(--cas-ink) 200deg 210deg, var(--cas-red) 210deg 220deg, var(--cas-ink) 220deg 230deg, var(--cas-red) 230deg 240deg, var(--cas-ink) 240deg 250deg, var(--cas-red) 250deg 260deg, var(--cas-ink) 260deg 270deg, var(--cas-red) 270deg 280deg, var(--cas-ink) 280deg 290deg, var(--cas-red) 290deg 300deg, var(--cas-ink) 300deg 310deg, var(--cas-red) 310deg 320deg, var(--cas-ink) 320deg 330deg, var(--cas-red) 330deg 340deg, var(--cas-ink) 340deg 350deg, var(--cas-red) 350deg 360deg);
  box-shadow: 0 3px 10px rgb(0 0 0 / 0.55);
}

/* Phase 8X: the Festivus Slots tile -- three little reels, a crown between two stars. */
.cas-art--slots {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3px;
  padding: 6px 4px;
  border: 2px solid var(--cas-gold);
  border-radius: 10px;
  background: var(--cas-burgundy-deep);
  box-shadow: 0 3px 10px rgb(0 0 0 / 0.55);
}

.cas-art__reel {
  display: grid;
  place-items: center;
  min-height: 100%;
  border-radius: 4px;
  background: var(--cas-ink);
  color: var(--cas-gold);
  font-size: var(--fs-body);
  font-weight: 900;
  line-height: 1;
}

.cas-art__reel--mid { color: var(--cas-gold-hi); box-shadow: inset 0 0 0 1px var(--cas-gold-hi); }

/* Phase 8Y: the Festivus Connect Four tile -- a 3 x 3 corner of the board, gold stars and evergreen rings. */
.cas-art--connect-four {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3px;
  padding: 6px;
  border: 2px solid var(--cas-gold);
  border-radius: 10px;
  background: var(--cas-burgundy);
  box-shadow: 0 3px 10px rgb(0 0 0 / 0.55);
}

.cas-art__hole {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--cas-ink);
}

.cas-art__hole--star { background: radial-gradient(circle at 34% 28%, var(--cas-gold-hi), var(--cas-gold) 50%, var(--cas-gold-lo)); }
.cas-art__hole--ring { background: radial-gradient(circle, var(--cas-green) 0 22%, var(--snow) 23% 36%, var(--cas-green) 37%); }

/* Phase 8Z: the Festivus Fleet Battle tile -- a 3 x 3 corner of a target grid: a miss (dot), a hit (cross), a sunk vessel (filled, struck). */
.cas-art--fleet-battle {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2px;
  padding: 5px;
  border: 2px solid var(--cas-gold);
  border-radius: 10px;
  background: var(--cas-felt-deep);
  box-shadow: 0 3px 10px rgb(0 0 0 / 0.55);
}

.cas-art__sea {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 2px;
  background: var(--cas-felt);
  color: var(--snow);
  font-size: 0.7rem;
  font-weight: 900;
  line-height: 1;
}

.cas-art__sea--hit { background: var(--cas-burgundy); color: var(--cas-gold-hi); }
/* Phase 9J: the Festivus Color Clash tile -- three little cards fanned out, each a colour AND its glyph. */
.cas-art__cc {
  position: absolute;
  display: grid;
  place-items: center;
  width: 42%;
  aspect-ratio: 5 / 7;
  border: 2px solid var(--cas-ivory);
  border-radius: 5px;
  box-shadow: 0 3px 8px rgb(0 0 0 / 0.5);
  font-size: 0.85rem;
  font-weight: 900;
  line-height: 1;
}

.cas-art__cc--evergreen { background: rgb(31 110 74); color: var(--cas-ivory); transform: translateX(-38%) rotate(-14deg); }
.cas-art__cc--gold { background: rgb(255 214 0); color: var(--cas-ink); z-index: 1; }
.cas-art__cc--cranberry { background: rgb(160 28 58); color: var(--cas-ivory); transform: translateX(38%) rotate(14deg); z-index: 2; }

.cas-art__sea--sunk { background: var(--cas-burgundy-deep); color: var(--cas-gold-hi); box-shadow: inset 0 0 0 1px var(--cas-gold); }

/* ========================================================================== *
 * The lobby (Part B)
 * ========================================================================== */

.casino {
  display: grid;
  gap: var(--sp-4);
  min-width: 0;
  padding: 0 var(--sp-3) var(--sp-4);
  border: 2px solid var(--cas-gold-lo);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(130% 60% at 50% 0%, rgb(110 17 41 / 0.85), transparent 70%),
    radial-gradient(100% 50% at 50% 100%, rgb(7 42 28 / 0.9), transparent 75%),
    var(--cas-black);
  box-shadow: var(--cas-trim);
  color: var(--cas-ivory);
}

.cas-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
  gap: var(--sp-3);
}

.cas-tile {
  position: relative;
  display: grid;
  gap: var(--sp-3);
  align-content: start;
  min-width: 0;
  padding: var(--sp-3);
  border: 2px solid var(--cas-gold);
  border-radius: var(--radius);
  background:
    radial-gradient(110% 80% at 30% 20%, var(--cas-felt), var(--cas-felt-deep));
  box-shadow: var(--cas-trim);
}

.cas-tile__top {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  min-width: 0;
}

.cas-tile__top .cas-art {
  min-width: clamp(52px, 15vw, 68px);
  flex: none;
}

.cas-tile__title {
  margin: 0;
  font-size: var(--fs-title);
  font-weight: 900;
  letter-spacing: 0.12em;
  color: var(--cas-gold-hi);
  overflow-wrap: anywhere;
}

.cas-tile__lines {
  margin: 0;
  display: grid;
  gap: var(--sp-2);
}

.cas-tile__line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-1) var(--sp-2);
}

.cas-tile__label {
  font-size: var(--fs-small);
  color: var(--cas-dim);
  letter-spacing: 0.04em;
}

.cas-tile__value {
  margin: 0;
  font-weight: 800;
  font-size: var(--fs-small);
}

.cas-tile__actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
  gap: var(--sp-2);
}

.cas-tile__actions:empty { display: none; }

.cas-tile__note {
  margin: 0;
  font-size: var(--fs-small);
  color: var(--cas-dim);
}

.cas-tile--soon {
  border-style: dashed;
  border-color: var(--cas-gold-lo);
  background:
    repeating-linear-gradient(135deg, rgb(255 255 255 / 0.025) 0 10px, transparent 10px 20px),
    radial-gradient(110% 80% at 30% 20%, rgb(110 17 41 / 0.7), var(--cas-burgundy-deep));
}

.cas-tile--soon .cas-art { opacity: 0.6; }

/* ========================================================================== *
 * Festivus 21 -> the casino (navigation only; festivus21.js adds the link)
 * ========================================================================== */

.f21-casino-link {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  border-color: var(--cas-gold-lo);
  color: var(--cas-gold-hi);
  text-decoration: none;
}

/* ========================================================================== *
 * Admin Console page (admin-casino.js)
 * ========================================================================== */

.casa {
  display: grid;
  gap: var(--sp-4);
  min-width: 0;
}

.casa__block {
  display: grid;
  gap: var(--sp-2);
  padding: var(--sp-3);
  border: 1px solid var(--line);
  border-top: 2px solid var(--cas-gold-lo);
  border-radius: var(--radius);
  background: var(--bg-elev);
  min-width: 0;
}

.casa__title {
  margin: 0;
  font-size: var(--fs-title);
}

.casa-kv {
  margin: 0;
  display: grid;
  gap: var(--sp-1);
  min-width: 0;
}

.casa-kv__row {
  display: grid;
  grid-template-columns: minmax(0, 12em) minmax(0, 1fr);
  gap: var(--sp-2);
  padding: var(--sp-1) 0;
  border-bottom: 1px solid var(--line-soft);
  min-width: 0;
}

.casa-kv__row dt { color: var(--text-dim); font-size: var(--fs-small); overflow-wrap: anywhere; }
.casa-kv__row dd { margin: 0; font-size: var(--fs-small); overflow-wrap: anywhere; min-width: 0; }

.casa__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  padding: var(--sp-2) 0;
  border-bottom: 1px solid var(--line-soft);
  overflow-wrap: anywhere;
  min-width: 0;
}

.casa__row > span { min-width: 0; flex: 1 1 14em; }

.casa__controls {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.casa__controls .field__input {
  flex: 1 1 10em;
  min-height: var(--tap);
  font-size: 16px;
}

/* Phase 8Y.2: a Connect Four timing control -- label, "Now: 1 hour", [number][unit][Save], wrapping on a phone. */
.casa__timing {
  display: grid;
  gap: var(--sp-1);
  padding: var(--sp-2) 0;
  border-bottom: 1px solid var(--line-soft);
  min-width: 0;
}

.casa__timing-label { font-weight: 800; }
.casa__timing-now { font-size: var(--fs-small); color: var(--text-dim); }
.casa__controls .casa__timing-unit { flex: 0 1 8em; }

.casa__hidden {
  margin: 0;
  padding: var(--sp-2) var(--sp-3);
  border-left: 3px solid var(--warn);
  background: var(--bg-elev-2);
  color: var(--text);
  font-size: var(--fs-small);
}

.casa__verdict {
  margin: 0;
  font-weight: 800;
}

.casa__problems,
.casa__fixed {
  margin: 0;
  padding-left: 1.2em;
  font-size: var(--fs-small);
  color: var(--text-dim);
  overflow-wrap: anywhere;
}

@media (max-width: 479px) {
  .casa-kv__row { grid-template-columns: minmax(0, 1fr); gap: 0; }
}

@media (min-width: 640px) {
  .casino { padding: 0 var(--sp-5) var(--sp-5); }
  .casino-card { grid-template-columns: auto minmax(0, 1fr) auto; padding: var(--sp-2) var(--sp-4) var(--sp-4); }
  .casino-card__enter { grid-column: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .cas-scope,
  .cas-scope *,
  .cas-scope *::before,
  .cas-scope *::after,
  .casino-card,
  .casino-card * {
    animation: none !important;
    transition: none !important;
  }
}

/* ========================================================================== *
 * p9k Package 4 -- THE CLASSIC COLOR CLASH LAUNCH MARQUEE (Home, 48 hours)
 * One link: four card glyphs, the words, PLAY NOW. Wraps on a phone, one row on
 * a wide screen; at least 44 px tall; the shimmer is skipped under reduced motion.
 * ========================================================================== */

.ccl-host { margin-block: 0.75rem; }
.ccl {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.6rem 0.85rem;
  min-block-size: 44px;
  padding: 0.85rem 1rem;
  overflow: hidden;
  border: 2px solid rgb(255 214 0);
  border-radius: var(--radius);
  background: linear-gradient(120deg, rgb(18 88 57), rgb(6 46 29) 60%, rgb(28 98 214 / 0.55));
  color: rgb(255 255 255);
  text-decoration: none;
  box-shadow: 0 0 18px rgb(255 214 0 / 0.35);
}
.ccl:focus-visible { outline: 3px solid rgb(255 214 0); outline-offset: 3px; }
.ccl__cards { display: inline-flex; }
.ccl__card {
  display: grid;
  place-items: center;
  inline-size: 1.7rem;
  block-size: 2.4rem;
  margin-inline-start: -0.45rem;
  border: 2px solid rgb(255 255 255 / 0.85);
  border-radius: 0.3rem;
  font-size: 0.9rem;
  transform: rotate(-8deg);
}
.ccl__card:first-child { margin-inline-start: 0; }
.ccl__card--evergreen { background: rgb(31 110 74); }
.ccl__card--gold { background: rgb(255 214 0); color: rgb(30 20 2); transform: rotate(-3deg); }
.ccl__card--cranberry { background: rgb(160 28 58); transform: rotate(3deg); }
.ccl__card--frost { background: rgb(28 98 214); transform: rotate(8deg); }
.ccl__text { display: grid; gap: 0.1rem; min-width: 0; }
.ccl__kicker { font-size: 0.7rem; font-weight: 900; letter-spacing: 0.12em; color: rgb(255 214 0); }
.ccl__title { font-size: 1.15rem; font-weight: 900; letter-spacing: 0.04em; overflow-wrap: anywhere; }
.ccl__sub { font-size: 0.85rem; color: rgb(232 244 238); }
.ccl__cta {
  grid-column: 1 / -1;
  justify-self: stretch;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  background: rgb(255 214 0);
  color: rgb(30 20 2);
  font-weight: 900;
  letter-spacing: 0.08em;
  text-align: center;
}
.ccl::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgb(255 255 255 / 0.14) 50%, transparent 60%) 160% 0 / 260% 100% no-repeat;
  animation: ccl-shine 3.2s ease-in-out 3;
  pointer-events: none;
}
@keyframes ccl-shine { to { background-position: -60% 0; } }
@media (prefers-reduced-motion: reduce) { .ccl::after { animation: none; } }
@media (min-width: 640px) {
  .ccl { grid-template-columns: auto minmax(0, 1fr) auto; }
  .ccl__cta { grid-column: auto; justify-self: end; }
}

/* ========================================================================== *
 * p9k Package 5 -- THE HOME GAME CENTER
 * Invitations and games in play; one compact line when there are none. Every
 * button and link at least 44 px; rows wrap on a phone, never scroll sideways.
 * ========================================================================== */

.gc-host { margin-block: 0.75rem; }
.gc { display: grid; gap: 0.5rem; padding: 0.75rem 0.85rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-elev); min-width: 0; }
.gc.is-empty { gap: 0.25rem; padding-block: 0.5rem; }
.gc__head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.gc__title { margin: 0; font-size: 0.95rem; font-weight: 900; letter-spacing: 0.1em; }
.gc__casino { display: inline-flex; align-items: center; min-block-size: 44px; padding-inline: 0.5rem; color: var(--accent); font-weight: 800; text-decoration: none; }
.gc__empty, .gc__message { margin: 0; color: var(--text-dim); font-size: 0.9rem; }
.gc__message { color: var(--text); }
.gc__sub { margin: 0.25rem 0 0; font-size: 0.75rem; font-weight: 900; letter-spacing: 0.1em; color: var(--text-dim); }
.gc__list { display: grid; gap: 0.5rem; margin: 0; padding: 0; list-style: none; }
.gc__item { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.4rem 0.75rem; padding: 0.55rem 0.65rem; border: 1px solid var(--line); border-radius: var(--radius-sm); min-width: 0; }
.gc__item--invite { border-color: rgb(255 214 0 / 0.7); }
.gc__item.is-your-turn { border-color: var(--warn); box-shadow: 0 0 10px rgb(240 180 41 / 0.3); }
.gc__text { min-width: 0; flex: 1 1 12rem; }
.gc__item--invite > .gc__who, .gc__item--invite > .gc__facts { flex: 1 1 100%; }
.gc__who { margin: 0; font-weight: 900; letter-spacing: 0.04em; overflow-wrap: anywhere; }
.gc__facts { margin: 0; color: var(--text-dim); font-size: 0.85rem; overflow-wrap: anywhere; }
.gc__actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.gc__btn { display: inline-flex; align-items: center; justify-content: center; min-block-size: 44px; min-inline-size: 44px; padding: 0 1rem; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); color: var(--text); font: inherit; font-weight: 900; letter-spacing: 0.06em; text-decoration: none; cursor: pointer; }
.gc__btn--accept, .gc__btn--rejoin { border-color: rgb(255 214 0); background: rgb(255 214 0); color: rgb(30 20 2); }
.gc__btn[disabled] { opacity: 0.6; cursor: default; }

/* ========================================================================== *
 * p9k Package 6 -- THE SITE-WIDE INVITATION ALERT
 * One small banner above the tab bar (safe area included), never covering the
 * page's top; VIEW and ✕ are 44 px; it slides in briefly (none under reduced motion).
 * ========================================================================== */

.ia {
  position: fixed;
  inset-inline: max(var(--gutter, 16px), env(safe-area-inset-left));
  inset-block-end: calc(var(--shell-nav-space, 5rem) + 0.75rem);
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  max-inline-size: 32rem;
  margin-inline: auto;
  padding: 0.45rem 0.5rem 0.45rem 0.85rem;
  border: 2px solid rgb(255 214 0);
  border-radius: var(--radius);
  background: var(--bg-elev);
  color: var(--text);
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.45);
  animation: ia-in 0.25s ease-out;
}
.ia__text { flex: 1 1 auto; min-width: 0; }
.ia__title { margin: 0; font-weight: 900; letter-spacing: 0.04em; font-size: 0.9rem; overflow-wrap: anywhere; }
.ia__sub { margin: 0; color: var(--text-dim); font-size: 0.75rem; overflow-wrap: anywhere; }
.ia__btn { display: inline-flex; align-items: center; justify-content: center; min-block-size: 44px; min-inline-size: 44px; padding: 0 0.85rem; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); color: var(--text); font: inherit; font-weight: 900; text-decoration: none; cursor: pointer; }
.ia__btn--view { border-color: rgb(255 214 0); background: rgb(255 214 0); color: rgb(30 20 2); }
@keyframes ia-in { from { transform: translateY(1rem); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .ia { animation: none; } }

