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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  touch-action: manipulation;
  overscroll-behavior: none;
  -webkit-overflow-scrolling: none;
  background: #18112a;
  font-family: 'Nunito', 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: #f8f0ff;
}

#game-canvas {
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  cursor: crosshair;
  touch-action: none;
}

#start-hint {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 16px 30px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255, 150, 210, 0.85), rgba(180, 150, 255, 0.85));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.45);
  color: #fff;
  font-size: 22px;
  font-weight: 800;
  text-shadow: 0 2px 8px rgba(120, 40, 120, 0.4);
  letter-spacing: 0.3px;
  text-align: center;
  pointer-events: none;
  z-index: 50;
  box-shadow: 0 8px 30px rgba(180, 100, 220, 0.45);
  animation: start-hint-pulse 1.8s ease-in-out infinite;
  transition: opacity 0.3s ease, transform 0.3s ease;
  white-space: nowrap;
}

#start-hint.fade-out {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.9);
}

@keyframes start-hint-pulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) scale(1.05); }
}

@media (max-width: 480px) {
  #start-hint { font-size: 17px; padding: 13px 22px; }
}

#ui-root {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
}

#ui-root > * {
  pointer-events: auto;
}

/* Top bar */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  background: linear-gradient(180deg, #4a2a78 0%, #3a1f60 100%);
  border-bottom: 2px solid rgba(255, 210, 245, 0.15);
  height: 48px;
  box-shadow: 0 2px 10px rgba(90, 40, 140, 0.35);
}

.level-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 1;
  min-width: 0;
}

.level-badge {
  font-size: 13px;
  font-weight: 800;
  color: #ffd466;
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
  white-space: nowrap;
  flex-shrink: 0;
  padding: 2px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255, 200, 80, 0.2), rgba(255, 150, 100, 0.2));
  border: 1px solid rgba(255, 220, 130, 0.3);
}

.level-bar {
  width: 90px;
  height: 8px;
  background: rgba(255,255,255,0.15);
  border-radius: 999px;
  overflow: hidden;
  flex-shrink: 1;
  min-width: 40px;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.3);
}

.level-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #ffb764, #ff88c8, #b898ff);
  border-radius: 999px;
  transition: width 0.3s ease;
  box-shadow: 0 0 8px rgba(255, 150, 200, 0.6);
}

.top-controls {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-shrink: 0;
}

.btn-icon {
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 12px;
  background: rgba(255, 230, 250, 0.12);
  color: #ffe8f8;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s, transform 0.1s;
}

.btn-icon:hover {
  background: rgba(255, 230, 250, 0.22);
  color: #fff;
  transform: translateY(-1px);
}

.btn-icon:active {
  transform: translateY(0);
  background: rgba(255, 160, 220, 0.35);
}

.btn-icon.active {
  background: linear-gradient(135deg, rgba(140, 200, 255, 0.4), rgba(180, 140, 255, 0.4));
  color: #a8e0ff;
  box-shadow: 0 0 10px rgba(140, 200, 255, 0.35);
}

.btn-icon.muted {
  color: #886c9a;
  opacity: 0.7;
}

.btn-icon.muted .sound-waves {
  display: none;
}

/* Bottom panel */
.bottom-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: linear-gradient(0deg, #3a1f60 0%, #4a2a78 100%);
  border-top: 2px solid rgba(255, 210, 245, 0.15);
  padding: 6px 8px;
  padding-bottom: max(6px, env(safe-area-inset-bottom));
  box-shadow: 0 -2px 10px rgba(90, 40, 140, 0.35);
}

.scrollable-container {
  overscroll-behavior: contain;
}

.scrollable-container.scroll-x {
  touch-action: pan-x;
}

/* Categories */
.categories {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 6px;
}

.categories::-webkit-scrollbar { display: none; }

/* Fade affordances: shown only when the row actually has hidden content */
.categories.can-scroll-right,
.materials.can-scroll-right {
  mask-image: linear-gradient(to right, black 0, black calc(100% - 40px), transparent 100%);
  -webkit-mask-image: linear-gradient(to right, black 0, black calc(100% - 40px), transparent 100%);
}
.categories.can-scroll-left,
.materials.can-scroll-left {
  mask-image: linear-gradient(to right, transparent 0, black 40px, black 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0, black 40px, black 100%);
}
.categories.can-scroll-left.can-scroll-right,
.materials.can-scroll-left.can-scroll-right {
  mask-image: linear-gradient(to right, transparent 0, black 40px, black calc(100% - 40px), transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0, black 40px, black calc(100% - 40px), transparent 100%);
}

.cat-btn {
  flex-shrink: 0;
  padding: 6px 14px;
  border: none;
  border-radius: 999px;
  background: rgba(255, 220, 245, 0.1);
  color: #d8c5ea;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.cat-btn:hover {
  background: rgba(255, 220, 245, 0.2);
  color: #fff;
}

.cat-btn.active {
  background: linear-gradient(135deg, #ff88c8, #b898ff);
  color: #fff;
  box-shadow: 0 3px 12px rgba(255, 136, 200, 0.45);
}

/* Materials */
.materials {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 6px;
}

.materials::-webkit-scrollbar { display: none; }

.mat-btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border: 2px solid transparent;
  border-radius: 12px;
  background: rgba(255, 230, 250, 0.08);
  color: #e8d8f0;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.mat-btn:hover {
  background: rgba(255, 230, 250, 0.18);
  border-color: rgba(255, 230, 250, 0.15);
  transform: translateY(-1px);
}

.mat-btn.active {
  background: rgba(255, 255, 255, 0.18);
  border-color: #ffb464;
  color: #fff;
  box-shadow: 0 3px 12px rgba(255, 180, 100, 0.4);
}

.mat-swatch {
  width: 16px;
  height: 16px;
  border-radius: 6px;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}

.mat-name {
  font-weight: 700;
}

/* Brush controls */
.brush-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.brush-label {
  font-size: 11px;
  color: #c8b0dc;
  font-weight: 700;
  margin-right: 2px;
}

.shape-group {
  display: flex;
  gap: 2px;
  padding: 2px;
  background: rgba(255, 230, 250, 0.06);
  border-radius: 10px;
  margin-right: 4px;
}

.shape-btn {
  width: 28px;
  height: 26px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #c8b0dc;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.shape-btn:hover {
  background: rgba(255, 230, 250, 0.12);
  color: #fff;
}

.shape-btn.active {
  background: linear-gradient(135deg, #ffb464, #ff88c8);
  color: #fff;
  box-shadow: 0 2px 6px rgba(255, 150, 130, 0.45);
}

.brush-sizes {
  display: flex;
  gap: 3px;
}

.brush-btn {
  width: 34px;
  height: 30px;
  border: none;
  border-radius: 10px;
  background: rgba(255, 230, 250, 0.1);
  color: #d0bce0;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s;
}

.brush-btn:hover {
  background: rgba(255, 230, 250, 0.2);
  color: #fff;
}

.brush-btn.active {
  background: linear-gradient(135deg, #ffb464, #ff88c8);
  color: #fff;
  box-shadow: 0 2px 8px rgba(255, 150, 130, 0.45);
}

.eraser-btn {
  width: 38px;
  height: 30px;
  border: none;
  border-radius: 10px;
  background: rgba(255, 230, 250, 0.1);
  color: #d0bce0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  margin-left: 4px;
}

.eraser-btn:hover {
  background: rgba(255, 230, 250, 0.2);
  color: #fff;
}

.eraser-btn.active {
  background: linear-gradient(135deg, #ff88c8, #b898ff);
  color: #fff;
}

/* Small buttons */
.btn-sm {
  width: 32px;
  height: 32px;
  border-radius: 10px;
}

.control-divider {
  width: 1px;
  height: 24px;
  background: rgba(255, 230, 250, 0.18);
  margin: 0 2px;
  flex-shrink: 0;
}

/* Save panel */
.save-card {
  max-width: 380px;
  width: 90%;
}

.save-slots {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.save-slot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(255, 230, 250, 0.07);
  border-radius: 14px;
  border: 1px solid rgba(255, 230, 250, 0.08);
}

.save-slot-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.save-slot-num {
  font-size: 13px;
  font-weight: 800;
  color: #f0e0ff;
}

.save-slot-date {
  font-size: 11px;
  color: #a896c0;
}

.save-slot-actions {
  display: flex;
  gap: 6px;
}

.save-slot-btn {
  padding: 6px 13px;
  border: none;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}

.save-slot-btn.save-action {
  background: linear-gradient(135deg, rgba(140, 200, 255, 0.28), rgba(180, 140, 255, 0.28));
  color: #b0dcff;
}

.save-slot-btn.save-action:hover {
  background: linear-gradient(135deg, rgba(140, 200, 255, 0.45), rgba(180, 140, 255, 0.45));
}

.save-slot-btn.load-action {
  background: linear-gradient(135deg, rgba(150, 255, 200, 0.22), rgba(200, 255, 150, 0.22));
  color: #a8ffc8;
}

.save-slot-btn.load-action:hover {
  background: linear-gradient(135deg, rgba(150, 255, 200, 0.35), rgba(200, 255, 150, 0.35));
}

.save-slot-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

/* Locked material */
.mat-btn.locked {
  opacity: 0.75;
  position: relative;
}

.mat-btn.locked .mat-swatch {
  filter: grayscale(0.7) brightness(0.85);
}

.mat-ad-badge {
  position: absolute;
  top: -7px;
  right: -7px;
  width: 27px;
  height: 27px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #ffd466, #ff9064);
  border: 2px solid rgba(255, 255, 255, 0.92);
  border-radius: 50%;
  color: #fff;
  box-shadow: 0 2px 8px rgba(255, 140, 80, 0.75);
  pointer-events: none;
}

.mat-ad-badge svg {
  margin-left: 0;
}

/* Prominent "watch video" icon on every rewardedBreak() button (Poki req.) */
.video-icon {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
  filter: drop-shadow(0 1px 1.5px rgba(0, 0, 0, 0.28));
}

.unlock-popup-watch .video-icon,
.mat-ad-badge .video-icon,
.slot-unlock-btn .video-icon {
  animation: video-pulse 1.7s ease-in-out infinite;
  transform-origin: center;
}

@keyframes video-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.13); }
}

@media (prefers-reduced-motion: reduce) {
  .unlock-popup-watch .video-icon,
  .mat-ad-badge .video-icon,
  .slot-unlock-btn .video-icon { animation: none; }
}

.save-slot-locked {
  opacity: 0.7;
}

.save-slot-locked .save-slot-date {
  color: #ffd466;
}

.slot-unlock-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: linear-gradient(135deg, rgba(255, 200, 80, 0.3), rgba(255, 140, 100, 0.3));
  color: #ffd466;
}

/* White clapper on the gold button → high contrast, matching the prominence of
   the other rewarded triggers (Poki req. #2). currentColor drives the SVG fill. */
.slot-unlock-btn .video-icon {
  color: #fff;
  filter: drop-shadow(0 1px 2px rgba(120, 60, 0, 0.5));
}

.slot-unlock-btn:hover {
  background: linear-gradient(135deg, rgba(255, 200, 80, 0.45), rgba(255, 140, 100, 0.45));
}

/* Popups */
.unlock-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  opacity: 0;
  transition: opacity 0.2s;
}

.unlock-popup.visible {
  opacity: 1;
}

.unlock-popup-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(30, 15, 50, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.unlock-popup-card {
  position: relative;
  background: linear-gradient(160deg, #4a2a78 0%, #2e1652 100%);
  border: 2px solid rgba(255, 220, 255, 0.18);
  border-radius: 22px;
  padding: 28px 32px;
  max-width: 340px;
  width: 88%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  box-shadow: 0 20px 60px rgba(30, 10, 60, 0.65), 0 0 60px rgba(255, 150, 220, 0.1);
}

.unlock-popup-swatch {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.5), 0 0 20px rgba(255, 255, 255, 0.15);
}

.unlock-popup-title {
  font-size: 22px;
  font-weight: 900;
  color: #fff;
  text-align: center;
  text-shadow: 0 2px 6px rgba(120, 40, 120, 0.3);
}

.unlock-popup-desc {
  font-size: 13px;
  color: #d8c5ea;
  text-align: center;
  line-height: 1.5;
}

.unlock-popup-buttons {
  display: flex;
  gap: 10px;
  margin-top: 8px;
  width: 100%;
}

.unlock-popup-btn {
  flex: 1;
  padding: 11px 18px;
  border: none;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s;
  font-family: inherit;
}

.unlock-popup-watch {
  background: linear-gradient(135deg, #ffb464, #ff88c8);
  color: #fff;
  box-shadow: 0 4px 14px rgba(255, 150, 150, 0.45);
}

.unlock-popup-watch:hover {
  background: linear-gradient(135deg, #ffc888, #ffa0d4);
  transform: translateY(-1px);
}

.unlock-popup-watch:disabled {
  opacity: 0.6;
  cursor: default;
  transform: none;
}

.unlock-popup-cancel {
  background: rgba(255, 230, 250, 0.1);
  color: #d8c5ea;
}

.unlock-popup-cancel:hover {
  background: rgba(255, 230, 250, 0.2);
  color: #fff;
}

/* Mobile */
@media (max-width: 480px) {
  .top-bar {
    padding: 4px 8px;
    height: 42px;
  }
  .level-badge { font-size: 11px; padding: 2px 8px; }
  .level-bar { width: 60px; }
  .top-controls { gap: 3px; }
  .btn-icon { width: 32px; height: 32px; border-radius: 10px; }
  .btn-sm { width: 28px; height: 28px; border-radius: 9px; }
  .cat-btn { padding: 5px 11px; font-size: 11px; }
  .mat-btn { padding: 5px 9px; font-size: 11px; border-radius: 10px; }
  .mat-swatch { width: 14px; height: 14px; border-radius: 5px; }
  .brush-btn { width: 30px; height: 28px; font-size: 11px; border-radius: 9px; }
  .unlock-popup-card { padding: 22px 22px; border-radius: 18px; }
  .unlock-popup-swatch { width: 48px; height: 48px; }
  .unlock-popup-title { font-size: 18px; }
  .unlock-popup-desc { font-size: 12px; }
  .unlock-popup-btn { padding: 10px 12px; font-size: 13px; }
}

/* Quest panel */
.quest-card {
  max-width: 400px;
  width: 92%;
}

.quest-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 9px;
  max-height: 60vh;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.quest-list::-webkit-scrollbar { display: none; }

.quest-item {
  display: flex;
  gap: 11px;
  padding: 11px 13px;
  background: rgba(255, 230, 250, 0.07);
  border-radius: 14px;
  align-items: flex-start;
  border: 1px solid rgba(255, 230, 250, 0.07);
}

.quest-swatch {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  flex-shrink: 0;
  margin-top: 2px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.quest-info {
  flex: 1;
  min-width: 0;
}

.quest-name {
  font-size: 13px;
  font-weight: 800;
  color: #f8f0ff;
  display: flex;
  align-items: center;
  gap: 6px;
}

.quest-xp {
  font-size: 11px;
  font-weight: 800;
  color: #ffd466;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.quest-desc {
  font-size: 11px;
  color: #b8a4cc;
  margin-top: 3px;
  line-height: 1.4;
}

.quest-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 230, 250, 0.1);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 6px;
}

.quest-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #ffb464, #ff88c8, #b898ff);
  border-radius: 999px;
  transition: width 0.3s ease;
  box-shadow: 0 0 8px rgba(255, 150, 200, 0.55);
}

.quest-count {
  font-size: 10px;
  color: #a896c0;
  margin-top: 2px;
  text-align: right;
  font-weight: 700;
}

.quest-empty {
  text-align: center;
  padding: 20px;
  color: #b8a4cc;
  font-size: 14px;
}

/* Daily quest block */
.daily-quest-section {
  border: 1.5px solid rgba(255, 212, 102, 0.35);
  border-radius: 14px;
  padding: 8px;
  margin-bottom: 2px;
  background: linear-gradient(135deg, rgba(255, 212, 102, 0.08), rgba(255, 140, 200, 0.08));
}

.daily-quest-label {
  font-size: 11px;
  font-weight: 800;
  color: #ffd466;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.daily-item {
  background: rgba(255, 212, 102, 0.08) !important;
  border: 1px solid rgba(255, 212, 102, 0.2) !important;
}

.quest-toast {
  position: fixed;
  top: 58px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 20px;
  background: linear-gradient(135deg, #4a2a78 0%, #2e1652 100%);
  border: 2px solid rgba(150, 255, 190, 0.4);
  border-radius: 999px;
  box-shadow: 0 10px 30px rgba(30, 10, 60, 0.55), 0 0 20px rgba(150, 255, 190, 0.25);
  z-index: 200;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}

.quest-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.quest-toast-icon {
  flex-shrink: 0;
}

.quest-toast-title {
  font-size: 13px;
  font-weight: 800;
  color: #fff;
}

.quest-toast-xp {
  font-size: 12px;
  font-weight: 800;
  color: #96ffbe;
}

/* Recipe book */
.recipe-card {
  max-width: 420px;
  width: 92%;
}

.recipe-counter {
  font-size: 13px;
  font-weight: 700;
  color: #ffd466;
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
  margin-top: -4px;
}

.recipe-bar {
  width: 100%;
  height: 8px;
  background: rgba(255, 230, 250, 0.1);
  border-radius: 999px;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.3);
}

.recipe-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #ffb464, #ff88c8, #b898ff);
  border-radius: 999px;
  transition: width 0.4s ease;
  box-shadow: 0 0 10px rgba(255, 150, 200, 0.6);
}

.recipe-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-height: 55vh;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.recipe-list::-webkit-scrollbar { display: none; }

.recipe-item {
  display: flex;
  gap: 11px;
  padding: 9px 12px;
  background: rgba(255, 230, 250, 0.07);
  border-radius: 12px;
  align-items: center;
  border: 1px solid rgba(255, 230, 250, 0.08);
}

.recipe-item.recipe-locked {
  opacity: 0.55;
}

.recipe-swatch {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.recipe-info {
  flex: 1;
  min-width: 0;
}

.recipe-name {
  font-size: 13px;
  font-weight: 800;
  color: #f8f0ff;
  display: flex;
  align-items: center;
  gap: 6px;
}

.recipe-xp {
  font-size: 10px;
  font-weight: 800;
  color: #ffd466;
}

.recipe-desc {
  font-size: 11px;
  color: #b8a4cc;
  margin-top: 2px;
}

.recipe-check {
  flex-shrink: 0;
}

/* Recipe discovery toast */
.recipe-toast {
  position: fixed;
  top: 58px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 20px;
  background: linear-gradient(135deg, #4a2a78 0%, #2e1652 100%);
  border: 2px solid rgba(255, 212, 102, 0.5);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(30, 10, 60, 0.6), 0 0 25px rgba(255, 200, 100, 0.35);
  z-index: 200;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
  max-width: 85vw;
}

.recipe-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.recipe-toast-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.recipe-toast-label {
  font-size: 10px;
  font-weight: 800;
  color: #ffd466;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.recipe-toast-title {
  font-size: 14px;
  font-weight: 800;
  color: #fff;
  margin-top: 2px;
}

.recipe-toast-xp {
  font-size: 12px;
  font-weight: 800;
  color: #96ffbe;
  margin-top: 1px;
}

/* Very narrow */
@media (max-width: 360px) {
  .level-bar { width: 40px; }
  .top-controls { gap: 2px; }
  .btn-sm { width: 26px; height: 26px; }
  .control-divider { display: none; }
}

/* Landscape short */
@media (max-height: 440px) {
  .top-bar { padding: 2px 8px; height: 34px; }
  .level-badge { font-size: 10px; padding: 1px 6px; }
  .level-bar { width: 50px; height: 5px; }
  .top-controls { gap: 3px; }
  .btn-icon { width: 28px; height: 28px; }
  .btn-sm { width: 24px; height: 24px; }
  .control-divider { height: 18px; }
  .bottom-panel { padding: 3px 6px; padding-bottom: max(3px, env(safe-area-inset-bottom)); }
  .categories { padding-bottom: 3px; gap: 3px; }
  .cat-btn { padding: 3px 9px; font-size: 10px; }
  .materials { padding-bottom: 3px; }
  .mat-btn { padding: 3px 7px; font-size: 10px; }
  .mat-swatch { width: 12px; height: 12px; }
  .brush-controls { gap: 4px; }
  .brush-btn { width: 26px; height: 24px; font-size: 10px; }
  .eraser-btn { width: 30px; height: 24px; }
}
