:root {
  --tmnt-green: #38b000;
  --tmnt-green-dark: #1b5e20;
  --tmnt-green-light: #70e000;
  --mutagen-glow: #80ff00;
  --mike-orange: #ff7b00;
  --mike-orange-light: #ffa200;
  --pizzeria-red: #e63946;
  --pizzeria-red-dark: #9e1b24;
  --shredder-purple: #9d4edd;
  --krang-magenta: #ff007f;
  --cheese-gold: #ffbe0b;
  --sauce-red: #d90429;
  --crust-brown: #d4a373;
  --crust-baked: #bc6c25;
  --comic-ink: #14111f;
  --comic-shadow: #0d0a14;
  --nyc-night: #120e1c;
  --sewer-brick: #1d162b;
  --card-bg: #1e1830;
  --text-main: #ffffff;
  --text-dim: #cbd5e1;
  --font-display: 'Luckiest Guy', cursive, sans-serif;
  --font-ui: 'Fredoka', cursive, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
}

body {
  background-color: var(--nyc-night);
  /* NYC Night Brick Wall + Comic Halftone Dots + Sewer Mutagen & Neon Pizzeria Glows */
  background-image:
    radial-gradient(circle at 12% 18%, rgba(255, 123, 0, 0.22) 0%, transparent 38%),
    radial-gradient(circle at 88% 82%, rgba(112, 224, 0, 0.20) 0%, transparent 40%),
    radial-gradient(circle at 50% 10%, rgba(230, 57, 70, 0.16) 0%, transparent 35%),
    radial-gradient(rgba(255, 255, 255, 0.045) 1.5px, transparent 1.5px),
    repeating-linear-gradient(
      0deg,
      rgba(0, 0, 0, 0.28) 0px,
      rgba(0, 0, 0, 0.28) 2px,
      transparent 2px,
      transparent 28px
    ),
    repeating-linear-gradient(
      90deg,
      rgba(0, 0, 0, 0.18) 0px,
      rgba(0, 0, 0, 0.18) 2px,
      transparent 2px,
      transparent 56px
    );
  background-size: 100% 100%, 100% 100%, 100% 100%, 16px 16px, 100% 28px, 56px 56px;
  color: var(--text-main);
  font-family: var(--font-ui);
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#game-app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-height: 100vh;
  width: 100%;
  max-width: 1560px;
  margin: 0 auto;
  padding: 8px 14px 10px;
  position: relative;
  gap: 8px;
}

/* =========================================
   TOP HEADER: NYC NEON PIZZERIA + SEWER PIPE BAR
   ========================================= */
#game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background:
    linear-gradient(180deg, #27382b 0%, #18241b 55%, #121a16 100%);
  border: 3.5px solid var(--comic-ink);
  border-bottom: 4px solid var(--tmnt-green-light);
  border-radius: 16px;
  padding: 8px 16px 7px;
  box-shadow:
    0 5px 0 var(--comic-shadow),
    0 8px 20px rgba(0, 0, 0, 0.65),
    inset 0 2px 0 rgba(112, 224, 0, 0.35),
    0 0 18px rgba(112, 224, 0, 0.22);
  gap: 12px;
  flex-wrap: nowrap;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

/* Subtle NYC Pizzeria Checker / Sewer Hazard Trim along top edge of header */
#game-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: repeating-linear-gradient(
    90deg,
    var(--mike-orange) 0px,
    var(--mike-orange) 18px,
    var(--tmnt-green-light) 18px,
    var(--tmnt-green-light) 36px,
    var(--pizzeria-red) 36px,
    var(--pizzeria-red) 54px
  );
  opacity: 0.95;
}

.header-left {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex-shrink: 0;
}

.title-marquee-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sewer-manhole-badge {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #70e000, #2b8a00);
  border: 2.5px solid var(--comic-ink);
  box-shadow: 2px 2px 0 var(--comic-shadow), inset 0 1px 2px rgba(255, 255, 255, 0.5);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  flex-shrink: 0;
}

#game-title {
  font-family: var(--font-display);
  font-size: 1.48rem;
  letter-spacing: 1.5px;
  color: #ffde59;
  -webkit-text-stroke: 1.5px var(--comic-ink);
  text-shadow:
    2px 2px 0 var(--comic-ink),
    3px 3px 0 #d90429,
    0 0 12px rgba(255, 170, 0, 0.55);
  line-height: 1.05;
  white-space: nowrap;
}

#level-tracker {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 0.88rem;
  color: #ffde59;
  flex-wrap: wrap;
}

.level-badge {
  background: linear-gradient(180deg, #ff9e00 0%, #ff6000 100%);
  color: #fff;
  font-family: var(--font-display);
  font-size: 0.8rem;
  letter-spacing: 0.8px;
  padding: 3px 10px 2px;
  border-radius: 8px;
  border: 2px solid var(--comic-ink);
  box-shadow: 2px 2px 0 var(--comic-shadow);
  text-shadow: 1px 1px 0 var(--comic-ink);
}

.pizza-dots {
  display: flex;
  gap: 4px;
}

.pizza-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #233128;
  color: #cbd5e1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  border: 2px solid var(--comic-ink);
  box-shadow: 2px 2px 0 var(--comic-shadow);
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.pizza-dot.active {
  background: linear-gradient(135deg, #ffbe0b, #ff6b00);
  color: #fff;
  border-color: var(--comic-ink);
  transform: scale(1.15);
  box-shadow: 2px 2px 0 var(--comic-shadow), 0 0 10px rgba(255, 123, 0, 0.8);
}

.pizza-dot.completed {
  background: linear-gradient(135deg, #70e000, #2b9348);
  color: #fff;
  border-color: var(--comic-ink);
  transform: scale(1);
  box-shadow: 2px 2px 0 var(--comic-shadow), 0 0 8px rgba(112, 224, 0, 0.55);
}

#orders-count-text {
  font-family: var(--font-display);
  font-size: 0.85rem;
  color: #fff;
  text-shadow: 1px 1px 0 var(--comic-ink);
  margin-right: 2px;
}

.tracker-reset-btn {
  background: linear-gradient(180deg, #ffbe0b 0%, #fb8500 100%);
  border: 2px solid var(--comic-ink);
  color: #14111f;
  border-radius: 8px;
  padding: 2px 8px;
  font-family: var(--font-ui);
  font-weight: 800;
  font-size: 0.74rem;
  cursor: pointer;
  box-shadow: 2px 2px 0 var(--comic-shadow);
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.tracker-reset-btn:hover {
  background: linear-gradient(180deg, #ffe066 0%, #ff9e00 100%);
  transform: translateY(-1px);
  box-shadow: 3px 3px 0 var(--comic-shadow);
}

.tracker-reset-btn:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 var(--comic-shadow);
}

.tracker-reset-game-btn {
  background: linear-gradient(180deg, #ff4d6d 0%, #c9184a 100%);
  color: #ffffff;
  text-shadow: 1px 1px 0 var(--comic-ink);
}

.tracker-reset-game-btn:hover {
  background: linear-gradient(180deg, #ff758f 0%, #e01e5a 100%);
  color: #ffffff;
}

.custom-topping-svg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  line-height: 1;
}

.custom-topping-svg svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* Comic Speech-Bubble Instruction Banner */
.header-center {
  flex: 1;
  display: flex;
  justify-content: center;
  min-width: 240px;
}

.helper-banner {
  background: linear-gradient(180deg, #fff3b0 0%, #ffd166 100%);
  color: var(--comic-ink);
  border: 3px solid var(--comic-ink);
  border-radius: 999px;
  padding: 6px 18px;
  font-size: 0.98rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 9px;
  box-shadow:
    4px 4px 0 var(--comic-shadow),
    0 0 14px rgba(255, 209, 102, 0.35);
  animation: pulseNotice 2s infinite alternate;
  text-align: center;
  position: relative;
}

.helper-banner strong {
  color: #b5171e;
  font-weight: 800;
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

@keyframes pulseNotice {
  0% { transform: scale(1); }
  100% { transform: scale(1.02); }
}

#helper-icon {
  font-size: 1.35rem;
  animation: pointBounce 0.9s infinite alternate;
  filter: drop-shadow(1px 1px 0 rgba(0, 0, 0, 0.25));
  display: inline-flex;
  align-items: center;
}

@keyframes pointBounce {
  0% { transform: translateX(0); }
  100% { transform: translateX(5px); }
}

/* Chunky 90s Arcade Push-Buttons in Header Right */
.header-right {
  display: flex;
  gap: 7px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.icon-btn {
  background: linear-gradient(180deg, #3b4d61 0%, #243140 100%);
  border: 2.5px solid var(--comic-ink);
  color: #fff;
  border-radius: 10px;
  padding: 6px 11px;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 0.84rem;
  cursor: pointer;
  box-shadow:
    0 4px 0 var(--comic-shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
  transition: all 0.14s ease;
  display: flex;
  align-items: center;
  gap: 5px;
  text-shadow: 1px 1px 0 var(--comic-ink);
  white-space: nowrap;
}

.icon-btn.arcade-nav-btn {
  background: linear-gradient(180deg, #7b2cbf 0%, #5a189a 100%);
}

.icon-btn.help-arcade-btn {
  background: linear-gradient(180deg, #ff9e00 0%, #e85d04 100%);
}

.icon-btn:hover {
  filter: brightness(1.15);
  transform: translateY(-2px);
  box-shadow:
    0 6px 0 var(--comic-shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.icon-btn:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--comic-shadow);
}

.icon-btn.active-state {
  background: linear-gradient(180deg, #52b788 0%, #2d6a4f 100%);
}

.icon-btn.muted-state {
  opacity: 0.65;
  filter: grayscale(0.5);
}

/* =========================================
   MAIN 3-COLUMN ARCADE LAYOUT (FITS 100VH)
   ========================================= */
#game-container {
  display: grid;
  grid-template-columns: 276px 1fr 306px;
  gap: 14px;
  flex: 1;
  min-height: 0;
  align-items: stretch;
}

.hud-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* =========================================
   LEFT SIDEBAR: NYC PIZZERIA GUEST CHECK TICKET
   ========================================= */
.order-ticket {
  background-color: #fff8e7;
  background-image:
    repeating-linear-gradient(
      0deg,
      transparent 0px,
      transparent 26px,
      rgba(102, 155, 188, 0.16) 26px,
      rgba(102, 155, 188, 0.16) 27px
    );
  color: #1f1b24;
  border: 4px solid var(--comic-ink);
  border-radius: 16px;
  padding: 0 14px 12px;
  box-shadow:
    6px 6px 0 var(--comic-shadow),
    0 10px 24px rgba(0, 0, 0, 0.55);
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

/* Authentic NYC Pizzeria Red & White Checkered Tablecloth Top Trim */
.ticket-checker-trim {
  height: 16px;
  margin: 0 -14px 10px;
  background:
    repeating-linear-gradient(
      90deg,
      #d90429 0px,
      #d90429 16px,
      #ffffff 16px,
      #ffffff 32px
    );
  border-bottom: 3px solid var(--comic-ink);
  flex-shrink: 0;
}

.ticket-header {
  border-bottom: 3px dashed #b5171e;
  padding-bottom: 8px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.ticket-clip {
  font-size: 1.75rem;
  transform: rotate(-14deg);
  filter: drop-shadow(2px 2px 0 rgba(0, 0, 0, 0.25));
}

.ticket-sub {
  font-family: var(--font-display);
  font-size: 0.78rem;
  letter-spacing: 0.8px;
  color: #d90429;
  display: block;
}

#ticket-pizza-name {
  font-family: var(--font-display);
  font-size: 1.22rem;
  line-height: 1.15;
  color: var(--comic-ink);
  margin-top: 2px;
  text-shadow: 1px 1px 0 rgba(255, 190, 11, 0.45);
}

.ticket-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
}

.recipe-list-title {
  font-family: var(--font-display);
  font-size: 0.84rem;
  text-transform: uppercase;
  color: #1d3557;
  letter-spacing: 0.8px;
  margin-bottom: 7px;
}

.ticket-checklist {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.recipe-item {
  display: flex;
  align-items: center;
  background: #ffffff;
  border: 2.5px solid var(--comic-ink);
  border-radius: 10px;
  padding: 6px 10px;
  gap: 8px;
  font-weight: 700;
  font-size: 0.94rem;
  box-shadow: 3px 3px 0 rgba(20, 17, 31, 0.85);
  transition: all 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.recipe-item .item-emoji {
  font-size: 1.3rem;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.2));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
}

.recipe-item .item-name {
  flex: 1;
  color: var(--comic-ink);
  font-weight: 800;
}

.recipe-item .item-check {
  font-size: 1.1rem;
  color: #94a3b8;
}

.recipe-item.done {
  background: linear-gradient(90deg, #d8f3dc 0%, #b7efc5 100%);
  border-color: #1b4332;
  transform: translateX(3px);
  box-shadow: 2px 2px 0 #1b4332, 0 0 8px rgba(56, 176, 0, 0.35);
}

.recipe-item.done .item-name {
  color: #1b4332;
  text-decoration: line-through;
  text-decoration-thickness: 2px;
}

.recipe-item.done .item-check {
  color: #2d6a4f;
  animation: checkPop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.recipe-item.target-next {
  border-color: var(--comic-ink);
  background: linear-gradient(90deg, #fff3b0 0%, #ffda79 100%);
  box-shadow:
    3px 3px 0 var(--comic-ink),
    0 0 0 2px #ff7b00;
  animation: targetPulse 1.2s infinite alternate;
}

@keyframes targetPulse {
  0% { transform: scale(1); }
  100% { transform: scale(1.02); }
}

@keyframes checkPop {
  0% { transform: scale(0.5); }
  70% { transform: scale(1.35); }
  100% { transform: scale(1); }
}

.ticket-status-box {
  margin-top: 8px;
  background: linear-gradient(180deg, #2b2d42 0%, #1a1b2e 100%);
  color: #ffde59;
  border: 2.5px solid var(--comic-ink);
  border-radius: 10px;
  padding: 7px 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 800;
  font-size: 0.92rem;
  box-shadow: 3px 3px 0 var(--comic-shadow);
  flex-shrink: 0;
}

/* =========================================
   CENTER: RIVETED SEWER-STEEL & BRICK ARCADE BEZEL
   ========================================= */
#kitchen-viewport-wrapper {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  min-height: 0;
}

#kitchen-viewport {
  position: relative;
  background: #111822;
  border-radius: 20px;
  border: 5px solid var(--comic-ink);
  outline: 3px solid var(--mike-orange);
  box-shadow:
    8px 8px 0 var(--comic-shadow),
    0 0 28px rgba(255, 123, 0, 0.32),
    0 0 45px rgba(56, 176, 0, 0.18);
  overflow: hidden;
  width: 800px;
  height: 600px;
  max-width: 100%;
  max-height: calc(100vh - 102px);
  aspect-ratio: 4 / 3;
}

#game-canvas {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* Comic-Book "POW!" Action Prompt Callout Bubble */
.action-prompt-bubble {
  position: absolute;
  top: 40px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(180deg, #ffee32 0%, #ff9e00 100%);
  border: 3.5px solid var(--comic-ink);
  color: var(--comic-ink);
  padding: 6px 16px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow:
    4px 4px 0 var(--comic-shadow),
    0 0 18px rgba(255, 238, 50, 0.75);
  pointer-events: none;
  z-index: 20;
  animation: promptBob 0.75s infinite alternate ease-in-out;
  white-space: nowrap;
}

@keyframes promptBob {
  0% { transform: translate(-50%, 0) scale(1); }
  100% { transform: translate(-50%, -6px) scale(1.04); }
}

.prompt-key {
  background: var(--pizzeria-red);
  color: #ffffff;
  font-family: var(--font-display);
  font-size: 0.9rem;
  letter-spacing: 0.8px;
  padding: 3px 9px 2px;
  border-radius: 6px;
  border: 2px solid var(--comic-ink);
  box-shadow: 2px 2px 0 var(--comic-ink);
}

.kitchen-arrow {
  position: absolute;
  pointer-events: none;
  z-index: 15;
  transition: all 0.2s ease-out;
}

.arrow-bounce {
  font-size: 2.2rem;
  filter: drop-shadow(0 4px 0 var(--comic-ink));
  animation: arrowBounceAnim 0.65s infinite alternate cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes arrowBounceAnim {
  0% { transform: translateY(0); }
  100% { transform: translateY(-12px); }
}

/* =========================================
   RIGHT SIDEBAR: PIZZA PEEL SHOWCASE + 1989 FIGHTER SELECT + KONAMI ARCADE DECK
   ========================================= */
#pizza-showcase-sidebar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
  min-height: 0;
  justify-content: space-between;
}

/* Card 1: Pizza In Progress Showcase */
.showcase-card {
  background:
    radial-gradient(circle at 50% 52%, rgba(255, 158, 0, 0.22) 0%, transparent 62%),
    linear-gradient(160deg, #2b1d28 0%, #191324 100%);
  border: 3.5px solid var(--comic-ink);
  border-radius: 16px;
  padding: 0 12px 10px;
  box-shadow:
    5px 5px 0 var(--comic-shadow),
    0 8px 18px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: hidden;
  flex-shrink: 0;
}

.showcase-checker-trim {
  height: 12px;
  margin: 0 -12px 4px;
  background:
    repeating-linear-gradient(
      90deg,
      #d90429 0px,
      #d90429 14px,
      #ffffff 14px,
      #ffffff 28px
    );
  border-bottom: 2.5px solid var(--comic-ink);
}

.showcase-header h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: #ffde59;
  text-align: center;
  letter-spacing: 1px;
  text-shadow: 2px 2px 0 var(--comic-ink);
}

.pizza-plate-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2px 0;
}

.pizza-display {
  width: 148px;
  height: 148px;
  border-radius: 50%;
  background: radial-gradient(circle, #5c3a21 0%, #3e2723 75%, #271714 100%);
  border: 5px solid #8d5b3c;
  outline: 3px solid var(--comic-ink);
  position: relative;
  box-shadow:
    inset 0 0 18px rgba(0, 0, 0, 0.8),
    4px 4px 0 var(--comic-shadow),
    0 0 18px rgba(255, 170, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.pizza-display.empty::after {
  content: "Put Dough Here! 🫓";
  color: rgba(255, 240, 210, 0.65);
  font-size: 0.8rem;
  font-weight: 800;
  text-align: center;
  width: 80%;
  text-shadow: 1px 1px 0 var(--comic-ink);
}

.pizza-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  pointer-events: none;
  transition: all 0.35s ease-out;
}

/* Dough Disc */
.dough-layer {
  background: radial-gradient(circle, #fde2b4 60%, #e2b47e 92%, #c8955a 100%);
  border: 5px solid #cf9b63;
  box-shadow: inset 0 0 10px rgba(184, 115, 51, 0.45);
  transform: scale(0.92);
  animation: doughPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes doughPop {
  0% { transform: scale(0.2); opacity: 0; }
  80% { transform: scale(1.05); }
  100% { transform: scale(0.92); opacity: 1; }
}

/* Sauce Layer */
.sauce-layer {
  transform: scale(0.82);
  background: radial-gradient(circle, #e63946 68%, #9b001a 100%);
  box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.45);
  animation: sauceSpread 0.4s ease-out;
}

@keyframes sauceSpread {
  0% { transform: scale(0.1); opacity: 0; }
  100% { transform: scale(0.82); opacity: 1; }
}

/* Cheese Layer */
.cheese-layer {
  transform: scale(0.76);
  background: radial-gradient(circle, #fff3b0 55%, #ffbe0b 92%, #fb8500 100%);
  box-shadow: inset 0 0 6px rgba(180, 80, 0, 0.35);
  animation: cheeseMelt 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes cheeseMelt {
  0% { transform: scale(0.2); opacity: 0; }
  100% { transform: scale(0.76); opacity: 1; }
}

/* Toppings Layer */
.toppings-layer {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
}

.topping-emoji-item {
  position: absolute;
  font-size: 1.2rem;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.6));
  animation: toppingDrop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
  user-select: none;
}

@keyframes toppingDrop {
  0% { opacity: 0; margin-top: -16px; }
  70% { margin-top: 3px; }
  100% { opacity: 1; margin-top: 0; }
}

/* Baking Glow */
.baking-glow {
  background: radial-gradient(circle, rgba(255, 84, 0, 0.65) 0%, rgba(255, 0, 0, 0.3) 70%, transparent 100%);
  display: flex;
  align-items: center;
  justify-content: space-around;
  font-size: 1.8rem;
  animation: ovenPulse 0.5s infinite alternate;
}

@keyframes ovenPulse {
  0% { opacity: 0.5; filter: brightness(1); }
  100% { opacity: 0.95; filter: brightness(1.4); }
}

/* Cooked Crust */
.cooked-layer {
  background: radial-gradient(circle, rgba(160, 82, 45, 0.22) 50%, rgba(139, 69, 19, 0.5) 85%, #8B4513 100%);
  box-shadow: inset 0 0 15px rgba(70, 30, 0, 0.6);
  border: 5px solid #a0522d;
  animation: bakeGold 0.5s ease-out;
}

@keyframes bakeGold {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

.sparkles-layer {
  background: radial-gradient(circle, rgba(255, 230, 0, 0.4) 0%, transparent 70%);
  animation: sparkleTwinkle 1s infinite alternate;
}

@keyframes sparkleTwinkle {
  0% { opacity: 0.3; transform: rotate(0deg); }
  100% { opacity: 0.8; transform: rotate(180deg); }
}

/* Stage Indicator */
.pizza-stage-indicator {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stage-label {
  font-size: 0.86rem;
  font-weight: 800;
  color: #ffde59;
  text-align: center;
  text-shadow: 1px 1px 0 var(--comic-ink);
}

.stage-progress-bar {
  width: 100%;
  height: 11px;
  background: #120e1c;
  border-radius: 999px;
  overflow: hidden;
  border: 2px solid var(--comic-ink);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.6);
}

.stage-progress-fill {
  height: 100%;
  background: repeating-linear-gradient(
    -45deg,
    #38b000,
    #38b000 8px,
    #70e000 8px,
    #70e000 16px
  );
  border-radius: 999px;
  transition: width 0.3s ease;
}

/* =========================================
   CARD 2: 1989 TMNT ARCADE CHARACTER SELECT
   ========================================= */
.avatar-selector-section {
  background: linear-gradient(180deg, #1b2436 0%, #111726 100%);
  border: 3.5px solid var(--comic-ink);
  border-radius: 16px;
  padding: 8px 10px 10px;
  box-shadow:
    5px 5px 0 var(--comic-shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

.avatar-selector-title {
  font-family: var(--font-display);
  font-size: 0.9rem;
  letter-spacing: 1px;
  color: #70e000;
  text-align: center;
  text-shadow: 2px 2px 0 var(--comic-ink);
}

.avatar-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.avatar-card {
  background: linear-gradient(180deg, #283246 0%, #182030 100%);
  border: 2.5px solid var(--comic-ink);
  border-radius: 12px;
  padding: 6px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  box-shadow: 3px 3px 0 var(--comic-shadow);
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  color: #fff;
  font-family: var(--font-ui);
  position: relative;
}

/* Signature Character Hover & Active Themes (Mikey Orange, Shredder Purple, Krang Magenta) */
.avatar-card[data-avatar="michelangelo"]:hover,
.avatar-card[data-avatar="michelangelo"].active {
  background: linear-gradient(180deg, #ff9e00 0%, #c85a00 100%);
  border-color: var(--comic-ink);
  box-shadow: 3px 3px 0 var(--comic-shadow), 0 0 12px rgba(255, 123, 0, 0.65);
  transform: translateY(-2px);
}

.avatar-card[data-avatar="shredder"]:hover,
.avatar-card[data-avatar="shredder"].active {
  background: linear-gradient(180deg, #9d4edd 0%, #5a189a 100%);
  border-color: var(--comic-ink);
  box-shadow: 3px 3px 0 var(--comic-shadow), 0 0 12px rgba(157, 78, 221, 0.65);
  transform: translateY(-2px);
}

.avatar-card[data-avatar="krang"]:hover,
.avatar-card[data-avatar="krang"].active {
  background: linear-gradient(180deg, #ff007f 0%, #a80054 100%);
  border-color: var(--comic-ink);
  box-shadow: 3px 3px 0 var(--comic-shadow), 0 0 12px rgba(255, 0, 127, 0.65);
  transform: translateY(-2px);
}

.avatar-thumb-box {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: radial-gradient(circle, #2b394f 0%, #0f1520 100%);
  border: 2px solid var(--comic-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.avatar-thumb {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  image-rendering: pixelated;
  transition: transform 0.2s;
}

.avatar-thumb.shredder-thumb,
.avatar-thumb.krang-thumb {
  max-height: 98%;
  image-rendering: auto;
}

.avatar-card:hover .avatar-thumb {
  transform: scale(1.12);
}

.avatar-card-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}

.avatar-card-name {
  font-family: var(--font-display);
  font-size: 0.76rem;
  letter-spacing: 0.4px;
  color: #ffffff;
  text-shadow: 1px 1px 0 var(--comic-ink);
}

.avatar-card-status {
  font-size: 0.66rem;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.38);
  color: #e2e8f0;
  white-space: nowrap;
}

.avatar-card.active .avatar-card-status {
  background: #14111f;
  color: #70e000;
}

/* =========================================
   CARD 3: KONAMI BRUSHED-METAL ARCADE CONTROL DECK
   ========================================= */
#touch-controls {
  display: flex;
  flex-direction: column;
  width: 100%;
  background:
    repeating-linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.03) 0px,
      rgba(255, 255, 255, 0.03) 6px,
      transparent 6px,
      transparent 12px
    ),
    linear-gradient(180deg, #333d4b 0%, #1d242f 100%);
  border: 3.5px solid var(--comic-ink);
  border-radius: 16px;
  padding: 8px 12px 10px;
  gap: 6px;
  box-shadow:
    5px 5px 0 var(--comic-shadow),
    inset 0 2px 0 rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
}

.arcade-deck-header {
  font-family: var(--font-display);
  font-size: 0.82rem;
  letter-spacing: 1px;
  color: #ffd166;
  text-align: center;
  text-shadow: 1px 1px 0 var(--comic-ink);
}

.arcade-deck-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.dpad-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.dpad-middle {
  display: flex;
  align-items: center;
  gap: 3px;
}

.dpad-center {
  width: 34px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  background: #14111f;
  border-radius: 6px;
  border: 2px solid #4a5568;
}

.dpad-btn {
  width: 40px;
  height: 34px;
  background: linear-gradient(180deg, #4a5568 0%, #2d3748 100%);
  border: 2.5px solid var(--comic-ink);
  border-radius: 8px;
  color: #fff;
  font-size: 1.05rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 3px 0 var(--comic-ink),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transition: all 0.08s;
}

.dpad-btn:hover {
  background: linear-gradient(180deg, #5a677d 0%, #384459 100%);
}

.dpad-btn:active, .dpad-btn.pressed {
  transform: translateY(3px);
  box-shadow: 0 0 0 var(--comic-ink);
  background: linear-gradient(180deg, #70e000 0%, #38b000 100%);
}

.action-btn-container {
  flex: 1;
  display: flex;
  justify-content: center;
}

.action-btn {
  width: 100%;
  background: radial-gradient(circle at 35% 25%, #ff9e00 0%, #e63946 65%, #9e1b24 100%);
  border: 3.5px solid var(--comic-ink);
  border-radius: 16px;
  padding: 12px 10px;
  color: #ffffff;
  cursor: pointer;
  box-shadow:
    0 6px 0 var(--comic-ink),
    0 8px 16px rgba(230, 57, 70, 0.45),
    inset 0 2px 2px rgba(255, 255, 255, 0.45);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.1s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.action-btn:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow:
    0 7px 0 var(--comic-ink),
    0 10px 20px rgba(255, 123, 0, 0.6),
    inset 0 2px 2px rgba(255, 255, 255, 0.55);
}

.action-btn:active, .action-btn.pressed {
  transform: translateY(4px);
  box-shadow:
    0 2px 0 var(--comic-ink),
    0 4px 8px rgba(230, 57, 70, 0.4);
}

.action-btn-key {
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: 1px;
  text-shadow: 2px 2px 0 var(--comic-ink);
}

.action-btn-label {
  font-size: 0.78rem;
  font-weight: 800;
  background: rgba(20, 17, 31, 0.65);
  color: #ffde59;
  padding: 2px 8px;
  border-radius: 8px;
  border: 1.5px solid var(--comic-ink);
  text-align: center;
}

/* =========================================
   MODALS (WIN & HELP)
   ========================================= */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(12, 9, 20, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.modal-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.modal-card {
  background: linear-gradient(155deg, #231b38 0%, #140f24 100%);
  border: 5px solid var(--comic-ink);
  outline: 3px solid var(--mike-orange);
  border-radius: 24px;
  padding: 28px;
  max-width: 520px;
  width: 90%;
  color: #fff;
  text-align: center;
  position: relative;
  box-shadow:
    10px 10px 0 var(--comic-shadow),
    0 20px 50px rgba(0, 0, 0, 0.9);
  animation: modalPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalPop {
  0% { transform: scale(0.7); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  background: var(--pizzeria-red);
  border: 2.5px solid var(--comic-ink);
  color: #fff;
  font-size: 1.1rem;
  font-weight: 800;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 2px 2px 0 var(--comic-ink);
  transition: transform 0.15s;
}

.close-btn:hover {
  transform: scale(1.1);
}

/* Win Card */
.win-confetti-badge {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: #ffbe0b;
  text-shadow: 2px 2px 0 var(--comic-ink);
  margin-bottom: 8px;
}

.win-avatar {
  width: 135px;
  height: auto;
  image-rendering: pixelated;
  margin: 8px auto;
  display: block;
  animation: avatarCheer 1s infinite alternate ease-in-out;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.6));
}

@keyframes avatarCheer {
  0% { transform: scale(1) translateY(0); }
  100% { transform: scale(1.1) translateY(-10px); }
}

.win-title {
  font-family: var(--font-display);
  font-size: 2.1rem;
  color: #70e000;
  text-shadow: 3px 3px 0 var(--comic-ink);
  margin-bottom: 10px;
}

.win-message {
  font-size: 1.1rem;
  color: #e2e8f0;
  line-height: 1.5;
  margin-bottom: 18px;
}

.win-stats {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-bottom: 22px;
}

.stat-box {
  background: rgba(255, 255, 255, 0.08);
  border: 2.5px solid var(--comic-ink);
  border-radius: 14px;
  padding: 10px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: 3px 3px 0 var(--comic-shadow);
}

.stat-number {
  font-family: var(--font-display);
  font-size: 1.7rem;
  color: #ffd166;
  text-shadow: 2px 2px 0 var(--comic-ink);
}

.stat-label {
  font-size: 0.88rem;
  color: var(--text-dim);
  font-weight: 700;
}

.play-again-btn, .got-it-btn {
  background: linear-gradient(180deg, #70e000 0%, #38b000 100%);
  border: 3.5px solid var(--comic-ink);
  color: #fff;
  font-family: var(--font-display);
  font-size: 1.3rem;
  letter-spacing: 1px;
  padding: 13px 26px;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 0 6px 0 var(--comic-ink), 0 8px 20px rgba(56, 176, 0, 0.5);
  text-shadow: 2px 2px 0 var(--comic-ink);
  transition: all 0.15s;
  width: 100%;
}

.play-again-btn:hover, .got-it-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 0 var(--comic-ink), 0 12px 25px rgba(112, 224, 0, 0.6);
}

.play-again-btn:active, .got-it-btn:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 var(--comic-ink);
}

/* Help modal styles */
.help-card {
  max-width: 580px;
  text-align: left;
}

.help-card h2 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  color: #ffbe0b;
  text-shadow: 2px 2px 0 var(--comic-ink);
  text-align: center;
  margin-bottom: 16px;
}

.help-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.help-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 2px solid var(--comic-ink);
  border-radius: 12px;
  padding: 9px 12px;
  box-shadow: 3px 3px 0 var(--comic-shadow);
}

.step-num {
  width: 30px;
  height: 30px;
  background: linear-gradient(180deg, #ff9e00, #ff6000);
  border: 2px solid var(--comic-ink);
  color: #fff;
  font-family: var(--font-display);
  font-size: 1.1rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  text-shadow: 1px 1px 0 var(--comic-ink);
}

.step-desc {
  font-size: 0.96rem;
  line-height: 1.4;
  color: #f1f5f9;
}

.mini-recipe {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 5px;
  font-weight: 700;
  color: #ffbe0b;
}

/* Confetti Canvas */
#confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 99;
}

/* Utility */
.hidden {
  display: none !important;
}

/* Responsive */
@media (max-width: 1240px) {
  #game-container {
    grid-template-columns: 245px 1fr 275px;
    gap: 10px;
  }
}

@media (max-width: 980px) {
  body, #game-app {
    height: auto;
    max-height: none;
    overflow-y: auto;
  }
  #game-header {
    flex-wrap: wrap;
  }
  #game-container {
    grid-template-columns: 1fr;
    display: flex;
    flex-direction: column;
  }
  #order-sidebar, #pizza-showcase-sidebar {
    width: 100%;
  }
  #kitchen-viewport {
    width: 100%;
    height: auto;
    max-height: none;
  }
}
