/* SFG FNF World — 16-bit Pixel Plaza, Sol's RNG Console, Luck Potions, Cutscenes & FNF Quiz */

.world-shell, .rng-console, .quiz-hud, .quiz-stage {
  border-radius: 20px;
  background: var(--card);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow);
  margin: 0 8px 18px;
}

.world-shell {
  padding: 10px 12px;
  background: radial-gradient(80% 70% at 50% 0%, rgba(57, 44, 255, 0.16), transparent 70%), var(--card);
}
.wv-zone, .wv-pill, .lf-chip, .luck-hero b, .cs-odds, .rng-eq-odds, .quiz-hud b {
  font-family: 'Silkscreen', var(--font);
  letter-spacing: 0.02em;
}
#worldCanvas {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* ---------- Live Watch-to-Farm Bar ---------- */
.live-farm-bar {
  margin: 0 8px 18px;
  padding: 12px 16px;
  border-radius: 16px;
  background: rgba(20, 19, 28, 0.78);
  border: 1px solid var(--line-2);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
}
.live-farm-bar.on {
  border-color: rgba(62, 224, 122, 0.55);
  background: linear-gradient(90deg, rgba(62, 224, 122, 0.12), rgba(20, 19, 28, 0.85));
}
.live-farm-bar.idle { border-color: rgba(255, 200, 61, 0.45); }
.lf-left { display: flex; align-items: center; gap: 10px; flex: 1 1 260px; min-width: 0; }
.lf-dot { width: 11px; height: 11px; border-radius: 50%; background: #6b6890; flex: none; }
.live-farm-bar.on .lf-dot { background: var(--ok); box-shadow: 0 0 12px var(--ok); animation: rec 1.4s infinite; }
.live-farm-bar.idle .lf-dot { background: var(--gold); }
.lf-copy { display: flex; flex-direction: column; min-width: 0; }
.lf-copy b { color: #fff; font-size: 14px; font-weight: 900; }
.lf-copy small { color: var(--muted); font-size: 12px; font-weight: 600; }
.lf-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; flex: 1 1 260px; }
.lf-chip { font-size: 11px; padding: 4px 9px; border-radius: 8px; background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line); color: var(--soft); }
.lf-chip.ok { color: var(--ok); border-color: rgba(62, 224, 122, 0.4); }
.lf-chip.gold { color: var(--gold); border-color: rgba(255, 200, 61, 0.45); }
.lf-prog { flex: 1 1 120px; min-width: 90px; height: 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.lf-prog i { display: block; height: 100%; background: linear-gradient(90deg, var(--down), var(--ok)); transition: width 0.5s linear; }
.lf-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Sol's RNG Roll Console ---------- */
.rng-console { padding: 20px; }
.rng-grid { display: grid; grid-template-columns: 220px minmax(0, 1fr) 220px; gap: 20px; align-items: center; }
.rng-eq {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px;
  padding: 14px 12px; border-radius: 16px; background: rgba(16, 14, 28, 0.72);
  border: 1px solid color-mix(in srgb, var(--rc, #8c84ff) 45%, transparent);
}
.rng-eq-stage {
  position: relative; width: 136px; height: 136px; border-radius: 14px;
  display: grid; place-items: center; padding: 8px; cursor: pointer;
  background: radial-gradient(circle at 50% 60%, color-mix(in srgb, var(--rc, #8c84ff) 32%, transparent), #121022 76%);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.rng-eq-img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.65)); }
.rng-eq-empty { font-size: 46px; opacity: 0.6; }
.rng-eq-odds {
  position: absolute; bottom: -8px; left: 50%; transform: translateX(-50%);
  white-space: nowrap; font-size: 10px; padding: 3px 8px; border-radius: 999px;
  background: var(--rc, #392cff); color: #12101a; font-weight: 700;
  box-shadow: 0 0 12px color-mix(in srgb, var(--rc, #392cff) 65%, transparent);
}
.rng-eq-name { margin-top: 6px; font-weight: 900; color: #fff; font-size: 15px; }
.rng-eq-sub { font-size: 12px; color: var(--muted); font-weight: 700; }
.rng-toggle { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700; color: var(--soft); cursor: pointer; user-select: none; }
.rng-toggle input { width: 16px; height: 16px; accent-color: var(--blue); cursor: pointer; }

.rng-center { display: grid; gap: 14px; min-width: 0; }
.rng-head-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.luck-hero {
  display: flex; flex-direction: column; align-items: flex-end; padding: 8px 14px; border-radius: 14px;
  background: linear-gradient(135deg, rgba(62, 224, 122, 0.18), rgba(57, 44, 255, 0.18));
  border: 1px solid rgba(62, 224, 122, 0.45);
}
.luck-hero small { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); }
.luck-hero b { font-size: 18px; color: var(--ok); text-shadow: 0 0 12px rgba(62, 224, 122, 0.45); }

.luck-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.lk-pill { font-size: 11px; font-weight: 800; padding: 4px 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line); color: var(--soft); }
.lk-pill.ok { color: var(--ok); border-color: rgba(62, 224, 122, 0.4); }
.lk-pill.gold { color: var(--gold); border-color: rgba(255, 200, 61, 0.45); }
.lk-pill.potion { color: #ff77c8; border-color: rgba(194, 75, 153, 0.5); }

.rng-btns { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.rng-roll-btn { min-width: 158px; }
.live-chat-roll { border-color: rgba(255, 45, 61, 0.5); background: rgba(255, 45, 61, 0.14); }
.rng-sub-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.reward-tile.mini { padding: 8px 14px; }
.reward-tile.mini .rt-ico { font-size: 22px; }
.reward-tile.mini .rt-txt b { font-size: 13px; }
.rng-pity { display: grid; gap: 12px; }

/* ---------- Potions & Recent Rolls ---------- */
.potions-section, .recent-rolls { margin: 0 8px 18px; }
.pot-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.potions-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.potion-card {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px;
  background: var(--card); border: 1px solid color-mix(in srgb, var(--pc) 38%, var(--line));
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.potion-card:hover { transform: translateY(-2px); border-color: var(--pc); box-shadow: 0 8px 24px color-mix(in srgb, var(--pc) 25%, transparent); }
.potion-card.active { border-color: var(--gold); box-shadow: 0 0 24px rgba(255, 200, 61, 0.3); }
.pot-ico { font-size: 30px; flex: none; filter: drop-shadow(0 0 10px var(--pc)); }
.pot-body { min-width: 0; display: grid; gap: 4px; flex: 1; }
.pot-body b { font-size: 14px; color: #fff; font-weight: 900; }
.pot-body p { margin: 0; font-size: 12px; color: var(--muted); font-weight: 600; line-height: 1.3; }
.pot-foot { margin-top: 4px; }

.rr-list { display: flex; flex-wrap: wrap; gap: 8px; }
.rr-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 999px;
  background: rgba(20, 19, 28, 0.72); border: 1px solid color-mix(in srgb, var(--rc) 45%, var(--line));
  color: #fff; font-size: 12px; font-weight: 800; cursor: pointer;
}
.rr-chip small { color: var(--muted); font-weight: 700; }
.rr-chip:hover { border-color: var(--rc); }

/* ---------- Sol's RNG Cutscene Overlay ---------- */
.rng-cutscene {
  position: fixed; inset: 0; z-index: 260;
  display: grid; place-items: center; padding: 20px;
  background: radial-gradient(circle at 50% 45%, rgba(28, 22, 70, 0.92), rgba(5, 4, 14, 0.96) 75%);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.cs-stage { position: relative; display: grid; place-items: center; width: min(560px, 92vw); aspect-ratio: 1; }
#rngStarCanvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.cs-reel {
  position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 6px;
  text-align: center; padding: 20px 28px; border-radius: 18px;
  background: rgba(14, 12, 26, 0.78); border: 2px solid var(--rc, #8c84ff);
  box-shadow: 0 0 36px color-mix(in srgb, var(--rc, #8c84ff) 55%, transparent);
}
.cs-reel b { font-size: clamp(22px, 4vw, 34px); font-weight: 900; color: #fff; text-shadow: 0 0 18px var(--rc, #8c84ff); }
.cs-reel span { font-family: 'Silkscreen', var(--font); font-size: 15px; color: var(--rc, #ffc83d); }
.cs-reel.tease { transform: scale(1.08); transition: transform 0.35s ease; }
.cs-skip { position: fixed; right: 20px; bottom: 20px; z-index: 5; }

.cs-reveal {
  display: grid; gap: 12px; justify-items: center; text-align: center; max-width: min(1040px, 96vw); max-height: 92vh; overflow-y: auto;
  padding: 16px; animation: csPop 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
@keyframes csPop { from { opacity: 0; transform: scale(0.84); } }
.cs-badge { padding: 4px 12px; border-radius: 999px; background: color-mix(in srgb, var(--rc) 25%, #14131c); border: 1px solid var(--rc); font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.12em; color: #fff; }
.cs-title { margin: 0; font-size: clamp(26px, 4.2vw, 42px); font-weight: 900; color: #fff; text-shadow: 0 0 24px var(--rc); }
.cs-odds { font-size: clamp(16px, 2.5vw, 22px); font-weight: 700; color: var(--gold); text-shadow: 0 0 16px rgba(255, 200, 61, 0.65); }
.cs-cards { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }
.cs-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 4px; }

/* ---------- Quiz Arena ---------- */
.quiz-wrap { display: grid; gap: 16px; }
.quiz-hud { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 18px; }
.qh-energy { flex: 1 1 280px; display: grid; gap: 6px; }
.qh-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.qh-row b { color: #fff; font-size: 14px; }
.qh-row small { color: var(--muted); font-weight: 700; }
.qh-bar { height: 10px; border-radius: 999px; background: rgba(20, 19, 28, 0.78); border: 1px solid var(--line); overflow: hidden; }
.qh-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--down), var(--gold)); transition: width 0.4s; }
.qh-streak { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.quiz-stage { padding: 24px; display: grid; gap: 16px; justify-items: center; text-align: center; }
.quiz-gate { display: grid; gap: 12px; justify-items: center; max-width: 440px; padding: 20px 0; }
.quiz-gate img { width: 92px; filter: drop-shadow(0 0 16px rgba(85, 74, 255, 0.6)); }
.quiz-prompt { font-size: clamp(19px, 2.6vw, 26px); max-width: 34ch; }
.quiz-media { display: grid; place-items: center; gap: 8px; padding: 14px 24px; border-radius: 16px; background: rgba(16, 14, 28, 0.72); border: 1px solid var(--line); min-width: min(260px, 100%); }
.quiz-media img { height: 168px; max-width: 240px; object-fit: contain; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.65)); }
.quiz-silhouette img { filter: brightness(0) drop-shadow(0 0 12px rgba(85, 74, 255, 0.6)); transition: filter 0.45s ease; }
.quiz-silhouette.revealed img { filter: drop-shadow(0 0 16px rgba(62, 224, 122, 0.55)); }
.qm-name { font-size: 16px; font-weight: 900; color: #fff; }
.quiz-quote { margin: 0; padding: 16px 22px; border-radius: 14px; border-left: 4px solid var(--blue); background: rgba(57, 44, 255, 0.14); font-size: 18px; font-style: italic; font-weight: 700; color: #fff; max-width: 52ch; }
.quiz-vs { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 16px; }
.qvs-card { display: grid; justify-items: center; gap: 4px; padding: 12px 16px; border-radius: 14px; background: rgba(16, 14, 28, 0.75); border: 1px solid var(--line-2); width: 170px; }
.qvs-card img { height: 112px; object-fit: contain; }
.qvs-card b { color: #fff; font-size: 14px; }
.qvs-card small { color: var(--muted); font-size: 11px; font-weight: 700; }
.qvs-sep { font-family: 'Silkscreen', var(--font); font-size: 20px; color: var(--gold); text-shadow: 0 0 12px rgba(255, 200, 61, 0.6); }

.quiz-opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; width: min(680px, 100%); }
.quiz-opt {
  padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--card-hi);
  color: #fff; font-size: 15px; font-weight: 800; cursor: pointer; transition: transform 0.15s, border-color 0.2s, background 0.2s;
}
.quiz-opt:hover:not(:disabled) { transform: translateY(-2px); border-color: var(--blue-bright); box-shadow: 0 6px 20px rgba(57, 44, 255, 0.35); }
.quiz-opt.correct { background: rgba(62, 224, 122, 0.22); border-color: var(--ok); color: #fff; box-shadow: 0 0 20px rgba(62, 224, 122, 0.35); }
.quiz-opt.wrong { background: rgba(255, 107, 114, 0.22); border-color: var(--bad); }

.quiz-feedback { display: grid; gap: 10px; justify-items: center; padding: 14px 18px; border-radius: 14px; background: rgba(20, 19, 28, 0.75); border: 1px solid var(--line); width: min(680px, 100%); }
.quiz-feedback.ok { border-color: rgba(62, 224, 122, 0.5); }
.quiz-feedback.bad { border-color: rgba(255, 107, 114, 0.5); }
.qf-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; font-size: 16px; color: #fff; }
.quiz-feedback p { margin: 0; color: var(--soft); font-size: 14px; font-weight: 600; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .rng-grid { grid-template-columns: 1fr; }
  .rng-pity { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .world-shell, .live-farm-bar, .rng-console, .potions-section, .recent-rolls, .quiz-hud, .quiz-stage { margin-left: 0; margin-right: 0; }
  .rng-pity { grid-template-columns: 1fr; }
  .quiz-opts { grid-template-columns: 1fr; }
  .rng-btns .btn { flex: 1 1 auto; }
}
