/* Brick Hunt — scoped under .bh-root. Element rules use :where() (specificity 0,0,1) so Tailwind
   utilities (css/tailwind.css, loaded first) still win. */

/* The page around the game */
html,
body {
  background: #ebe7de;
}

body {
  font-family: 'Arial Black', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

#app {
  min-height: 100vh;
}

.bh-root {
  --bh-cream: #fff7ea;
  --bh-ink: #3b3350;
  --bh-ink-soft: #6f6787;
  --bh-accent: #ff8a5b;
  --bh-accent-dark: #e8693a;
  --bh-sky: #cfe6f3;
  --bh-card: rgba(255, 255, 255, 0.86);
  --st: env(safe-area-inset-top, 0px);
  --sr: env(safe-area-inset-right, 0px);
  --sb: env(safe-area-inset-bottom, 0px);
  --sl: env(safe-area-inset-left, 0px);
  position: fixed;
  inset: 0;
  overflow: hidden;
  color: var(--bh-ink);
  background: radial-gradient(circle at 20% 10%, #fffaf0 0%, transparent 45%),
    radial-gradient(circle at 85% 90%, #ffe3cf 0%, transparent 40%), linear-gradient(160deg, #fdf3e3 0%, #e7f0f8 100%);
  font-family: ui-rounded, 'SF Pro Rounded', 'Nunito', 'Segoe UI', system-ui, -apple-system, sans-serif;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

:where(.bh-root) button {
  font: inherit;
  padding: 0;
  border-radius: 0;
  border: none;
  font-weight: inherit;
  font-size: inherit;
  cursor: pointer;
  background: none;
  color: inherit;
}

:where(.bh-root) h1,
:where(.bh-root) h2,
:where(.bh-root) h3 {
  margin: 0;
  color: inherit;
  text-shadow: none;
  font-size: inherit;
}

.bh-root button:focus-visible {
  outline: 3px solid #7cb7ff;
  outline-offset: 2px;
}

.bh-canvas {
  position: absolute !important;
  inset: 0;
  touch-action: none;
}

/* Kept from kokotgames, where another game's global `.grid { display: flex }` clobbered Tailwind's
   `.grid`: the screens use this class instead. */
.bh-grid {
  display: grid;
}

.bh-scroll {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  user-select: none;
}

.bh-safe {
  padding-top: max(12px, var(--st));
  padding-right: max(12px, var(--sr));
  padding-bottom: max(12px, var(--sb));
  padding-left: max(12px, var(--sl));
}

.bh-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 48px;
  padding: 0 1.4rem;
  border-radius: 999px;
  font-weight: 800;
  letter-spacing: 0.01em;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.bh-btn:active {
  transform: translateY(2px) scale(0.98);
}
.bh-btn-primary {
  color: #fff;
  background: linear-gradient(180deg, #ffa07a, var(--bh-accent));
  box-shadow: 0 5px 0 var(--bh-accent-dark), 0 12px 24px rgba(232, 105, 58, 0.25);
}
.bh-btn-primary:active {
  box-shadow: 0 2px 0 var(--bh-accent-dark), 0 6px 14px rgba(232, 105, 58, 0.2);
}
.bh-btn-soft {
  background: #fff;
  color: var(--bh-ink);
  box-shadow: 0 4px 0 #e5dccd, 0 10px 20px rgba(80, 60, 30, 0.08);
}
.bh-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: var(--bh-card);
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.06), 0 8px 18px rgba(60, 50, 90, 0.12);
  backdrop-filter: blur(8px);
  font-size: 20px;
  transition: transform 0.12s ease;
}
.bh-icon-btn:active {
  transform: scale(0.94);
}
.bh-icon-btn:disabled {
  cursor: default;
  opacity: 0.42;
  transform: none;
}

.bh-card {
  background: var(--bh-card);
  border-radius: 24px;
  box-shadow: 0 10px 30px rgba(60, 50, 90, 0.12);
  backdrop-filter: blur(10px);
}

.bh-fade {
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.bh-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
}

@keyframes bh-pop {
  0% { transform: scale(0.4); opacity: 0; }
  60% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); }
}
@keyframes bh-bump {
  0% { transform: scale(1); }
  35% { transform: scale(1.14); }
  100% { transform: scale(1); }
}
@keyframes bh-float {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-8px) rotate(2deg); }
}
@keyframes bh-toast {
  0% { transform: translateY(-16px); opacity: 0; }
  12%, 85% { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(-8px); opacity: 0; }
}
@keyframes bh-confetti {
  0% { transform: translate3d(0, -10vh, 0) rotate(0deg); opacity: 1; }
  100% { transform: translate3d(var(--dx), 105vh, 0) rotate(var(--rot)); opacity: 0.9; }
}
@keyframes bh-pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(255, 196, 90, 0.7); }
  100% { box-shadow: 0 0 0 14px rgba(255, 196, 90, 0); }
}
.bh-pop { animation: bh-pop 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.3) both; }
.bh-bump { animation: bh-bump 0.35s ease-out; }
.bh-float { animation: bh-float 4s ease-in-out infinite; }
.bh-toast { animation: bh-toast 2.6s ease both; }
.bh-pulse { animation: bh-pulse-ring 1.4s ease-out infinite; }
.bh-confetti-piece {
  position: absolute;
  top: 0;
  width: 10px;
  height: 14px;
  border-radius: 3px;
  animation: bh-confetti linear forwards;
}

@media (prefers-reduced-motion: reduce) {
  .bh-float, .bh-pulse { animation: none; }
}
.bh-reduced .bh-float, .bh-reduced .bh-pulse { animation: none; }
.bh-reduced .bh-confetti-piece { display: none; }

/* ── Tutorial illustrations (js/components/Onboarding.js) ───────────────────────────────────────── */
.bh-tut-stage { position: relative; width: 240px; height: 132px; margin: 0 auto; }
.bh-tut-brick {
  position: absolute; border-radius: 6px; background: var(--c);
  box-shadow: inset 0 -5px 0 rgba(0, 0, 0, 0.16);
}
.bh-tut-brick::before, .bh-tut-brick::after {
  content: ''; position: absolute; top: -6px; width: 30%; height: 7px; border-radius: 3px 3px 0 0;
  background: var(--c); filter: brightness(1.08);
}
.bh-tut-brick::before { left: 12%; }
.bh-tut-brick::after { right: 12%; }
.bh-tut-table {
  position: absolute; border-radius: 14px; background: #e5c9a0;
  box-shadow: inset 0 0 0 5px #c89d6c, 0 10px 18px rgba(120, 80, 40, 0.18);
}
.bh-tut-card { position: absolute; border-radius: 14px; background: #fff; box-shadow: 0 6px 14px rgba(59, 51, 80, 0.12); }
.bh-tut-finger { position: absolute; font-size: 30px; line-height: 1; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.2)); }
.bh-tut-ring {
  position: absolute; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 999px;
  border: 3px solid #ff8a5b; opacity: 0;
}
.bh-tut-chip {
  position: absolute; display: flex; align-items: center; justify-content: center; border-radius: 999px;
  background: #fff; font-size: 20px; box-shadow: 0 4px 10px rgba(59, 51, 80, 0.15);
}

@keyframes bh-tut-tap { 0%, 30% { transform: translate(0, 18px); } 45% { transform: translate(0, 0) scale(0.9); } 60%, 100% { transform: translate(0, 4px); } }
@keyframes bh-tut-ring { 0%, 40% { opacity: 0; transform: scale(0.4); } 50% { opacity: 1; } 80%, 100% { opacity: 0; transform: scale(1.5); } }
@keyframes bh-tut-collect { 0%, 50% { transform: translate(0, 0) scale(1); opacity: 1; } 75% { transform: translate(-70px, -26px) scale(0.5); opacity: 0.2; } 76%, 100% { transform: translate(0, 0) scale(1); opacity: 1; } }
@keyframes bh-tut-spin3d { 0% { transform: perspective(300px) rotateX(18deg) rotateY(0); } 100% { transform: perspective(300px) rotateX(18deg) rotateY(360deg); } }
@keyframes bh-tut-swipe { 0%, 20% { transform: translateY(26px); opacity: 0; } 35% { opacity: 1; } 75% { transform: translateY(-22px); opacity: 1; } 90%, 100% { transform: translateY(-22px); opacity: 0; } }
@keyframes bh-tut-slide { 0%, 15% { transform: translateX(0); } 50%, 65% { transform: translateX(86px); } 100% { transform: translateX(0); } }
@keyframes bh-tut-turn { 0%, 30% { transform: rotate(0); } 50%, 80% { transform: rotate(90deg); } 100% { transform: rotate(0); } }
@keyframes bh-tut-orbit { 0%, 100% { transform: perspective(380px) rotateX(52deg) rotateZ(-28deg); } 50% { transform: perspective(380px) rotateX(38deg) rotateZ(32deg); } }
@keyframes bh-tut-arc { 0%, 100% { transform: translate(-46px, 6px); } 50% { transform: translate(46px, -6px); } }
@keyframes bh-tut-zoom { 0%, 15% { transform: perspective(380px) rotateX(45deg) scale(0.8); } 55%, 75% { transform: perspective(380px) rotateX(45deg) scale(1.45); } 100% { transform: perspective(380px) rotateX(45deg) scale(0.8); } }
@keyframes bh-tut-pinch-l { 0%, 15% { transform: translate(-12px, 6px) rotate(-20deg); } 55%, 75% { transform: translate(-52px, 26px) rotate(-20deg); } 100% { transform: translate(-12px, 6px) rotate(-20deg); } }
@keyframes bh-tut-pinch-r { 0%, 15% { transform: translate(12px, -6px) rotate(160deg); } 55%, 75% { transform: translate(52px, -26px) rotate(160deg); } 100% { transform: translate(12px, -6px) rotate(160deg); } }
@keyframes bh-tut-glow { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 201, 60, 0); } 50% { box-shadow: 0 0 0 10px rgba(255, 201, 60, 0.55); } }
@keyframes bh-tut-shuffle { 0%, 40% { transform: rotate(0); } 60%, 100% { transform: rotate(360deg); } }
@keyframes bh-tut-drop { 0% { transform: translateY(-46px); opacity: 0; } 18% { transform: translateY(0); opacity: 1; } 85% { transform: translateY(0); opacity: 1; } 100% { transform: translateY(0); opacity: 0; } }
@keyframes bh-tut-appear { 0%, 10% { opacity: 0; transform: translateY(10px) scale(0.9); } 25%, 85% { opacity: 1; transform: none; } 100% { opacity: 0; } }

.bh-tut-anim-tap { animation: bh-tut-tap 2.2s ease-in-out infinite; }
.bh-tut-anim-ring { animation: bh-tut-ring 2.2s ease-out infinite; }
.bh-tut-anim-collect { animation: bh-tut-collect 2.2s ease-in-out infinite; }
.bh-tut-anim-spin3d { animation: bh-tut-spin3d 4s linear infinite; }
.bh-tut-anim-swipe { animation: bh-tut-swipe 2.4s ease-in-out infinite; }
.bh-tut-anim-slide { animation: bh-tut-slide 3s ease-in-out infinite; }
.bh-tut-anim-turn { animation: bh-tut-turn 3s ease-in-out infinite; }
.bh-tut-anim-orbit { animation: bh-tut-orbit 4s ease-in-out infinite; }
.bh-tut-anim-arc { animation: bh-tut-arc 4s ease-in-out infinite; }
.bh-tut-anim-zoom { animation: bh-tut-zoom 3.2s ease-in-out infinite; }
.bh-tut-anim-pinch-l { animation: bh-tut-pinch-l 3.2s ease-in-out infinite; }
.bh-tut-anim-pinch-r { animation: bh-tut-pinch-r 3.2s ease-in-out infinite; }
.bh-tut-anim-glow { animation: bh-tut-glow 1.6s ease-in-out infinite; }
.bh-tut-anim-shuffle { animation: bh-tut-shuffle 2.4s ease-in-out infinite; }
.bh-tut-anim-drop { animation: bh-tut-drop 3.2s ease-out infinite both; }
.bh-tut-anim-appear { animation: bh-tut-appear 3.6s ease-out infinite both; }
.bh-reduced [class*='bh-tut-anim-'] { animation: none; }
@media (prefers-reduced-motion: reduce) { [class*='bh-tut-anim-'] { animation: none; } }
