:root {
  --game-bg: #fdf7ea;
  --game-ink: #163629;
  --game-muted: #4b675a;
  --game-panel: #fffdf8;
  --game-line: rgba(22, 54, 41, 0.14);
  --game-accent: #1d6b46;
  --game-warm: #d49b45;
}

.game-main {
  background: radial-gradient(circle at 10% 10%, rgba(212, 155, 69, 0.14), transparent 30rem),
    linear-gradient(180deg, var(--game-bg), #fffdfa 56%);
}

.game-shell {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  padding: 0.35rem 0 3.2rem;
}

.game-hero {
  margin-bottom: 1rem;
}

.game-hero h1 {
  font-size: clamp(1.9rem, 4.1vw, 3.2rem);
  margin: 0.2rem 0 0.5rem;
}

.game-hero p {
  color: var(--game-muted);
  max-width: 64ch;
}

.game-layout {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 1rem;
}

.game-card {
  background: var(--game-panel);
  border: 1px solid var(--game-line);
  border-radius: 20px;
  padding: 1rem;
  box-shadow: 0 12px 24px rgba(28, 45, 33, 0.06);
}

.kitchen-stage {
  position: relative;
  display: grid;
  gap: 0.42rem;
}

.floating-start-btn {
  position: absolute;
  right: 1rem;
  bottom: clamp(10.6rem, 17vh, 12.2rem);
  z-index: 26;
  border: 0;
  border-radius: 999px;
  padding: 0.66rem 1rem;
  font-size: 0.96rem;
  font-weight: 900;
  letter-spacing: 0.01em;
  color: #fffef7;
  background: linear-gradient(130deg, #ef5b2b, #f5a43a);
  box-shadow: 0 10px 26px rgba(157, 71, 26, 0.32);
  cursor: pointer;
}

.kitchen-stage.is-start-ready .floating-start-btn {
  animation: start-btn-pop 900ms ease-in-out infinite;
}

.floating-start-btn[hidden] {
  display: none !important;
}

.kitchen-title {
  margin: 0;
  font-size: clamp(1.1rem, 1.9vw, 1.46rem);
  font-weight: 800;
  color: #163629;
}

#kitchenCanvas {
  width: 100%;
  height: clamp(460px, 64vh, 620px);
  border-radius: 16px;
  border: 1px solid rgba(22, 54, 41, 0.18);
  background: #f8f0de;
}

.slice-control-panel {
  border: 1px solid var(--game-line);
  border-radius: 12px;
  background: #fff;
  padding: 0.42rem;
  display: grid;
  grid-template-columns: 1fr 108px;
  gap: 0.6rem;
  align-items: stretch;
}

.slice-control-main {
  display: grid;
  gap: 0.45rem;
}

.sprout-start-guide {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 0.62rem;
  align-items: center;
  border: 1px solid rgba(255, 169, 63, 0.5);
  border-radius: 14px;
  padding: 0.5rem 0.6rem;
  background: linear-gradient(135deg, rgba(255, 244, 206, 0.96), rgba(255, 229, 159, 0.88));
  box-shadow: 0 10px 24px rgba(146, 88, 13, 0.16);
}

.sprout-start-guide img {
  width: 88px;
  height: 88px;
  object-fit: contain;
  filter: drop-shadow(0 6px 14px rgba(22, 54, 41, 0.2));
}

.sprout-start-copy {
  min-width: 0;
}

.sprout-start-title {
  margin: 0;
  color: #7a2d00;
  font-size: 1.03rem;
  font-weight: 900;
  letter-spacing: 0.01em;
}

.start-steps {
  margin: 0.32rem 0 0;
  padding-left: 1.05rem;
  display: grid;
  gap: 0.16rem;
}

.start-steps li {
  color: #1e3529;
  font-weight: 800;
  font-size: 0.87rem;
  line-height: 1.28;
}

.start-steps li.is-done {
  color: #0a5f37;
}

.start-steps li.is-done::marker {
  content: "\2713  ";
  font-weight: 900;
}

.prep-step-title {
  margin: 0;
  padding: 0.42rem 0.56rem;
  border-radius: 10px;
  border: 1px dashed rgba(22, 54, 41, 0.25);
  background: rgba(255, 255, 255, 0.92);
  color: #1c3c2d;
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.tool-rack {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.45rem;
}

.tool-pill {
  border: 1px solid rgba(22, 54, 41, 0.22);
  border-radius: 999px;
  padding: 0.46rem 0.5rem;
  background: #fff;
  color: #355948;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.tool-pill.is-active {
  background: rgba(29, 107, 70, 0.16);
  border-color: rgba(29, 107, 70, 0.38);
  color: #0f5030;
}

.tool-pill.is-required {
  box-shadow: 0 0 0 2px rgba(212, 155, 69, 0.28);
  border-color: rgba(212, 155, 69, 0.72);
}

.slice-control-panel.is-onboarding .sprout-start-guide {
  animation: intro-guide-glow 1.15s ease-in-out infinite;
}

@keyframes intro-guide-glow {
  0% {
    box-shadow: 0 0 0 rgba(255, 165, 57, 0), 0 10px 24px rgba(146, 88, 13, 0.16);
  }
  50% {
    box-shadow: 0 0 0 4px rgba(255, 178, 79, 0.32), 0 12px 28px rgba(146, 88, 13, 0.2);
  }
  100% {
    box-shadow: 0 0 0 rgba(255, 165, 57, 0), 0 10px 24px rgba(146, 88, 13, 0.16);
  }
}

.slice-meters {
  display: grid;
  gap: 0.48rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: center;
}

.slice-meter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 0.75rem;
  border-radius: 11px;
  font-size: 0.88rem;
  letter-spacing: 0.01em;
  font-weight: 700;
  color: #0f5030;
  background: rgba(29, 107, 70, 0.14);
  border: 1px solid rgba(29, 107, 70, 0.25);
}

.slice-meter[hidden],
.slice-meters [hidden] {
  display: none !important;
}

.slice-meter.alt {
  color: #5d3d19;
  background: rgba(212, 155, 69, 0.2);
  border-color: rgba(212, 155, 69, 0.35);
}

.mute-all-btn {
  cursor: pointer;
  font-size: 0.8rem;
}

.mute-all-btn[aria-pressed="true"] {
  background: rgba(64, 72, 78, 0.88);
  color: #f4f7f8;
  border-color: rgba(46, 53, 58, 0.95);
}

.slice-controls {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.audio-toggle {
  min-width: 92px;
  padding: 0.48rem 0.62rem;
  font-size: 0.78rem;
}

.audio-toggle[aria-pressed="false"] {
  opacity: 0.82;
  filter: grayscale(0.2);
}

.stage-caption {
  display: none;
}

.cuisine-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.cuisine-row label {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--game-muted);
}

.cuisine-row select {
  min-height: 36px;
  border: 1px solid var(--game-line);
  border-radius: 9px;
  padding: 0 0.55rem;
  font: inherit;
  color: var(--game-ink);
  background: #fff;
}

.station-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem;
}

.station-pill {
  border: 1px solid var(--game-line);
  border-radius: 999px;
  padding: 0.45rem 0.55rem;
  font-size: 0.8rem;
  text-align: center;
  color: var(--game-muted);
  background: #fff;
}

.station-pill.is-active {
  background: rgba(29, 107, 70, 0.12);
  border-color: rgba(29, 107, 70, 0.3);
  color: #0f5030;
  font-weight: 700;
}

.prep-panel {
  border: 1px solid var(--game-line);
  background: #fff;
  border-radius: 12px;
  padding: 0.65rem;
  display: grid;
  gap: 0.45rem;
}

.prep-title {
  margin: 0;
  font-weight: 800;
  font-size: 0.88rem;
  color: var(--game-ink);
}

.slice-stats {
  margin: 0.28rem 0 0;
  font-size: 0.8rem;
  color: #234838;
  font-weight: 700;
}

.prep-actions {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.prep-line {
  margin-top: 0.1rem;
}

.builder-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.slot h3 {
  margin: 0 0 0.45rem;
  font-size: 1rem;
}

.item-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
}

.item-btn {
  border: 1px solid var(--game-line);
  border-radius: 12px;
  background: #fff;
  color: var(--game-ink);
  padding: 0.5rem;
  font-size: 0.78rem;
  text-align: left;
  cursor: pointer;
}

.item-btn small {
  display: block;
  color: var(--game-muted);
  margin-top: 0.18rem;
  font-size: 0.72rem;
}

.item-btn.is-picked {
  border-color: rgba(29, 107, 70, 0.4);
  background: rgba(29, 107, 70, 0.1);
}

.recipe-panel {
  display: grid;
  gap: 0.8rem;
}

.recipe-title-row {
  display: flex;
  gap: 0.5rem;
}

.recipe-title-row input {
  flex: 1;
  min-height: 42px;
  border: 1px solid var(--game-line);
  border-radius: 10px;
  padding: 0 0.7rem;
  font: inherit;
}

.recipe-title-row button,
.action-btn,
.vote-btn {
  border: 0;
  border-radius: 10px;
  background: var(--game-accent);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  padding: 0.62rem 0.85rem;
}

.action-btn:disabled {
  cursor: not-allowed;
  background: #8a9690;
  color: #eef2ef;
  opacity: 0.88;
}

.action-btn.alt {
  background: #304f43;
}

.action-btn.start-attention {
  background: linear-gradient(130deg, #ef5b2b, #f5a43a);
  box-shadow: 0 0 0 rgba(239, 91, 43, 0.1);
  animation: start-btn-pop 900ms ease-in-out infinite;
}

@keyframes start-btn-pop {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 rgba(239, 91, 43, 0.2);
  }
  50% {
    transform: scale(1.04);
    box-shadow: 0 0 0 5px rgba(239, 91, 43, 0.2);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 rgba(239, 91, 43, 0.2);
  }
}

.recipe-summary {
  border: 1px dashed var(--game-line);
  border-radius: 12px;
  padding: 0.75rem;
  background: #fff;
}

.prep-plan-card {
  border: 1px solid var(--game-line);
  border-radius: 12px;
  background: #fff;
  padding: 0.75rem;
  display: grid;
  gap: 0.55rem;
}

.prep-plan-head {
  display: flex;
  gap: 0.55rem;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.prep-plan-head h3 {
  margin: 0;
  font-size: 1rem;
}

.prep-plan-list {
  display: grid;
  gap: 0.45rem;
}

.prep-row {
  display: grid;
  grid-template-columns: 1.3fr minmax(120px, 1fr) 90px 90px;
  gap: 0.45rem;
  align-items: center;
  border: 1px solid var(--game-line);
  border-radius: 10px;
  background: #fffdfa;
  padding: 0.45rem;
}

.prep-row strong {
  display: block;
  font-size: 0.84rem;
  color: var(--game-ink);
}

.prep-row small {
  color: var(--game-muted);
  font-size: 0.72rem;
}

.prep-row select,
.prep-row input {
  min-height: 34px;
  border: 1px solid var(--game-line);
  border-radius: 8px;
  padding: 0 0.4rem;
  font: inherit;
  color: var(--game-ink);
  background: #fff;
}

.prep-row input {
  width: 100%;
}

.recipe-summary h3 {
  margin: 0 0 0.4rem;
  font-size: 1rem;
}

.recipe-list {
  margin: 0;
  padding-left: 1rem;
  color: var(--game-muted);
  font-size: 0.9rem;
}

.step-badges {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-bottom: 0.45rem;
}

.step-badge {
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  border: 1px solid var(--game-line);
  color: var(--game-muted);
  background: #fff;
}

.step-badge.done {
  color: #0f5030;
  border-color: rgba(29, 107, 70, 0.35);
  background: rgba(29, 107, 70, 0.1);
}

.score-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
}

.dish-reveal {
  margin-top: 0.9rem;
  border: 1px solid var(--game-line);
  border-radius: 14px;
  background: linear-gradient(160deg, rgba(255, 250, 240, 0.96), rgba(244, 252, 244, 0.92));
  padding: 0.72rem;
  display: grid;
  grid-template-columns: 108px 1fr;
  align-items: center;
  gap: 0.8rem;
}

.dish-reveal[hidden] {
  display: none !important;
}

.dish-reveal-title {
  grid-column: 1 / -1;
  margin: 0;
  font-weight: 900;
  color: #19422f;
}

#dishRevealImage {
  width: 108px;
  height: 108px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid rgba(22, 54, 41, 0.2);
  background: #f1e7d4;
}

.score-card {
  border: 1px solid var(--game-line);
  border-radius: 12px;
  background: #fff;
  padding: 0.65rem;
}

.score-card strong {
  font-size: 1.22rem;
  color: var(--game-ink);
}

.score-line {
  height: 7px;
  border-radius: 999px;
  background: #ebefe9;
  overflow: hidden;
  margin-top: 0.36rem;
}

.score-line > span {
  display: block;
  height: 100%;
  width: var(--score, 0%);
  background: linear-gradient(90deg, var(--game-warm), var(--game-accent));
}

.community-panel {
  margin-top: 1rem;
}

.community-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.community-action-btn {
  border: 1px solid rgba(22, 54, 41, 0.16);
  border-radius: 999px;
  padding: 0.52rem 0.82rem;
  background: #fff;
  color: var(--game-ink);
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
}

.community-action-btn.primary {
  color: #fffef7;
  border-color: rgba(29, 107, 70, 0.46);
  background: linear-gradient(135deg, #1d6b46, #2f8f5a);
}

.community-list {
  display: grid;
  gap: 0.6rem;
  margin-top: 0.65rem;
}

.community-item {
  border: 1px solid var(--game-line);
  border-radius: 12px;
  background: #fff;
  padding: 0.68rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.6rem;
}

.community-item p {
  margin: 0.2rem 0 0;
  color: var(--game-muted);
  font-size: 0.85rem;
}

.community-item .badge {
  display: inline-block;
  margin-right: 0.35rem;
  margin-top: 0.35rem;
  padding: 0.15rem 0.42rem;
  border-radius: 999px;
  background: rgba(29, 107, 70, 0.12);
  color: #0f5030;
  font-size: 0.73rem;
  font-weight: 700;
}

.community-item .badge.tracked {
  background: rgba(212, 155, 69, 0.2);
  color: #7a4b10;
}

.community-item .badge.pending {
  background: rgba(212, 155, 69, 0.18);
  color: #7a4b10;
}

.community-item .badge.approved {
  background: rgba(29, 107, 70, 0.16);
  color: #0f5030;
}

.community-item .badge.rejected {
  background: rgba(156, 62, 33, 0.16);
  color: #8b341a;
}

.community-item-actions {
  display: grid;
  justify-items: end;
  gap: 0.45rem;
}

.community-source-note {
  margin-top: 0.34rem;
  color: #6a614d;
  font-size: 0.76rem;
  font-weight: 700;
}

.help-note {
  margin-top: 0.45rem;
  color: var(--game-muted);
  font-size: 0.83rem;
}

.panel-status-strong {
  margin-top: 0.15rem;
  color: #8a3500;
  font-size: 0.96rem;
  font-weight: 900;
  letter-spacing: 0.01em;
}

.mobile-sprout-coach {
  display: none;
}

@media (max-width: 980px) {
  .game-shell {
    padding-top: 0.18rem;
  }

  .game-card {
    padding: 0.72rem;
  }

  .kitchen-stage {
    min-height: calc(100dvh - 7.2rem);
  }

  #kitchenCanvas {
    height: min(66dvh, 560px);
  }

  .floating-start-btn {
    right: 0.72rem;
    bottom: clamp(11.2rem, 19vh, 13.4rem);
    font-size: 0.92rem;
    padding: 0.62rem 0.9rem;
  }

  .game-layout {
    grid-template-columns: 1fr;
  }

  .community-actions {
    width: 100%;
  }

  .community-action-btn {
    flex: 1 1 11rem;
  }

  .builder-grid {
    grid-template-columns: 1fr;
  }

  .item-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .prep-row {
    grid-template-columns: 1fr;
  }

  .slice-control-panel {
    grid-template-columns: 1fr;
  }

  .sprout-start-guide {
    grid-template-columns: 78px 1fr;
    padding: 0.52rem;
  }

  .sprout-start-guide img {
    width: 78px;
    height: 78px;
  }

  .start-steps li {
    font-size: 0.89rem;
  }

  .slice-meters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
  }

  .tool-rack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .slice-meter {
    min-height: 40px;
    font-size: 0.94rem;
  }

  .audio-toggle {
    min-width: 84px;
    font-size: 0.75rem;
  }

  .mobile-sprout-coach {
    position: fixed;
    right: 0.65rem;
    bottom: max(0.75rem, env(safe-area-inset-bottom));
    z-index: 45;
    width: min(246px, calc(100vw - 1.2rem));
    display: grid;
    grid-template-columns: 46px 1fr;
    gap: 0.45rem;
    align-items: center;
    padding: 0.35rem 0.48rem;
    border: 1px solid rgba(22, 54, 41, 0.22);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 10px 24px rgba(22, 54, 41, 0.2);
    pointer-events: none;
    transform: translateY(0);
    transition: transform 320ms ease;
  }

  .mobile-sprout-coach.is-onboarding {
    background: linear-gradient(135deg, rgba(255, 250, 228, 0.98), rgba(255, 234, 178, 0.96));
    border-color: rgba(255, 175, 72, 0.48);
    box-shadow: 0 12px 26px rgba(173, 102, 27, 0.24);
  }

  .mobile-sprout-coach.is-hidden {
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
  }

  .mobile-sprout-coach.is-ready {
    transform: translateY(-118px);
  }

  .mobile-sprout-coach img {
    width: 46px;
    height: 46px;
    object-fit: contain;
  }

  .mobile-sprout-coach p {
    margin: 0;
    font-size: 0.86rem;
    line-height: 1.2;
    color: #163629;
    font-weight: 800;
  }

}

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

  .slice-meter {
    min-height: 42px;
    justify-content: flex-start;
    padding: 0 0.85rem;
    font-size: 1rem;
  }

  .dish-reveal {
    grid-template-columns: 82px 1fr;
  }

  #dishRevealImage {
    width: 82px;
    height: 82px;
  }
}
