body[data-food-truck-phase="finished"] {
  background-color: #075d59;
  background-image: none;
}

.ft-app[data-phase="finished"] .ft-topbar {
  display: none;
}

.ft-result-panel,
.ft-app[data-phase="finished"] .ft-result-panel {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: block;
  width: auto;
  height: auto;
  overflow: hidden;
  background: transparent;
}

.ft-result-hero {
  position: absolute;
  top: 13.4%;
  left: 37.3%;
  z-index: 3;
  display: grid;
  width: 28.9%;
  height: 9.4%;
  min-height: 0;
  place-content: center;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  text-align: center;
}

.ft-result-hero h2 {
  margin: 0;
  color: #fff;
  font-size: clamp(1rem, 1.85vw, 1.5rem);
  font-weight: 1000;
  text-shadow: 0 2px 0 rgba(4, 73, 69, 0.45);
}

.ft-result-hero p {
  position: static;
  margin: 3px 0 0;
  color: #fff8cf;
  font-size: clamp(0.56rem, 0.9vw, 0.72rem);
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 1px 0 rgba(4, 73, 69, 0.65);
}

.ft-result-awards {
  position: absolute;
  inset: 0;
  z-index: 3;
}

.ft-award-ticket {
  position: absolute;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  padding: 4.5% 2% 2%;
  color: #17484a;
  text-align: center;
  opacity: 0;
  transform: translateY(-28px) scale(0.82);
  transition: opacity 0.38s ease, transform 0.58s cubic-bezier(0.2, 0.85, 0.25, 1.15);
}

.ft-award-ticket.is-revealed {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.ft-award-rank-1.is-revealed {
  animation: ftWinnerFirstReveal 0.9s cubic-bezier(0.18, 0.88, 0.28, 1.25) both;
}

@keyframes ftWinnerFirstReveal {
  0% { opacity: 0; transform: translateY(-42px) scale(0.7); }
  62% { opacity: 1; transform: translateY(5px) scale(1.1); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.ft-award-rank-2 {
  top: 27%;
  left: 22%;
  width: 15%;
  height: 36%;
}

.ft-award-rank-1 {
  top: 27%;
  left: 42%;
  width: 18%;
  height: 36%;
  padding-top: 2%;
}

.ft-award-rank-3 {
  top: 27%;
  left: 66%;
  width: 16%;
  height: 36%;
}

.ft-award-rank {
  color: #8a5200;
  font-size: clamp(0.82rem, 1.3vw, 1.02rem);
  font-weight: 1000;
}

.ft-award-ticket strong {
  width: 100%;
  overflow: hidden;
  color: #063f3d;
  font-size: clamp(1rem, 1.75vw, 1.4rem);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ft-award-rank-1 strong {
  font-size: clamp(1.25rem, 2.3vw, 1.85rem);
}

.ft-award-ticket > b {
  color: #087f7a;
  font-size: clamp(0.82rem, 1.45vw, 1.18rem);
}

.live-avatar-bubble.ft-result-avatar {
  display: grid;
  width: clamp(44px, 5vw, 62px);
  height: clamp(44px, 5vw, 62px);
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  border: 3px solid #e0b846;
  border-radius: 50%;
  background: #fff3c0;
  font-size: clamp(1.35rem, 2.5vw, 2rem);
  box-shadow: 0 3px 0 rgba(96, 67, 5, 0.16);
}

.live-avatar-bubble.ft-result-avatar.lg {
  width: clamp(58px, 6.5vw, 82px);
  height: clamp(58px, 6.5vw, 82px);
}

.live-avatar-bubble.ft-result-avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.ft-result-grid {
  position: absolute;
  top: 70.6%;
  right: 6.6%;
  bottom: 4.8%;
  left: 7.4%;
  display: grid;
  grid-template-columns: 57% minmax(0, 1fr);
  gap: 2.2%;
  height: auto;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.38s ease, transform 0.38s ease;
}

.ft-result-panel[data-reveal-complete="true"] .ft-result-grid {
  opacity: 1;
  transform: translateY(0);
}

.ft-result-grid > .ft-panel {
  position: relative;
  padding: 7% 4% 3%;
  overflow: visible;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.ft-result-grid .ft-panel-head {
  position: absolute;
  top: 1.5%;
  left: 0;
  display: grid;
  width: 100%;
  height: 18%;
  margin: 0;
  place-items: center;
}

.ft-result-grid .ft-panel-head > div {
  position: absolute;
  inset: 0;
  display: grid;
  width: auto;
  place-items: center;
}

.ft-result-grid .ft-kicker {
  display: none;
}

.ft-result-grid .ft-panel h2 {
  width: 100%;
  color: #075d59;
  font-size: clamp(0.88rem, 1.3vw, 1.05rem);
  text-align: center;
  text-shadow: none;
}

.ft-result-top5,
.ft-result-panel .rank-list {
  display: grid;
  gap: 0;
}

.ft-result-panel .rank-row {
  grid-template-columns: 42px minmax(0, 1fr) auto;
  min-height: 30px;
  padding: 2px 7px;
  border: 0;
  border-bottom: 1px dashed #dfc996;
  border-radius: 0;
  background: transparent;
  color: #17484a;
  font-size: clamp(0.68rem, 1vw, 0.82rem);
}

.ft-result-panel .rank-row.me {
  background: transparent !important;
}

.ft-result-panel .rank-no {
  min-width: 32px;
  min-height: 20px;
  background: #f9d65d;
  color: #674600;
}

.ft-result-panel .rank-name {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.ft-result-panel .rank-name > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ft-result-panel .rank-name .live-avatar-bubble {
  width: 28px;
  height: 28px;
  border-width: 1px;
  font-size: 0.72rem;
}

.ft-result-my-identity {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 42%;
  padding: 0 4%;
  color: #17484a;
}

.ft-result-my-identity .live-avatar-bubble {
  width: clamp(44px, 4.8vw, 58px);
  height: clamp(44px, 4.8vw, 58px);
  border-width: 2px;
}

.ft-result-my-identity > div {
  display: grid;
  min-width: 0;
}

.ft-result-my-identity strong {
  overflow: hidden;
  color: #063f3d;
  font-size: clamp(0.9rem, 1.35vw, 1.05rem);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ft-result-my-identity span {
  color: #47645f;
  font-size: clamp(0.64rem, 0.92vw, 0.76rem);
  font-weight: 900;
}

.ft-result-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 2px 4px;
  height: 40%;
}

.ft-result-stat {
  display: grid;
  grid-template-columns: 1fr;
  place-content: center;
  gap: 1px;
  min-height: 0;
  padding: 1px 3px;
  border: 0;
  background: transparent;
  text-align: center;
}

.ft-result-stat:nth-child(5) {
  grid-column: 2 / 4;
}

.ft-result-stat span {
  color: #47645f;
  font-size: clamp(0.56rem, 0.82vw, 0.68rem);
}

.ft-result-stat strong {
  color: var(--ft-festival-teal-dark);
  font-size: clamp(0.78rem, 1.2vw, 1rem);
}

.ft-growth-modal {
  z-index: 40;
  place-items: stretch end;
  padding: 12px;
}

.ft-growth-backdrop {
  background: rgba(7, 36, 37, 0.62);
}

.ft-growth-dialog {
  position: relative;
  display: grid;
  grid-template-rows: 128px minmax(0, 1fr);
  width: min(620px, 94vw);
  height: min(900px, calc(100dvh - 24px));
  max-height: none;
  padding: 0 14px 14px;
  overflow: hidden;
  border: 4px solid var(--ft-festival-teal-dark);
  border-radius: 24px 8px 8px 24px;
  background: var(--ft-festival-paper);
  box-shadow: 0 18px 42px rgba(2, 30, 31, 0.38);
}

.ft-growth-header-art {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  width: 100%;
  height: 128px;
  object-fit: cover;
  pointer-events: none;
}

.ft-growth-modal-head {
  position: relative;
  z-index: 1;
  align-items: center;
  margin: 0;
  padding: 50px 76px 8px;
  border: 0;
}

.ft-growth-modal-head .ft-kicker {
  display: none;
}

.ft-growth-modal-head h2 {
  margin: 0;
  color: #17484a;
  font-size: clamp(1.2rem, 2.7vw, 1.8rem);
  text-align: center;
}

.ft-growth-close {
  position: absolute;
  top: 48px;
  right: -64px;
  min-width: 56px;
  min-height: 44px;
  border: 2px solid #c9a956;
  border-radius: 11px;
  background: var(--ft-festival-cream);
  color: var(--ft-festival-teal-dark);
}

.ft-growth-modal-body {
  min-height: 0;
  padding: 4px 4px 10px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.ft-growth-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.ft-growth-card {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  grid-template-rows: auto auto auto;
  gap: 5px 12px;
  min-height: 134px;
  padding: 10px 11px;
  border: 2px solid #c7ded8;
  border-radius: 16px;
  background: #fffdf5;
  box-shadow: 0 4px 0 rgba(7, 94, 89, 0.1);
}

.ft-growth-card.unlocked {
  background: #ecfbf3;
}

.ft-growth-card .ft-growth-art {
  grid-row: 1 / -1;
  align-self: center;
  width: 88px;
  height: 88px;
}

.ft-growth-card-head,
.ft-growth-meta,
.ft-recipe-needs,
.ft-growth-action {
  grid-column: 2;
}

.ft-growth-card-head strong {
  color: #173e41;
  font-size: 1rem;
}

.ft-growth-card-head span,
.ft-growth-meta {
  color: #5b7474;
  font-size: 0.73rem;
}

.ft-growth-card .ft-need-chip {
  min-height: 26px;
  padding: 3px 7px;
  font-size: 0.68rem;
}

.ft-growth-action {
  min-height: 42px;
  border: 0;
  border-radius: 11px;
  background: var(--ft-festival-teal);
  color: #fff;
  box-shadow: 0 3px 0 rgba(4, 74, 70, 0.2);
}

.ft-growth-action:disabled {
  background: #8dc6c0;
  color: #f4ffff;
}

.ft-image-dialog {
  border: 4px solid var(--ft-festival-teal-dark);
  background: var(--ft-festival-paper);
}

.ft-toast {
  z-index: 60;
}

@media (max-height: 780px) and (orientation: landscape) {
  .ft-app {
    width: min(1194px, 100vw, calc(100dvh * 1.43165));
  }

  .ft-option {
    min-height: 58px;
  }

  .ft-question-media {
    max-height: 205px;
  }

  .ft-market {
    gap: 2px 4px;
  }

  .ft-order {
    grid-template-rows: 82px auto auto minmax(0, 1fr) 42px;
  }

  .ft-order-portrait,
  .ft-art-customer {
    width: 78px;
    height: 78px;
  }

  .ft-token .ft-art {
    width: clamp(56px, 6vw, 72px);
    height: clamp(56px, 6vw, 72px);
  }
}

@media (max-width: 1024px) and (orientation: portrait) {
  body {
    place-items: start center;
  }

  .ft-app {
    width: 100vw;
    height: 100dvh;
    max-height: none;
    aspect-ratio: auto;
    padding: max(6px, env(safe-area-inset-top)) max(6px, env(safe-area-inset-right)) max(6px, env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left));
    background-color: rgba(236, 250, 245, 0.94);
    background-image: none;
  }

  .ft-app::before {
    display: none;
  }

  .ft-topbar {
    top: 6px;
    left: 6px;
    right: 6px;
    grid-template-columns: 1fr;
    height: 104px;
    overflow: hidden;
    border: 3px solid var(--ft-festival-teal-dark);
    border-radius: 17px;
    background: var(--ft-festival-paper);
    box-shadow: var(--ft-festival-shadow);
  }

  .ft-topbar .ft-brand {
    min-height: 51px;
    padding: 5px 10px;
    background: var(--ft-festival-teal);
  }

  .ft-brand h1,
  .ft-brand .ft-eyebrow {
    color: #fff;
    text-shadow: none;
  }

  .ft-metrics {
    height: 50px;
    padding: 0;
  }

  .ft-flow {
    top: 116px;
    left: 6px;
    right: 6px;
    height: 48px;
    gap: 6px;
  }

  .ft-app[data-phase="question"][data-view="kitchen"] .ft-flow,
  .ft-app[data-phase="business"] .ft-flow {
    top: 116px;
    right: 6px;
    left: 6px;
    gap: 6px;
    height: 48px;
  }

  .ft-app[data-phase="question"][data-view="kitchen"] .ft-flow-step,
  .ft-app[data-phase="business"] .ft-flow-step {
    min-height: 44px;
    border-radius: 12px 12px 5px 5px;
    font-size: 0.94rem;
  }

  .ft-flow-step {
    border: 2px solid var(--ft-festival-teal-dark);
    border-radius: 12px 12px 5px 5px;
    background: var(--ft-festival-cream);
    color: var(--ft-festival-teal-dark);
    font-size: 0.94rem;
  }

  .ft-flow-step.active {
    background: var(--ft-festival-teal);
    color: #fff;
  }

  .ft-app[data-phase="question"][data-view="question"] .ft-question {
    top: 172px;
    right: 6px;
    bottom: 6px;
    left: 6px;
    padding: 15px 16px 78px;
    overflow: hidden;
    border: 4px solid var(--ft-festival-teal-dark);
    border-radius: 20px;
    background: var(--ft-festival-paper);
    box-shadow: var(--ft-festival-shadow);
  }

  .ft-question-text {
    min-height: 90px;
    padding: 10px 16px;
    border: 2px solid #e6c979;
    border-radius: 13px;
    background: var(--ft-festival-cream);
    font-size: clamp(1rem, 3.8vw, 1.45rem);
  }

  .ft-question-media {
    width: min(94%, 650px);
    max-height: min(285px, 29dvh);
  }

  .ft-option {
    min-height: 58px;
  }

  .ft-question-wait-state {
    grid-template-columns: 1fr;
    min-height: 150px;
    text-align: center;
  }

  .ft-question-wait-state strong,
  .ft-question-wait-state span,
  .ft-question-wait-state button {
    grid-column: 1;
    grid-row: auto;
  }

  .ft-question-wait-state button {
    justify-self: center;
  }

  .ft-feedback {
    right: 12px;
    bottom: 8px;
    left: 12px;
    min-height: 62px;
    padding: 8px 12px;
    border-radius: 14px;
    background: var(--ft-festival-teal);
  }

  .ft-feedback {
    grid-template-columns: 100px minmax(0, 1fr);
  }

  .ft-app[data-phase="question"][data-view="kitchen"] .ft-kitchen,
  .ft-app[data-phase="business"] .ft-kitchen {
    top: 172px;
    right: 6px;
    bottom: 6px;
    left: 6px;
    grid-template-rows: auto auto minmax(0, 1fr);
    padding: 10px;
    overflow: hidden;
    border: 4px solid var(--ft-festival-teal-dark);
    border-radius: 20px;
    background: var(--ft-festival-paper);
    box-shadow: var(--ft-festival-shadow);
  }

  .ft-kitchen > .ft-panel-head {
    position: static;
    display: block;
    height: auto;
    min-height: 54px;
    padding: 0;
  }

  .ft-kitchen-actions {
    gap: 7px;
  }

  .ft-kitchen-actions .ft-growth-open-btn,
  .ft-kitchen-actions .ft-chip {
    min-height: 48px;
    border: 2px solid #c1d9d4;
    background: var(--ft-festival-teal);
    font-size: 0.78rem;
  }

  .ft-kitchen-section-nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
    margin: 6px 0 8px;
  }

  .ft-kitchen-section-nav button {
    min-height: 48px;
    border: 2px solid var(--ft-festival-line);
    border-radius: 12px;
    background: #fff;
    color: var(--ft-festival-teal-dark);
    font-weight: 1000;
  }

  .ft-kitchen-section-nav button[aria-pressed="true"] {
    border-color: var(--ft-festival-teal-dark);
    background: var(--ft-festival-teal);
    color: #fff;
  }

  .ft-kitchen-workflow,
  .ft-app[data-phase="question"][data-view="kitchen"] .ft-kitchen-workflow,
  .ft-app[data-phase="business"] .ft-kitchen-workflow {
    display: block;
    min-height: 0;
    overflow: hidden;
  }

  .ft-kitchen .ft-work-zone {
    display: none;
    height: 100%;
    padding: 8px;
    border: 2px solid var(--ft-festival-line);
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.93);
  }

  .ft-kitchen[data-kitchen-section="market"] .ft-market-zone,
  .ft-kitchen[data-kitchen-section="prep"] .ft-prep-zone,
  .ft-kitchen[data-kitchen-section="service"] .ft-service-area {
    display: grid;
  }

  .ft-zone-head {
    color: var(--ft-festival-teal-dark);
  }

  .ft-zone-head strong {
    color: var(--ft-festival-teal-dark);
    text-shadow: none;
  }

  .ft-market,
  .ft-app[data-phase="question"][data-view="kitchen"] .ft-market,
  .ft-app[data-phase="business"] .ft-market {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-rows: repeat(3, minmax(0, 1fr));
    height: 100%;
  }

  .ft-market-zone {
    grid-template-rows: 44px minmax(0, 1fr);
  }

  .ft-ingredient-card,
  .ft-app[data-phase="question"][data-view="kitchen"] .ft-ingredient-card,
  .ft-app[data-phase="business"] .ft-ingredient-card {
    min-height: 112px;
    background: var(--ft-festival-cream);
  }

  .ft-prep-zone {
    grid-template-rows: 44px 154px minmax(0, 1fr);
  }

  .ft-prep-focus {
    background: var(--ft-festival-cream);
    border-radius: 13px;
  }

  .ft-token .ft-art {
    width: clamp(58px, 10vw, 76px);
    height: clamp(58px, 10vw, 76px);
  }

  .ft-service-area {
    grid-template-rows: 44px minmax(0, 1fr) 44px;
  }

  .ft-service-area .ft-orders-list {
    grid-template-columns: 1fr;
  }

  .ft-order {
    grid-template-columns: 110px minmax(0, 1fr);
    grid-template-rows: auto auto minmax(0, 1fr) 48px;
    padding: 12px;
    background: var(--ft-festival-cream);
  }

  .ft-order-portrait,
  .ft-art-customer {
    grid-column: 1;
    grid-row: 1 / -1;
    align-self: start;
    margin-top: 4px;
  }

  .ft-order-head,
  .ft-order-items,
  .ft-order-needs,
  .ft-order .ft-serve-btn {
    grid-column: 2;
  }

  .ft-order-head { grid-row: 1; }
  .ft-order-items { grid-row: 2; justify-content: start; }
  .ft-order-needs { grid-row: 3; justify-content: start; }
  .ft-order .ft-serve-btn { grid-row: 4; }

  .ft-app[data-phase="finished"]::before {
    display: block;
    background-image: url("../../assets/quiz/food-truck-tycoon/festival-v2/result-stage-tickets-v2.png");
    background-position: center;
    background-size: 100% 100%;
  }

  .ft-result-hero {
    top: 14.2%;
    left: 34%;
    width: 32%;
  }

  .ft-result-grid {
    top: 70.6%;
    right: 6.6%;
    bottom: 4.8%;
    left: 7.4%;
    grid-template-columns: 57% minmax(0, 1fr);
    gap: 2.2%;
    height: auto;
  }

  .ft-result-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ft-result-stat:nth-child(5) {
    grid-column: 1 / -1;
  }

  .ft-growth-modal {
    padding: 0;
  }

  .ft-growth-dialog {
    width: 100vw;
    height: 100dvh;
    border-radius: 0;
  }
}

@media (max-width: 699px) {
  .ft-options {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .ft-option {
    min-height: 46px;
    padding: 5px 10px;
  }

  .ft-option-label {
    width: 34px;
    height: 34px;
  }

  .ft-market {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: repeat(4, minmax(0, 1fr));
  }

  .ft-ingredient-card,
  .ft-app[data-phase="question"][data-view="kitchen"] .ft-ingredient-card,
  .ft-app[data-phase="business"] .ft-ingredient-card {
    min-height: 98px;
  }

  .ft-craft-area {
    grid-template-columns: 1fr;
  }

  .ft-dishes {
    display: none;
  }

  .ft-action-row {
    right: 4%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
