/* Phase 111 - Festival Command single-page redesign */

body[data-active-view="festival-app"] #festival-app {
  background:
    radial-gradient(circle at 12% 0%, rgba(236, 187, 96, .32), transparent 34%),
    linear-gradient(135deg, #f9f2e3 0%, #f4e2c2 48%, #e9d0a1 100%) !important;
  color: #24160d;
  overflow-y: auto !important;
  overflow-x: hidden !important;
}

body[data-active-view="festival-app"] #festival-app > :not(.ff111-shell) {
  display: none !important;
}

body[data-active-view="festival-app"] #festival-app.phase79-mask-specialty-content > .ff111-shell {
  display: block !important;
  visibility: visible !important;
}

body[data-active-view="festival-app"] #festival-app > .phase79-specialty-shield {
  display: none !important;
}

body[data-active-view="festival-app"] #festival-app > .ss78-flow-shell,
body[data-active-view="festival-app"] #festival-app > .fm108-layout[data-ff111-legacy-blocker] {
  display: none !important;
}

.ff111-shell,
.ff111-shell * {
  box-sizing: border-box;
}

.ff111-shell {
  --ff111-ink: #21150d;
  --ff111-muted: #755d45;
  --ff111-card: rgba(255, 251, 243, .94);
  --ff111-line: rgba(123, 86, 44, .2);
  --ff111-gold: #d79a35;
  --ff111-blue: #243b63;
  --ff111-green: #2b7652;
  --ff111-red: #a64932;
  width: min(1480px, calc(100vw - 28px));
  margin: 0 auto;
  padding: 20px 0 76px;
  color: var(--ff111-ink);
}

.ff111-hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 350px;
  gap: 22px;
  min-height: 210px;
  border: 1px solid rgba(96, 64, 29, .28);
  border-radius: 30px;
  padding: 28px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .9), rgba(255, 243, 217, .75)),
    repeating-linear-gradient(90deg, rgba(121, 76, 24, .08) 0 1px, transparent 1px 19px);
  box-shadow: 0 24px 70px rgba(84, 55, 19, .18);
}

.ff111-hero::after {
  content: "";
  position: absolute;
  inset: auto -7% -42% 48%;
  height: 180px;
  border-radius: 999px;
  background: rgba(215, 154, 53, .18);
  transform: rotate(-9deg);
  pointer-events: none;
}

.ff111-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  padding: 7px 11px;
  border-radius: 999px;
  background: #21150d;
  color: #ffe4a7;
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.ff111-title {
  margin: 0;
  max-width: 820px;
  font-size: clamp(2rem, 5vw, 4.4rem);
  line-height: .9;
  letter-spacing: -.07em;
  color: var(--ff111-ink);
}

.ff111-copy {
  max-width: 850px;
  margin: 16px 0 0;
  color: #60452c;
  font-size: clamp(.98rem, 1.6vw, 1.14rem);
  line-height: 1.55;
}

.ff111-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.ff111-btn {
  appearance: none;
  border: 1px solid rgba(54, 35, 16, .2);
  border-radius: 16px;
  min-height: 42px;
  padding: 10px 15px;
  background: #21150d;
  color: #fff6df;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(33, 21, 13, .16);
}

.ff111-btn:hover {
  transform: translateY(-1px);
}

.ff111-btn.secondary {
  background: #fff9ea;
  color: #21150d;
}

.ff111-btn.gold {
  background: linear-gradient(135deg, #f6c565, #d68d25);
  color: #21150d;
}

.ff111-score {
  position: relative;
  z-index: 1;
  align-self: stretch;
  border: 1px solid rgba(96, 64, 29, .22);
  border-radius: 26px;
  padding: 20px;
  background: rgba(35, 24, 16, .92);
  color: #fff4d8;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1);
}

.ff111-score-top {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.ff111-score-top span,
.ff111-stat span,
.ff111-label,
.ff111-section-kicker {
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.ff111-score-top strong {
  display: block;
  margin-top: 4px;
  font-size: 2.25rem;
  line-height: 1;
}

.ff111-meter {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, .14);
}

.ff111-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #f6c565, #70d6aa, #6eb6ff);
}

.ff111-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 16px;
}

.ff111-stat {
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 17px;
  background: rgba(255, 255, 255, .08);
}

.ff111-stat strong {
  display: block;
  font-size: 1.25rem;
  color: #fff;
}

.ff111-flow {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.ff111-flow-card {
  min-width: 0;
  border: 1px solid var(--ff111-line);
  border-radius: 22px;
  padding: 16px;
  background: rgba(255, 250, 239, .82);
  box-shadow: 0 14px 32px rgba(84, 55, 19, .1);
}

.ff111-flow-card strong {
  display: block;
  margin-bottom: 6px;
  font-size: 1rem;
}

.ff111-flow-card span {
  color: var(--ff111-muted);
  font-size: .83rem;
  line-height: 1.4;
}

.ff111-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(380px, .85fr);
  gap: 16px;
  align-items: start;
}

.ff111-card {
  border: 1px solid var(--ff111-line);
  border-radius: 26px;
  padding: 20px;
  background: var(--ff111-card);
  box-shadow: 0 18px 42px rgba(93, 65, 31, .12);
}

.ff111-card + .ff111-card {
  margin-top: 16px;
}

.ff111-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.ff111-section-kicker {
  color: #9b6930;
}

.ff111-card h3 {
  margin: 4px 0 0;
  font-size: clamp(1.25rem, 2.4vw, 1.85rem);
  line-height: 1.05;
  letter-spacing: -.04em;
}

.ff111-card p {
  margin: 8px 0 0;
  color: var(--ff111-muted);
  line-height: 1.5;
}

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

.ff111-form.one {
  grid-template-columns: 1fr;
}

.ff111-field {
  min-width: 0;
}

.ff111-field.wide {
  grid-column: 1 / -1;
}

.ff111-field label {
  display: block;
  margin: 0 0 6px;
  color: #593d25;
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.ff111-field input,
.ff111-field select,
.ff111-field textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(88, 58, 28, .22);
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, .78);
  color: #24160d;
  font: inherit;
  outline: none;
}

.ff111-field textarea {
  min-height: 94px;
  resize: vertical;
  line-height: 1.45;
}

.ff111-field input:focus,
.ff111-field select:focus,
.ff111-field textarea:focus {
  border-color: #d79a35;
  box-shadow: 0 0 0 4px rgba(215, 154, 53, .16);
}

.ff111-segment {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ff111-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  border: 1px solid rgba(88, 58, 28, .18);
  border-radius: 999px;
  padding: 8px 11px;
  background: rgba(255, 255, 255, .65);
  color: #332216;
  font-weight: 800;
  cursor: pointer;
}

.ff111-chip input {
  accent-color: #d79a35;
}

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

.ff111-check {
  display: flex;
  gap: 10px;
  min-width: 0;
  border: 1px solid rgba(88, 58, 28, .16);
  border-radius: 18px;
  padding: 12px;
  background: rgba(255, 255, 255, .62);
  cursor: pointer;
}

.ff111-check input {
  flex: 0 0 auto;
  margin-top: 2px;
  accent-color: #2b7652;
}

.ff111-check strong {
  display: block;
  color: #26170e;
  font-size: .9rem;
}

.ff111-check span {
  display: block;
  margin-top: 3px;
  color: var(--ff111-muted);
  font-size: .76rem;
  line-height: 1.35;
}

.ff111-entry-list {
  display: grid;
  gap: 10px;
}

.ff111-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid rgba(88, 58, 28, .17);
  border-radius: 20px;
  padding: 13px;
  background: rgba(255, 255, 255, .67);
}

.ff111-entry h4 {
  margin: 0 0 6px;
  font-size: 1.02rem;
}

.ff111-entry-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ff111-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 4px 9px;
  background: rgba(36, 59, 99, .08);
  color: #25334d;
  font-size: .72rem;
  font-weight: 900;
}

.ff111-pill.good {
  background: rgba(43, 118, 82, .12);
  color: #24583f;
}

.ff111-pill.warn {
  background: rgba(215, 154, 53, .18);
  color: #73511d;
}

.ff111-pill.danger {
  background: rgba(166, 73, 50, .12);
  color: #82351f;
}

.ff111-entry-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.ff111-empty {
  border: 1px dashed rgba(88, 58, 28, .28);
  border-radius: 22px;
  padding: 24px;
  background: rgba(255, 255, 255, .45);
  color: var(--ff111-muted);
  text-align: center;
}

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

.ff111-link-card {
  border: 1px solid rgba(88, 58, 28, .17);
  border-radius: 20px;
  padding: 14px;
  background: linear-gradient(135deg, rgba(255, 255, 255, .74), rgba(255, 242, 211, .5));
  cursor: pointer;
}

.ff111-link-card strong {
  display: block;
  margin-bottom: 4px;
}

.ff111-link-card span {
  color: var(--ff111-muted);
  font-size: .8rem;
  line-height: 1.35;
}

.ff111-deck {
  display: grid;
  gap: 10px;
}

.ff111-deck-item {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  border: 1px solid rgba(88, 58, 28, .16);
  border-radius: 18px;
  padding: 10px;
  background: rgba(255, 255, 255, .6);
}

.ff111-poster {
  aspect-ratio: 2 / 3;
  border-radius: 12px;
  background:
    linear-gradient(140deg, rgba(36, 59, 99, .9), rgba(215, 154, 53, .78)),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, .14) 0 1px, transparent 1px 8px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35);
}

.ff111-deck-item strong {
  display: block;
}

.ff111-deck-item span {
  color: var(--ff111-muted);
  font-size: .8rem;
  line-height: 1.4;
}

@media (max-width: 1120px) {
  .ff111-hero,
  .ff111-grid {
    grid-template-columns: 1fr;
  }

  .ff111-flow {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .ff111-shell {
    width: min(100vw - 16px, 720px);
    padding-top: 10px;
    padding-bottom: 96px;
  }

  .ff111-hero,
  .ff111-card {
    border-radius: 22px;
    padding: 16px;
  }

  .ff111-flow,
  .ff111-form,
  .ff111-package,
  .ff111-linked,
  .ff111-stats {
    grid-template-columns: 1fr;
  }

  .ff111-score-top {
    flex-direction: column;
  }

  .ff111-entry {
    grid-template-columns: 1fr;
  }

  .ff111-entry-actions {
    justify-content: flex-start;
  }

  .ff111-deck-item {
    grid-template-columns: 64px minmax(0, 1fr);
  }
}
