:root {
  --p0: #1a9bf0;
  --p1: #e8202a;
  --p2: #d99a00;
  --p3: #7b4fd6;
  --p4: #12a36b;
  --p5: #e0559b;
}

.lj {
  max-width: 1080px;
  margin: 0 auto;
  padding: 16px 16px 48px;
}
.lj [hidden] {
  display: none !important;
}

/* ---------- setup ---------- */
.lj-setup {
  max-width: 480px;
  margin: 0 auto;
  display: grid;
  gap: 16px;
}
.lj-hero {
  text-align: center;
  padding: 8px 0 0;
}
.lj-hero h1 {
  font-size: 44px;
  line-height: 1.1;
  margin-bottom: 8px;
}
.lj-hero p {
  margin: 0;
  font-size: 16px;
  line-height: 1.6;
}
.lj-red {
  color: var(--sg-red);
}
.lj-count {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  font-weight: 500;
}
.lj-stepper {
  display: flex;
  align-items: center;
  gap: 12px;
}
.lj-stepper b {
  font-family: var(--sg-font-card);
  font-size: 24px;
  min-width: 20px;
  text-align: center;
}
.lj-stepper .sg-btn {
  width: 40px;
  font-size: 20px;
  padding: 0;
}
.lj-names {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}
.lj-name {
  display: flex;
  align-items: center;
  gap: 10px;
}
.lj-dot {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--sg-ink);
  background: var(--pc, var(--sg-ink));
}
.lj-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  font-size: 15px;
}
.lj-check input {
  width: 18px;
  height: 18px;
}
.lj-hint {
  margin: 10px 0 0;
  font-size: 14px;
  color: #6b6461;
  text-align: center;
}
.lj-rules summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 17px;
}
.lj-rules ul {
  margin: 12px 0 0;
  padding-left: 20px;
  line-height: 1.7;
  font-size: 15px;
}

/* ---------- game ---------- */
.lj-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  gap: 8px;
}
.lj-piles {
  display: flex;
  gap: 14px;
  font-size: 16px;
}
.lj-piles b {
  font-family: var(--sg-font-card);
}
.lj-bar-actions {
  display: flex;
  gap: 8px;
}
.lj-layout {
  display: grid;
  gap: 16px;
}
@media (min-width: 860px) {
  .lj-layout {
    grid-template-columns: minmax(0, 1fr) 320px;
    align-items: start;
  }
}

.lj-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  min-height: 420px;
}
.lj-turn {
  font-size: 20px;
}
.lj-turn b {
  font-size: 26px;
}
.lj-flip {
  --card-w: 76px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  min-height: calc(var(--card-w) * 1.4 + 6px);
  align-items: center;
  width: 100%;
}
.lj-flip .bust {
  box-shadow: 0 0 0 4px var(--sg-red), 0 3px 0 var(--sg-ink);
}
.lj-empty {
  color: #8b8481;
  font-size: 16px;
}
.lj-events {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}
.lj-events:empty {
  display: none;
}
.lj-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 4px;
  border-radius: 999px;
  background: #f3eee4;
  font-size: 14px;
}
.lj-chip .sg-card {
  border-width: 2px;
  box-shadow: none;
}
.lj-status {
  font-size: 17px;
  min-height: 26px;
}
.lj-status.bad {
  color: var(--sg-red);
  font-weight: 600;
  font-size: 20px;
}
.lj-status.good {
  color: #0f7a4f;
  font-weight: 600;
  font-size: 20px;
}
.lj-meter {
  width: 100%;
  max-width: 360px;
}
.lj-meter-label {
  font-size: 15px;
  margin-bottom: 6px;
}
.lj-meter-label b {
  font-family: var(--sg-font-card);
  font-size: 18px;
}
.lj-meter-track {
  height: 14px;
  border: 2.5px solid var(--sg-ink);
  border-radius: 999px;
  background: #fff;
  overflow: hidden;
}
.lj-meter-fill {
  height: 100%;
  width: 0;
  background: #22b573;
  transition: width 0.3s ease, background 0.3s;
}
.lj-meter-fill[data-level="mid"] {
  background: var(--sg-yellow);
}
.lj-meter-fill[data-level="high"] {
  background: var(--sg-red);
}
.lj-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  width: 100%;
  margin-top: auto;
}
.lj-actions .sg-btn {
  flex: 1 1 160px;
  max-width: 260px;
  font-size: 19px;
  min-height: 56px;
}
.lj-keys {
  margin: 0;
  font-size: 12px;
  color: #8b8481;
}
@media (hover: none) {
  .lj-keys {
    display: none;
  }
}

.lj-side {
  display: grid;
  gap: 12px;
}
.lj-players {
  display: grid;
  gap: 8px;
}
.lj-player {
  --pill-h: 30px;
  --row-gap: 4px;
  background: #fff;
  border: 2.5px solid #e2dccf;
  border-radius: 14px;
  padding: 8px 10px 10px;
}
.lj-player.cur {
  border-color: var(--pc);
  box-shadow: 0 0 0 2px var(--pc);
}
.lj-pname {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 500;
  margin-bottom: 6px;
}
.lj-pcount {
  margin-left: auto;
  font-family: var(--sg-font-card);
  font-weight: 600;
}
.lj-player .sg-pill.fresh {
  animation: lj-glow 1.2s ease-out 2;
}
@keyframes lj-glow {
  50% { transform: scale(1.15); }
}
.lj-log {
  list-style: none;
  margin: 0;
  padding: 0 4px;
  font-size: 13px;
  color: #6b6461;
  line-height: 1.6;
}
.lj-log li:first-child {
  color: var(--sg-ink);
}

/* ---------- end ---------- */
.lj-end {
  max-width: 520px;
  margin: 0 auto;
}
.lj-end-card {
  text-align: center;
  display: grid;
  gap: 10px;
}
.lj-eyebrow {
  margin: 0;
  font-size: 15px;
  color: #6b6461;
}
.lj-winner {
  font-size: 40px;
  margin: 0;
}
.lj-end-logo {
  font-size: 34px;
  margin: 0;
}
.lj-end .lj-players {
  text-align: left;
  margin: 6px 0;
}

/* ---------- big screen (stream / TV) ---------- */
body.lj-big .header,
body.lj-big .mobile-menu {
  display: none;
}
body.lj-big .lj {
  max-width: none;
  padding: 20px 28px;
}
body.lj-big .lj-layout {
  grid-template-columns: minmax(0, 1fr) 380px;
}
body.lj-big .lj-stage {
  min-height: calc(100vh - 110px);
  justify-content: center;
}
body.lj-big .lj-flip {
  --card-w: clamp(90px, 9vw, 150px);
}
body.lj-big .lj-turn {
  font-size: 30px;
}
body.lj-big .lj-turn b {
  font-size: 42px;
}
body.lj-big .lj-status {
  font-size: 24px;
}
body.lj-big .lj-meter {
  max-width: 520px;
}
body.lj-big .lj-meter-label {
  font-size: 20px;
}
body.lj-big .lj-player {
  --pill-h: 40px;
}
body.lj-big .lj-pname {
  font-size: 19px;
}

@media (max-width: 480px) {
  .lj-flip {
    --card-w: 60px;
  }
  .lj-stage {
    min-height: 380px;
  }
}

/* ---------- flip row slots: card + label ---------- */
.lj-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.lj-tag {
  min-height: 22px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  padding: 5px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.lj-tag:empty {
  padding: 0;
}
.lj-tag.go { background: var(--sg-yellow); color: var(--sg-ink); }
.lj-tag.stay { background: var(--sg-red); color: #fff; }
.lj-tag.good { background: #22b573; color: #fff; }
.lj-tag.bad { background: var(--sg-red); color: #fff; }
.lj-tag.muted { background: #e2dccf; color: #6b6461; }

/* action cards are used up, not kept: smaller, tilted, faded */
.lj-flip .sg-card.used {
  --card-w: 58px;
  transform: rotate(-6deg);
  opacity: 0.8;
  box-shadow: none;
}
.lj-flip .sg-card.used.pop {
  animation: lj-used-in 0.5s ease-out;
}
@keyframes lj-used-in {
  0% { transform: scale(1.4) rotate(0); opacity: 1; }
  100% { transform: rotate(-6deg); opacity: 0.8; }
}
.lj-flip .sg-card.bonus {
  box-shadow: 0 0 0 4px #22b573, 0 3px 0 var(--sg-ink);
}
.lj-flip .sg-card.crossed {
  opacity: 0.5;
  position: relative;
}
.lj-flip .sg-card.crossed::after {
  content: "✕";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: calc(var(--card-w) * 0.8);
  color: var(--sg-red);
  font-family: var(--sg-font-card);
}
.lj-ghost {
  border-style: dashed;
  box-shadow: none;
  background: #fff8e6;
  color: var(--sg-red);
  animation: lj-ghost 1.2s ease-in-out infinite;
}
@keyframes lj-ghost {
  50% { transform: translateY(-4px); }
}

/* ---------- GO!/STAY banner ---------- */
.lj-callout-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
}
.lj-callout-wrap:empty {
  display: none;
}
.lj-callout {
  width: 100%;
  max-width: 440px;
  display: grid;
  gap: 2px;
  padding: 10px 16px;
  border: 3px solid var(--sg-ink);
  border-radius: 16px;
  box-shadow: 0 4px 0 var(--sg-ink);
}
.lj-callout b {
  font-size: 22px;
  font-weight: 600;
}
.lj-callout span {
  font-size: 15px;
}
.lj-callout.go { background: var(--sg-yellow); color: var(--sg-ink); }
.lj-callout.stay { background: var(--sg-red); color: #fff; }
.lj-callout.good { background: #22b573; color: #fff; }
.lj-callout.muted { background: #f3eee4; color: var(--sg-ink); box-shadow: none; border-width: 2px; }
.lj-callout.muted b { font-size: 18px; }
.lj-pips {
  font-style: normal;
  letter-spacing: 4px;
  font-size: 18px;
}
.pop-in {
  animation: lj-pop-in 0.35s ease-out;
}
@keyframes lj-pop-in {
  0% { transform: scale(0.85); opacity: 0; }
  70% { transform: scale(1.04); }
  100% { transform: none; opacity: 1; }
}
body.lj-big .lj-callout { max-width: 640px; }
body.lj-big .lj-callout b { font-size: 32px; }
body.lj-big .lj-callout span { font-size: 20px; }
body.lj-big .lj-tag { font-size: 15px; }
body.lj-big .lj-flip .sg-card.used { --card-w: clamp(70px, 7vw, 110px); }
@media (prefers-reduced-motion: reduce) {
  .lj-ghost, .pop-in, .lj-flip .sg-card.used.pop { animation: none; }
}
