/* Where's Waldo booth — capsunlocked.com/waldo */
:root {
  --red: #cf3436; --navy: #193b51; --cream: #fcf7ed; --paper: #fffdf7;
  --gold: #f2c230; --muted: #526a75; --line: #193b5130;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body.waldo {
  background: var(--cream); color: var(--navy); min-height: 100vh;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  display: flex; flex-direction: column;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.waldo button { font-family: inherit; color: inherit; cursor: pointer; }
.waldo button:disabled { cursor: default; }
.waldo :focus-visible { outline: 4px solid #1867c0; outline-offset: 4px; }
.waldo h1:focus, .waldo h2:focus, .waldo h1:focus-visible, .waldo h2:focus-visible { outline: none; }

/* header / footer */
.w-nav, .w-footer {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 14px 4%; font-size: 13px; font-weight: 800; letter-spacing: 1px;
}
.w-nav { border-bottom: 1px solid var(--line); }
.w-nav a { color: inherit; text-decoration: none; }
.w-nav b { font-weight: 400; }
.w-footer { border-top: 1px solid var(--line); margin-top: auto; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.w-linkbtn { background: none; border: 1px solid var(--line); border-radius: 30px; padding: 8px 14px; font-size: 13px !important; font-weight: 700; }
.w-wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 24px 40px; flex: 1; }

/* shared */
.w-label { font-size: 12px; font-weight: 900; letter-spacing: 2px; margin: 0; }
.w-small { font-size: 15px; color: var(--muted); margin: 8px 0; }
.w-primary, .w-secondary, .w-giant {
  border: 3px solid var(--navy); border-radius: 40px; font-weight: 800;
  padding: 16px 30px; font-size: 20px; min-height: 60px;
}
.w-primary { background: var(--red); color: #fff !important; box-shadow: 4px 4px 0 var(--navy); }
.w-secondary { background: var(--paper); }
.w-primary:active, .w-giant:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--navy); }
.w-endbar { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin: 18px 0; }
.w-feedback { min-height: 30px; font-weight: 800; font-size: 22px; margin: 18px 0 6px; }
.w-score { font-weight: 900; font-size: 24px; margin: 12px 0; }
.w-score span { padding: 0 10px; color: #b49e7c; }
.w-play { text-align: center; padding-top: 22px; }
.w-play h1 { font-size: clamp(38px, 6vw, 64px); letter-spacing: -2px; margin: 8px 0; color: var(--red); }
.w-clue { font-size: 20px; line-height: 1.4; margin: 6px auto 10px; max-width: 760px; font-weight: 600; }

/* attract */
.w-attract { text-align: center; padding: 8vh 0 4vh; }
.w-attract h1 { font-size: clamp(64px, 12vw, 140px); line-height: .95; letter-spacing: -5px; margin: 20px 0; }
.w-attract h1 span { color: var(--red); display: block; }
.w-intro { font: 26px/1.4 Georgia, serif; margin: 0 0 34px; }
.w-giant {
  font-size: 34px; padding: 26px 64px; background: var(--red); color: #fff !important;
  box-shadow: 6px 6px 0 var(--navy); animation: w-pulse 1.8s ease-in-out infinite;
}
@keyframes w-pulse { 50% { transform: scale(1.05); } }

/* menu */
.w-menu { padding-top: 20px; }
.w-menu-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.w-menu-head h2 { font-size: clamp(34px, 5vw, 54px); letter-spacing: -2px; margin: 0; }
.w-count {
  width: 92px; height: 92px; border-radius: 50%; border: 4px solid var(--navy);
  background: var(--gold); display: grid; place-items: center; font-size: 44px; font-weight: 900; flex: none;
}
.w-games { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 18px; }
.w-card {
  position: relative; text-align: left; background: var(--paper); border: 3px solid var(--navy);
  border-radius: 18px; padding: 18px; display: flex; flex-direction: column; gap: 8px; min-height: 300px;
}
.w-card:active { transform: translateY(3px); }
.w-card.red { --accent: #cf3436; --tint: #fbe7de; }
.w-card.blue { --accent: #256e9a; --tint: #e0eff3; }
.w-card.yellow { --accent: #8b5c00; --tint: #fff0bd; }
.w-card.green { --accent: #3d765b; --tint: #e4eee0; }
.w-card-num { font-size: 13px; font-weight: 800; }
.w-badge {
  position: absolute; top: 14px; right: 14px; background: var(--navy); color: #fff;
  font-size: 12px; font-weight: 800; padding: 5px 10px; border-radius: 20px;
}
.w-card-icon { background: var(--tint); font-size: 54px; border-radius: 50%; width: 96px; height: 96px; display: grid; place-items: center; }
.w-card .w-label { color: var(--accent); font-size: 11px; }
.w-card-title { font-size: 26px; font-weight: 900; letter-spacing: -1px; }
.w-card-text { font-size: 16px; line-height: 1.45; flex: 1; }
.w-card-meta { font-size: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
.w-card-meta b { color: var(--accent); font-size: 17px; }

/* 1. big picture search */
.w-controls { display: flex; justify-content: center; align-items: center; gap: 18px; }
.w-controls .w-secondary { font-size: 17px; padding: 10px 22px; min-height: 50px; }
.w-scene {
  position: relative; margin: 12px auto 0; border: 4px solid var(--navy); border-radius: 14px;
  overflow: hidden; line-height: 0; max-width: 1400px; user-select: none; -webkit-user-select: none;
}
.w-scene img { width: 100%; height: auto; display: block; cursor: crosshair; -webkit-touch-callout: none; }
.w-mark {
  position: absolute; transform: translate(-50%, -50%); pointer-events: none;
  display: grid; place-items: center; font-weight: 900; line-height: 1;
}
.w-mark.miss { width: 44px; height: 44px; font-size: 30px; color: #fff; background: #193b51cc; border-radius: 50%; }
.w-mark.hit {
  width: 11%; aspect-ratio: 1; border-radius: 50%; border: 6px dashed var(--navy);
  background: #ffffff55; box-shadow: 0 0 0 6px #fff; animation: w-pop .5s ease-out;
}
@keyframes w-pop { from { transform: translate(-50%, -50%) scale(2.5); opacity: 0; } }
.w-hintbox {
  position: absolute; width: 50%; height: 50%; pointer-events: none;
  outline: 6px dashed var(--gold); outline-offset: -6px; background: #f2c23026;
}

/* 2. hat trick */
.w-hats { position: relative; max-width: 660px; height: 260px; margin: 20px auto 0; }
.w-hatbtn {
  position: absolute; top: 0; width: 33.333%; height: 100%; border: 0; background: transparent;
  transition: left .6s ease-in-out; display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
}
.w-hat { width: 170px; max-width: 92%; transition: transform .45s ease; position: relative; z-index: 1; }
.w-hat svg, .w-star svg { width: 100%; display: block; }
.w-star { position: absolute; bottom: 14px; width: 74px; visibility: hidden; }
.w-hatbtn.up .w-hat { transform: translateY(-110px); }
.w-hatbtn.up.has-star .w-star { visibility: visible; }
.w-hatbtn:not(:disabled) .w-hat { filter: drop-shadow(0 0 0 transparent); }
.w-hatbtn:not(:disabled):active .w-hat { transform: translateY(-14px); }
.w-hatbtn.picked::after {
  content: "your pick"; position: absolute; bottom: -30px; font-weight: 800; font-size: 16px;
}

/* 3. perfect pairs */
.w-grades { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; max-width: 860px; margin: 24px auto; }
.w-grade {
  background: var(--paper); border: 3px solid var(--navy); border-radius: 18px; padding: 20px 12px;
  display: flex; flex-direction: column; gap: 6px; min-height: 130px; justify-content: center;
}
.w-grade b { font-size: 24px; }
.w-grade span { font-size: 18px; font-weight: 700; }
.w-grade small { font-size: 14px; color: var(--muted); }
.w-grade:active { background: #fff0bd; }
.w-timebar { max-width: 620px; height: 16px; margin: 0 auto 6px; border: 2px solid var(--navy); border-radius: 10px; overflow: hidden; background: var(--paper); }
.w-timebar div { height: 100%; width: 100%; background: repeating-linear-gradient(45deg, var(--navy) 0 10px, #2e5a78 10px 20px); transition: width .1s linear; }
.w-memory { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; max-width: 620px; margin: 14px auto 0; }
.w-mcard {
  aspect-ratio: 1; border: 3px solid var(--navy); border-radius: 14px; font-size: 52px; font-weight: 900;
  background: repeating-linear-gradient(0deg, var(--red) 0 14px, #e45a5c 14px 28px); color: #fff;
  box-shadow: 3px 3px 0 var(--navy); display: grid; place-items: center; position: relative;
}
.w-mcard.up { background: var(--paper); color: var(--navy); }
.w-mcard.matched { background: #d9ecf7; box-shadow: none; }
.w-mcard.matched::after { content: "✓"; position: absolute; top: 4px; right: 8px; font-size: 22px; color: var(--navy); }

/* 4. waldo's hand */
.w-trunks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; max-width: 560px; margin: 14px auto 0; }
.w-trunk {
  height: 140px; border: 3px solid var(--navy); border-radius: 18px; background: #e3edf0;
  display: grid; place-items: center; overflow: hidden; position: relative; touch-action: none;
}
.w-trunk-lid { width: 70%; height: 22px; border: 3px solid var(--navy); border-radius: 8px; background: #b9cfd8; }
.w-trunk.out { background: #fff0bd; }
.w-handemoji { font-size: 82px; animation: w-peek .18s ease-out; }
.w-handimg { max-width: 90%; max-height: 90%; animation: w-peek .18s ease-out; }
@keyframes w-peek { from { transform: translateY(60%); } }

/* booth settings */
.w-settings { text-align: left; max-width: 640px; margin: 0 auto; }
.w-settings h1 { text-align: left; }
.w-settings ul { font-size: 18px; line-height: 1.7; }
.w-settings .w-endbar { justify-content: flex-start; }

/* tablets & phones */
@media (max-width: 1000px) {
  .w-games { grid-template-columns: repeat(2, 1fr); }
  .w-card { min-height: 0; }
}
@media (max-width: 600px) {
  .w-wrap { padding: 0 14px 30px; }
  .w-nav-mid { display: none; }
  .w-games { gap: 10px; }
  .w-card { padding: 12px; }
  .w-card-icon { width: 70px; height: 70px; font-size: 40px; }
  .w-card-title { font-size: 20px; }
  .w-card-text { font-size: 14px; }
  .w-count { width: 70px; height: 70px; font-size: 32px; }
  .w-grades { grid-template-columns: repeat(2, 1fr); }
  .w-hats { height: 200px; }
  .w-hatbtn.up .w-hat { transform: translateY(-80px); }
  .w-star { width: 54px; }
  .w-mcard { font-size: 36px; }
  .w-trunk { height: 100px; }
  .w-handemoji { font-size: 58px; }
  .w-giant { font-size: 26px; padding: 20px 40px; }
}
@media (prefers-reduced-motion: reduce) {
  .w-giant, .w-mark.hit, .w-handemoji, .w-handimg { animation: none; }
  /* Hat shuffle motion is kept on purpose: the game is about following it. */
}
