/* Where is Buds Bear? */
:root {
  --hunt-navy: #214f69;
  --hunt-blue: #2c9fd3;
  --hunt-blue-dark: #14749f;
  --hunt-sky: #e9f8ff;
  --hunt-coral: #ff6f61;
  --hunt-ink: #17394c;
  --hunt-shadow: 0 12px 34px rgba(27, 78, 103, .15);
}

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 8% 8%, rgba(255, 216, 61, .25), transparent 24rem),
    radial-gradient(circle at 92% 12%, rgba(142, 216, 248, .38), transparent 27rem),
    linear-gradient(180deg, #f7fcff, #edf9f0);
  color: var(--hunt-ink);
}

button:focus-visible {
  outline: 4px solid var(--eb-yellow);
  outline-offset: 3px;
}

.bear-game {
  width: min(100% - 28px, 1280px);
  margin: 0 auto;
  padding: 14px 0 26px;
}

.game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  margin-bottom: 14px;
  padding: 10px 16px;
  border: 1px solid #d7eaf2;
  border-radius: 20px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 5px 18px rgba(31, 92, 118, .08);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.game-logo { width: min(182px, 31vw); }
.title-divider { width: 1px; height: 35px; background: #d9e5e8; }
.brand-lockup h1 { margin: 0; color: var(--hunt-navy); font-size: clamp(1.25rem, 2.5vw, 2rem); line-height: 1.1; }

.header-action,
.game-button {
  min-height: 48px;
  border: 0;
  border-radius: 14px;
  font-weight: 900;
  cursor: pointer;
  transition: transform .14s ease, box-shadow .14s ease, background .14s ease;
}

.header-action {
  padding: 9px 18px;
  border: 2px solid #b9d8e6;
  background: #fff;
  color: var(--hunt-navy);
}

.header-action:hover,
.game-button:hover { transform: translateY(-2px); }
.header-action:active,
.game-button:active { transform: translateY(0); }

.place-screen {
  padding: clamp(16px, 3vw, 34px);
  border: 1px solid #d8e9e5;
  border-radius: 30px;
  background: rgba(255, 255, 255, .95);
  box-shadow: var(--hunt-shadow);
}

.welcome-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  width: min(100%, 1050px);
  margin: 0 auto 24px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--eb-green-dark);
  font-size: .86rem;
  font-weight: 900;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.welcome-copy h2 {
  margin: 0;
  color: var(--hunt-navy);
  font-size: clamp(2rem, 5vw, 3.7rem);
  line-height: 1.05;
}

.welcome-copy p:last-child {
  max-width: 640px;
  margin: 12px 0 0;
  color: #56717e;
  font-size: clamp(1rem, 2vw, 1.2rem);
}

.welcome-bear {
  width: clamp(116px, 15vw, 180px);
  filter: drop-shadow(0 10px 12px rgba(45, 87, 64, .14));
  transform: rotate(3deg);
}

.place-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.place-card {
  position: relative;
  min-height: 250px;
  padding: 0;
  overflow: hidden;
  border: 3px solid #fff;
  border-radius: 22px;
  background: #cce8f0;
  box-shadow: 0 6px 18px rgba(30, 76, 99, .15);
  color: #fff;
  cursor: pointer;
  isolation: isolate;
  transition: transform .17s ease, box-shadow .17s ease;
}

.place-card::after {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  background: linear-gradient(180deg, transparent 36%, rgba(11, 43, 58, .18) 58%, rgba(10, 38, 52, .84));
}

.place-card:hover { transform: translateY(-5px); box-shadow: 0 12px 25px rgba(30, 76, 99, .22); }
.place-card img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.place-card:hover img { transform: scale(1.035); }
.place-card-content { position: absolute; z-index: 2; left: 16px; right: 16px; bottom: 15px; text-align: left; }
.place-card-icon { display: block; margin-bottom: 5px; font-size: 1.45rem; }
.place-card strong { display: block; font-size: 1.22rem; }
.place-card span:last-child { display: block; margin-top: 2px; color: rgba(255,255,255,.86); font-size: .78rem; }

.game-screen { min-width: 0; }
.control-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  padding: 10px 14px;
  border: 1px solid #d7eaf2;
  border-radius: 19px;
  background: rgba(255, 255, 255, .95);
  box-shadow: 0 4px 14px rgba(33, 79, 105, .08);
}

.place-heading { display: flex; align-items: center; gap: 10px; min-width: 0; }
.place-heading > span { display: grid; place-items: center; width: 47px; aspect-ratio: 1; border-radius: 14px; background: var(--hunt-sky); font-size: 1.55rem; }
.place-heading p { margin: 0; color: #6a7e88; font-size: .72rem; font-weight: 800; text-transform: uppercase; }
.place-heading h2 { margin: 0; color: var(--hunt-navy); font-size: clamp(1.25rem, 2.5vw, 1.75rem); line-height: 1.05; }
.game-actions { display: flex; align-items: center; gap: 9px; }
.tries-pill { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 8px 14px; border-radius: 14px; background: #edf6f8; color: #5e7681; }
.tries-pill span { font-size: .74rem; font-weight: 900; text-transform: uppercase; }
.tries-pill strong { color: var(--hunt-navy); font-size: 1.45rem; line-height: 1; }
.game-button { padding: 10px 16px; color: #fff; }
.hint-button { background: #f5b82e; box-shadow: 0 4px 0 #d49113; }
.new-game-button { background: var(--hunt-blue); box-shadow: 0 4px 0 var(--hunt-blue-dark); }

.play-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 14px;
  align-items: start;
}

.scene-card,
.helper-card,
.teacher-nudge {
  border: 1px solid #d7e8eb;
  border-radius: 22px;
  background: rgba(255,255,255,.96);
  box-shadow: var(--hunt-shadow);
}

.scene-card { min-width: 0; padding: 10px; }
.scene {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 16px;
  background: #cce9f5;
  isolation: isolate;
}

.scene-image { display: block; width: 100%; height: 100%; object-fit: cover; user-select: none; pointer-events: none; }
.hotspot-layer { position: absolute; z-index: 6; inset: 0; }

.hotspot {
  position: absolute;
  display: grid;
  place-items: center;
  width: clamp(44px, 4.3vw, 58px) !important;
  height: clamp(44px, 4.3vw, 58px) !important;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 2px dashed rgba(255, 255, 255, .56);
  border-radius: 50%;
  background: rgba(26, 126, 167, .1);
  cursor: pointer;
  transform: translate(-50%, -50%);
  transition: background .14s ease, border-color .14s ease, transform .14s ease;
}

.hotspot::after {
  content: "?";
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 2px solid rgba(255,255,255,.9);
  border-radius: 50%;
  background: rgba(22, 105, 139, .72);
  color: #fff;
  font-size: 1rem;
  font-weight: 900;
  box-shadow: 0 3px 8px rgba(18, 60, 78, .24);
}

.hotspot:hover,
.hotspot:focus-visible { z-index: 8; border-color: #fff; background: rgba(255, 216, 61, .34); transform: translate(-50%, -50%) scale(1.09); }
.hotspot.is-checked { pointer-events: none; border-color: rgba(255, 255, 255, .38); background: rgba(255, 111, 97, .13); }
.hotspot.is-checked::after { content: "×"; background: rgba(215, 78, 71, .86); }
.hotspot.is-found { border-color: #fff; background: rgba(127, 181, 28, .25); }
.hotspot.is-found::after { content: "★"; background: var(--eb-green); }

.bear-reveal {
  position: absolute;
  z-index: 9;
  display: grid;
  place-items: end center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: 44% 44% 38% 38% / 38% 38% 48% 48%;
  background: radial-gradient(ellipse at 50% 42%, rgba(255, 255, 255, .96), rgba(255, 249, 220, .82) 62%, rgba(214, 240, 204, .68));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .52), 0 5px 14px rgba(35, 74, 62, .2);
  pointer-events: none;
  animation: bear-pop .48s cubic-bezier(.2, .85, .24, 1.18) both;
}

.bear-reveal img {
  display: block;
  width: 82%;
  height: 86%;
  margin-bottom: 4%;
  max-width: none;
  object-fit: contain;
  object-position: 50% 100%;
  filter: drop-shadow(0 0 1px rgba(255, 255, 255, .98)) drop-shadow(0 3px 4px rgba(44, 55, 39, .2));
  transform: rotate(var(--bear-rotate, 0deg)) scale(var(--bear-scale, 1));
  transform-origin: 50% 82%;
}

.bear-reveal.peek-left { clip-path: inset(1% 45% 4% 0 round 32%); }
.bear-reveal.peek-right { clip-path: inset(1% 0 4% 45% round 32%); }
.bear-reveal.face-only { clip-path: inset(0 4% 40% 4% round 42%); }
.bear-reveal.top-peek { clip-path: inset(0 2% 54% 2% round 45%); }
.bear-reveal.small-peek { clip-path: inset(3% 20% 26% 20% round 42%); }

.scene-message {
  position: absolute;
  z-index: 12;
  left: 50%;
  top: 4%;
  max-width: 90%;
  padding: 10px 18px;
  border: 3px solid #fff;
  border-radius: 999px;
  background: var(--hunt-coral);
  color: #fff;
  font-size: clamp(1rem, 2.4vw, 1.4rem);
  font-weight: 900;
  text-align: center;
  transform: translateX(-50%);
  box-shadow: 0 7px 18px rgba(68, 53, 47, .2);
}

.scene-message.is-success { background: var(--eb-green); }
.scene-message.pop { animation: message-pop .28s ease-out both; }
.scene-instruction { display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 30px; margin: 7px 4px 0; color: #456875; font-weight: 800; text-align: center; }

.talk-panel { display: grid; gap: 12px; }
.helper-card,
.teacher-nudge { padding: 17px; }
.helper-label { color: var(--hunt-blue-dark); font-size: .74rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.helper-card p,
.teacher-nudge p { margin: 8px 0 0; font-size: 1.08rem; font-weight: 800; line-height: 1.34; }
.hint-card { border: 2px solid #f5d17b; background: #fff9e8; }
.saying-card { border: 2px solid #bfe2ef; background: #f2fbff; }
.helper-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.phrase-button { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%; background: #dbeff7; color: var(--hunt-blue-dark); font-weight: 900; cursor: pointer; }
.teacher-nudge { border: 2px solid #cde5a0; background: #f7ffe9; }
.teacher-nudge strong { color: var(--eb-green-dark); }
.teacher-nudge p { color: #496d36; font-size: .96rem; }

.result-overlay {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(22, 57, 76, .46);
  backdrop-filter: blur(5px);
}

.result-card {
  position: relative;
  width: min(100%, 520px);
  padding: 30px;
  overflow: hidden;
  border: 4px solid #fff;
  border-radius: 30px;
  background: linear-gradient(165deg, #fff 0 54%, #f0fae3 100%);
  box-shadow: 0 22px 60px rgba(18, 51, 67, .28);
  text-align: center;
  animation: result-in .36s ease-out both;
}

.result-burst { position: absolute; right: 8%; top: 9%; color: var(--eb-yellow); font-size: 3rem; transform: rotate(13deg); }
.result-bear-frame {
  width: 154px;
  aspect-ratio: 1;
  margin: 0 auto 9px;
  display: grid;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, .94);
  border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, #fff 0 44%, #fff8d9 72%, #e8f5d5 100%);
  box-shadow: inset 0 0 0 1px rgba(127, 181, 28, .12), 0 9px 24px rgba(42, 71, 39, .12);
}
.result-bear {
  width: 118px;
  max-height: 128px;
  object-fit: contain;
  filter: drop-shadow(0 0 1px rgba(255, 255, 255, .98)) drop-shadow(0 5px 7px rgba(42, 71, 39, .16));
  animation: result-bear-pop .5s cubic-bezier(.2, .82, .25, 1.14) both;
}
.result-card h2 { margin: 5px auto 0; color: var(--hunt-navy); font-size: clamp(1.55rem, 5vw, 2.25rem); line-height: 1.15; }
.result-location { margin: 12px 0 20px; color: #5c717a; font-size: 1.05rem; font-weight: 800; }
.result-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.result-actions .eb-button { width: 100%; padding-inline: 14px; }

@keyframes bear-pop {
  from { opacity: 0; transform: translateY(16%) scale(.8) rotate(-4deg); }
  70% { opacity: 1; transform: translateY(-2%) scale(1.035) rotate(1deg); }
  to { opacity: 1; transform: translateY(0) scale(1) rotate(0); }
}

@keyframes result-bear-pop {
  from { opacity: 0; transform: translateY(8px) scale(.86); }
  70% { opacity: 1; transform: translateY(-2px) scale(1.035); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes message-pop {
  from { opacity: 0; transform: translate(-50%, -8px) scale(.92); }
  to { opacity: 1; transform: translate(-50%, 0) scale(1); }
}

@keyframes result-in {
  from { opacity: 0; transform: translateY(18px) scale(.94); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 1050px) {
  .place-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .place-card { min-height: 220px; }
  .play-layout { grid-template-columns: minmax(0, 1fr); }
  .talk-panel { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .bear-game { width: 100%; padding: 8px; }
  .game-header { min-height: 58px; margin-bottom: 8px; padding: 8px 10px; border-radius: 16px; }
  .game-logo { width: 135px; }
  .title-divider { display: none; }
  .brand-lockup { align-items: flex-start; flex-direction: column; gap: 1px; }
  .brand-lockup h1 { font-size: 1rem; }
  .header-action { min-height: 42px; padding: 7px 13px; }
  .place-screen { padding: 16px; border-radius: 22px; }
  .welcome-copy { margin-bottom: 15px; gap: 10px; }
  .welcome-copy h2 { font-size: 2rem; }
  .welcome-copy p:last-child { font-size: .93rem; }
  .welcome-bear { width: 92px; }
  .place-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .place-card { min-height: 180px; border-radius: 17px; }
  .control-bar { align-items: stretch; flex-direction: column; gap: 8px; padding: 9px; }
  .game-actions { display: grid; grid-template-columns: auto 1fr 1fr; }
  .tries-pill { justify-content: center; padding-inline: 10px; }
  .game-button { padding-inline: 9px; font-size: .83rem; }
  .scene-card { padding: 6px; border-radius: 17px; }
  .scene { border-radius: 13px; }
  .scene-instruction { font-size: .88rem; }
  .talk-panel { grid-template-columns: 1fr; gap: 8px; }
  .helper-card, .teacher-nudge { padding: 13px; border-radius: 17px; }
  .result-card { padding: 24px 17px; border-radius: 24px; }
  .result-bear-frame { width: 138px; margin-bottom: 7px; }
  .result-bear { width: 106px; max-height: 114px; }
  .result-actions { grid-template-columns: 1fr; }
}

@media (max-width: 430px) {
  .place-grid { grid-template-columns: 1fr; }
  .place-card { min-height: 155px; }
  .welcome-bear { display: none; }
  .game-actions { grid-template-columns: 62px 1fr 1fr; }
  .game-button { min-height: 45px; font-size: .74rem; }
  .hotspot::after { width: 24px; height: 24px; font-size: .88rem; }
  .scene-message { top: 3%; padding: 7px 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
