:root {
  --bg-deep: #07040c;
  --bg-panel: rgba(20, 11, 31, 0.84);
  --bg-card: rgba(28, 15, 42, 0.96);
  --border-subtle: rgba(255, 255, 255, 0.11);
  --border-highlight: rgba(255, 255, 255, 0.24);
  --text-main: #fdf2f8;
  --text-muted: #d8b4fe;
  --text-dim: #9d8bb8;

  --c1-color: #e8b88a;
  --c1-glow: rgba(232, 184, 138, 0.34);
  --c2-color: #f59342;
  --c2-glow: rgba(245, 147, 66, 0.38);
  --c3-color: #f43f6b;
  --c3-glow: rgba(244, 63, 107, 0.44);

  --p1-color: #64d2ff;
  --p1-glow: rgba(100, 210, 255, 0.65);
  --p2-color: #ff6482;
  --p2-glow: rgba(255, 100, 130, 0.65);

  --gold: #fbbf24;
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
  background-color: var(--bg-deep);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
  position: relative;
}

button,
input,
select,
textarea {
  font-family: inherit;
}

/* ==================== DARK SCROLLBARS (APPLE DARK) ==================== */
html,
body,
.modal-body,
.modal-backdrop {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 99px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.34);
}

/* ==================== AMBIENT FLOATING ORBS ==================== */
.ambient-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.ambient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(85px);
  opacity: 0.35;
  animation: floatOrb 16s ease-in-out infinite alternate;
}

.orb-1 {
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, #ff375f, transparent 70%);
  top: -100px;
  right: -80px;
}

.orb-2 {
  width: 380px;
  height: 380px;
  background: radial-gradient(circle, #30d158, transparent 70%);
  bottom: -90px;
  left: -80px;
  animation-delay: -5s;
}

.orb-3 {
  width: 340px;
  height: 340px;
  background: radial-gradient(circle, #ff6482, transparent 70%);
  top: 40%;
  left: 45%;
  animation-delay: -10s;
}

/* ==================== TOP BAR ==================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: rgba(11, 6, 18, 0.85);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border-subtle);
  gap: 14px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  width: 38px;
  height: 38px;
  min-width: 38px;
  aspect-ratio: 1 / 1;
  flex-shrink: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(255, 55, 95, 0.25), rgba(251, 191, 36, 0.15));
  border: 1px solid rgba(255, 55, 95, 0.45);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  line-height: 1;
  box-shadow: 0 0 18px rgba(255, 55, 95, 0.35);
}

.brand-title {
  font-size: 1.22rem;
  font-weight: 800;
  background: linear-gradient(90deg, #fff, #fda4af, #fbbf24);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 0.4px;
}

.brand-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 99px;
  background: rgba(255, 55, 95, 0.18);
  border: 1px solid rgba(255, 55, 95, 0.45);
  color: #fda4af;
  white-space: nowrap;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ==================== BUTTONS & ICONS ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  padding: 10px 15px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  user-select: none;
  white-space: normal;
}

.topbar-actions .btn {
  min-height: 44px;
  min-width: 44px;
  white-space: nowrap;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 1;
  font-style: normal;
}

.btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.13);
  border-color: var(--border-highlight);
  transform: translateY(-1px);
}

.btn:active:not(:disabled) {
  transform: translateY(0) scale(0.98);
}

.btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, #ff375f, #be185d);
  border-color: rgba(251, 113, 133, 0.55);
  box-shadow: 0 6px 20px rgba(255, 55, 95, 0.38);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #ff375f, #ff375f);
  box-shadow: 0 8px 26px rgba(255, 55, 95, 0.6);
}

/* ==================== MAIN LAYOUT ==================== */
.app-layout {
  position: relative;
  z-index: 1;
  max-width: 1420px;
  margin: 0 auto;
  padding: 20px 22px 44px;
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 24px;
  align-items: start;
}

@media (max-width: 1060px) {
  .app-layout {
    grid-template-columns: 1fr;
  }
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 76px;
}

@media (max-width: 1060px) {
  .sidebar {
    position: static;
  }
}

.panel {
  background: var(--bg-panel);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 18px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.5);
}

/* ==================== CIRCLE STATUS BANNER ==================== */
.circle-banner {
  border-radius: var(--radius-lg);
  padding: 15px 16px;
  border: 1px solid var(--border-subtle);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.01));
  transition: all 0.35s ease;
}

.circle-banner-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.circle-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.73rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 4px 11px;
  border-radius: 99px;
}

.circle-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
}

.circle-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 3px;
}

/* ==================== PLAYERS CARDS ==================== */
.players-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.player-card {
  position: relative;
  border-radius: var(--radius-md);
  padding: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.09);
  transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease, background 0.28s ease;
}

.player-card.active-turn {
  background: rgba(255, 255, 255, 0.07);
  transform: translateY(-2px);
}

.player-card.p1.active-turn {
  border-color: var(--p1-color);
  box-shadow: 0 0 24px rgba(100, 210, 255, 0.25);
}

.player-card.p2.active-turn {
  border-color: var(--p2-color);
  box-shadow: 0 0 24px rgba(255, 100, 130, 0.25);
}

.player-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.player-identity {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.player-avatar {
  width: 42px;
  height: 42px;
  min-width: 42px;
  min-height: 42px;
  aspect-ratio: 1 / 1;
  flex-shrink: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  line-height: 1;
}

.p1 .player-avatar {
  background: rgba(100, 210, 255, 0.18);
  border: 2px solid var(--p1-color);
  box-shadow: 0 0 14px var(--p1-glow);
}

.p2 .player-avatar {
  background: rgba(255, 100, 130, 0.18);
  border: 2px solid var(--p2-color);
  box-shadow: 0 0 14px var(--p2-glow);
}

.player-info-text {
  min-width: 0;
}

.player-name {
  font-weight: 800;
  font-size: 1rem;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-pos-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.turn-pill {
  flex-shrink: 0;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 10px;
  border-radius: 99px;
  display: none;
}

.player-card.active-turn .turn-pill {
  display: inline-flex;
  align-items: center;
  background: linear-gradient(90deg, #ff375f, #ff6482);
  color: #fff;
  box-shadow: 0 0 12px rgba(255, 55, 95, 0.55);
  animation: pulseGlow 2s infinite;
}

.player-tokens-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 11px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.8rem;
  flex-wrap: wrap;
}

.token-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 99px;
  background: rgba(251, 191, 36, 0.14);
  border: 1px solid rgba(251, 191, 36, 0.4);
  color: #fde68a;
  font-size: 0.76rem;
  font-weight: 700;
}

.clothes-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  border-radius: 99px;
  background: rgba(255, 100, 130, 0.14);
  border: 1px solid rgba(255, 100, 130, 0.35);
  color: #fbcfe8;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  transition: background 0.18s ease, transform 0.15s ease;
}

.clothes-chip:hover {
  background: rgba(255, 255, 255, 0.14);
  transform: translateY(-1px);
}

.task-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 6px;
}

/* ==================== 3D DICE DOCK ==================== */
.dice-dock {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.dice-stage-wrapper {
  perspective: 600px;
  margin: 4px 0;
}

.dice-stage {
  width: 104px;
  height: 104px;
  min-width: 104px;
  min-height: 104px;
  aspect-ratio: 1 / 1;
  border-radius: 26px;
  background: radial-gradient(circle at 30% 25%, #3b1754, #170826 75%);
  border: 2px solid rgba(255, 55, 95, 0.65);
  box-shadow:
    0 12px 32px rgba(255, 55, 95, 0.32),
    inset 0 2px 14px rgba(255, 255, 255, 0.18);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.28s ease;
  user-select: none;
  position: relative;
}

.dice-stage:hover {
  transform: translateY(-4px) rotateX(8deg) rotateY(-8deg) scale(1.05);
  box-shadow:
    0 16px 40px rgba(255, 55, 95, 0.55),
    inset 0 2px 16px rgba(255, 255, 255, 0.25);
}

.dice-stage.rolling {
  animation: diceRoll3D 0.65s cubic-bezier(0.36, 0.07, 0.19, 0.97) infinite;
}

.dice-stage.landed-burst {
  animation: diceLandedPop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.dice-value {
  font-size: 2rem;
  font-weight: 900;
  color: #fff;
  line-height: 1.05;
  text-shadow: 0 2px 12px rgba(255, 55, 95, 0.7);
}

.dice-sub {
  font-size: 0.74rem;
  font-weight: 700;
  color: #fda4af;
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.dice-result-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  min-height: 22px;
  font-weight: 500;
}

.btn-roll-main {
  width: 100%;
  padding: 14px 20px;
  font-size: 1.02rem;
  font-weight: 800;
  border-radius: var(--radius-md);
  letter-spacing: 0.3px;
}

/* ==================== BOARD AREA ==================== */
.board-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ==================== SPIRAL BOARD VIEW ==================== */
.circle-gate-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 700;
  white-space: nowrap;
}

.player-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.player-pos-short {
  display: none;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text-muted);
  flex-shrink: 0;
}

.btn-roll-main.turn-p1 {
  background: linear-gradient(135deg, #0284c7, #2563eb);
  border-color: rgba(100, 210, 255, 0.65);
  box-shadow: 0 6px 20px rgba(100, 210, 255, 0.38);
}

.btn-roll-main.turn-p1:hover:not(:disabled) {
  background: linear-gradient(135deg, #0ea5e9, #3b82f6);
  box-shadow: 0 8px 26px rgba(100, 210, 255, 0.55);
}

.btn-roll-main.turn-p2 {
  background: linear-gradient(135deg, #ff375f, #ff375f);
  border-color: rgba(244, 114, 182, 0.65);
  box-shadow: 0 6px 20px rgba(255, 100, 130, 0.42);
}

.btn-roll-main.turn-p2:hover:not(:disabled) {
  background: linear-gradient(135deg, #ff375f, #ff6482);
  box-shadow: 0 8px 26px rgba(255, 100, 130, 0.6);
}

/* Full Bedroom Night Mode (X-03: OLED #000, ~40% dimmer accents, 18-20px task font) */
body.night-mode {
  background-color: #000000 !important;
  color: #e4d5e8;
}

body.night-mode .ambient-orb {
  opacity: 0.08 !important;
}

body.night-mode .panel,
body.night-mode .topbar,
body.night-mode .modal-card,
body.night-mode .dice-dock,
body.night-mode .circle-banner,
body.night-mode .player-card,
body.night-mode .turn-handoff-card,
body.night-mode .skip-undo-toast,
body.night-mode .pending-task-banner {
  background: rgba(10, 10, 12, 0.98) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  box-shadow: none !important;
}

body.night-mode .rings-hero-card,
body.night-mode .carousel-tile {
  background: rgba(12, 12, 14, 0.96) !important;
  border-color: rgba(255, 255, 255, 0.07) !important;
  box-shadow: none !important;
}

body.night-mode .btn-primary,
body.night-mode .btn-roll-main.turn-p1,
body.night-mode .btn-roll-main.turn-p2 {
  filter: brightness(0.68) saturate(0.8);
}

body.night-mode .task-description {
  font-size: 1.12rem;
  line-height: 1.56;
  color: rgba(235, 235, 245, 0.88);
  background: transparent;
}

body.night-mode .task-title {
  font-size: 1.32rem;
  color: rgba(255, 255, 255, 0.94);
}

body.night-mode .topbar-icon-btn[aria-pressed="true"],
body.night-mode .finale-dim-btn[aria-pressed="true"] {
  background: rgba(251, 191, 36, 0.16);
  border-color: rgba(251, 191, 36, 0.45);
  color: #fde68a;
}

/* ==================== DYNAMIC ROOM MOOD BY CIRCLE (X-01) ==================== */
body {
  transition: background-color 1.2s ease;
}

.ambient-orb {
  transition: background 1.4s ease, opacity 1.4s ease;
}

body[data-circle="1"] {
  background-color: #040b0e;
}

body[data-circle="1"] .orb-1 {
  background: radial-gradient(circle, #30d158, transparent 70%);
  opacity: 0.34;
}

body[data-circle="1"] .orb-2 {
  background: radial-gradient(circle, #06b6d4, transparent 70%);
  opacity: 0.28;
}

body[data-circle="1"] .orb-3 {
  background: radial-gradient(circle, #6366f1, transparent 70%);
  opacity: 0.24;
}

body[data-circle="2"] {
  background-color: #0d060a;
}

body[data-circle="2"] .orb-1 {
  background: radial-gradient(circle, #ff9f0a, transparent 70%);
  opacity: 0.34;
}

body[data-circle="2"] .orb-2 {
  background: radial-gradient(circle, #be123c, transparent 70%);
  opacity: 0.32;
}

body[data-circle="2"] .orb-3 {
  background: radial-gradient(circle, rgba(255, 255, 255, 0.04), transparent 70%);
  opacity: 0.25;
}

body[data-circle="3"] {
  background-color: #09090b;
}

body[data-circle="3"] .orb-1 {
  background: radial-gradient(circle, rgba(255, 55, 95, 0.24), transparent 70%);
  opacity: 0.9;
}

body[data-circle="3"] .orb-2 {
  background: radial-gradient(circle, rgba(136, 19, 55, 0.18), transparent 70%);
  opacity: 0.9;
}

body[data-circle="3"] .orb-3 {
  background: radial-gradient(circle, rgba(255, 255, 255, 0.035), transparent 70%);
  opacity: 0.35;
}

/* ==================== TOY SELECTOR CARDS ==================== */
.toys-selector-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

@media (max-width: 560px) {
  .toys-selector-grid {
    grid-template-columns: 1fr;
  }
}

.toy-option-card {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.toy-option-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 159, 10, 0.45);
}

.toy-option-card.selected {
  background: linear-gradient(135deg, rgba(255, 159, 10, 0.18), rgba(255, 55, 95, 0.14));
  border-color: #ff9f0a;
  box-shadow: 0 0 20px rgba(255, 159, 10, 0.25);
}

.toy-option-icon {
  width: 38px;
  height: 38px;
  min-width: 38px;
  min-height: 38px;
  aspect-ratio: 1 / 1;
  flex-shrink: 0;
  border-radius: 10px;
  background: rgba(255, 159, 10, 0.2);
  border: 1px solid rgba(255, 159, 10, 0.45);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  line-height: 1;
}

.toy-option-title {
  font-size: 0.9rem;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 6px;
}

.toy-option-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
  line-height: 1.35;
}

.active-toys-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.toy-pill-active {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.75rem;
  font-weight: 600;
}

/* ==================== UPGRADED MODALS (FIXED & POLISHED) ==================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 2, 11, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
  overflow-y: auto;
}

.modal-backdrop.open {
  display: flex;
  animation: backdropFadeIn 0.22s ease forwards;
}

.modal-card {
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - 40px);
  background: linear-gradient(165deg, rgba(35, 18, 52, 0.98), rgba(18, 9, 29, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 26px;
  box-shadow:
    0 25px 70px rgba(0, 0, 0, 0.82),
    0 0 45px rgba(255, 55, 95, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalSpringIn 0.34s cubic-bezier(0.34, 1.56, 0.64, 1);
  margin: auto;
}

.modal-card.modal-wide {
  max-width: 860px;
}

.modal-card.card-flip-anim {
  animation: cardFlipReveal 0.42s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 24px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.02);
  flex-shrink: 0;
}

.modal-body {
  padding: 20px 24px 24px;
  overflow-y: auto;
  flex: 1 1 auto;
}

.modal-close {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  aspect-ratio: 1 / 1;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-main);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.05rem;
  line-height: 1;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: rgba(255, 55, 95, 0.28);
  border-color: rgba(255, 55, 95, 0.6);
  transform: rotate(90deg);
}

/* Task Modal Specifics (M-03: Zero-scroll layout) */
.task-modal-header {
  padding: 12px 18px;
}

.task-modal-body {
  padding: 14px 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.task-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.task-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 5px 12px;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.task-title {
  font-size: 1.24rem;
  font-weight: 800;
  margin: 0;
  line-height: 1.24;
  color: #fff;
}

.task-performer-banner {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin: 0;
  font-size: 0.92rem;
  font-weight: 700;
}

.task-special-note {
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(251, 191, 36, 0.14);
  border: 1px solid rgba(251, 191, 36, 0.4);
  color: #fde68a;
  font-size: 0.84rem;
  line-height: 1.35;
}

.task-description {
  font-size: 1.02rem;
  line-height: 1.5;
  color: #fdf2f8;
  background: rgba(8, 4, 15, 0.45);
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-left: 4px solid #ff375f;
  margin: 0;
  box-shadow: inset 0 2px 12px rgba(0, 0, 0, 0.35);
}

/* Visual Pose Illustration (Clean 16:9 without overlaid badges) */
.task-visual-wrapper {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
}

.task-visual-svg-box {
  width: 100%;
  border-radius: 14px;
  background: #07040c;
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 0;
}

.cinematic-pose-card {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 180px;
  border-radius: 13px;
  overflow: hidden;
  background: #07040c;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cinematic-pose-card picture {
  display: block;
  width: 100%;
  height: 100%;
}

.cinematic-pose-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.cinematic-pose-img.mirror-x {
  transform: scaleX(-1);
}

.cinematic-pose-badges {
  position: absolute;
  left: 8px;
  right: 8px;
  top: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.pose-role-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.2;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
}

.pose-role-badge.badge-male {
  background: rgba(14, 116, 144, 0.62);
  border: 1px solid rgba(100, 210, 255, 0.6);
  color: #e0f2fe;
}

.pose-role-badge.badge-female {
  background: rgba(157, 23, 77, 0.62);
  border: 1px solid rgba(244, 114, 182, 0.6);
  color: #fce7f3;
}

.cinematic-pose-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 5px 10px;
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(248, 250, 252, 0.88);
  text-align: center;
  background: linear-gradient(to top, rgba(7, 4, 12, 0.82), rgba(7, 4, 12, 0));
  pointer-events: none;
}

/* PWA тост оновлення та банер встановлення */
.pwa-toast,
.pwa-install-banner {
  position: fixed;
  left: 50%;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 950;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: min(440px, calc(100vw - 24px));
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(20, 11, 31, 0.96);
  border: 1px solid rgba(244, 114, 182, 0.42);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #f8fafc;
  font-size: 0.84rem;
}

.pwa-install-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.pwa-toast-btn {
  padding: 8px 14px !important;
  font-size: 0.84rem !important;
  min-height: 44px !important;
}

.pwa-dismiss-btn {
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  min-height: 44px !important;
  font-size: 0.9rem !important;
}

/* Компактний юридичний футер та посилання в Age Gate */
.game-legal-footer {
  max-width: 1280px;
  margin: 8px auto 0;
  padding: 10px 16px calc(14px + env(safe-area-inset-bottom, 0px));
  text-align: center;
  font-size: 0.76rem;
  color: rgba(203, 213, 225, 0.72);
}

.game-legal-links,
.consent-legal-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0 2px;
}

.game-legal-links a,
.consent-legal-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 8px;
  color: rgba(235, 235, 245, 0.78);
  text-decoration: none;
  border-radius: 10px;
  transition: color 0.18s ease, background 0.18s ease;
}

.game-legal-links a:hover,
.consent-legal-links a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
  text-decoration: underline;
}

.game-legal-req {
  margin-top: 4px;
  font-size: 0.72rem;
  color: rgba(148, 163, 184, 0.78);
}

.consent-legal-links {
  margin-top: 10px;
  font-size: 0.75rem;
  color: rgba(148, 163, 184, 0.8);
}

/* Collapsed How-To Accordion */
.task-howto-accordion {
  border-radius: 12px;
  background: rgba(255, 100, 130, 0.08);
  border: 1px solid rgba(255, 100, 130, 0.28);
  overflow: hidden;
}

.task-howto-summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 13px;
  min-height: 44px;
  font-size: 0.88rem;
  font-weight: 700;
  color: #e9d5ff;
  cursor: pointer;
  user-select: none;
}

.task-howto-summary::-webkit-details-marker {
  display: none;
}

.task-howto-summary::after {
  content: "▾";
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.task-howto-accordion[open] .task-howto-summary::after {
  transform: rotate(180deg);
}

.task-howto-text {
  font-size: 0.86rem;
  line-height: 1.45;
  color: #e9d5ff;
  padding: 0 13px 11px;
}

/* Horizontal Compact Timer Bar (54px) */
.timer-bar-box {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  background: rgba(12, 6, 22, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.timer-progress-track {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
}

.timer-progress-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #ff375f, #ff6482, #fbbf24);
  transition: width 0.35s linear;
}

.timer-bar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 10px;
  min-height: 50px;
}

.timer-time-display {
  font-size: 1.42rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #fff;
  letter-spacing: 0.5px;
  padding-left: 4px;
}

.timer-bar-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.timer-btn-toggle {
  min-height: 44px;
  padding: 8px 14px;
  font-size: 0.9rem;
  background: rgba(255, 55, 95, 0.16);
  border-color: rgba(255, 55, 95, 0.45);
}

.timer-btn-mini {
  min-height: 44px;
  min-width: 50px;
  padding: 8px 10px;
  font-size: 0.88rem;
}

.timer-btn-icon {
  min-height: 44px;
  min-width: 44px;
  width: 44px;
  padding: 0;
  font-size: 1.15rem;
}

.task-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 2px;
}

.btn-complete-main {
  width: 100%;
  min-height: 52px;
  padding: 12px 16px;
  font-size: 1.02rem;
  font-weight: 800;
}

.task-secondary-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.task-secondary-row .btn:only-child,
.task-secondary-row.single-visible .btn {
  grid-column: 1 / -1;
}

/* ==================== UNDO SKIP TOAST (M-04) ==================== */
.skip-undo-toast {
  position: fixed;
  left: 50%;
  bottom: calc(88px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 95;
  width: min(calc(100% - 24px), 420px);
  padding: 8px 10px 8px 16px;
  border-radius: 14px;
  background: rgba(20, 10, 34, 0.96);
  border: 1px solid rgba(251, 191, 36, 0.45);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.72);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  animation: modalSpringIn 0.25s ease;
}

.skip-undo-text {
  font-size: 0.9rem;
  font-weight: 700;
  color: #fde68a;
}

.skip-undo-btn {
  min-height: 44px;
  padding: 8px 16px;
  background: rgba(251, 191, 36, 0.18);
  border-color: rgba(251, 191, 36, 0.55);
  color: #fff;
  font-weight: 800;
  flex-shrink: 0;
}

/* ==================== TURN HANDOFF OVERLAY (M-06) ==================== */
.turn-handoff-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(5, 2, 11, 0.76);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  cursor: pointer;
  animation: backdropFadeIn 0.2s ease;
}

.turn-handoff-card {
  width: min(100%, 340px);
  padding: 26px 22px;
  border-radius: 24px;
  text-align: center;
  background: linear-gradient(160deg, rgba(30, 15, 48, 0.98), rgba(14, 7, 24, 0.98));
  border: 2px solid var(--p1-color);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.75), 0 0 36px var(--p1-glow);
  animation: modalSpringIn 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.turn-handoff-card.handoff-p2 {
  border-color: var(--p2-color);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.75), 0 0 36px var(--p2-glow);
}

.turn-handoff-label {
  font-size: 0.86rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.turn-handoff-player {
  font-size: 1.55rem;
  font-weight: 900;
  color: #fff;
  line-height: 1.25;
}

.turn-handoff-tap {
  margin-top: 10px;
  font-size: 0.78rem;
  color: var(--text-dim);
}

/* Tokens & Actions inside Task Modal */
.btn-token-use {
  min-height: 44px;
  font-size: 0.9rem;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.38);
  color: #fde68a;
}

.btn-token-use:hover:not(:disabled) {
  background: rgba(251, 191, 36, 0.24);
  border-color: rgba(251, 191, 36, 0.65);
}

.btn-skip-safe {
  min-height: 44px;
  font-size: 0.9rem;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--text-muted);
}

.btn-skip-safe:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.player-setup-inline {
  display: grid;
  grid-template-columns: 1fr 112px;
  gap: 8px;
}

.gender-select {
  padding-left: 8px;
  padding-right: 8px;
}

.boundaries-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 10px 12px;
}

/* ==================== DARK TOGGLE SWITCHES & SELECTION DOTS (QW-04) ==================== */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 6px 2px;
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--text-main);
  user-select: none;
}

.toggle-row+.toggle-row {
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.toggle-label-text {
  flex: 1;
  line-height: 1.35;
}

.toggle-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 46px;
  height: 26px;
  flex-shrink: 0;
}

.toggle-switch input[type="checkbox"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  margin: 0;
  cursor: pointer;
  z-index: 2;
}

.toggle-track {
  width: 46px;
  height: 26px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  position: relative;
  transition: background 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.toggle-track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #e9d5ff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.22s ease;
}

.toggle-switch input[type="checkbox"]:checked+.toggle-track {
  background: linear-gradient(135deg, #ff375f, #ff6482);
  border-color: rgba(251, 113, 133, 0.7);
  box-shadow: 0 0 12px rgba(255, 55, 95, 0.4);
}

.toggle-switch input[type="checkbox"]:checked+.toggle-track::after {
  transform: translateX(20px);
  background: #fff;
}

.toggle-switch input[type="checkbox"]:focus-visible+.toggle-track {
  outline: 2px solid #fda4af;
  outline-offset: 2px;
}

.select-check-dot {
  width: 24px;
  height: 24px;
  min-width: 24px;
  min-height: 24px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.26);
  background: rgba(14, 7, 24, 0.75);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-left: auto;
  position: relative;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.select-check-dot.checked {
  background: linear-gradient(135deg, #ff375f, #ff6482);
  border-color: #fda4af;
  box-shadow: 0 0 10px rgba(255, 55, 95, 0.45);
}

.select-check-dot.checked::after {
  content: "";
  width: 6px;
  height: 11px;
  border-right: 2.2px solid #fff;
  border-bottom: 2.2px solid #fff;
  transform: rotate(42deg) translate(-1px, -1px);
}

/* ==================== PENDING TASK BANNER (QW-02) ==================== */
.pending-task-banner {
  position: sticky;
  top: 64px;
  z-index: 38;
  max-width: 1376px;
  margin: 10px auto 0;
  padding: 10px 14px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(44, 15, 62, 0.96), rgba(25, 10, 42, 0.96));
  border: 1px solid rgba(255, 55, 95, 0.55);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55), 0 0 20px rgba(255, 55, 95, 0.24);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.pending-task-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-size: 0.92rem;
  font-weight: 700;
  color: #fdf2f8;
}

.pending-task-info span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pending-task-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ff375f;
  box-shadow: 0 0 10px rgba(255, 55, 95, 0.85);
  flex-shrink: 0;
  animation: pulseGlow 1.6s infinite;
}

.pending-task-btn {
  flex-shrink: 0;
  padding: 9px 16px;
  min-height: 44px;
  font-size: 0.9rem;
}

/* ==================== HIGH-CONTRAST SVG CELL ICONS (QW-12) ==================== */
.node-svg-icon {
  width: 1.15em;
  height: 1.15em;
  vertical-align: -0.18em;
  display: inline-block;
  flex-shrink: 0;
  filter: drop-shadow(0 0 4px rgba(251, 207, 232, 0.45));
}

.consent-card {
  max-width: 500px;
}

.consent-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 0.92rem;
  color: #f3e8ff;
}

.consent-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 11px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.consent-agree-note {
  font-size: 0.84rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.38;
}

.btn-consent-confirm {
  width: 100%;
  min-height: 52px;
  padding: 13px 18px;
  font-size: 1rem;
  font-weight: 800;
  white-space: normal;
  line-height: 1.3;
}

.consent-decline-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  transition: color 0.18s ease;
}

.consent-decline-link:hover {
  color: var(--text-muted);
}

/* Forms & Editor */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 560px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

.form-label {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-muted);
}

.form-input,
.form-select,
.form-textarea {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(0, 0, 0, 0.38);
  color: #fff;
  font-size: 0.92rem;
  font-family: inherit;
}

.form-input:focus,
.form-select:focus {
  outline: none;
  border-color: #ff375f;
  box-shadow: 0 0 0 3px rgba(255, 55, 95, 0.2);
}

/* ==================== KEYFRAME ANIMATIONS ==================== */
@keyframes floatOrb {
  0% {
    transform: translate(0, 0) scale(1);
  }

  100% {
    transform: translate(35px, -30px) scale(1.12);
  }
}

@keyframes dashFlow {
  to {
    stroke-dashoffset: -220;
  }
}

@keyframes pulseGlow {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.72;
    transform: scale(0.96);
  }
}

@keyframes pulseCenter {

  0%,
  100% {
    transform: translate(-50%, -50%) scale(1);
  }

  50% {
    transform: translate(-50%, -50%) scale(1.08);
  }
}

@keyframes diceRoll3D {
  0% {
    transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg) scale(1);
  }

  25% {
    transform: rotateX(22deg) rotateY(-25deg) rotateZ(-12deg) scale(1.08);
  }

  50% {
    transform: rotateX(-20deg) rotateY(25deg) rotateZ(14deg) scale(1.12);
  }

  75% {
    transform: rotateX(15deg) rotateY(18deg) rotateZ(-10deg) scale(1.06);
  }

  100% {
    transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg) scale(1);
  }
}

@keyframes diceLandedPop {
  0% {
    transform: scale(0.82);
  }

  60% {
    transform: scale(1.14);
  }

  100% {
    transform: scale(1);
  }
}

@keyframes tokenBounceIn {
  0% {
    transform: scale(0.2) translateY(-10px);
    opacity: 0;
  }

  70% {
    transform: scale(1.15) translateY(0);
    opacity: 1;
  }

  100% {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

@keyframes nodeStepFlash {
  0% {
    transform: translate(-50%, -50%) scale(1);
  }

  50% {
    transform: translate(-50%, -50%) scale(1.26);
    box-shadow: 0 0 32px #fff;
  }

  100% {
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes backdropFadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes modalSpringIn {
  0% {
    opacity: 0;
    transform: translateY(22px) scale(0.93);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes cardFlipReveal {
  0% {
    transform: perspective(800px) rotateY(75deg) scale(0.92);
    opacity: 0.4;
  }

  100% {
    transform: perspective(800px) rotateY(0deg) scale(1);
    opacity: 1;
  }
}

/* ==================== MOBILE, TABLET & LAPTOP RESPONSIVE ENHANCEMENTS ==================== */
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100dvh;
  -webkit-tap-highlight-color: transparent;
}

/* Tablets & smaller laptops (<= 1060px) */
@media (max-width: 1060px) {
  .app-layout {
    padding: 14px 16px 32px;
    gap: 16px;
  }

  .players-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .dice-dock {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    gap: 12px;
  }

  .dice-stage-wrapper {
    margin: 0;
  }

  .dice-stage {
    width: 82px;
    height: 82px;
    min-width: 82px;
    min-height: 82px;
    border-radius: 20px;
  }

  .dice-value {
    font-size: 1.65rem;
  }

  .dice-result-desc {
    flex: 1;
    min-width: 160px;
    text-align: left;
    margin: 0 8px;
  }

  .btn-roll-main {
    width: auto;
    min-width: 210px;
  }
}

/* Smartphones (<= 680px) — Mobile-First Zero-Scroll Above the Fold (M-01) */
@media (max-width: 680px) {
  .topbar {
    height: 48px;
    padding: 2px 10px;
    gap: 6px;
    flex-wrap: nowrap;
  }

  .brand {
    gap: 7px;
    min-width: 0;
  }

  .brand-logo {
    width: 30px;
    height: 30px;
    min-width: 30px;
    border-radius: 9px;
    font-size: 1rem;
  }

  .brand-title {
    font-size: 0.98rem;
    white-space: nowrap;
  }

  .brand-badge {
    display: none;
  }

  .topbar-actions {
    gap: 5px;
    flex-wrap: nowrap;
    flex-shrink: 0;
  }

  .topbar-actions .btn {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    border-radius: 12px;
    font-size: 1.05rem;
  }

  .topbar-actions .btn-label-text {
    display: none;
  }

  .app-layout {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: calc(100dvh - 48px);
    padding: 6px 8px calc(82px + env(safe-area-inset-bottom));
    gap: 6px;
  }

  .sidebar {
    display: contents;
  }

  /* 1. Compact Circle Strip (36px) */
  .circle-banner {
    order: 1;
    padding: 6px 11px;
    min-height: 36px;
    border-radius: 12px;
  }

  .circle-banner-header {
    margin-bottom: 0;
  }

  .circle-badge {
    font-size: 0.72rem;
    padding: 3px 9px;
  }

  .circle-gate-hint {
    font-size: 0.75rem;
  }

  .circle-title,
  .circle-subtitle,
  .active-toys-pills {
    display: none;
  }

  /* 2. Centerpiece Apple Activity Rings + Carousel Board */
  .board-panel {
    order: 2;
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    gap: 12px;
    flex: 1 1 auto;
  }

  /* 3. Compact 2-Column Players Strip (64px) */
  .players-grid {
    order: 3;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    padding: 6px;
    border-radius: 16px;
  }

  .player-card {
    padding: 6px 8px;
    border-radius: 12px;
  }

  .player-card.active-turn {
    transform: none;
  }

  .player-identity {
    gap: 6px;
  }

  .player-avatar {
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
    font-size: 0.92rem;
  }

  .player-name {
    font-size: 0.88rem;
  }

  .player-pos-short {
    display: inline;
  }

  .player-pos-label,
  .turn-pill {
    display: none !important;
  }

  .player-tokens-row {
    margin-top: 5px;
    padding-top: 5px;
    gap: 4px;
    justify-content: flex-start;
  }

  .token-chip,
  .clothes-chip {
    font-size: 0.75rem;
    padding: 2px 7px;
  }

  /* 4. Fixed Bottom Thumb-Zone Dice Bar (76px) */
  .dice-dock {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 45;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 12px max(10px, env(safe-area-inset-bottom));
    border-radius: 18px 18px 0 0;
    background: rgba(13, 7, 24, 0.96);
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.65);
  }

  .dice-stage-wrapper {
    margin: 0;
    flex-shrink: 0;
  }

  .dice-stage {
    width: 52px;
    height: 52px;
    min-width: 52px;
    min-height: 52px;
    border-radius: 14px;
  }

  .dice-value {
    font-size: 1.15rem;
  }

  .dice-sub {
    font-size: 0.54rem;
    margin-top: 1px;
    letter-spacing: 0.3px;
  }

  .dice-result-desc {
    display: none;
  }

  .btn-roll-main {
    flex: 1;
    width: auto;
    min-width: 0;
    min-height: 54px;
    padding: 10px 14px;
    font-size: 1rem;
  }

  .pending-task-banner {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: calc(80px + env(safe-area-inset-bottom));
    top: auto;
    margin: 0;
    padding: 9px 12px;
    z-index: 65;
  }

  /* Modals on mobile */
  .modal-backdrop {
    padding: 8px;
  }

  .modal-card {
    max-height: calc(100dvh - 16px);
    border-radius: 20px;
  }

  .modal-header {
    padding: 12px 14px;
  }

  .modal-body {
    padding: 12px 14px 14px;
  }

  .task-modal-body {
    padding: 10px 14px 12px;
    gap: 8px;
  }

  .task-title {
    font-size: 1.12rem;
  }

  .task-performer-banner {
    padding: 6px 10px;
    font-size: 0.88rem;
  }

  .cinematic-pose-card {
    max-height: 158px;
  }

  .task-description {
    font-size: 0.98rem;
    line-height: 1.44;
    padding: 10px 12px;
  }

  .timer-time-display {
    font-size: 1.32rem;
  }

  /* Prevent iOS auto-zoom on form inputs */
  .form-input,
  .form-select,
  .form-textarea {
    font-size: 16px;
  }
}

/* ==================== ТЕМАТИЧНІ СЕТИ КАРТОК (ВІТРИНА + ВИБІР) ==================== */
.sets-section {
  margin-top: 4px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(251, 191, 36, 0.22);
}

.sets-category-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.set-cat-pill {
  min-height: 44px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.set-cat-pill:hover {
  border-color: rgba(251, 191, 36, 0.55);
  color: #fff;
}

.set-cat-pill.active {
  background: linear-gradient(135deg, rgba(255, 55, 95, 0.35), rgba(255, 100, 130, 0.35));
  border-color: rgba(255, 55, 95, 0.75);
  color: #fff;
}

.sets-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

@media (max-width: 680px) {
  .sets-grid {
    grid-template-columns: 1fr;
  }
}

.set-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border-radius: 13px;
  background: rgba(15, 7, 26, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.12);
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.set-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 55, 95, 0.5);
}

.set-card.selected {
  border-color: #30d158;
  background: rgba(48, 209, 88, 0.12);
  box-shadow: 0 0 18px rgba(48, 209, 88, 0.22);
}

.set-card.locked {
  border-color: rgba(251, 191, 36, 0.36);
  background: linear-gradient(155deg, rgba(45, 16, 62, 0.72), rgba(15, 7, 26, 0.88));
}

.set-card-cover {
  width: 100%;
  height: 92px;
  border-radius: 9px;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(255, 55, 95, 0.22), rgba(255, 100, 130, 0.24));
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.set-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.set-card-cover-placeholder {
  font-size: 2rem;
}

.set-badge-promo {
  position: absolute;
  top: 6px;
  left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 55, 95, 0.92);
  color: #fff;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.set-price-pill {
  position: absolute;
  top: 6px;
  right: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(10, 6, 18, 0.85);
  border: 1px solid rgba(251, 191, 36, 0.65);
  color: #fde68a;
  font-size: 0.7rem;
  font-weight: 700;
}

.set-price-pill.free {
  border-color: rgba(48, 209, 88, 0.65);
  color: #a7f3d0;
}

.set-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.set-card-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.25;
}

.set-card-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.42;
}

.set-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: auto;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.72rem;
  color: #cbd5e1;
}

.set-card-cta {
  width: 100%;
  min-height: 44px;
  margin-top: 4px;
  padding: 9px 12px;
  border-radius: 9px;
  border: 1px solid rgba(251, 191, 36, 0.45);
  background: rgba(251, 191, 36, 0.14);
  color: #fde68a;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
}

.set-card-cta:hover {
  background: rgba(251, 191, 36, 0.25);
}

.set-pill-active {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.71rem;
  font-weight: 700;
  background: rgba(251, 191, 36, 0.16);
  border: 1px solid rgba(251, 191, 36, 0.42);
  color: #fde68a;
}

/* Прев'ю платного сету (модалка) */
.set-preview-hero {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
}

@media (max-width: 560px) {
  .set-preview-hero {
    flex-direction: column;
    align-items: stretch;
  }
}

.set-preview-cover {
  width: 120px;
  height: 120px;
  border-radius: 14px;
  overflow: hidden;
  flex-shrink: 0;
  background: linear-gradient(135deg, rgba(255, 55, 95, 0.28), rgba(255, 100, 130, 0.28));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.6rem;
}

.set-preview-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.set-preview-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 14px;
}

.set-preview-stat-chip {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #f3e8ff;
}

.set-teaser-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 12px 0 16px;
}

.set-teaser-item {
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.34);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-left: 3px solid #ff9f0a;
}

.set-teaser-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
}

.set-teaser-text {
  font-size: 0.84rem;
  line-height: 1.48;
  color: #e2e8f0;
}

.set-preview-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.set-preview-price {
  font-size: 1.25rem;
  font-weight: 800;
  color: #fde68a;
}

.task-set-origin-pill {
  display: inline-block;
  margin-bottom: 8px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(251, 191, 36, 0.14);
  border: 1px solid rgba(251, 191, 36, 0.35);
  color: #fde68a;
}

/* ==================== PHASE 3: QUICK START, SETUP TABS, RULES, DIALOGS ==================== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.clothes-chip {
  position: relative;
}

.clothes-chip::after {
  content: "";
  position: absolute;
  inset: -8px -6px;
  min-width: 44px;
  min-height: 44px;
}

/* Setup Tabs (S-03, S-04) */
.setup-tabs-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 10px 18px 0;
  background: rgba(255, 255, 255, 0.015);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.setup-tab-btn {
  min-height: 44px;
  padding: 8px 12px;
  border: none;
  border-bottom: 2.5px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
  border-radius: 10px 10px 0 0;
}

.setup-tab-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.04);
}

.setup-tab-btn.active {
  color: #fff;
  border-bottom-color: #ff375f;
  background: rgba(255, 55, 95, 0.1);
}

.setup-tab-panel {
  display: none;
}

.setup-tab-panel.active {
  display: block;
}

.setup-footer-actions {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 12px;
}

.setup-save-btn {
  width: 100%;
  min-height: 50px;
  font-size: 1rem;
  font-weight: 800;
}

.setup-newgame-btn {
  width: 100%;
  min-height: 44px;
  font-size: 0.92rem;
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.14);
  color: var(--text-muted);
}

.setup-inline-hint {
  margin-top: 6px;
  padding: 8px 11px;
  border-radius: 10px;
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.35);
  color: #fde68a;
  font-size: 0.82rem;
  line-height: 1.35;
}

.toy-option-card.locked-by-boundary,
.qs-toy-chip.locked-by-boundary {
  opacity: 0.48;
  border-style: dashed;
}

/* Atmospheric cover for card sets without coverUrl (S-04) */
.set-card-cover-atmospheric {
  background:
    radial-gradient(circle at 22% 28%, rgba(255, 55, 95, 0.42), transparent 55%),
    radial-gradient(circle at 80% 72%, rgba(255, 100, 130, 0.42), transparent 58%),
    linear-gradient(135deg, #1b0a2c 0%, #2d0d3a 55%, #12061e 100%);
}

.set-card-cover-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: rgba(253, 242, 248, 0.9);
  letter-spacing: 0.3px;
  text-align: center;
  padding: 0 12px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.65);
}

.sets-empty-note {
  padding: 20px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  font-size: 0.9rem;
  text-align: center;
  line-height: 1.5;
}

/* Quick Start Modal (S-02 — zero scroll on 390x844) */
.quick-start-card {
  max-width: 460px;
}

.quick-start-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.qs-players-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.qs-player-field {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.qs-name-input {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 8px 10px;
}

.qs-gender-btn {
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  font-size: 1.15rem;
  flex-shrink: 0;
}

.qs-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.qs-section-label {
  font-size: 0.88rem;
  font-weight: 700;
  color: #f5d0fe;
}

.qs-optional {
  font-weight: 500;
  color: var(--text-dim);
  font-size: 0.82rem;
}

.qs-toys-chips {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.qs-toy-chip {
  min-height: 44px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  font-size: 0.86rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  cursor: pointer;
  transition: all 0.18s ease;
  text-align: left;
}

.qs-toy-chip.selected {
  background: linear-gradient(135deg, rgba(255, 159, 10, 0.22), rgba(255, 55, 95, 0.18));
  border-color: #ff6482;
  box-shadow: 0 0 14px rgba(255, 100, 130, 0.28);
}

/* Resume & Confirm Dialogs */
.resume-summary-text {
  font-size: 0.96rem;
  line-height: 1.5;
  color: #f3e8ff;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.confirm-dialog-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

@media (max-width: 420px) {
  .confirm-dialog-actions {
    grid-template-columns: 1fr;
  }
}

/* Rules Modal Classes (S-11) */
.rules-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 0.92rem;
  color: #f3e8ff;
}

.rules-card {
  padding: 12px 14px;
  border-radius: 14px;
  line-height: 1.48;
}

.rules-c1 {
  background: rgba(48, 209, 88, 0.1);
  border: 1px solid rgba(48, 209, 88, 0.35);
}

.rules-c2 {
  background: rgba(255, 159, 10, 0.1);
  border: 1px solid rgba(255, 159, 10, 0.35);
}

.rules-c3 {
  background: rgba(255, 55, 95, 0.12);
  border: 1px solid rgba(255, 55, 95, 0.4);
}

.rules-neutral {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.rules-safety {
  background: rgba(100, 210, 255, 0.09);
  border: 1px solid rgba(100, 210, 255, 0.35);
}

.rules-legend-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 10px;
  margin-top: 8px;
  font-size: 0.85rem;
  color: #e9d5ff;
}

@media (max-width: 440px) {
  .rules-legend-grid {
    grid-template-columns: 1fr;
  }
}

/* ==================== INTERACTIVE 3-CARD PICK (X-02) ==================== */
.card-pick-modal-card {
  max-width: 520px;
}

.card-pick-body {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.card-pick-title {
  font-size: 1.24rem;
  font-weight: 800;
  color: #fff;
}

.card-pick-subtitle {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.card-pick-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 6px;
}

.tempt-card {
  perspective: 900px;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  aspect-ratio: 2 / 3;
  min-height: 150px;
  width: 100%;
}

.tempt-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.55s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tempt-card:hover:not(:disabled) .tempt-card-inner {
  transform: translateY(-4px);
}

.tempt-card.flipped .tempt-card-inner {
  transform: rotateY(180deg);
}

.tempt-card.dimmed {
  opacity: 0.35;
  pointer-events: none;
}

.tempt-card-face {
  position: absolute;
  inset: 0;
  border-radius: 16px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 8px;
}

.tempt-card-back {
  background:
    radial-gradient(circle at 50% 35%, rgba(255, 55, 95, 0.34), transparent 65%),
    linear-gradient(155deg, #2d1042 0%, #140620 100%);
  border: 1.5px solid rgba(244, 114, 182, 0.52);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.55), inset 0 0 18px rgba(255, 55, 95, 0.22);
}

.tempt-card-back-icon {
  font-size: 2rem;
  line-height: 1;
  margin-bottom: 8px;
}

.tempt-card-back-num {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: #fbcfe8;
}

.tempt-card-front {
  transform: rotateY(180deg);
  background: linear-gradient(155deg, rgba(255, 55, 95, 0.36), rgba(32, 12, 48, 0.98));
  border: 1.5px solid #fb7185;
  box-shadow: 0 0 26px rgba(255, 55, 95, 0.45);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.3;
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  .tempt-card-inner {
    transition: opacity 0.25s ease;
  }

  .tempt-card.flipped .tempt-card-inner {
    transform: none;
  }

  .tempt-card.flipped .tempt-card-back {
    display: none;
  }

  .tempt-card.flipped .tempt-card-front {
    transform: none;
  }
}

/* ==================== CLOTHES STAGE SCALE (X-04) ==================== */
.clothes-stage-scale {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.stage-pill {
  padding: 7px 4px;
  border-radius: 10px;
  text-align: center;
  font-size: 0.74rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-dim);
}

.stage-pill.active {
  background: rgba(255, 100, 130, 0.22);
  border-color: rgba(244, 114, 182, 0.65);
  color: #fff;
}

/* ==================== FINALE & AFTERGLOW (X-05) ==================== */
.finale-modal-card {
  border-color: rgba(251, 191, 36, 0.45);
  box-shadow: 0 25px 75px rgba(0, 0, 0, 0.88), 0 0 55px rgba(255, 55, 95, 0.35);
}

.finale-badge {
  background: rgba(251, 191, 36, 0.18);
  border: 1px solid rgba(251, 191, 36, 0.55);
  color: #fde68a;
}

.finale-dim-btn {
  min-height: 44px;
  padding: 8px 14px;
  font-size: 0.86rem;
}

.finale-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.finale-title {
  font-size: 1.38rem;
  font-weight: 900;
  color: #fff;
  line-height: 1.22;
}

.finale-subtitle {
  font-size: 0.96rem;
  color: #f3e8ff;
  line-height: 1.45;
}

.finale-poses-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

@media (max-width: 680px) {
  .finale-poses-grid {
    grid-template-columns: 1fr;
  }
}

.finale-pose-option {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  cursor: pointer;
  text-align: left;
  color: var(--text-main);
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.18s ease;
}

.finale-pose-option.selected {
  border-color: #ff9f0a;
  background: rgba(255, 159, 10, 0.12);
  box-shadow: 0 0 0 1px rgba(255, 159, 10, 0.35);
}

.finale-pose-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 150px;
  object-fit: cover;
  object-position: center 22%;
  border-radius: 12px;
  background: #09090b;
  display: block;
}

.finale-pose-name {
  font-size: 0.9rem;
  font-weight: 800;
  color: #fff;
}

.finale-selected-detail {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 55, 95, 0.1);
  border: 1px solid rgba(255, 55, 95, 0.35);
  font-size: 0.94rem;
  line-height: 1.5;
  color: #fdf2f8;
}

.afterglow-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.afterglow-section-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #fda4af;
}

.afterglow-tasks-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
}

.afterglow-task-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
}

.afterglow-task-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
  flex: 1;
  min-width: 0;
}

.fav-heart-btn {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.05);
  font-size: 1.15rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.fav-heart-btn.active {
  background: rgba(255, 55, 95, 0.24);
  border-color: #fb7185;
  transform: scale(1.06);
}


/* ============================================================================
   APPLE DARK / LIQUID GLASS DESIGN SYSTEM OVERHAUL (b1_6)
   iOS 18+ / Apple Music / Apple Fitness+ / StandBy Aesthetic
   ============================================================================ */
:root {
  --bg-deep: #09090b;
  --bg-panel: rgba(28, 28, 32, 0.72);
  --bg-card: rgba(28, 28, 32, 0.86);
  --ios-elevated: rgba(28, 28, 32, 0.72);
  --ios-elevated-strong: rgba(36, 36, 42, 0.86);
  --border-subtle: rgba(255, 255, 255, 0.11);
  --border-highlight: rgba(255, 255, 255, 0.2);
  --specular-top: inset 0 1px 0 rgba(255, 255, 255, 0.09);

  --text-main: rgba(255, 255, 255, 0.94);
  --text-muted: rgba(235, 235, 245, 0.72);
  --text-dim: rgba(235, 235, 245, 0.62);

  --c1-color: #e8b88a;
  --c1-glow: rgba(232, 184, 138, 0.34);
  --c2-color: #f59342;
  --c2-glow: rgba(245, 147, 66, 0.38);
  --c3-color: #f43f6b;
  --c3-glow: rgba(244, 63, 107, 0.44);

  --active-accent: #e8b88a;
  --active-soft: rgba(232, 184, 138, 0.16);
  --rings-card-glow: rgba(232, 184, 138, 0.15);
  --p1-color: #64d2ff;
  --p1-bg: rgba(100, 210, 255, 0.14);
  --p2-color: #ff6482;
  --p2-bg: rgba(255, 100, 130, 0.14);

  --ios-spring: cubic-bezier(0.22, 1, 0.36, 1);
}

body[data-circle="1"] {
  --active-accent: #e8b88a;
  --active-soft: rgba(232, 184, 138, 0.16);
  --rings-card-glow: rgba(232, 184, 138, 0.15);
}

body[data-circle="2"] {
  --active-accent: #f59342;
  --active-soft: rgba(245, 147, 66, 0.16);
  --rings-card-glow: rgba(245, 147, 66, 0.16);
}

body[data-circle="3"] {
  --active-accent: #f43f6b;
  --active-soft: rgba(244, 63, 107, 0.18);
  --rings-card-glow: rgba(244, 63, 107, 0.18);
}

body.passion-game-body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  background-color: #09090b;
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Subtle Candlelight-to-Ruby Ambient Blobs (Reactive to Circle I -> II -> III) */
.ambient-orb {
  filter: blur(92px);
  opacity: 0.88;
  transition: background 1.1s var(--ios-spring), opacity 1.1s var(--ios-spring);
}

.orb-1 {
  width: 380px;
  height: 380px;
  background: radial-gradient(circle, rgba(232, 184, 138, 0.18), transparent 70%);
  top: -100px;
  left: -60px;
  right: auto;
}

.orb-2 {
  width: 340px;
  height: 340px;
  background: radial-gradient(circle, rgba(138, 72, 96, 0.15), transparent 70%);
  bottom: -90px;
  right: -70px;
  left: auto;
}

.orb-3 {
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, rgba(246, 213, 176, 0.05), transparent 70%);
  top: 42%;
  left: 50%;
}

body[data-circle="2"] .orb-1 {
  background: radial-gradient(circle, rgba(245, 147, 66, 0.21), transparent 70%);
}

body[data-circle="2"] .orb-2 {
  background: radial-gradient(circle, rgba(180, 83, 9, 0.16), transparent 70%);
}

body[data-circle="2"] .orb-3 {
  background: radial-gradient(circle, rgba(251, 191, 36, 0.06), transparent 70%);
}

body[data-circle="3"] .orb-1 {
  background: radial-gradient(circle, rgba(244, 63, 107, 0.22), transparent 70%);
}

body[data-circle="3"] .orb-2 {
  background: radial-gradient(circle, rgba(159, 18, 57, 0.17), transparent 70%);
}

body[data-circle="3"] .orb-3 {
  background: radial-gradient(circle, rgba(251, 113, 133, 0.07), transparent 70%);
}

body.night-mode .ambient-orb {
  opacity: 0.22;
}

/* SF Symbols Icon System */
.sf-icon {
  width: 19px;
  height: 19px;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
}

.sf-icon-sm {
  width: 16px;
  height: 16px;
}

.sf-icon-xs {
  width: 14px;
  height: 14px;
}

.sf-icon-play {
  width: 17px;
  height: 17px;
}

/* Topbar & Dynamic Island Pill */
.topbar {
  background: rgba(9, 9, 11, 0.78);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 10px 20px;
  gap: 10px;
  flex-wrap: nowrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
}

.brand-logo {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 13px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.03));
  border: 1px solid var(--border-subtle);
  box-shadow: var(--specular-top), 0 6px 18px rgba(0, 0, 0, 0.35);
  color: var(--active-accent);
  transition: transform 0.28s var(--ios-spring), border-color 0.28s ease, box-shadow 0.28s ease;
}

.brand:hover .brand-logo {
  transform: scale(1.05);
  border-color: rgba(255, 255, 255, 0.24);
  box-shadow: var(--specular-top), 0 8px 24px rgba(255, 55, 95, 0.22);
}

.brand-logo-svg {
  width: 34px;
  height: 34px;
  display: block;
}

.brand-title {
  background: none;
  -webkit-text-fill-color: var(--text-main);
  color: var(--text-main);
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}

body.night-mode .brand-logo {
  background: #09090b;
  border-color: rgba(255, 255, 255, 0.09);
  box-shadow: none;
}

/* Branded Footer Lockup */
.footer-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  margin-bottom: 14px;
}

.footer-brand-logo {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: var(--specular-top), 0 10px 26px rgba(0, 0, 0, 0.45);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.footer-brand-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  gap: 2px;
}

.footer-brand-title {
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
  line-height: 1.2;
}

.footer-brand-sub {
  font-size: 0.78rem;
  color: var(--text-dim);
  letter-spacing: 0.01em;
}

body.night-mode .footer-brand-logo {
  background: #050507;
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: none;
}

.brand-badge {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.7rem;
  padding: 2px 8px;
}

.dynamic-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 13px;
  border-radius: 999px;
  background: rgba(16, 16, 20, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.42), var(--specular-top);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-main);
  letter-spacing: -0.01em;
  white-space: nowrap;
  transform-origin: center;
}

.dynamic-pill.is-turn-pulse {
  animation: dynamicPillPulse 320ms var(--ios-spring);
}

@keyframes dynamicPillPulse {
  0% {
    transform: scale(1);
  }

  42% {
    transform: scale(1.045);
  }

  100% {
    transform: scale(1);
  }
}

.turn-indicator-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--p1-color);
  box-shadow: 0 0 8px var(--p1-color);
  transition: background 0.35s var(--ios-spring), box-shadow 0.35s var(--ios-spring);
}

.turn-indicator-dot.female {
  background: var(--p2-color);
  box-shadow: 0 0 8px var(--p2-color);
}

.turn-indicator-dot.finished {
  background: #ffd60a;
  box-shadow: 0 0 8px #ffd60a;
}

.topbar-actions .btn {
  background: var(--ios-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  box-shadow: var(--specular-top);
  color: var(--text-main);
  font-weight: 500;
  font-size: 0.84rem;
  padding: 8px 13px;
}

.topbar-actions .topbar-icon-btn {
  padding: 8px 12px;
}

/* Frosted Panels & Partner Cards */
.panel,
.circle-banner,
.player-card {
  background: var(--ios-elevated);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--specular-top), 0 12px 32px rgba(0, 0, 0, 0.36);
}

.circle-banner {
  border-radius: 22px;
  padding: 16px 18px;
}

.circle-badge {
  background: var(--active-soft) !important;
  border: 1px solid var(--active-accent) !important;
  color: var(--active-accent) !important;
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: -0.01em;
}

.circle-title {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.circle-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.classic-mode-hint {
  font-size: 0.76rem;
  color: var(--text-dim);
}

.player-card {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  padding: 12px 14px;
  transition: border-color 0.35s var(--ios-spring), background 0.35s var(--ios-spring), box-shadow 0.35s var(--ios-spring);
}

.player-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 16%;
  right: 16%;
  height: 1.5px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s var(--ios-spring);
}

.player-card.p1::before {
  background: linear-gradient(90deg, transparent, var(--p1-color), transparent);
}

.player-card.p2::before {
  background: linear-gradient(90deg, transparent, var(--p2-color), transparent);
}

.player-card.active-turn::before {
  opacity: 0.85;
}

body.night-mode .player-card.active-turn::before {
  opacity: 0.35;
}

.player-card.active-turn {
  background: var(--ios-elevated-strong);
  border-color: rgba(255, 255, 255, 0.22);
}

.player-card.p1.active-turn {
  box-shadow: var(--specular-top), 0 0 0 1px rgba(100, 210, 255, 0.3), 0 10px 26px rgba(0, 0, 0, 0.38);
}

.player-card.p2.active-turn {
  box-shadow: var(--specular-top), 0 0 0 1px rgba(255, 100, 130, 0.3), 0 10px 26px rgba(0, 0, 0, 0.38);
}

.player-avatar {
  width: 30px;
  height: 30px;
  min-width: 30px;
  min-height: 30px;
  border-radius: 50%;
  font-size: 0.82rem;
  font-weight: 700;
  border: none;
}

.player-card.p1 .player-avatar {
  background: var(--p1-bg);
  color: var(--p1-color);
  box-shadow: none;
}

.player-card.p2 .player-avatar {
  background: var(--p2-bg);
  color: var(--p2-color);
  box-shadow: none;
}

.player-name {
  font-size: 0.94rem;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.player-pos-short {
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  font-weight: 600;
}

.token-chip,
.clothes-chip {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  white-space: nowrap;
}

.clothes-chip {
  min-height: 44px;
  padding: 6px 11px;
  background: rgba(255, 255, 255, 0.075);
  border-color: rgba(255, 255, 255, 0.14);
  color: var(--text-main);
}

.clothes-chip::after {
  inset: 0;
  min-width: 44px;
  min-height: 44px;
}

.clothes-chip .clothes-chevron {
  opacity: 0.62;
  margin-left: 1px;
}

.turn-pill,
.player-card.active-turn .turn-pill {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-transform: none;
  box-shadow: none;
  animation: none;
}

.player-card.p1.active-turn .turn-pill {
  background: var(--p1-bg);
  border-color: rgba(100, 210, 255, 0.32);
  color: var(--p1-color);
}

.player-card.p2.active-turn .turn-pill {
  background: var(--p2-bg);
  border-color: rgba(255, 100, 130, 0.32);
  color: var(--p2-color);
}

/* ==================== APPLE ACTIVITY RINGS + CAROUSEL BOARD ==================== */
.app-layout>* {
  min-width: 0;
  max-width: 100%;
}

.board-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
  border-radius: 26px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.rings-hero-card {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 18px 20px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.038);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--specular-top);
  transition: border-color 0.9s var(--ios-spring);
}

/* Warm candlelight glow behind the 3 rings */
.rings-hero-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle 138px at 84px 50%, var(--rings-card-glow, rgba(232, 184, 138, 0.15)), transparent 74%);
  opacity: 0.92;
  pointer-events: none;
  transition: background 1.1s var(--ios-spring), opacity 1.1s var(--ios-spring);
  z-index: 0;
}

/* Gate crossing bloom (soft radiance reveal) */
.rings-hero-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle 168px at 84px 50%, var(--active-accent), transparent 72%);
  opacity: 0;
  pointer-events: none;
  z-index: 0;
}

.rings-hero-card.is-gate-reveal::after {
  animation: ringsGateBloom 1.1s var(--ios-spring);
}

.rings-hero-card>* {
  position: relative;
  z-index: 1;
}

.rings-svg-wrap {
  position: relative;
  width: 128px;
  height: 128px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
}

/* Step Ripple wave around the rings */
.rings-svg-wrap::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1.5px solid var(--active-accent);
  opacity: 0;
  transform: scale(0.84);
  pointer-events: none;
}

.rings-hero-card.is-stepping .rings-svg-wrap::after {
  animation: ringsStepRipple 750ms var(--ios-spring);
}

.rings-hero-card.is-stepping .rings-flame-breath {
  animation: ringsFlameStepInhale 750ms var(--ios-spring);
}

.rings-svg {
  width: 128px;
  height: 128px;
  display: block;
  overflow: visible;
  --flame-aura-color: #e8b88a;
}

/* Organic jewelry orbital tracks & differentiated arc hierarchy */
.ring-track {
  fill: none;
  opacity: 0.11;
}

.ring-track-1 {
  stroke-width: 6.5;
}

.ring-track-2 {
  stroke-width: 7.5;
}

.ring-track-3 {
  stroke-width: 8.5;
}

.ring-orbit {
  fill: none;
  stroke-width: 1.15;
  stroke-linecap: round;
  opacity: 0.26;
}

.ring-progress {
  fill: none;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.85s var(--ios-spring), opacity 0.55s ease;
}

.ring-progress-1 {
  stroke-width: 6.5;
}

.ring-progress-2 {
  stroke-width: 7.5;
}

.ring-progress-3 {
  stroke-width: 8.5;
}

.ring-progress.is-completed-arc {
  filter: drop-shadow(0 0 3px rgba(246, 213, 176, 0.28));
}

/* Progress Tip Orb (Світлова іскра-перлина на кінчику активної дуги) */
.ring-tip-orb-rot {
  transform-origin: 64px 64px;
  transform: rotate(var(--tip-deg, 30deg));
  transition: transform 0.85s var(--ios-spring), opacity 0.45s ease;
  --tip-color: #e8b88a;
}

.ring-tip-orb-pos {
  transform: translate(64px, var(--tip-y, 9px));
  transition: transform 0.7s var(--ios-spring);
}

.ring-tip-orb-pulse {
  transform-origin: 0 0;
  animation: ringTipOrbBreathe 3.2s ease-in-out infinite;
}

.ring-tip-halo {
  fill: var(--tip-color, #e8b88a);
  opacity: 0.28;
  transition: fill 0.8s var(--ios-spring);
}

.ring-tip-core {
  fill: #fffaf3;
  stroke: var(--tip-color, #e8b88a);
  stroke-width: 1.45;
  transition: stroke 0.8s var(--ios-spring);
}

@keyframes ringTipOrbBreathe {

  0%,
  100% {
    transform: scale(0.94);
    opacity: 0.84;
  }

  50% {
    transform: scale(1.12);
    opacity: 1;
  }
}

@keyframes ringsStepRipple {
  0% {
    transform: scale(0.84);
    opacity: 0.26;
  }

  100% {
    transform: scale(1.16);
    opacity: 0;
  }
}

@keyframes ringsFlameStepInhale {
  0% {
    transform: scale(1) translateY(0);
  }

  38% {
    transform: scale(1.09) translateY(-0.9px);
  }

  100% {
    transform: scale(1) translateY(0);
  }
}

@keyframes ringsGateBloom {
  0% {
    opacity: 0;
    transform: scale(0.92);
  }

  32% {
    opacity: 0.22;
    transform: scale(1.02);
  }

  100% {
    opacity: 0;
    transform: scale(1.08);
  }
}

/* Brand Dynamic Flame inside Intimate Rings */
.rings-flame-group {
  transition: filter 0.85s var(--ios-spring);
}

.rings-flame-aura-stop {
  stop-color: var(--flame-aura-color, #e8b88a);
  transition: stop-color 0.85s var(--ios-spring);
}

.rings-flame-aura {
  opacity: 0.34;
  transition: opacity 0.85s var(--ios-spring);
}

.rings-flame-breath {
  transform-origin: 64px 72px;
  animation: ringsFlameBreathe 3.8s ease-in-out infinite;
}

.rings-flame-base {
  fill: rgba(255, 250, 243, 0.07);
  stroke: rgba(246, 213, 176, 0.18);
  stroke-width: 0.9;
  vector-effect: non-scaling-stroke;
}

.rings-flame-clip-rect {
  transform: translateY(var(--flame-offset-y, 48.56px));
  transition: transform 0.85s var(--ios-spring);
}

.rings-flame-core {
  opacity: 0.26;
  transition: opacity 0.85s var(--ios-spring);
}

.rings-flame-group.flame-stage-0 {
  filter: none;
}

.rings-flame-group.flame-stage-0 .rings-flame-aura,
.rings-flame-group.flame-stage-0 .rings-flame-core {
  opacity: 0;
}

.rings-flame-group.flame-stage-0 .rings-flame-breath {
  animation: none;
}

.rings-flame-group.flame-stage-1 {
  filter: drop-shadow(0 0 4px rgba(232, 184, 138, 0.36));
}

.rings-flame-group.flame-stage-1 .rings-flame-aura {
  opacity: 0.38;
}

.rings-flame-group.flame-stage-1 .rings-flame-core {
  opacity: 0.28;
}

.rings-flame-group.flame-stage-2 {
  filter: drop-shadow(0 0 5px rgba(245, 147, 66, 0.46)) drop-shadow(0 0 11px rgba(251, 191, 36, 0.20));
}

.rings-flame-group.flame-stage-2 .rings-flame-aura {
  opacity: 0.56;
}

.rings-flame-group.flame-stage-2 .rings-flame-core {
  opacity: 0.48;
}

.rings-flame-group.flame-stage-3 {
  filter: drop-shadow(0 0 6px rgba(244, 63, 107, 0.52)) drop-shadow(0 0 13px rgba(245, 147, 66, 0.24));
}

.rings-flame-group.flame-stage-3 .rings-flame-aura {
  opacity: 0.72;
}

.rings-flame-group.flame-stage-3 .rings-flame-core {
  opacity: 0.72;
}

.rings-flame-group.flame-stage-max {
  filter: drop-shadow(0 0 8px rgba(244, 63, 107, 0.68)) drop-shadow(0 0 16px rgba(253, 164, 175, 0.38));
}

.rings-flame-group.flame-stage-max .rings-flame-aura {
  opacity: 0.90;
}

.rings-flame-group.flame-stage-max .rings-flame-core {
  opacity: 0.90;
}

.rings-flame-group.flame-stage-max .rings-flame-breath {
  animation: ringsFlameBreathePeak 3.2s ease-in-out infinite;
}

@keyframes ringsFlameBreathe {

  0%,
  100% {
    transform: scale(1) translateY(0);
    opacity: 0.95;
  }

  50% {
    transform: scale(1.028) translateY(-0.45px);
    opacity: 1;
  }
}

@keyframes ringsFlameBreathePeak {

  0%,
  100% {
    transform: scale(1) translateY(0);
    opacity: 0.96;
  }

  50% {
    transform: scale(1.04) translateY(-0.6px);
    opacity: 1;
  }
}

body.night-mode .rings-hero-card::before {
  opacity: 0.38;
}

body.night-mode .rings-hero-card.is-stepping .rings-svg-wrap::after {
  animation-name: ringsStepRippleNight;
}

body.night-mode .rings-hero-card.is-gate-reveal::after {
  animation-name: ringsGateBloomNight;
}

@keyframes ringsStepRippleNight {
  0% {
    transform: scale(0.84);
    opacity: 0.11;
  }

  100% {
    transform: scale(1.14);
    opacity: 0;
  }
}

@keyframes ringsGateBloomNight {
  0% {
    opacity: 0;
    transform: scale(0.94);
  }

  32% {
    opacity: 0.10;
    transform: scale(1.02);
  }

  100% {
    opacity: 0;
    transform: scale(1.06);
  }
}

body.night-mode .rings-svg {
  filter: brightness(0.84) saturate(0.85);
}

body.night-mode .ring-orbit {
  opacity: 0.18;
}

body.night-mode .ring-tip-halo {
  opacity: 0.14;
}

body.night-mode .rings-flame-group.flame-stage-1 {
  filter: drop-shadow(0 0 2.5px rgba(232, 184, 138, 0.18));
}

body.night-mode .rings-flame-group.flame-stage-2 {
  filter: drop-shadow(0 0 3.5px rgba(245, 147, 66, 0.24));
}

body.night-mode .rings-flame-group.flame-stage-3 {
  filter: drop-shadow(0 0 4px rgba(244, 63, 107, 0.28));
}

body.night-mode .rings-flame-group.flame-stage-max {
  filter: drop-shadow(0 0 5px rgba(244, 63, 107, 0.36));
}

body.night-mode .rings-flame-aura {
  opacity: 0.16 !important;
}

body.night-mode .rings-flame-base {
  fill: rgba(255, 255, 255, 0.05);
  stroke: rgba(255, 255, 255, 0.11);
}

@media (prefers-reduced-motion: reduce) {

  .rings-flame-breath,
  .ring-tip-orb-pulse,
  .rings-hero-card.is-stepping .rings-svg-wrap::after,
  .rings-hero-card.is-stepping .rings-flame-breath,
  .rings-hero-card.is-gate-reveal::after,
  .dynamic-pill.is-turn-pulse {
    animation: none !important;
    transform: none !important;
  }

  .rings-flame-clip-rect,
  .rings-flame-core,
  .rings-flame-aura,
  .rings-flame-group,
  .ring-progress,
  .ring-tip-orb-rot,
  .ring-tip-orb-pos,
  .rings-hero-card::before,
  .ambient-orb {
    transition: none !important;
  }
}

.rings-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.circle-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--active-accent);
}

.circle-kicker-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.rings-title {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.18;
  color: var(--text-main);
}

.rings-legend {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 2px;
}

.ring-legend-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  padding: 2px 6px;
  margin: 0 -6px;
  border-radius: 9px;
  transition: background 0.4s var(--ios-spring), color 0.35s ease;
}

.ring-legend-row.is-active-chapter {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.045);
}

.ring-legend-row.is-active-chapter .ring-legend-bar {
  box-shadow: 0 0 8px currentColor;
  transform: scale(1.12);
}

.ring-legend-row.is-completed-chapter .ring-legend-status {
  color: var(--c1-color);
}

.ring-legend-name {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.ring-legend-bar {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  transition: transform 0.4s var(--ios-spring), box-shadow 0.4s ease;
}

.ring-legend-row[data-ring-circle="1"] .ring-legend-bar {
  color: var(--c1-color);
}

.ring-legend-row[data-ring-circle="2"] .ring-legend-bar {
  color: var(--c2-color);
}

.ring-legend-row[data-ring-circle="3"] .ring-legend-bar {
  color: var(--c3-color);
}

body.night-mode .ring-legend-row.is-active-chapter .ring-legend-bar {
  box-shadow: none;
}

/* Board Circle Filter Tabs */
.board-circle-tabs {
  display: inline-flex;
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  padding: 3px;
  border-radius: 999px;
  gap: 3px;
}

.board-circle-tab {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 8px 14px;
  min-height: 44px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.25s var(--ios-spring), color 0.25s ease;
}

.board-circle-tab .tab-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.board-circle-tab.active {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

/* Scroll-Snap Carousel */
.carousel-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
}

.carousel-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 2px;
}

.carousel-header-right {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.carousel-nav-btns {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.carousel-nav-btn {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, opacity 0.18s ease;
}

.carousel-nav-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.14);
  border-color: var(--border-highlight);
}

.carousel-nav-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.carousel-track-wrap {
  position: relative;
  min-width: 0;
  max-width: 100%;
}

.carousel-track-wrap::after,
.carousel-track-wrap::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 8px;
  width: 34px;
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.22s ease;
}

.carousel-track-wrap::before {
  left: 0;
  background: linear-gradient(to right, rgba(9, 9, 11, 0.85), rgba(9, 9, 11, 0));
}

.carousel-track-wrap::after {
  right: 0;
  background: linear-gradient(to left, rgba(9, 9, 11, 0.85), rgba(9, 9, 11, 0));
}

.carousel-track-wrap.has-more-left::before {
  opacity: 1;
}

.carousel-track-wrap.has-more-right::after {
  opacity: 1;
}

.carousel-section-title {
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text-main);
}

.carousel-section-hint {
  font-size: 0.78rem;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

.cell-carousel {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 4px 2px 10px;
  scrollbar-width: none;
}

.cell-carousel::-webkit-scrollbar {
  display: none;
}

.carousel-tile {
  position: relative;
  overflow: hidden;
  scroll-snap-align: center;
  flex: 0 0 118px;
  height: 140px;
  padding: 12px;
  border-radius: 20px;
  background: var(--ios-elevated);
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--specular-top);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: transform 0.22s var(--ios-spring), border-color 0.26s ease, background 0.26s ease;
  text-align: left;
  color: var(--text-main);
}

.carousel-tile:hover {
  border-color: rgba(255, 255, 255, 0.22);
  transform: translateY(-2px);
}

.carousel-tile:active {
  transform: scale(0.975);
}

.carousel-tile.is-passed {
  opacity: 0.56;
}

.carousel-tile.is-current {
  background: var(--ios-elevated-strong);
  border-color: var(--active-accent);
  box-shadow: var(--specular-top), 0 0 0 1px var(--active-soft), 0 12px 28px rgba(0, 0, 0, 0.42);
}

.carousel-tile.is-current::before {
  content: "";
  position: absolute;
  top: 0;
  left: 14%;
  right: 14%;
  height: 1.5px;
  background: linear-gradient(90deg, transparent, var(--active-accent), transparent);
  opacity: 0.72;
  pointer-events: none;
}

.carousel-tile.is-current::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 18px var(--active-soft);
  opacity: 0.55;
  pointer-events: none;
  animation: currentTileGlowBreath 4.4s ease-in-out infinite;
}

@keyframes currentTileGlowBreath {

  0%,
  100% {
    opacity: 0.35;
  }

  50% {
    opacity: 0.85;
  }
}

body.night-mode .carousel-tile.is-current::before {
  opacity: 0.35;
}

body.night-mode .carousel-tile.is-current::after {
  animation: none;
  opacity: 0.14;
}

.carousel-tile.is-reachable {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(38, 38, 46, 0.78);
}

.carousel-tile.is-gate,
.carousel-tile.is-finale {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.08), rgba(28, 28, 32, 0.84));
  border-color: rgba(245, 147, 66, 0.45);
}

.carousel-tile.is-finale {
  border-color: rgba(244, 63, 107, 0.58);
}

.tile-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tile-num {
  font-size: 0.76rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-dim);
}

.carousel-tile.is-current .tile-num {
  color: var(--active-accent);
}

.tile-reach-tag {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-main);
  font-variant-numeric: tabular-nums;
}

.tile-icon-badge {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  display: grid;
  place-items: center;
  color: var(--text-main);
}

.carousel-tile.is-current .tile-icon-badge {
  background: var(--active-soft);
  color: var(--active-accent);
}

.carousel-tile.is-gate .tile-icon-badge {
  background: rgba(245, 147, 66, 0.18);
  color: var(--c2-color);
}

.carousel-tile.is-finale .tile-icon-badge {
  background: rgba(244, 63, 107, 0.2);
  color: var(--c3-color);
}

.tile-bottom {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tile-type-name {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tile-pawns {
  display: flex;
  gap: 4px;
  min-height: 19px;
  align-items: center;
  flex-wrap: nowrap;
}

.pawn-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
  letter-spacing: -0.01em;
  max-width: 58px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pawn-badge.male {
  background: var(--p1-bg);
  color: var(--p1-color);
  border: 1px solid rgba(100, 210, 255, 0.3);
}

.pawn-badge.female {
  background: var(--p2-bg);
  color: var(--p2-color);
  border: 1px solid rgba(255, 100, 130, 0.3);
}

.board-legend-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px 14px;
  font-size: 0.75rem;
  color: var(--text-dim);
  padding-top: 2px;
}

.board-legend-strip span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Primary Roll CTA — Apple Crisp High-Contrast Pill */
.btn-primary,
.btn-roll-main,
.btn-roll-main.turn-p1,
.btn-roll-main.turn-p2 {
  background: #ffffff;
  color: #09090b;
  border: none;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: -0.015em;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.16);
  transition: transform 0.22s var(--ios-spring), opacity 0.2s ease, background 0.2s ease;
}

.btn-primary:hover:not(:disabled),
.btn-roll-main:hover:not(:disabled),
.btn-roll-main.turn-p1:hover:not(:disabled),
.btn-roll-main.turn-p2:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.92);
  color: #09090b;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
  transform: translateY(-1px);
}

.btn-primary:active:not(:disabled),
.btn-roll-main:active:not(:disabled) {
  transform: scale(0.975);
  transition-duration: 120ms;
}

/* Silk Diagonal Specular Sheen on Primary Roll CTA */
#btnRollDice {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

#btnRollDice::after {
  content: "";
  position: absolute;
  top: -15%;
  bottom: -15%;
  left: 0;
  width: 42%;
  background: linear-gradient(108deg, transparent 15%, rgba(232, 184, 138, 0.34) 50%, transparent 85%);
  transform: translateX(-160%) skewX(-18deg);
  pointer-events: none;
  animation: rollDiceSilkSheen 5.8s cubic-bezier(0.22, 1, 0.36, 1) infinite;
}

#btnRollDice:disabled::after {
  animation: none;
  opacity: 0;
}

@keyframes rollDiceSilkSheen {

  0%,
  72% {
    transform: translateX(-160%) skewX(-18deg);
    opacity: 0;
  }

  78% {
    opacity: 1;
  }

  96% {
    transform: translateX(340%) skewX(-18deg);
    opacity: 0.7;
  }

  100% {
    transform: translateX(340%) skewX(-18deg);
    opacity: 0;
  }
}

body.night-mode #btnRollDice::after {
  background: linear-gradient(108deg, transparent 15%, rgba(232, 184, 138, 0.14) 50%, transparent 85%);
}

/* ==================== iOS BOTTOM SHEET TASK MODAL ==================== */
.task-sheet-backdrop {
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.task-modal-card {
  background: rgba(24, 24, 28, 0.94);
  backdrop-filter: blur(36px) saturate(200%);
  -webkit-backdrop-filter: blur(36px) saturate(200%);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 28px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.72), var(--specular-top);
}

.sheet-grabber {
  width: 38px;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  margin: 10px auto 2px;
}

.task-modal-header {
  border-bottom: none;
  padding: 8px 20px 6px;
}

.task-modal-body {
  padding: 4px 20px 20px;
}

.task-badge {
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 5px 12px;
  text-transform: none;
  letter-spacing: -0.01em;
}

.modal-close {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  display: grid;
  place-items: center;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.22);
  color: #fff;
  transform: none;
}

.task-title {
  font-size: 1.32rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.22;
  color: #fff;
}

.task-description {
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  font-size: 0.96rem;
  line-height: 1.52;
  color: rgba(255, 255, 255, 0.88);
}

.cinematic-pose-card {
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #09090b;
  overflow: hidden;
}

.task-howto-accordion {
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 10px 13px;
}

.task-howto-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  list-style: none;
  font-weight: 600;
  color: var(--text-main);
}

.task-howto-summary::after {
  display: none;
}

.task-howto-summary::-webkit-details-marker {
  display: none;
}

/* Apple StandBy Timer Bar */
.timer-bar-box {
  border-radius: 20px;
  background: rgba(12, 12, 16, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.09);
  padding: 13px 16px;
  gap: 10px;
}

.timer-progress-track {
  height: 3px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
}

.timer-progress-fill {
  background: var(--active-accent);
  border-radius: 999px;
}

.timer-time-display {
  font-size: 2.15rem;
  font-weight: 300;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  color: #fff;
  line-height: 1;
}

.timer-bar-controls {
  gap: 8px;
}

.timer-btn-toggle {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: 50%;
  border: none;
  background: var(--active-accent);
  color: #09090b;
}

.timer-btn-mini,
.timer-btn-icon {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.09);
  border: none;
  color: var(--text-main);
  font-size: 0.78rem;
  font-weight: 600;
}

.btn-complete-main {
  min-height: 52px;
  border-radius: 16px !important;
  font-size: 1rem;
}

.btn-token-use,
.btn-skip-safe {
  min-height: 44px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-weight: 500;
}

/* Unified Apple Dark for Secondary Modals & Controls (Neon Cleanup) */
.modal-backdrop {
  background: rgba(9, 9, 11, 0.84);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

body.modal-open .dice-dock {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.modal-card {
  max-width: min(560px, calc(100vw - 24px));
  background: rgba(24, 24, 28, 0.96);
  backdrop-filter: blur(32px) saturate(180%);
  -webkit-backdrop-filter: blur(32px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.72), var(--specular-top);
}

.modal-card.modal-wide {
  max-width: min(860px, calc(100vw - 24px));
}

.modal-title-row {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
  margin: 0;
}

.age-pill-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.gender-svg.is-male {
  color: var(--p1-color);
}

.gender-svg.is-female {
  color: var(--p2-color);
}

.sf-icon-dice-lg {
  width: 34px;
  height: 34px;
}

.sf-heart-inline {
  fill: #ff375f;
  stroke: #ff375f;
  vertical-align: -2px;
}

/* Desktop Sidebar Circle Banner Deduplication (keeps active toys/sets pills only) */
@media (min-width: 681px) {

  .circle-banner-header,
  .circle-title,
  .circle-subtitle {
    display: none;
  }

  .circle-banner {
    padding: 12px 14px;
    border-radius: 18px;
  }

  .active-toys-pills {
    margin-top: 0;
  }
}

/* Apple Dark Dice Stage (Desktop/Tablet) */
.dice-stage {
  background: rgba(34, 34, 40, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: var(--specular-top), 0 12px 28px rgba(0, 0, 0, 0.45);
}

.dice-stage:hover {
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow: var(--specular-top), 0 16px 36px rgba(0, 0, 0, 0.58);
}

.dice-value {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: #fff;
  text-shadow: none;
}

.dice-sub {
  color: var(--text-dim);
}

/* Apple Dark Pending Task Banner & Turn Handoff */
.pending-task-banner {
  background: rgba(28, 28, 34, 0.94);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: var(--specular-top), 0 12px 32px rgba(0, 0, 0, 0.55);
}

.pending-task-dot {
  background: var(--active-accent);
  box-shadow: 0 0 8px var(--active-accent);
}

.pending-task-btn {
  padding: 8px 16px;
  min-height: 44px;
  font-size: 0.88rem;
}

.turn-handoff-overlay {
  background: rgba(9, 9, 11, 0.8);
}

.turn-handoff-card {
  background: rgba(24, 24, 28, 0.96);
  border: 1px solid rgba(100, 210, 255, 0.42);
  box-shadow: var(--specular-top), 0 24px 60px rgba(0, 0, 0, 0.72);
}

.turn-handoff-card.handoff-p2 {
  border-color: rgba(255, 100, 130, 0.42);
  box-shadow: var(--specular-top), 0 24px 60px rgba(0, 0, 0, 0.72);
}

.turn-handoff-player {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* Apple Dark Performer Banner & Role Badges */
.performer-line {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.performer-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.performer-arrow {
  color: var(--text-dim);
}

.pose-role-badge.badge-male {
  background: rgba(16, 26, 36, 0.76);
  border: 1px solid rgba(100, 210, 255, 0.45);
  color: #e0f2fe;
}

.pose-role-badge.badge-female {
  background: rgba(36, 16, 24, 0.76);
  border: 1px solid rgba(255, 100, 130, 0.45);
  color: #fce7f3;
}

/* Apple Dark Setup, Quick Start, Toggles, Toys & Sets */
.form-label-with-icon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-main);
  font-weight: 600;
}

.form-label-safety {
  color: var(--text-main);
}

.toggle-label-with-icon {
  display: inline-flex;
  align-items: flex-start;
  gap: 7px;
}

.toggle-label-with-icon .sf-icon {
  margin-top: 2px;
  color: var(--text-muted);
}

.toggle-track::after {
  background: rgba(255, 255, 255, 0.88);
}

.toggle-switch input[type="checkbox"]:checked+.toggle-track {
  background: #30d158;
  border-color: rgba(48, 209, 88, 0.8);
  box-shadow: none;
}

.toggle-switch input[type="checkbox"]:focus-visible+.toggle-track {
  outline: 2px solid rgba(255, 255, 255, 0.75);
}

.select-check-dot {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.22);
}

.select-check-dot.checked {
  background: #30d158;
  border-color: #30d158;
  box-shadow: none;
}

.toy-option-card {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.toy-option-card:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.22);
}

.toy-option-card.selected {
  background: rgba(48, 209, 88, 0.1);
  border-color: rgba(48, 209, 88, 0.55);
  box-shadow: none;
}

.toy-option-icon {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-main);
}

.toy-option-card.selected .toy-option-icon {
  background: rgba(48, 209, 88, 0.16);
  border-color: rgba(48, 209, 88, 0.45);
  color: #30d158;
}

.qs-section-label {
  color: var(--text-main);
}

.qs-gender-btn {
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.qs-gender-btn.is-male {
  background: var(--p1-bg);
  border-color: rgba(100, 210, 255, 0.35);
}

.qs-gender-btn.is-female {
  background: var(--p2-bg);
  border-color: rgba(255, 100, 130, 0.35);
}

.qs-toy-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.qs-toy-chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.qs-toy-chip.selected {
  background: rgba(48, 209, 88, 0.12);
  border-color: rgba(48, 209, 88, 0.58);
  box-shadow: none;
}

.setup-tab-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.setup-tab-btn.active {
  border-bottom-color: #fff;
  background: rgba(255, 255, 255, 0.07);
}

.setup-modal-body {
  padding-bottom: 0;
}

.setup-footer-sticky {
  position: sticky;
  bottom: 0;
  margin: 14px -24px 0;
  padding: 14px 24px 18px;
  background: rgba(20, 20, 24, 0.94);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 -16px 28px rgba(14, 14, 18, 0.88);
  z-index: 6;
}

body.night-mode .setup-footer-sticky {
  background: rgba(8, 8, 10, 0.98) !important;
  box-shadow: 0 -14px 24px rgba(0, 0, 0, 0.96);
}

/* Sets Storefront Apple Dark */
.set-cat-pill.active {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.32);
  color: #fff;
}

.set-card {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.set-card:hover {
  border-color: rgba(255, 255, 255, 0.24);
}

.set-card.selected {
  border-color: rgba(48, 209, 88, 0.6);
  background: rgba(48, 209, 88, 0.09);
  box-shadow: none;
}

.set-card.locked {
  border-color: rgba(255, 159, 10, 0.3);
  background: rgba(255, 255, 255, 0.035);
}

.set-card-cover {
  background: rgba(255, 255, 255, 0.05);
}

.set-card-cover-atmospheric {
  background:
    radial-gradient(circle at 20% 25%, rgba(255, 255, 255, 0.08), transparent 55%),
    linear-gradient(145deg, #16161a 0%, #1f1f26 55%, #111114 100%);
}

.set-card-cover-emblem {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.set-badge-promo {
  font-size: 0.75rem;
  padding: 2px 9px;
  background: rgba(255, 55, 95, 0.9);
}

.set-price-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  background: rgba(9, 9, 11, 0.86);
  border-color: rgba(255, 159, 10, 0.55);
  color: #ffd60a;
}

.set-price-pill.free {
  border-color: rgba(48, 209, 88, 0.55);
  color: #30d158;
}

.set-lock-icon {
  color: var(--text-dim);
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
}

.set-meta-inline {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.spice-pips {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.spice-pip {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
}

.spice-pip.active {
  background: #ff375f;
}

.set-card-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #fff;
  border-radius: 12px;
}

.set-card-cta:hover {
  background: rgba(255, 255, 255, 0.15);
}

.set-preview-cover {
  background: linear-gradient(145deg, #1b1b22, #121216);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
}

.set-preview-stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-main);
}

.set-teaser-section-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-main);
  margin-top: 4px;
}

.set-teaser-meta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.set-teaser-item {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-left: 3px solid #ff9f0a;
}

.set-teaser-text {
  color: var(--text-muted);
}

/* Consent, Rules, Clothes, Card Pick & PWA Apple Dark */
.consent-content {
  color: var(--text-main);
}

.consent-list li {
  display: flex;
  align-items: flex-start;
  gap: 9px;
}

.consent-list-icon {
  margin-top: 3px;
  color: var(--text-muted);
}

.consent-decline-link {
  gap: 6px;
}

.rules-list {
  color: var(--text-main);
}

.rules-heading {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 4px;
  color: #fff;
}

.rules-copy {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.rules-legend-grid {
  color: var(--text-muted);
}

.rules-inline-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.rules-c1 {
  background: rgba(48, 209, 88, 0.08);
  border: 1px solid rgba(48, 209, 88, 0.28);
}

.rules-c2 {
  background: rgba(255, 159, 10, 0.08);
  border: 1px solid rgba(255, 159, 10, 0.28);
}

.rules-c3 {
  background: rgba(255, 55, 95, 0.09);
  border: 1px solid rgba(255, 55, 95, 0.3);
}

.rules-safety {
  background: rgba(100, 210, 255, 0.08);
  border: 1px solid rgba(100, 210, 255, 0.26);
}

.tab-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Clothes Adjust Interactive Stage Pills + +1/-1 Controls */
button.stage-pill {
  min-height: 44px;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.78rem;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

button.stage-pill:hover {
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
}

button.stage-pill.active {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.38);
  color: #fff;
}

.clothes-adjust-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.clothes-reset-btn {
  grid-column: 1 / -1;
}

.resume-summary-text {
  color: var(--text-main);
}

/* Card Pick Apple Dark */
.tempt-card-back {
  background:
    radial-gradient(circle at 50% 35%, rgba(255, 255, 255, 0.08), transparent 65%),
    linear-gradient(155deg, #222228 0%, #121216 100%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: var(--specular-top), 0 10px 26px rgba(0, 0, 0, 0.55);
}

.tempt-card-back-icon {
  color: var(--text-main);
}

.tempt-card-back-icon .sf-icon {
  width: 28px;
  height: 28px;
}

.tempt-card-back-num {
  color: var(--text-muted);
}

.tempt-card-front {
  background: linear-gradient(155deg, rgba(40, 40, 48, 0.96), rgba(22, 22, 28, 0.98));
  border: 1.5px solid var(--active-accent);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.55);
}

/* Finale & Afterglow Apple Dark */
.finale-modal-card {
  border-color: rgba(255, 159, 10, 0.35);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.78), var(--specular-top);
}

.finale-subtitle {
  color: var(--text-muted);
}

.finale-selected-detail {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-main);
}

.afterglow-section-title {
  color: var(--text-muted);
}

.fav-heart-btn {
  color: var(--text-muted);
}

.fav-heart-btn.active {
  background: rgba(255, 55, 95, 0.16);
  border-color: rgba(255, 55, 95, 0.55);
  color: #ff375f;
}

/* PWA Toast & Banner Apple Dark */
.pwa-toast,
.pwa-install-banner {
  background: rgba(24, 24, 28, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: var(--specular-top), 0 14px 36px rgba(0, 0, 0, 0.65);
}

.pwa-toast-text,
.pwa-install-text {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.brand-badge {
  font-size: 0.75rem;
}

/* ==================== MOBILE UNIFIED BREAKPOINT (<= 680px — 360 / 390 / 430 / 660) ==================== */
@media (max-width: 680px) {
  .topbar {
    height: auto;
    min-height: 54px;
    padding: 6px 12px;
  }

  .brand-logo {
    width: 38px;
    height: 38px;
    min-width: 38px;
    border-radius: 11px;
  }

  .brand-logo-svg {
    width: 28px;
    height: 28px;
  }

  .brand-badge,
  .brand-text-wrap,
  .topbar-actions .btn-label-text {
    display: none;
  }

  .topbar-actions {
    gap: 6px;
  }

  .topbar-actions .btn {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    border-radius: 50%;
  }

  .app-layout {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 10px 14px calc(104px + env(safe-area-inset-bottom, 0px));
    gap: 12px;
  }

  .circle-banner {
    display: none;
  }

  .players-grid {
    order: 1;
    width: 100%;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    gap: 8px;
  }

  .player-card {
    padding: 9px 10px;
    border-radius: 18px;
  }

  .player-tokens-row {
    flex-wrap: nowrap;
    justify-content: space-between;
    gap: 5px;
    margin-top: 7px;
    padding-top: 7px;
  }

  .token-chip {
    padding: 4px 7px;
    font-size: 0.75rem;
    flex-shrink: 0;
  }

  .clothes-chip {
    min-height: 44px;
    padding: 4px 8px;
    font-size: 0.75rem;
    min-width: 0;
    flex: 1 1 auto;
    justify-content: center;
  }

  .board-panel {
    order: 2;
    width: 100%;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    border-radius: 0;
    gap: 12px;
  }

  .rings-hero-card {
    padding: 14px 16px;
    gap: 14px;
    background: var(--ios-elevated);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    box-shadow: var(--specular-top), 0 12px 32px rgba(0, 0, 0, 0.36);
  }

  .rings-svg-wrap,
  .rings-svg {
    width: 112px;
    height: 112px;
  }

  .rings-title {
    font-size: 1.12rem;
  }

  .carousel-nav-btns {
    display: none;
  }

  .carousel-tile {
    flex: 0 0 104px;
    height: 132px;
    padding: 10px;
  }

  .board-legend-strip {
    display: grid;
    grid-template-columns: repeat(3, auto);
    justify-content: center;
    gap: 8px 16px;
  }

  .finale-pose-thumb {
    max-height: 205px;
  }

  .setup-footer-sticky {
    margin: 12px -14px 0;
    padding: 12px 14px calc(14px + env(safe-area-inset-bottom, 0px));
  }

  /* P0-9: PWA Banner & Update Toast above fixed .dice-dock */
  .pwa-toast,
  .pwa-install-banner {
    bottom: calc(88px + env(safe-area-inset-bottom, 0px));
  }

  /* Fixed Thumb-Zone Bottom Dock */
  .dice-dock {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 35;
    margin: 0;
    padding: 12px 16px calc(14px + env(safe-area-inset-bottom, 0px));
    border-radius: 0;
    border: none;
    background: linear-gradient(to top, rgba(9, 9, 11, 0.98) 62%, rgba(9, 9, 11, 0));
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: none;
    flex-direction: row;
    align-items: center;
    gap: 10px;
  }

  .dice-stage-wrapper {
    display: none;
  }

  .dice-result-desc {
    display: none;
  }

  .btn-roll-main {
    width: 100%;
    height: 54px;
    min-height: 54px;
    font-size: 1rem;
  }

  /* P0-1: True iOS Bottom Sheet Slide-Up pinned cleanly to bottom edge */
  .task-sheet-backdrop {
    align-items: flex-end;
    padding: 0;
  }

  .task-modal-card {
    margin: 0;
    width: 100%;
    max-width: 100%;
    max-height: 92dvh;
    border-radius: 30px 30px 0 0;
    border-bottom: none;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
}

/* ============================================================================
   DESIGN REFINEMENT PHASES 2 & 3 (DR-05 .. DR-12)
   Warm Intimate Evening Atmosphere, Bedroom Ergonomics & Premium Accents
   ============================================================================ */

/* DR-05: Warm Velvet Ambient Mood & Intimate Rings of Passion */
body[data-circle="1"] {
  background-color: #09090b;
}

body[data-circle="1"] .orb-1 {
  background: radial-gradient(circle, rgba(232, 184, 138, 0.18), transparent 70%);
}

body[data-circle="1"] .orb-2 {
  background: radial-gradient(circle, rgba(138, 72, 96, 0.14), transparent 70%);
}

body[data-circle="1"] .orb-3 {
  background: radial-gradient(circle, rgba(246, 213, 176, 0.06), transparent 70%);
}

body[data-circle="2"] {
  background-color: #0c090a;
}

body[data-circle="2"] .orb-1 {
  background: radial-gradient(circle, rgba(245, 147, 66, 0.21), transparent 70%);
}

body[data-circle="2"] .orb-2 {
  background: radial-gradient(circle, rgba(180, 83, 9, 0.16), transparent 70%);
}

body[data-circle="2"] .orb-3 {
  background: radial-gradient(circle, rgba(251, 191, 36, 0.07), transparent 70%);
}

body[data-circle="3"] {
  background-color: #0e080b;
}

body[data-circle="3"] .orb-1 {
  background: radial-gradient(circle, rgba(244, 63, 107, 0.22), transparent 70%);
}

body[data-circle="3"] .orb-2 {
  background: radial-gradient(circle, rgba(159, 18, 57, 0.16), transparent 70%);
}

body[data-circle="3"] .orb-3 {
  background: radial-gradient(circle, rgba(251, 113, 133, 0.08), transparent 70%);
}

.rings-hero-card {
  background: linear-gradient(150deg, rgba(32, 30, 36, 0.78), rgba(20, 19, 24, 0.86));
  border-color: rgba(255, 255, 255, 0.11);
}

.rings-hero-card::before {
  background: radial-gradient(circle 142px at 84px 50%, var(--rings-card-glow, rgba(232, 184, 138, 0.15)), transparent 74%);
  opacity: 0.92;
  transition: background 1.1s var(--ios-spring), opacity 1.1s var(--ios-spring);
}

body.night-mode .rings-hero-card::before {
  opacity: 0.16;
}

.ring-track {
  opacity: 0.11;
}

.rings-mood-subtitle {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.35;
  color: var(--text-muted);
}

.rings-legend {
  gap: 5px;
  margin-top: 4px;
}

.ring-legend-row {
  padding: 2px 0;
  color: var(--text-dim);
  transition: color 0.25s ease, opacity 0.25s ease;
}

.ring-legend-row.is-active-chapter {
  color: var(--text-main);
  font-weight: 600;
}

.ring-legend-row.is-completed-chapter {
  color: var(--text-muted);
}

.ring-legend-status {
  font-size: 0.76rem;
  font-variant-numeric: tabular-nums;
}

/* DR-06: Elevated Atmospheric Header for 90% Text-Only Cards */
.task-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.modal-action-icon-btn {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.11);
  color: var(--text-muted);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.modal-action-icon-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.modal-action-icon-btn[aria-pressed="true"] {
  background: rgba(255, 159, 10, 0.2);
  border-color: rgba(255, 159, 10, 0.5);
  color: #ffd180;
}

.task-atmosphere-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 11px 14px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: var(--specular-top);
  overflow: hidden;
}

.task-atmosphere-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 12% 50%, color-mix(in srgb, var(--task-accent, #ff9f0a) 22%, transparent), transparent 60%);
}

.task-atmosphere-medallion {
  position: relative;
  z-index: 1;
  width: 42px;
  height: 42px;
  min-width: 42px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid color-mix(in srgb, var(--task-accent, #ff9f0a) 42%, rgba(255, 255, 255, 0.12));
  color: var(--task-accent, var(--active-accent));
  display: grid;
  place-items: center;
}

.task-atmosphere-copy {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.task-atmosphere-label {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.task-atmosphere-cue {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.task-description.is-text-only-card {
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-left: 3px solid var(--task-accent, var(--active-accent));
  font-size: 1rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.92);
}

body.night-mode .task-atmosphere-card {
  background: rgba(255, 255, 255, 0.025);
  border-color: rgba(255, 255, 255, 0.07);
}

body.night-mode .task-description.is-text-only-card {
  background: rgba(255, 255, 255, 0.02);
  border-color: rgba(255, 255, 255, 0.07);
  border-left-color: color-mix(in srgb, var(--task-accent, var(--active-accent)) 65%, #000);
}

/* DR-07: Pause / Calm Rest Overlay */
.pause-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(4, 4, 6, 0.96);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
}

.pause-overlay-card {
  width: 100%;
  max-width: 400px;
  padding: 32px 24px 26px;
  border-radius: 28px;
  background: rgba(22, 22, 26, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.11);
  box-shadow: var(--specular-top), 0 28px 70px rgba(0, 0, 0, 0.8);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.pause-overlay-emblem {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(255, 159, 10, 0.14);
  border: 1px solid rgba(255, 159, 10, 0.34);
  color: #ffd180;
  display: grid;
  place-items: center;
}

.sf-icon-pause-lg {
  width: 26px;
  height: 26px;
}

.pause-overlay-title {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
}

.pause-overlay-text {
  margin: 0;
  font-size: 0.94rem;
  line-height: 1.55;
  color: var(--text-muted);
  max-width: 32ch;
}

.pause-overlay-actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 6px;
}

.pause-secondary-btn {
  width: 100%;
  min-height: 46px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-main);
  font-weight: 500;
}

.pause-secondary-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* DR-08: Sensory Timer 00:00 Warm Pulse & Live Minimized Banner Timer */
.task-modal-card {
  position: relative;
}

.task-modal-card::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  border: 2px solid rgba(255, 159, 10, 0.85);
  box-shadow: inset 0 0 36px rgba(255, 159, 10, 0.24);
  pointer-events: none;
  opacity: 0;
}

.task-modal-card.timer-done-pulse::after {
  animation: timerDonePulse 0.95s ease-in-out 3;
}

@keyframes timerDonePulse {

  0%,
  100% {
    opacity: 0;
    transform: scale(1);
  }

  45% {
    opacity: 0.95;
    transform: scale(1.004);
  }
}

.timer-bar-box.is-done {
  border-color: rgba(255, 159, 10, 0.45);
  background: rgba(28, 22, 16, 0.86);
}

.timer-done-note {
  font-size: 0.82rem;
  font-weight: 600;
  color: #ffd180;
  line-height: 1.35;
  padding-top: 2px;
}

.btn-complete-main.is-timer-done {
  background: linear-gradient(135deg, #fff7e6, #ffd180);
  color: #09090b;
  box-shadow: 0 0 0 2px rgba(255, 159, 10, 0.55), 0 12px 32px rgba(255, 159, 10, 0.32);
}

.pending-task-info {
  gap: 8px;
}

.pending-task-timer {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-main);
  font-size: 0.78rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex-shrink: 0;
}

.pending-task-banner.is-running .pending-task-timer {
  background: var(--active-soft);
  border-color: var(--active-accent);
  color: #fff;
}

.pending-task-banner.is-done .pending-task-timer {
  background: rgba(255, 159, 10, 0.22);
  border-color: rgba(255, 159, 10, 0.65);
  color: #ffd180;
}

/* DR-10: Hands-Free "Телефон на ліжку" Dark Card Mode */
.bed-mode-exit-hint {
  display: none;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-dim);
  padding-top: 4px;
}

#taskModal.bed-mode {
  background: rgba(0, 0, 0, 0.97);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  align-items: center;
  padding: 16px;
}

#taskModalCard.bed-mode {
  background: #000000 !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 30px;
  box-shadow: none !important;
  max-width: 560px;
  width: 100%;
  margin: auto;
  cursor: pointer;
}

#taskModalCard.bed-mode .sheet-grabber,
#taskModalCard.bed-mode #taskMetaChip,
#taskModalCard.bed-mode #btnCloseTaskModal,
#taskModalCard.bed-mode #taskPerformerBanner,
#taskModalCard.bed-mode #taskSpecialNote,
#taskModalCard.bed-mode #taskAtmosphereHeader,
#taskModalCard.bed-mode #taskVisualWrapper,
#taskModalCard.bed-mode #taskHowToAccordion,
#taskModalCard.bed-mode .task-secondary-row,
#taskModalCard.bed-mode #btnTimerReset,
#taskModalCard.bed-mode #btnTimerPlus30 {
  display: none !important;
}

#taskModalCard.bed-mode:not(.is-timer-finished) .task-modal-actions {
  display: none !important;
}

#taskModalCard.bed-mode .task-modal-header {
  justify-content: flex-end;
  padding: 12px 16px 0;
}

#taskModalCard.bed-mode .task-modal-body {
  padding: 6px 24px 28px;
  gap: 20px;
  text-align: center;
}

#taskModalCard.bed-mode .task-title {
  font-size: 1.42rem;
  line-height: 1.24;
  color: rgba(255, 255, 255, 0.94);
}

#taskModalCard.bed-mode .task-description,
#taskModalCard.bed-mode .task-description.is-text-only-card {
  background: transparent;
  border: none;
  padding: 0;
  font-size: 1.18rem;
  line-height: 1.62;
  color: rgba(245, 245, 250, 0.9);
  text-align: center;
}

#taskModalCard.bed-mode .timer-bar-box {
  background: transparent;
  border: none;
  padding: 8px 0 4px;
  gap: 14px;
  align-items: center;
}

#taskModalCard.bed-mode .timer-progress-track {
  width: 100%;
  height: 4px;
}

#taskModalCard.bed-mode .timer-bar-row {
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

#taskModalCard.bed-mode .timer-time-display {
  font-size: 4.1rem;
  font-weight: 200;
  letter-spacing: -0.04em;
  color: #fff;
  animation: bedTimerBreathe 3.4s ease-in-out infinite;
}

#taskModalCard.bed-mode .bed-mode-exit-hint {
  display: block;
}

@keyframes bedTimerBreathe {

  0%,
  100% {
    opacity: 0.88;
    transform: scale(1);
  }

  50% {
    opacity: 1;
    transform: scale(1.02);
  }
}

/* DR-11: "3 Cards with Character" Archetypes */
.tempt-card-back {
  gap: 5px;
  padding: 12px 8px;
}

.tempt-card-back-num {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: none;
  color: #fff;
}

.tempt-card-back-mood {
  font-size: 0.75rem;
  line-height: 1.25;
  color: var(--text-muted);
  text-align: center;
}

.tempt-card-front {
  gap: 6px;
  padding: 12px 8px;
}

.tempt-card-front-arch {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

.tempt-archetype-tenderness .tempt-card-back {
  background:
    radial-gradient(circle at 50% 28%, rgba(100, 210, 255, 0.2), transparent 68%),
    linear-gradient(155deg, #1b222a 0%, #111318 100%);
  border-color: rgba(100, 210, 255, 0.34);
}

.tempt-archetype-tenderness .tempt-card-back-icon {
  color: #7dd3fc;
}

.tempt-archetype-spark .tempt-card-back {
  background:
    radial-gradient(circle at 50% 28%, rgba(255, 159, 10, 0.22), transparent 68%),
    linear-gradient(155deg, #272017 0%, #141210 100%);
  border-color: rgba(255, 159, 10, 0.38);
}

.tempt-archetype-spark .tempt-card-back-icon {
  color: #ffbe4d;
}

.tempt-archetype-boldness .tempt-card-back {
  background:
    radial-gradient(circle at 50% 28%, rgba(255, 55, 95, 0.24), transparent 68%),
    linear-gradient(155deg, #2a1820 0%, #150e12 100%);
  border-color: rgba(255, 55, 95, 0.42);
}

.tempt-archetype-boldness .tempt-card-back-icon {
  color: #ff6b8a;
}

/* DR-12: Afterglow «Капсула Вечора» */
.afterglow-hero {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 18px;
  background: radial-gradient(circle at 12% 20%, rgba(255, 159, 10, 0.12), transparent 60%), rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.09);
}

.afterglow-hero-summary {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 600;
  line-height: 1.45;
  color: var(--text-main);
}

.afterglow-moments-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.afterglow-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.11);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}

.afterglow-question-card,
.afterglow-timer-card,
.afterglow-pwa-card {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: var(--specular-top);
}

.afterglow-question-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: linear-gradient(140deg, rgba(255, 100, 130, 0.09), rgba(255, 255, 255, 0.03));
  border-color: rgba(255, 100, 130, 0.22);
}

.afterglow-question-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.afterglow-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-muted);
}

.afterglow-refresh-btn {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.18s ease, transform 0.18s ease;
}

.afterglow-refresh-btn:hover {
  background: rgba(255, 255, 255, 0.14);
}

.afterglow-question-text {
  margin: 0;
  font-size: 1.04rem;
  font-weight: 500;
  line-height: 1.48;
  color: #fff;
}

.afterglow-timer-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.afterglow-timer-card.is-running {
  border-color: rgba(255, 159, 10, 0.42);
}

.afterglow-timer-card.is-done {
  border-color: rgba(48, 209, 88, 0.45);
}

.afterglow-timer-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.aftercare-time-display {
  font-size: 1.7rem;
  font-weight: 300;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  color: #fff;
  line-height: 1.1;
}

.afterglow-timer-controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.aftercare-toggle-btn {
  background: #ff9f0a;
  color: #09090b;
}

.afterglow-pwa-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.afterglow-pwa-copy {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 200px;
}

.afterglow-pwa-icon {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.11);
  color: var(--text-main);
  display: grid;
  place-items: center;
}

.afterglow-pwa-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: #fff;
}

.afterglow-pwa-desc {
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--text-muted);
  margin-top: 2px;
}

.afterglow-pwa-btn {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #fff;
  font-weight: 600;
}

/* Mobile 360px Topbar Fit for 4x 44px Buttons + Compact Mood Cards */
@media (max-width: 680px) {
  .topbar {
    gap: 6px;
    padding: 6px 10px;
  }

  .topbar-actions {
    gap: 4px;
  }

  .dynamic-pill {
    padding: 5px 9px;
    font-size: 0.75rem;
    gap: 5px;
    max-width: 122px;
    overflow: hidden;
  }

  #iosTurnPillText {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .rings-mood-subtitle {
    font-size: 0.78rem;
  }

  .tempt-card-back {
    padding: 10px 5px;
  }

  .tempt-card-back-num {
    font-size: 0.78rem;
  }

  .tempt-card-back-mood {
    font-size: 0.75rem;
  }
}

@media (max-width: 390px) {
  .dynamic-pill {
    max-width: 104px;
    padding: 5px 8px;
  }

  .card-pick-grid {
    gap: 7px;
  }
}

/* Silk Content Cascade inside #taskModal */
#taskModal.open .task-modal-header,
#taskModal.open .task-title,
#taskModal.open .task-performer-banner,
#taskModal.open .task-atmosphere-card,
#taskModal.open .task-visual-wrapper,
#taskModal.open .task-description,
#taskModal.open .timer-bar-box,
#taskModal.open .task-modal-actions {
  animation: taskSilkReveal 380ms var(--ios-spring) both;
}

#taskModal.open .task-modal-header {
  animation-delay: 20ms;
}

#taskModal.open .task-title {
  animation-delay: 65ms;
}

#taskModal.open .task-performer-banner {
  animation-delay: 110ms;
}

#taskModal.open .task-atmosphere-card,
#taskModal.open .task-visual-wrapper {
  animation-delay: 150ms;
}

#taskModal.open .task-description {
  animation-delay: 195ms;
}

#taskModal.open .timer-bar-box {
  animation-delay: 240ms;
}

#taskModal.open .task-modal-actions {
  animation-delay: 280ms;
}

@keyframes taskSilkReveal {
  0% {
    opacity: 0;
    transform: translateY(6px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {

  .task-modal-card.timer-done-pulse::after,
  #taskModalCard.bed-mode .timer-time-display,
  #btnRollDice::after,
  .carousel-tile.is-current::after,
  #taskModal.open .task-modal-header,
  #taskModal.open .task-title,
  #taskModal.open .task-performer-banner,
  #taskModal.open .task-atmosphere-card,
  #taskModal.open .task-visual-wrapper,
  #taskModal.open .task-description,
  #taskModal.open .timer-bar-box,
  #taskModal.open .task-modal-actions,
  .qs-step-panel.active,
  .qs-set-card,
  .qs-set-skeleton {
    animation: none !important;
    transform: none !important;
    transition: none !important;
  }
}

/* ==================== 2-КРОКОВИЙ СТАРТОВИЙ POPUP (/play/) ==================== */
.quick-start-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 600px;
  max-height: min(92dvh, 780px);
  overflow: hidden;
}

.qs-wizard-header {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  padding-bottom: 12px;
}

.qs-header-title-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
}

.qs-step-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  white-space: nowrap;
}

.qs-step-progress {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  width: 100%;
}

.qs-progress-seg {
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  transition: background-color 0.28s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.28s ease;
}

.qs-progress-seg.active {
  background: linear-gradient(90deg, #e8b88a, #f43f6b);
}

.quick-start-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 14px 18px 18px;
}

.qs-step-panel[hidden] {
  display: none !important;
}

.qs-step-panel.active {
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: qsStepReveal 280ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes qsStepReveal {
  0% {
    opacity: 0;
    transform: translateY(8px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Format Selector Cards (Step 1) */
.qs-format-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.qs-format-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 68px;
  padding: 12px;
  border-radius: 15px;
  border: 1.5px solid rgba(255, 255, 255, 0.13);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.94);
  text-align: left;
  cursor: pointer;
  transition: transform 140ms ease-out, border-color 220ms ease, background-color 220ms ease;
}

.qs-format-card:active {
  transform: scale(0.98);
}

.qs-format-card.selected {
  border-color: rgba(244, 63, 107, 0.72);
  background: linear-gradient(145deg, rgba(232, 184, 138, 0.14), rgba(244, 63, 107, 0.16));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 8px 22px rgba(244, 63, 107, 0.14);
}

.qs-format-icon {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.07);
  color: #e8b88a;
}

.qs-format-card.selected .qs-format-icon {
  background: rgba(244, 63, 107, 0.22);
  color: #fff;
}

.qs-format-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-width: 0;
}

.qs-format-title {
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.25;
  color: rgba(255, 255, 255, 0.95);
}

.qs-format-desc {
  font-size: 0.76rem;
  line-height: 1.35;
  color: rgba(235, 235, 245, 0.68);
}

.qs-moods-chips {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.qs-toy-chip:active {
  transform: scale(0.975);
}

.qs-toy-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.qs-toy-label span {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Step 2 Toolbar, Filter & Sets Grid */
.qs-step2-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.qs-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 0.84rem;
  font-weight: 600;
}

.qs-context-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.qs-context-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(232, 184, 138, 0.14);
  border: 1px solid rgba(232, 184, 138, 0.32);
}

.qs-sets-filter-bar {
  display: flex;
  gap: 6px;
  padding: 4px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.qs-filter-tab {
  flex: 1;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: rgba(235, 235, 245, 0.76);
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 180ms ease, color 180ms ease, border-color 180ms ease;
}

.qs-filter-tab.active {
  background: rgba(255, 255, 255, 0.13);
  border-color: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.qs-fallback-note {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(245, 147, 66, 0.12);
  border: 1px solid rgba(245, 147, 66, 0.34);
  color: rgba(255, 244, 232, 0.92);
  font-size: 0.82rem;
  line-height: 1.45;
}

.qs-step2-lead,
.setup-sets-lead {
  margin: 0 0 10px;
  font-size: 0.84rem;
  line-height: 1.48;
  color: rgba(235, 235, 245, 0.72);
}

.set-price-pill.is-selected-pill {
  background: rgba(244, 63, 107, 0.88);
  border-color: rgba(255, 190, 208, 0.55);
  color: #fff;
}

.set-card[role="radio"],
.qs-set-card[role="radio"] {
  transition: transform 240ms cubic-bezier(0.22, 1, 0.36, 1), border-color 240ms cubic-bezier(0.22, 1, 0.36, 1), background-color 240ms cubic-bezier(0.22, 1, 0.36, 1);
}

.set-card[role="radio"]:focus-visible,
.qs-set-card[role="radio"]:focus-visible {
  outline: 2px solid var(--c1-color);
  outline-offset: 2px;
}

.set-card[role="radio"]:active,
.qs-set-card[role="radio"]:active {
  transform: scale(0.985);
}

body.night-mode .set-price-pill.is-selected-pill {
  background: rgba(244, 63, 107, 0.48);
  border-color: rgba(244, 63, 107, 0.52);
  color: rgba(255, 240, 244, 0.94);
}

@media (prefers-reduced-motion: reduce) {
  .set-card[role="radio"],
  .qs-set-card[role="radio"] {
    transition: none;
  }
}

.qs-sets-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.qs-set-card {
  animation: qsStepReveal 320ms cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(var(--qs-card-idx, 0) * 45ms);
}

.qs-set-card .set-card-cover-emblem,
.set-card-cover-atmospheric .set-card-cover-emblem {
  padding-top: 22px;
}

.qs-set-desc-clamp {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.qs-match-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.qs-match-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  color: #f8e5cf;
  background: rgba(232, 184, 138, 0.14);
  border: 1px solid rgba(232, 184, 138, 0.3);
}

.set-card-cta-soft {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.92);
}

.set-card-cta-soft:hover {
  background: rgba(255, 255, 255, 0.13);
  border-color: rgba(255, 255, 255, 0.28);
}

/* Skeleton Loader */
.qs-set-skeleton {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  animation: qsSkelPulse 1.6s ease-in-out infinite;
}

.qs-skel-cover {
  height: 86px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.08);
}

.qs-skel-line {
  height: 12px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
}

.qs-skel-title {
  width: 72%;
  height: 15px;
}

.qs-skel-desc {
  width: 94%;
}

.qs-skel-meta {
  width: 55%;
}

@keyframes qsSkelPulse {
  0%, 100% {
    opacity: 0.55;
  }
  50% {
    opacity: 0.95;
  }
}

.qs-empty-sets-card {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 22px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  color: rgba(235, 235, 245, 0.8);
  font-size: 0.88rem;
  line-height: 1.5;
}

/* Sticky Wizard Footer */
.qs-wizard-footer {
  flex-shrink: 0;
  padding: 12px 18px calc(12px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(20, 20, 24, 0.92);
  backdrop-filter: blur(20px);
}

.qs-footer-group[hidden] {
  display: none !important;
}

.qs-footer-group.active {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.qs-selection-summary {
  width: 100%;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 600;
  color: rgba(235, 235, 245, 0.8);
}

.qs-cta-btn {
  width: 100%;
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.qs-cta-btn:disabled {
  opacity: 0.72;
  cursor: wait;
}

/* Night Mode Overrides for 2-Step Wizard */
body.night-mode .qs-wizard-footer {
  background: rgba(6, 6, 8, 0.96);
  border-top-color: rgba(255, 255, 255, 0.08);
}

body.night-mode .qs-format-card.selected {
  background: rgba(244, 63, 107, 0.12);
  box-shadow: none;
}

body.night-mode .qs-progress-seg.active {
  opacity: 0.72;
}

/* Mobile Responsive for 2-Step Wizard */
@media (max-width: 560px) {
  .quick-start-card {
    max-height: 94dvh;
  }

  .quick-start-body {
    padding: 12px 14px 16px;
  }

  .qs-wizard-footer {
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px));
  }

  .qs-sets-grid {
    grid-template-columns: 1fr;
  }

  .qs-format-grid {
    grid-template-columns: 1fr;
  }

  .qs-name-input {
    font-size: 16px;
  }
}

@media (max-width: 380px) {
  .qs-toys-chips,
  .qs-moods-chips {
    grid-template-columns: 1fr;
  }
}
