/* Hop City HUD + menus. Display font Baloo 2 (OFL), text Nunito (OFL), from the hole kit. Bright, chunky, toy-like:
   white type with a dark outline over the city, cards in cream with an orange primary. Top band only during play;
   the bottom centre stays free for the OhMyGames "How to play" pill (.in-frame adds room). */
@font-face { font-family: 'Baloo 2'; src: url('fonts/baloo2-700.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Nunito'; src: url('fonts/nunito-var.woff2') format('woff2'); font-weight: 400 900; font-display: swap; }
:root { --ink: #1d2333; --cream: #fff8ec; --orange: #c2410c; --orange-d: #9a3412; --pink: #c8175d; --sky: #2f7de1; --shadow: 0 6px 0 rgba(29, 35, 51, .25);
  --safe-t: max(10px, env(safe-area-inset-top)); --safe-b: max(12px, env(safe-area-inset-bottom)); }
html, body { margin: 0; height: 100%; overflow: hidden; background: #8fd0ff; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
#c { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
#hud { position: fixed; inset: 0; pointer-events: none; font-family: 'Nunito', system-ui, sans-serif; color: var(--ink); }
#hud button { pointer-events: auto; font-family: inherit; cursor: pointer; }
.hc-btn { border: 0; border-radius: 14px; background: rgba(255, 248, 236, .92); color: var(--ink); min-width: 44px; min-height: 44px; font-weight: 900; font-size: 18px; box-shadow: var(--shadow); transition: transform .08s; }
.hc-btn:hover { background: #fff; } .hc-btn:active { transform: translateY(3px); box-shadow: 0 3px 0 rgba(29, 35, 51, .25); }
.hc-btn:focus-visible, .hc-b:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }
.hc-btn:disabled { opacity: .55; cursor: default; }

/* ---- play HUD ---- */
.hc-top { position: absolute; left: 0; right: 0; top: var(--safe-t); display: flex; align-items: flex-start; gap: 10px; padding: 0 12px; opacity: 0; transition: opacity .2s; }
#hud.playing .hc-top { opacity: 1; }
.hc-top .hc-pause { font-size: 14px; letter-spacing: -2px; }
#hud:not(.playing) .hc-top button { pointer-events: none; }
.hc-score { display: flex; flex-direction: column; line-height: .9; }
.hc-score b { font-family: 'Baloo 2', 'Nunito', sans-serif; font-size: 52px; color: #fff; -webkit-text-stroke: 7px var(--ink); paint-order: stroke fill; text-shadow: 0 5px 0 rgba(29, 35, 51, .35); }
.hc-score small { font-weight: 900; font-size: 14px; color: #fff; -webkit-text-stroke: 4px var(--ink); paint-order: stroke fill; margin-top: 2px; }
.hc-snacks { margin-left: auto; display: flex; align-items: center; gap: 6px; background: rgba(255, 248, 236, .92); border-radius: 999px; padding: 6px 12px 6px 8px; box-shadow: var(--shadow); font-weight: 900; font-size: 20px; }
.hc-snacks.bump { animation: hc-bump .35s; }
@keyframes hc-bump { 40% { transform: scale(1.25); } }
.hc-donut { display: inline-block; width: 22px; height: 22px; border-radius: 50%; background: radial-gradient(circle at 50% 50%, transparent 0 4px, #ff8fc3 4.5px 8px, #f2b469 8.5px); box-shadow: inset 0 -2px 0 rgba(0,0,0,.15); vertical-align: -5px; margin-right: 2px; }
.hc-banner { position: absolute; left: 50%; top: calc(var(--safe-t) + 74px); transform: translate(-50%, -10px) scale(.9); opacity: 0; transition: .25s; font-family: 'Baloo 2', sans-serif; font-size: 30px; color: #fff; -webkit-text-stroke: 6px var(--ink); paint-order: stroke fill; white-space: nowrap; }
.hc-banner.on { opacity: 1; transform: translate(-50%, 0) scale(1); }
.hc-pop { position: absolute; left: 50%; top: 34%; transform: translate(-50%, 0); opacity: 0; font-family: 'Baloo 2', sans-serif; font-size: 26px; color: #ffd23f; -webkit-text-stroke: 5px var(--ink); paint-order: stroke fill; pointer-events: none; }
.hc-pop.on { animation: hc-pop .9s ease-out; }
.hc-pop.best { color: #ff5fa2; font-size: 34px; }
@keyframes hc-pop { 0% { opacity: 0; transform: translate(-50%, 10px) scale(.7); } 15% { opacity: 1; transform: translate(-50%, 0) scale(1.1); } 70% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -26px) scale(1); } }
.hc-danger { position: absolute; left: 0; right: 0; bottom: 0; height: 26vh; background: linear-gradient(to top, rgba(255, 122, 47, .55), rgba(255, 122, 47, 0)); opacity: 0; transition: opacity .25s; }
.hc-danger.on { opacity: 1; animation: hc-throb .6s infinite alternate; }
@keyframes hc-throb { to { opacity: .55; } }
.hc-coach { position: absolute; left: 50%; top: calc(var(--safe-t) + 70px); transform: translateX(-50%); background: rgba(29, 35, 51, .82); color: #fff; border-radius: 14px; padding: 10px 16px; font-weight: 800; font-size: 16px; white-space: nowrap; max-width: 92vw; white-space: normal; text-align: center; }

/* ---- title (on the live street, no cover) ---- */
.hc-title { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity .25s; }
.hc-title.on { opacity: 1; visibility: visible; }
.hc-title button { pointer-events: auto; }
.hc-logo { position: absolute; left: 50%; top: calc(var(--safe-t) + 4vh); transform: translateX(-50%) rotate(-4deg); margin: 0; display: flex; flex-direction: column; align-items: center; line-height: .78; font-family: 'Baloo 2', sans-serif; font-weight: 700; font-size: clamp(64px, 17vw, 120px); color: #fff; -webkit-text-stroke: 10px var(--ink); paint-order: stroke fill; text-shadow: 0 8px 0 rgba(29, 35, 51, .35); }
.hc-logo span:first-child { color: #ffd23f; }
.hc-logo span:last-child { color: #fff; margin-left: .6em; }
.hc-tagline { position: absolute; left: 50%; top: calc(var(--safe-t) + 4vh + clamp(118px, 30vw, 205px)); transform: translateX(-50%); margin: 0; font-weight: 900; font-size: 17px; color: #fff; -webkit-text-stroke: 4px var(--ink); paint-order: stroke fill; white-space: nowrap; }
.hc-gear { position: absolute; right: 12px; top: var(--safe-t); font-size: 22px; }
.hc-pick { position: absolute; left: 50%; bottom: calc(var(--safe-b) + 150px); transform: translateX(-50%); display: flex; align-items: center; gap: 12px; }
.hc-who { min-width: 150px; text-align: center; background: rgba(255, 248, 236, .94); border-radius: 16px; padding: 6px 14px; box-shadow: var(--shadow); }
.hc-who b { display: block; font-family: 'Baloo 2', sans-serif; font-size: 24px; line-height: 1.1; }
.hc-who small { font-weight: 800; font-size: 13px; color: #5a6072; }
.hc-arrow { font-size: 16px; }
.hc-unlock { position: absolute; left: 50%; bottom: calc(var(--safe-b) + 100px); transform: translateX(-50%); padding: 0 16px; background: var(--orange); color: #fff; white-space: nowrap; }
.hc-unlock:hover { background: var(--orange-d); }
.hc-unlock:disabled { background: rgba(255, 248, 236, .92); color: var(--ink); opacity: 1; }
.hc-tap { position: absolute; left: 50%; bottom: calc(var(--safe-b) + 66px); transform: translateX(-50%); margin: 0; font-family: 'Baloo 2', sans-serif; font-size: 26px; color: #fff; -webkit-text-stroke: 6px var(--ink); paint-order: stroke fill; white-space: nowrap; animation: hc-pulse 1.1s ease-in-out infinite; }
.hc-unlock:not([hidden]) ~ .hc-tap { bottom: calc(var(--safe-b) + 210px); font-size: 20px; animation: none; }
@keyframes hc-pulse { 50% { transform: translateX(-50%) scale(1.08); } }

/* ---- cards ---- */
.hc-layer { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); background: rgba(29, 35, 51, .35); opacity: 0; visibility: hidden; transition: opacity .2s; }
.hc-layer.on { opacity: 1; visibility: visible; pointer-events: auto; }
.hc-card { width: min(380px, 92vw); max-height: calc(100dvh - 32px); overflow: auto; background: var(--cream); border-radius: 22px; padding: clamp(20px, 5vw, 28px); box-shadow: 0 10px 0 rgba(29, 35, 51, .3); text-align: center; }
.hc-card h2 { margin: 0; font-family: 'Baloo 2', sans-serif; font-size: 42px; line-height: 1.05; color: #ff8a3d; -webkit-text-stroke: 6px var(--ink); paint-order: stroke fill; letter-spacing: .01em; }
.hc-sub { margin: 4px 0 12px; font-weight: 700; color: #5a6072; }
.hc-final { display: flex; justify-content: center; gap: 10px; margin: 6px 0; }
.hc-final div { flex: 1; background: #fff; border-radius: 14px; padding: 6px 4px; }
.hc-final small { display: block; font-weight: 800; font-size: 12px; color: #5a6072; text-transform: uppercase; letter-spacing: .06em; }
.hc-final b { font-family: 'Baloo 2', sans-serif; font-size: 34px; line-height: 1.05; }
.hc-newbest { margin: 8px 0 0; font-family: 'Baloo 2', sans-serif; font-size: 22px; color: var(--pink); }
.hc-next { margin: 8px 0 12px; font-weight: 700; font-size: 14px; color: #3c4256; }
.hc-row { display: flex; gap: 10px; justify-content: center; }
.hc-b { flex: 1; min-height: 48px; border: 0; border-radius: 14px; background: #fff; color: var(--ink); font-weight: 900; font-size: 17px; box-shadow: var(--shadow); }
.hc-b:hover { background: #f1ece3; }
.hc-b.hc-primary { background: var(--orange); color: #fff; }
.hc-b.hc-primary:hover { background: var(--orange-d); }
.hc-b:active { transform: translateY(3px); box-shadow: 0 3px 0 rgba(29, 35, 51, .25); }
.hc-help { font-size: 13px; color: #3c4256; margin: 10px 0 12px; line-height: 1.5; }
.hc-loading { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; font-family: 'Baloo 2', 'Nunito', sans-serif; color: #fff; font-size: 22px; -webkit-text-stroke: 5px var(--ink); paint-order: stroke fill; }
.hc-loading i { width: 40px; height: 40px; border-radius: 50%; background: radial-gradient(circle, transparent 0 7px, #ff8fc3 8px 15px, #f2b469 16px); animation: hc-spin 1s linear infinite; margin-bottom: 10px; }
@keyframes hc-spin { to { transform: rotate(360deg); } }

/* inside OhMyGames: keep the bottom centre free for the pill */
.in-frame .hc-tap { bottom: calc(var(--safe-b) + 78px); }
@media (max-height: 520px) and (orientation: landscape) {
  .hc-logo { font-size: 64px; top: 8px; left: 24px; transform: rotate(-4deg); align-items: flex-start; }
  .hc-tagline { left: 30px; transform: none; top: 112px; }
  .hc-pick { left: auto; right: 16px; transform: none; bottom: calc(var(--safe-b) + 66px); }
  .hc-unlock { left: auto; right: 16px; transform: none; bottom: calc(var(--safe-b) + 16px); }
  .hc-tap { left: 24px; transform: none; bottom: calc(var(--safe-b) + 16px); animation: none; }
  .hc-unlock:not([hidden]) ~ .hc-tap { bottom: calc(var(--safe-b) + 16px); }
  .hc-score b { font-size: 40px; }
  .hc-card { padding: 20px; } .hc-card h2 { font-size: 30px; }
}
/* inside OhMyGames on a sideways phone the page's top bar lies over the first ~56 px until play starts: logo and gear below it */
@media (max-height: 520px) and (orientation: landscape) {
  .in-frame .hc-logo { top: 64px; font-size: 56px; }
  .in-frame .hc-tagline { top: 160px; }
  .in-frame .hc-gear { top: 64px; }
}
