:root,
body[data-theme="cozy_cookie"],
body[data-theme="cozy_cookie_deko"] {
  --wood-dark: #432310;
  --wood-mid: #6e3b1b;
  --wood-light: #a86434;
  --biscuit-border: #c97e3d;
  --biscuit-lip: #87491b;
  --cream-top: #fffdf7;
  --cream-bottom: #f7e6cc;
  --cream-piping: rgba(196, 128, 68, 0.35);
  --choco-text: #4a2511;
  --choco-muted: #8c5836;
  --glaze-orange: #ff851b;
  --glaze-orange-lip: #c45106;
  --glaze-berry: #e83e58;
  --glaze-gold: #ffae19;
}

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

body {
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  background-color: #fff6e8;
  color: var(--choco-text);
  font-family: 'Fredoka', 'Nunito', 'Segoe UI', system-ui, sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

/* Warm Honey-Oak Wooden Puzzle Table Background (Without Border Cookies) */
.ambient-bg {
  position: fixed;
  inset: 0;
  background-color: #6b3b18;
  background-image:
    radial-gradient(circle at 50% 45%, rgba(255, 240, 205, 0.14) 0%, rgba(50, 22, 6, 0.42) 100%),
    url('assets/cozy_cookie/wood_table_bg.jpg?v=21');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  filter: none;
  z-index: 0;
}

.app-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 575px;
  height: 100vh;
  height: 100dvh;
  max-height: 990px;
  display: flex;
  flex-direction: column;
  padding: 10px 12px 6px;
  gap: 8px;
}

/* Mini L-Block Icon (used in Help modal) */
.mini-l-icon {
  display: grid;
  grid-template-columns: repeat(2, 14px);
  grid-template-rows: repeat(2, 14px);
  gap: 1.5px;
  filter: drop-shadow(0 2px 2px rgba(60, 24, 5, 0.35));
}

.mini-l-icon img {
  width: 14px;
  height: 14px;
  object-fit: contain;
  background: rgba(74, 32, 8, 0.45);
  border: 1px solid rgba(255, 220, 160, 0.65);
  border-radius: 3.5px;
}

/* Recipe Objectives Bar using Slim Wood-Grain PNG Asset (ui_recipe_bar.png) */
.recipe-bar {
  background: url('assets/cozy_cookie/ui_recipe_bar.png?v=29') center / 108% 124% no-repeat;
  border: 2px solid #8a4b1c;
  box-shadow:
    inset 0 1.5px 0 rgba(255, 250, 238, 0.78),
    inset 0 -2px 0 rgba(110, 52, 14, 0.32),
    0 2px 0 #6b340e;
  border-radius: 18px;
  padding: 6px 12px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  filter: drop-shadow(0 4px 8px rgba(70, 30, 6, 0.16));
}

.recipe-bar.hidden {
  display: none;
}

.recipe-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.recipe-title {
  font-family: 'Fredoka', sans-serif;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--choco-text);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.65);
  white-space: nowrap;
}

.recipe-title.hidden {
  display: none;
}

/* Live 3-Star Progress Bar inside Recipe Bar */
.recipe-star-meter {
  flex: 1 1 110px;
  max-width: 260px;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 4px;
}

.star-meter-track {
  position: relative;
  flex: 1;
  min-width: 68px;
  height: 11px;
  background: linear-gradient(180deg, #4f250b 0%, #6e3613 100%);
  border: 1.5px solid #965222;
  border-radius: 999px;
  box-shadow:
    inset 0 2px 3px rgba(25, 8, 0, 0.6),
    0 1px 0 rgba(255, 250, 238, 0.65);
  overflow: visible;
}

.star-meter-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #ff9914 0%, #ffcf44 65%, #fff099 100%);
  box-shadow:
    0 0 8px rgba(255, 190, 40, 0.65),
    inset 0 1.5px 0 rgba(255, 255, 255, 0.7);
  transition: width 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.star-meter-pins {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  pointer-events: none;
}

.hud-star-pin {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.hud-star-pin img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 2px 3px rgba(42, 15, 2, 0.55));
  transition: transform 0.2s ease, filter 0.2s ease;
}

.hud-star-pin.earned img {
  filter:
    drop-shadow(0 2px 4px rgba(50, 18, 2, 0.6))
    drop-shadow(0 0 7px rgba(255, 200, 45, 0.75));
}

.hud-star-pin.hud-star-pop {
  animation: hudStarPopAnim 0.52s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes hudStarPopAnim {
  0% { transform: translate(-50%, -50%) scale(0.6) rotate(-18deg); }
  55% { transform: translate(-50%, -50%) scale(1.42) rotate(8deg); }
  100% { transform: translate(-50%, -50%) scale(1) rotate(0deg); }
}

.star-meter-label {
  font-family: 'Fredoka', sans-serif;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--choco-text);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.75);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  margin-left: 4px;
  text-align: left;
  flex-shrink: 0;
}

.star-meter-label.all-earned {
  color: #b84a05;
}

.recipe-goals {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.goal-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 252, 245, 0.82);
  border: 1.5px solid rgba(168, 100, 52, 0.45);
  border-radius: 999px;
  padding: 2px 10px 2px 6px;
  font-family: 'Fredoka', sans-serif;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--choco-text);
  box-shadow: 0 2px 4px rgba(70, 30, 6, 0.1);
  transition: all 0.2s ease;
}

@media (max-width: 520px) {
  .recipe-bar {
    padding: 5px 8px 6px;
    gap: 6px;
  }

  .recipe-header .lvl-map-pill {
    padding: 3px 8px;
    gap: 4px;
    font-size: 11px;
  }

  .recipe-star-meter {
    gap: 5px;
    padding: 2px 2px;
  }

  .star-meter-track {
    height: 9.5px;
  }

  .hud-star-pin {
    width: 16px;
    height: 16px;
  }

  .star-meter-label {
    font-size: 10.5px;
    margin-left: 3px;
  }

  .recipe-goals {
    gap: 4px;
  }

  .goal-chip {
    padding: 2px 7px 2px 4px;
    gap: 3px;
    font-size: 11px;
  }
}

.goal-chip.done {
  background: linear-gradient(180deg, #dcfce7 0%, #bbf7d0 100%);
  border-color: #22c55e;
  color: #15803d;
}

.goal-chip.goal-pop {
  animation: goalChipPop 0.42s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.goal-chip.goal-just-completed {
  animation: goalChipCompleted 0.65s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes goalChipPop {
  0% { transform: scale(1); }
  40% { transform: scale(1.24); box-shadow: 0 0 12px rgba(255, 195, 50, 0.75); }
  100% { transform: scale(1); }
}

@keyframes goalChipCompleted {
  0% { transform: scale(1); }
  35% { transform: scale(1.32) rotate(-3deg); box-shadow: 0 0 18px rgba(34, 197, 94, 0.85); }
  70% { transform: scale(1.08) rotate(2deg); }
  100% { transform: scale(1) rotate(0deg); }
}

.goal-chip img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.flying-goal-cookie {
  position: fixed;
  z-index: 95;
  pointer-events: none;
  user-select: none;
  object-fit: contain;
  transform: translate(-50%, -50%);
  filter:
    drop-shadow(0 6px 10px rgba(45, 16, 2, 0.45))
    drop-shadow(0 0 12px rgba(255, 200, 55, 0.75));
  will-change: transform, opacity;
}

/* Tactile 3D Glazed Biscuit & Real Wood Buttons */
.cookie-btn {
  font-family: 'Fredoka', sans-serif;
  font-size: 13px;
  font-weight: 600;
  height: 36px;
  border-radius: 13px;
  padding: 0 11px;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.08s ease, filter 0.15s ease, box-shadow 0.08s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex-shrink: 0;
}

.secondary-cookie-btn,
.icon-only-btn {
  background: url('assets/cozy_cookie/ui_btn_wood.png?v=30') center / 112% 126% no-repeat;
  color: var(--choco-text);
  border: 2px solid #8a4b1c;
  box-shadow:
    inset 0 1.5px 0 rgba(255, 250, 238, 0.78),
    inset 0 -2px 0 rgba(110, 52, 14, 0.32),
    0 2px 0 #6b340e;
  filter: drop-shadow(0 3px 6px rgba(70, 30, 6, 0.16));
}

.icon-only-btn {
  width: 36px;
  padding: 0;
}

.game-icon-btn {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: 16px;
  background: url('assets/cozy_cookie/ui_menu_btn.png?v=30') center / 114% 114% no-repeat;
  color: var(--choco-text);
  border: 2px solid #8a4b1c;
  box-shadow:
    inset 0 1.5px 0 rgba(255, 250, 238, 0.78),
    inset 0 -2px 0 rgba(110, 52, 14, 0.35),
    0 2px 0 #6b340e;
  filter: drop-shadow(0 4px 8px rgba(70, 30, 6, 0.18));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.08s ease, filter 0.15s ease;
}

.hud-menu-btn {
  height: auto;
  width: 54px;
  align-self: stretch;
}

.game-icon-btn:hover {
  filter: brightness(1.04) drop-shadow(0 5px 10px rgba(70, 30, 6, 0.24));
  transform: translateY(-1px);
}

.game-icon-btn:active {
  transform: translateY(2px);
}

.primary-cookie-btn {
  background: url('assets/cozy_cookie/ui_btn_amber.png?v=30') center / 112% 126% no-repeat;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(100, 34, 0, 0.75);
  border: 2px solid #9c3c04;
  box-shadow:
    inset 0 1.5px 0 rgba(255, 236, 175, 0.72),
    inset 0 -2px 0 rgba(125, 42, 2, 0.42),
    0 2px 0 #7a2b02;
  filter: drop-shadow(0 4px 8px rgba(90, 35, 4, 0.22));
}

.cookie-btn:hover {
  filter: brightness(1.05) drop-shadow(0 4px 8px rgba(70, 30, 6, 0.22));
  transform: translateY(-1px);
}

.cookie-btn:active {
  transform: translateY(2px);
}

/* Slim Wood-Grain Score Strip: 3 Cards (ui_score_card.png) + Menu Button (ui_menu_btn.png) */
.score-strip {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  gap: 9px;
  align-items: stretch;
}

.score-card {
  background: url('assets/cozy_cookie/ui_score_card.png?v=30') center / 112% 126% no-repeat;
  border: 2px solid #8a4b1c;
  box-shadow:
    inset 0 1.5px 0 rgba(255, 250, 238, 0.78),
    inset 0 -2px 0 rgba(110, 52, 14, 0.32),
    0 2px 0 #6b340e;
  border-radius: 18px;
  padding: 5px 12px 7px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 4px 8px rgba(70, 30, 6, 0.16));
  position: relative;
  transition: transform 0.18s ease, filter 0.2s ease;
}

.score-label {
  font-family: 'Nunito', sans-serif;
  font-size: 10.5px;
  font-weight: 900;
  letter-spacing: 1.1px;
  color: var(--choco-muted);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
}

.score-number {
  font-family: 'Fredoka', sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--choco-text);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.75);
  line-height: 1.08;
  font-variant-numeric: tabular-nums;
}

.streak-card .score-number {
  color: var(--choco-muted);
}

.streak-card.streak-active {
  filter: brightness(1.06) drop-shadow(0 0 10px rgba(255, 150, 30, 0.55));
}

.streak-card.streak-active .score-number {
  color: var(--glaze-orange);
}

.streak-card.streak-pop {
  transform: scale(1.05);
}

.best-card .score-number {
  color: var(--glaze-berry);
}

/* Canvas Stage */
.canvas-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

#mosaic-canvas {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  aspect-ratio: 760 / 960;
  border-radius: 22px;
  touch-action: none;
  cursor: grab;
}

@media (max-width: 640px) {
  .app-shell {
    max-width: 100%;
    max-height: none;
    padding: 4px 0 2px;
    gap: 4px;
  }

  .score-strip {
    margin: 0 5px;
    gap: 6px;
  }

  .score-card {
    padding: 3px 8px 5px;
    border-radius: 15px;
  }

  .score-label {
    font-size: 9.5px;
  }

  .score-number {
    font-size: 20px;
  }

  .hud-menu-btn {
    width: 46px;
    border-radius: 14px;
  }

  .recipe-bar {
    margin: 0 5px;
    padding: 4px 8px 6px;
    border-radius: 15px;
    gap: 6px;
  }

  .canvas-stage {
    width: 100%;
    padding: 0;
  }

  #mosaic-canvas {
    width: 100%;
    border-radius: 16px;
  }
}

#mosaic-canvas:active {
  cursor: grabbing;
}

/* On-Board Level Start Objective Banner */
.level-intro-banner {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 34;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  padding-bottom: 16%;
}

.level-intro-banner.hidden {
  display: none;
}

.level-intro-plaque {
  background: url('assets/cozy_cookie/ui_modal_box.png?v=30') center / 100% 100% no-repeat;
  padding: 20px 28px 20px;
  border-radius: 24px;
  min-width: 245px;
  max-width: 88%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  pointer-events: auto;
  filter:
    drop-shadow(0 14px 26px rgba(32, 11, 2, 0.62))
    drop-shadow(0 0 22px rgba(255, 195, 65, 0.35));
  animation: levelIntroBannerAnim 0.36s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.level-intro-ok-btn {
  margin-top: 6px;
  min-width: 112px;
  height: 38px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.level-intro-kicker {
  font-family: 'Nunito', sans-serif;
  font-size: 11.5px;
  font-weight: 900;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #8a4312;
  background: rgba(255, 232, 185, 0.85);
  border: 1px solid rgba(185, 105, 40, 0.4);
  border-radius: 999px;
  padding: 2px 11px;
}

.level-intro-title {
  font-family: 'Fredoka', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--choco-text);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.78);
  line-height: 1.15;
}

.level-intro-goals {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.intro-goal-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 253, 247, 0.92);
  border: 2px solid rgba(185, 108, 45, 0.55);
  border-radius: 999px;
  padding: 4px 12px 4px 8px;
  font-family: 'Fredoka', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--choco-text);
  box-shadow: 0 3px 6px rgba(65, 25, 5, 0.14);
}

.intro-goal-pill img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.level-intro-stars {
  width: 100%;
  margin-top: 4px;
  padding: 7px 11px;
  background: rgba(255, 248, 232, 0.78);
  border: 1.5px solid rgba(180, 105, 42, 0.42);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.intro-star-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-family: 'Nunito', sans-serif;
  font-size: 11.5px;
  font-weight: 800;
  color: var(--choco-muted);
}

.intro-star-icons {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  flex-shrink: 0;
}

.intro-star-icons img {
  width: 14px;
  height: 14px;
  object-fit: contain;
  filter: drop-shadow(0 1px 2px rgba(60, 22, 4, 0.3));
}

.intro-star-cond {
  text-align: right;
  color: var(--choco-text);
  font-weight: 800;
}

@keyframes levelIntroBannerAnim {
  0% {
    opacity: 0;
    transform: translateY(20px) scale(0.75);
  }
  70% {
    opacity: 1;
    transform: translateY(-3px) scale(1.03);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* On-Board Level Clear Celebration Banner ("GESCHAFFT!") */
.victory-banner {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 35;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  padding-bottom: 14%;
}

.victory-banner.hidden {
  display: none;
}

.victory-banner-plaque {
  background: url('assets/cozy_cookie/ui_region_banner.png?v=32') center / 100% 100% no-repeat;
  padding: 18px 46px 22px;
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  filter:
    drop-shadow(0 12px 24px rgba(32, 11, 2, 0.65))
    drop-shadow(0 0 28px rgba(255, 195, 55, 0.55));
  animation: victoryBannerAnim 1.48s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.victory-banner-text {
  font-family: 'Fredoka', sans-serif;
  font-size: clamp(28px, 6.2vw, 40px);
  font-weight: 700;
  letter-spacing: 1.5px;
  color: #fffef5;
  text-shadow:
    0 3px 0 #7a2e04,
    0 -1.5px 0 #7a2e04,
    2.5px 0 0 #7a2e04,
    -2.5px 0 0 #7a2e04,
    0 6px 12px rgba(40, 12, 2, 0.62);
}

@keyframes victoryBannerAnim {
  0% {
    opacity: 0;
    transform: translateY(24px) scale(0.55);
  }
  22% {
    opacity: 1;
    transform: translateY(-4px) scale(1.06);
  }
  34% {
    opacity: 1;
    transform: translateY(0) scale(1.0);
  }
  78% {
    opacity: 1;
    transform: translateY(0) scale(1.02);
  }
  100% {
    opacity: 0;
    transform: translateY(-14px) scale(0.94);
  }
}

/* Cozy Wood-Grain Modal Dialogs with Smooth Fade & Spring Entrance */
.modal-overlay {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: rgba(42, 18, 5, 0.62);
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 220;
  animation: modalBackdropFadeIn 0.36s ease-out forwards;
}

.modal-overlay.hidden {
  display: none;
}

@keyframes modalBackdropFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-box {
  background: url('assets/cozy_cookie/ui_modal_box.png?v=30') center / 100% 100% no-repeat;
  border: none;
  border-radius: 28px;
  padding: 28px 26px 28px;
  width: 90%;
  max-width: 395px;
  text-align: center;
  filter: drop-shadow(0 20px 45px rgba(0, 0, 0, 0.62));
  position: relative;
  animation: modalCardPopIn 0.44s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes modalCardPopIn {
  0% {
    opacity: 0;
    transform: translateY(20px) scale(0.88);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-cookie-badge {
  width: 68px;
  height: 68px;
  margin: -52px auto 10px;
  background: url('assets/cozy_cookie/ui_menu_btn.png?v=30') center / 114% 114% no-repeat;
  border: 2px solid #8a4b1c;
  box-shadow:
    inset 0 1.5px 0 rgba(255, 250, 238, 0.78),
    inset 0 -2px 0 rgba(110, 52, 14, 0.35),
    0 2px 0 #6b340e;
  border-radius: 18px;
  filter: drop-shadow(0 5px 10px rgba(45, 18, 4, 0.32));
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-cookie-badge.hidden {
  display: none;
}

.modal-cookie-badge img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Real 3D Cookie-Gold Stars in Victory Modal */
.modal-victory-stars {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 8px;
  margin: -46px auto 10px;
  height: 82px;
}

.modal-victory-stars.hidden {
  display: none;
}

.victory-star-item {
  width: 64px;
  height: 64px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0);
}

.victory-star-item:nth-child(1) {
  animation: victoryStarLeftPop 0.52s cubic-bezier(0.34, 1.56, 0.64, 1) 0.16s forwards;
}

.victory-star-item:nth-child(2) {
  width: 78px;
  height: 78px;
  margin-bottom: 10px;
  z-index: 2;
  animation: victoryStarCenterPop 0.54s cubic-bezier(0.34, 1.56, 0.64, 1) 0.32s forwards;
}

.victory-star-item:nth-child(3) {
  animation: victoryStarRightPop 0.52s cubic-bezier(0.34, 1.56, 0.64, 1) 0.48s forwards;
}

.victory-star-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
  pointer-events: none;
}

.victory-star-item.earned img {
  filter:
    drop-shadow(0 5px 8px rgba(60, 22, 4, 0.48))
    drop-shadow(0 0 12px rgba(255, 190, 40, 0.42));
}

.victory-star-item.unearned img {
  opacity: 0.88;
  filter: drop-shadow(0 4px 6px rgba(45, 18, 4, 0.36));
}

@keyframes victoryStarLeftPop {
  0% { opacity: 0; transform: scale(0) rotate(-28deg); }
  70% { opacity: 1; transform: scale(1.14) rotate(-4deg); }
  100% { opacity: 1; transform: scale(1) rotate(-9deg); }
}

@keyframes victoryStarCenterPop {
  0% { opacity: 0; transform: scale(0) rotate(-14deg); }
  70% { opacity: 1; transform: scale(1.16) rotate(3deg); }
  100% { opacity: 1; transform: scale(1) rotate(0deg); }
}

@keyframes victoryStarRightPop {
  0% { opacity: 0; transform: scale(0) rotate(28deg); }
  70% { opacity: 1; transform: scale(1.14) rotate(4deg); }
  100% { opacity: 1; transform: scale(1) rotate(9deg); }
}

.modal-box h2 {
  font-family: 'Fredoka', sans-serif;
  font-size: 23px;
  font-weight: 700;
  color: var(--choco-text);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
}

.modal-sub {
  font-family: 'Nunito', sans-serif;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--choco-muted);
  margin: 6px 0 18px;
}

.modal-score-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.modal-stat-pill {
  background: url('assets/cozy_cookie/ui_score_card.png?v=30') center / 112% 126% no-repeat;
  border: 2px solid #8a4b1c;
  box-shadow:
    inset 0 1.5px 0 rgba(255, 250, 238, 0.78),
    inset 0 -2px 0 rgba(110, 52, 14, 0.32),
    0 2px 0 #6b340e;
  border-radius: 16px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.modal-stat-pill span {
  font-family: 'Nunito', sans-serif;
  font-size: 11.5px;
  font-weight: 800;
  color: var(--choco-muted);
}

.modal-stat-pill strong {
  font-family: 'Fredoka', sans-serif;
  font-size: 26px;
  color: var(--choco-text);
}

.best-pill strong {
  color: var(--glaze-berry);
}

.cta-cookie-btn {
  width: 100%;
  font-family: 'Fredoka', sans-serif;
  font-size: 16px;
  font-weight: 700;
  background: url('assets/cozy_cookie/ui_btn_amber.png?v=30') center / 112% 126% no-repeat;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(100, 34, 0, 0.78);
  border: 2px solid #9c3c04;
  box-shadow:
    inset 0 1.5px 0 rgba(255, 236, 175, 0.72),
    inset 0 -2px 0 rgba(125, 42, 2, 0.42),
    0 2px 0 #7a2b02;
  border-radius: 18px;
  padding: 13px 16px 15px;
  cursor: pointer;
  filter: drop-shadow(0 6px 12px rgba(70, 25, 2, 0.28));
  transition: transform 0.08s ease, filter 0.15s ease;
}

.cta-cookie-btn:hover {
  filter: brightness(1.05) drop-shadow(0 8px 14px rgba(70, 25, 2, 0.34));
  transform: translateY(-1px);
}

.cta-cookie-btn:active {
  transform: translateY(3px);
}

.lvl-map-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: linear-gradient(180deg, #ffa438 0%, var(--glaze-orange) 100%);
  color: #fff;
  border: 1.5px solid #b84a05;
  border-radius: 999px;
  padding: 3px 10px;
  font-family: 'Fredoka', sans-serif;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 0 var(--glaze-orange-lip);
}

.lvl-map-pill:hover {
  filter: brightness(1.06);
}

.modal-btn-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.modal-half-btn {
  flex: 0 0 auto;
  padding: 12px 16px;
  font-size: 14.5px;
}

.modal-half-btn.hidden {
  display: none;
}

/* ============================================================================
   75-Level Wide Winding World Map (iFrame-Safe Drag-to-Scroll Viewport)
   ============================================================================ */
html.map-open,
body.map-open {
  height: 100%;
  width: 100%;
  overflow: hidden;
}

body.map-open .app-shell {
  display: none;
}

.map-overlay {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 120;
  display: flex;
  flex-direction: column;
  padding: 0;
  background: transparent;
  overflow: hidden;
}

.map-overlay.hidden {
  display: none;
}

.map-window {
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-top: 0;
}

.map-header {
  position: relative;
  flex-shrink: 0;
  z-index: 200;
  width: 100%;
  padding: 12px 24px 16px;
  background: url('assets/cozy_cookie/ui_map_header.png?v=32') center / 100% 100% no-repeat;
  border-bottom: none;
  box-shadow: 0 10px 24px rgba(55, 22, 4, 0.38);
}

.map-header-inner {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.map-header h2 {
  font-family: 'Fredoka', sans-serif;
  font-size: 21px;
  font-weight: 700;
  color: var(--choco-text);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.72);
  white-space: nowrap;
}

.map-header p {
  font-family: 'Nunito', sans-serif;
  font-size: 12.5px;
  font-weight: 800;
  color: var(--choco-muted);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.55);
  white-space: nowrap;
}

.map-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
  justify-content: flex-end;
  flex-shrink: 0;
}

.map-stars-total {
  background: url('assets/cozy_cookie/ui_score_card.png?v=32') center / 112% 126% no-repeat;
  border: 2px solid #8a4b1c;
  box-shadow:
    inset 0 1.5px 0 rgba(255, 250, 238, 0.78),
    inset 0 -2px 0 rgba(110, 52, 14, 0.32),
    0 2px 0 #6b340e;
  border-radius: 13px;
  height: 36px;
  padding: 0 13px 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  white-space: nowrap;
  flex-shrink: 0;
  font-family: 'Fredoka', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: #8c4404;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.75);
  filter: drop-shadow(0 3px 6px rgba(55, 22, 4, 0.22));
}

.map-header .game-icon-btn {
  width: 40px;
  min-width: 40px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 13px;
}

@media (max-width: 960px) {
  .map-header p {
    display: none;
  }
}

@media (max-width: 780px) {
  .map-header {
    padding: 10px 14px 12px;
  }

  .map-header-inner > div:first-child {
    display: none;
  }

  .map-header-actions {
    width: 100%;
    justify-content: center;
    gap: 10px;
  }

  .map-stars-total {
    height: 36px;
    padding: 0 13px 1px;
    font-size: 13.5px;
    border-radius: 12px;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .map-header .cookie-btn {
    height: 36px;
    padding: 0 14px;
    font-size: 13.5px;
    border-radius: 12px;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .map-header .game-icon-btn {
    width: 38px;
    min-width: 38px;
    height: 36px;
    border-radius: 12px;
    flex-shrink: 0;
  }
}

@media (max-width: 420px) {
  .map-header {
    padding: 8px 8px 10px;
  }

  .map-header-actions {
    gap: 6px;
    justify-content: space-between;
  }

  .map-stars-total {
    height: 34px;
    padding: 0 9px 1px;
    font-size: 12px;
  }

  .map-header .cookie-btn {
    height: 34px;
    padding: 0 10px;
    font-size: 12px;
  }

  .map-header .game-icon-btn {
    width: 34px;
    min-width: 34px;
    height: 34px;
  }
}

.map-scroll-viewport {
  flex: 1;
  min-height: 0;
  width: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  position: relative;
  cursor: grab;
  touch-action: pan-y;
}

.map-scroll-viewport::-webkit-scrollbar {
  display: none;
}

.map-scroll-viewport.is-dragging,
.map-scroll-viewport.is-dragging .map-node {
  cursor: grabbing !important;
}

.map-world-canvas {
  position: relative;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  height: 15000px;
  background-color: #fff5e2;
  border-left: 4px solid var(--biscuit-border);
  border-right: 4px solid var(--biscuit-border);
  box-shadow: 0 0 55px rgba(35, 14, 3, 0.55);
}

@media (max-width: 1130px) {
  .map-world-canvas {
    border-left: none;
    border-right: none;
  }
}

.map-regions-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 15000px;
  display: flex;
  flex-direction: column;
  z-index: 0;
  pointer-events: none;
}

.map-region-tile {
  position: relative;
  width: 100%;
  height: 1000px;
  flex: 0 0 1000px;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
}

/* Smooth 100%-opaque buttercream gradient fade at every region transition + soft side vignette */
.map-region-tile::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg,
      rgba(255, 245, 226, 1.0) 0px,
      rgba(255, 245, 226, 0.92) 22px,
      rgba(255, 245, 226, 0.45) 75px,
      rgba(255, 245, 226, 0.0) 145px,
      rgba(255, 245, 226, 0.0) 855px,
      rgba(255, 245, 226, 0.45) 925px,
      rgba(255, 245, 226, 0.92) 978px,
      rgba(255, 245, 226, 1.0) 1000px
    ),
    linear-gradient(90deg,
      rgba(80, 38, 10, 0.14) 0%,
      transparent 10%,
      transparent 90%,
      rgba(80, 38, 10, 0.14) 100%
    );
  pointer-events: none;
}

/* Keep the very top sky of Region 15 and very bottom meadow of Region 1 un-faded */
.map-region-tile[data-region="15"]::after {
  background:
    linear-gradient(180deg,
      rgba(255, 245, 226, 0.0) 0px,
      rgba(255, 245, 226, 0.0) 855px,
      rgba(255, 245, 226, 0.45) 925px,
      rgba(255, 245, 226, 0.92) 978px,
      rgba(255, 245, 226, 1.0) 1000px
    );
}

.map-region-tile[data-region="1"]::after {
  background:
    linear-gradient(180deg,
      rgba(255, 245, 226, 1.0) 0px,
      rgba(255, 245, 226, 0.92) 22px,
      rgba(255, 245, 226, 0.45) 75px,
      rgba(255, 245, 226, 0.0) 145px,
      rgba(255, 245, 226, 0.0) 1000px
    );
}

.map-road-svg {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  overflow: visible;
}

/* Crucial: ALL SVG paths on the map must have fill: none so curves never fill black! */
.map-road-svg path {
  fill: none !important;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* 2.5D 3D-Extruded Biscuit Road Layers (from bottom shadow up to glossy top road) */
.map-road-svg .road-shadow {
  stroke: rgba(45, 18, 3, 0.28);
  stroke-width: 66px;
}

.map-road-svg .road-cliff-deep {
  stroke: #6e330d;
  stroke-width: 58px;
}

.map-road-svg .road-cliff-mid {
  stroke: #9e4f19;
  stroke-width: 56px;
}

.map-road-svg .road-outline {
  stroke: #d47a2a;
  stroke-width: 52px;
}

.map-road-svg .road-fill {
  stroke: #fff5df;
  stroke-width: 40px;
}

.map-road-svg .road-unlocked {
  stroke: #ffcf5c;
  stroke-width: 40px;
}

.map-road-svg .road-highlight {
  stroke: rgba(255, 255, 255, 0.72);
  stroke-width: 32px;
}

.map-road-svg .road-dashes {
  stroke: rgba(186, 102, 34, 0.45);
  stroke-width: 5px;
  stroke-dasharray: 10 22;
}

.map-nodes-layer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
}

/* Decorative 2.5D Golden Biscuit Divider Line across each Region Border */
.map-region-divider {
  position: absolute;
  left: 18px;
  right: 18px;
  height: 8px;
  transform: translateY(-50%);
  background: linear-gradient(90deg,
    rgba(201, 126, 61, 0) 0%,
    #b56522 14%,
    #ffcf66 50%,
    #b56522 86%,
    rgba(201, 126, 61, 0) 100%
  );
  border-top: 1.5px solid rgba(255, 255, 255, 0.85);
  border-bottom: 2px solid rgba(94, 44, 10, 0.55);
  border-radius: 999px;
  box-shadow: 0 3px 8px rgba(80, 36, 8, 0.25);
  pointer-events: none;
  z-index: 3;
}

/* 2.5D Wooden Bakery Region Banner Signpost along the Climb */
.map-region-banner {
  position: absolute;
  left: 50%;
  transform: translate(-50%, -50%);
  background: url('assets/cozy_cookie/ui_region_banner.png?v=32') center / 100% 100% no-repeat;
  border: none;
  border-radius: 20px;
  padding: 8px 24px 11px;
  font-family: 'Fredoka', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: #4a230b;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.82);
  filter: drop-shadow(0 8px 14px rgba(55, 22, 4, 0.36));
  white-space: nowrap;
  pointer-events: none;
  z-index: 5;
}

/* 2.5D Isometric Graphic Level Pedestal (1..75) */
.map-node {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 68px;
  height: 64px;
  background: transparent;
  border: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.16s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 4;
}

.map-node:hover {
  transform: translate(-50%, -56%) scale(1.13);
  z-index: 12;
}

.map-node:active {
  transform: translate(-50%, -46%) scale(0.97);
}

/* Real 2.5D Pedestal PNG Image */
.map-node-pedestal {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
}

.map-node.boss-node {
  width: 80px;
  height: 76px;
}

.map-node.locked {
  cursor: not-allowed;
  opacity: 0.56;
}

.map-node.locked:hover,
.map-node.locked:active {
  transform: translate(-50%, -50%);
}

.map-node.current {
  width: 78px;
  height: 74px;
  animation: currentPinBounce 1.15s infinite alternate ease-in-out;
  filter: drop-shadow(0 8px 12px rgba(60, 24, 4, 0.42));
  will-change: transform;
  z-index: 9;
}

@keyframes currentPinBounce {
  from { transform: translate(-50%, -50%) scale(1.0); }
  to { transform: translate(-50%, -58%) scale(1.09); }
}

/* Embossed 3D Level Number sitting on the 2.5D Pedestal top surface */
.map-node-num {
  position: absolute;
  top: 41%;
  left: 50%;
  transform: translate(-50%, -50%) rotateX(18deg);
  font-family: 'Fredoka', sans-serif;
  font-size: 19px;
  letter-spacing: -0.4px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1;
  text-shadow:
    0 2px 0 #592507,
    0 -1px 0 #592507,
    2px 0 0 #592507,
    -2px 0 0 #592507,
    0 3px 5px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}

.map-node.current .map-node-num {
  font-size: 21px;
  color: #fffef5;
  text-shadow:
    0 2px 0 #8a1529,
    0 -1px 0 #8a1529,
    2px 0 0 #8a1529,
    -2px 0 0 #8a1529,
    0 4px 6px rgba(0, 0, 0, 0.5);
}

/* 3-Star Ribbon under COMPLETED levels only (Real Cookie-Star PNGs) */
.map-node-stars {
  position: absolute;
  bottom: -12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: linear-gradient(180deg, #5e2c0e 0%, #3d1b06 100%);
  border: 1.5px solid #f5b041;
  border-radius: 999px;
  padding: 2px 6px;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.42);
  pointer-events: none;
}

.map-node-stars img {
  width: 14px;
  height: 14px;
  object-fit: contain;
  display: block;
}

.inline-star-icon {
  width: 17px;
  height: 17px;
  object-fit: contain;
  vertical-align: -3px;
  margin-right: 2px;
  filter: drop-shadow(0 1px 2px rgba(60, 22, 4, 0.35));
}

.help-modal-box {
  max-width: 440px;
  text-align: left;
}

.help-modal-box h2,
.help-modal-box .modal-sub {
  text-align: center;
}

.help-cards-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}

.help-rule-card {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  background: rgba(255, 255, 255, 0.72);
  border: 2px solid rgba(201, 126, 61, 0.42);
  border-radius: 16px;
  padding: 10px 12px;
}

.help-tile-img,
.help-star-img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  flex: 0 0 34px;
  margin-top: 2px;
  filter: drop-shadow(0 3px 4px rgba(80, 35, 10, 0.25));
}

.help-poly-icon {
  flex: 0 0 34px;
  margin-top: 2px;
}

.help-rule-card strong {
  display: block;
  font-family: 'Fredoka', sans-serif;
  font-size: 14.5px;
  color: var(--choco-text);
  margin-bottom: 2px;
}

.help-rule-card p {
  font-family: 'Nunito', sans-serif;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--choco-muted);
  line-height: 1.38;
}

/* ============================================================================
   AUTHENTIC 2D CASUAL GAME TITLE SCREEN (COOKIE BLOCKS)
   ============================================================================ */
.start-screen-overlay {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 150;
  background-color: #4a240c;
  background-image:
    radial-gradient(circle at 50% 42%, rgba(255, 240, 200, 0.18) 0%, rgba(58, 25, 8, 0.42) 72%, rgba(30, 11, 3, 0.72) 100%),
    url('assets/cozy_cookie/start_bg.jpg?v=21');
  background-size: cover;
  background-position: center center;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow: hidden;
}

.start-screen-overlay::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: radial-gradient(circle at 50% 44%, rgba(55, 24, 6, 0.12) 0%, rgba(38, 15, 4, 0.45) 100%);
  pointer-events: none;
}

.start-screen-overlay.hidden {
  display: none;
}

/* Top-Right Corner Tactile Wooden Settings Gear Button */
.start-corner-settings {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 5;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: url('assets/cozy_cookie/ui_menu_btn.png?v=30') center / 100% 100% no-repeat;
  color: var(--choco-text);
  border: none;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.42));
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.08s ease, filter 0.15s ease;
}

.start-corner-settings:hover {
  filter: brightness(1.06) drop-shadow(0 8px 14px rgba(0, 0, 0, 0.48));
  transform: translateY(-2px);
}

.start-corner-settings:active {
  transform: translateY(2px);
}

.start-hero-wrap {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}

/* Stacked 3D Game Logo Stage + Polyomino Block Showcase */
.logo-stage {
  position: relative;
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 26px;
}

.start-puzzle-showcase {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  pointer-events: none;
}

.start-dock-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

/* Connected Polyomino Block Shapes (3x3 Corner L, 5x1 Bar, 4x1 Bar) */
.poly-piece {
  display: inline-grid;
  gap: 2px;
  filter:
    drop-shadow(0 4px 0 #3a1704)
    drop-shadow(0 8px 14px rgba(0, 0, 0, 0.52));
}

.p-cell {
  width: 27px;
  height: 27px;
  object-fit: contain;
  background: linear-gradient(180deg, #874b1f 0%, #592d0d 100%);
  border: 1.5px solid #e6b373;
  border-radius: 5px;
  padding: 1px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.poly-l-left {
  grid-template-columns: repeat(3, 23px);
  grid-template-rows: repeat(3, 23px);
  transform: rotate(-7deg);
}

.poly-l-left .p-cell {
  width: 23px;
  height: 23px;
}

.poly-bar5-center {
  grid-template-columns: repeat(5, 27px);
  grid-template-rows: repeat(1, 27px);
  transform: rotate(-2.5deg);
}

.poly-bar4-right {
  grid-template-columns: repeat(4, 27px);
  grid-template-rows: repeat(1, 27px);
  transform: rotate(6.5deg);
}

@media (max-width: 400px) {
  .start-dock-row { transform: scale(0.88); }
}

.mini-tray-grid {
  display: grid;
  grid-template-columns: repeat(6, 38px);
  grid-template-rows: repeat(2, 38px);
  gap: 3px;
  padding: 6px;
  background: linear-gradient(180deg, #8c5125 0%, #5c3010 100%);
  border: 3px solid #d99b52;
  border-radius: 13px;
  box-shadow:
    0 6px 0 #381804,
    0 12px 22px rgba(0, 0, 0, 0.52),
    inset 0 2px 4px rgba(30, 10, 0, 0.45);
}

.m-cell {
  width: 38px;
  height: 38px;
  border-radius: 6px;
  background: rgba(54, 24, 6, 0.55);
  border: 1px solid rgba(255, 210, 150, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1px;
}

.m-cell.m-empty {
  background: rgba(115, 62, 22, 0.35);
}

.m-cell img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Glowing T-shaped drop target slot inside the 5x2 row preview */
.m-cell.m-target {
  background: rgba(255, 175, 55, 0.28);
  border: 1.5px dashed #ffd166;
  box-shadow: inset 0 0 8px rgba(255, 195, 70, 0.45);
}

.logo-wordmark {
  position: relative;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 0.88;
  user-select: none;
}

.logo-line-cookie {
  font-family: 'Fredoka', sans-serif;
  font-size: 68px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #fff8e7;
  -webkit-text-stroke: 3px #4a2008;
  paint-order: stroke fill;
  text-shadow:
    0 3px 0 #4a2008,
    0 6px 0 #381604,
    0 9px 0 #290f02,
    0 14px 24px rgba(20, 6, 0, 0.65);
  transform: rotate(-2deg);
}

.logo-line-blocks {
  font-family: 'Fredoka', sans-serif;
  font-size: 62px;
  font-weight: 700;
  letter-spacing: 3px;
  color: #ff9c2a;
  margin-top: -4px;
  -webkit-text-stroke: 3px #4a2008;
  paint-order: stroke fill;
  text-shadow:
    0 3px 0 #7a2e04,
    0 6px 0 #4a2008,
    0 9px 0 #2e1102,
    0 14px 24px rgba(20, 6, 0, 0.68);
  transform: rotate(1.5deg);
}

/* Smooth Wood-Grain Centered Game Plaque Buttons on Start Screen */
.start-play-stack {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.play-plaque-btn {
  width: 100%;
  max-width: 335px;
  border-radius: 24px;
  padding: 15px 22px 18px;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  text-align: center;
  filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.45));
  transition: transform 0.08s ease, filter 0.15s ease;
}

.play-levels-plaque {
  background: url('assets/cozy_cookie/ui_start_btn_levels.png?v=30') center / 100% 100% no-repeat;
  color: #ffffff;
}

.play-endless-plaque {
  background: url('assets/cozy_cookie/ui_start_btn_endless.png?v=30') center / 100% 100% no-repeat;
  color: var(--choco-text);
}

.play-plaque-btn:hover {
  filter: brightness(1.05) drop-shadow(0 12px 24px rgba(0, 0, 0, 0.5));
  transform: translateY(-2px);
}

.play-plaque-btn:active {
  transform: translateY(4px);
}

.play-plaque-main {
  font-family: 'Fredoka', sans-serif;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 1px;
  line-height: 1.05;
}

.play-levels-plaque .play-plaque-main {
  color: #ffffff;
  text-shadow:
    0 2px 0 #7a2c03,
    0 3px 5px rgba(70, 20, 0, 0.55);
}

.play-endless-plaque .play-plaque-main {
  color: #4a220b;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.85);
}

.play-plaque-sub {
  font-family: 'Nunito', sans-serif;
  font-size: 12.5px;
  font-weight: 900;
  letter-spacing: 0.4px;
  padding: 2px 12px;
  border-radius: 999px;
}

.play-levels-plaque .play-plaque-sub {
  background: rgba(82, 28, 3, 0.28);
  color: #fff9eb;
}

.play-endless-plaque .play-plaque-sub {
  background: rgba(135, 72, 24, 0.16);
  color: #6e3a15;
}

/* ============================================================================
   MENÜ & EINSTELLUNGEN MODAL (Wood-Grain Design)
   ============================================================================ */
.menu-modal-box {
  max-width: 400px;
}

.menu-settings-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.menu-setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: rgba(255, 251, 242, 0.62);
  border: 1.5px solid rgba(168, 98, 45, 0.42);
  border-radius: 16px;
  padding: 9px 13px;
}

.menu-setting-label {
  font-family: 'Fredoka', sans-serif;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--choco-text);
}

.lang-switch {
  display: inline-flex;
  background: rgba(140, 88, 54, 0.14);
  border: 1.5px solid rgba(201, 126, 61, 0.45);
  border-radius: 999px;
  padding: 2px;
  gap: 2px;
}

.lang-pill {
  font-family: 'Fredoka', sans-serif;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--choco-muted);
  background: transparent;
  border: none;
  border-radius: 999px;
  padding: 4px 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.lang-pill.active {
  background: linear-gradient(180deg, #ffa438 0%, var(--glaze-orange) 100%);
  color: #ffffff;
  box-shadow: 0 2px 4px rgba(184, 74, 5, 0.3);
}

.menu-val-btn {
  height: 36px;
  padding: 0 14px 2px;
  font-size: 13px;
}

.cookie-select.menu-val-select {
  height: 36px;
  padding: 0 12px 2px;
  font-family: 'Fredoka', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--choco-text);
  background: url('assets/cozy_cookie/ui_btn_wood.png?v=30') center / 112% 126% no-repeat;
  border: 2px solid #8a4b1c;
  box-shadow:
    inset 0 1.5px 0 rgba(255, 250, 238, 0.78),
    inset 0 -2px 0 rgba(110, 52, 14, 0.32),
    0 2px 0 #6b340e;
  border-radius: 13px;
  cursor: pointer;
  outline: none;
  filter: drop-shadow(0 3px 6px rgba(70, 30, 6, 0.16));
}

.cookie-select.menu-val-select option {
  background-color: #fff8ec;
  color: #3e1f0d;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
}

.menu-actions-col {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.menu-full-btn {
  width: 100%;
  height: 42px;
  padding-bottom: 3px;
  font-size: 14px;
}

.menu-home-btn {
  color: #7d3002;
}

.menu-credits-box {
  margin-top: 14px;
  padding: 9px 11px;
  background: rgba(255, 250, 240, 0.52);
  border: 1px solid rgba(168, 98, 45, 0.32);
  border-radius: 12px;
  font-family: 'Nunito', sans-serif;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.42;
  color: var(--choco-muted);
  text-align: center;
}

.menu-credits-box strong {
  color: var(--choco-text);
  font-weight: 800;
}

.menu-credits-box a {
  color: #8a3a08;
  text-decoration: underline;
  font-weight: 800;
}

.menu-credits-box a:hover {
  color: var(--glaze-orange);
}





/* One-time "NEW mechanic" tip cards inside the level intro banner */
.level-intro-tip {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 2px;
}

.level-intro-tip.hidden {
  display: none;
}

.intro-tip-card {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  background: rgba(255, 246, 222, 0.95);
  border: 2px solid rgba(214, 140, 52, 0.75);
  border-radius: 14px;
  padding: 7px 11px 7px 8px;
  box-shadow: 0 3px 8px rgba(65, 25, 5, 0.16);
}

.intro-tip-card img {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  object-fit: contain;
  filter: drop-shadow(0 2px 3px rgba(80, 35, 10, 0.25));
}

.intro-tip-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.intro-tip-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'Fredoka', sans-serif;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--choco-text);
  line-height: 1.15;
}

.intro-tip-badge {
  font-family: 'Nunito', sans-serif;
  font-size: 9.5px;
  font-weight: 900;
  letter-spacing: 0.8px;
  color: #fffaf0;
  background: linear-gradient(180deg, #f59e0b, #c2410c);
  border-radius: 999px;
  padding: 1px 7px 2px;
  box-shadow: 0 1px 2px rgba(80, 30, 5, 0.3);
}

.intro-tip-body {
  font-family: 'Nunito', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: var(--choco-muted);
  line-height: 1.32;
}

/* Help modal now has 5 rule cards: keep it scrollable on small phones */
.help-modal-box {
  max-height: calc(100vh - 28px);
  max-height: calc(100dvh - 28px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
