/* Pocket Garden - the HUD over the canvas. The page frame (full window, font, back link) is the site's frame.css. */
:root { --ink: rgb(22 34 30 / 0.6); --line: rgb(255 255 255 / 0.18); --leaf: #b8f5a0; --sun: #ffd84d; }
body { user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; touch-action: none; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; }
button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
[hidden] { display: none !important; }

/* ---------- attract mode ---------- */
.attract { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; text-align: center; pointer-events: none; transition: opacity 0.6s; padding: 0 16px; }
.attract h1 { margin: 5.5vh 0 0; font-size: clamp(44px, min(11.5vh, 19vw), 124px); line-height: 1.02; font-weight: 800; letter-spacing: -0.035em; color: #fffaf0;
  text-shadow: 0 2px 0 #4f8f4c, 0 4px 0 #3f7a3e, 0 6px 0 #2f6431, 0 12px 26px rgb(16 40 28 / 0.5); }
.attract .sub { margin: 14px 0 0; font-size: clamp(14px, 2.3vh, 20px); font-weight: 600; color: #fff; text-shadow: 0 1px 2px rgb(20 46 34 / 0.7), 0 2px 14px rgb(20 46 34 / 0.6); }
.attract .go { margin: auto 0 6vh; padding: 12px 22px; border-radius: 9999px; background: var(--ink); border: 1px solid var(--line); font-size: clamp(14px, 2.2vh, 17px); font-weight: 600;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); animation: breathe 2.4s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: 0.6; } }
.playing .attract { opacity: 0; }

/* ---------- the HUD ---------- */
.hud { position: fixed; inset: 0; pointer-events: none; opacity: 0; transition: opacity 0.5s; }
.playing .hud { opacity: 1; }
.photo .hud, .photo .hz-back { opacity: 0 !important; transition: none; }
.playing .bar, .playing .tray { pointer-events: auto; }

.goal { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 7px 14px 8px;
  border-radius: 16px; background: var(--ink); border: 1px solid var(--line); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); white-space: nowrap; }
.goal .head { display: flex; gap: 10px; align-items: baseline; font-size: 11px; line-height: 14px; font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase; color: rgb(255 255 255 / 0.78); }
.goal .clock { font-size: 13px; letter-spacing: 0; color: #fff; font-variant-numeric: tabular-nums; }
.goal .icons { display: flex; gap: 7px; }
.goal canvas { width: 24px; height: 24px; image-rendering: pixelated; opacity: 0.3; filter: grayscale(1); transition: opacity 0.4s, filter 0.4s, transform 0.4s; }
.goal canvas.got { opacity: 1; filter: none; transform: scale(1.08); }
.goal .bloom { font-size: 11px; line-height: 14px; color: rgb(255 255 255 / 0.72); }

.bar { position: absolute; top: 12px; right: 12px; display: flex; gap: 8px; }
.round { width: 34px; height: 34px; border-radius: 9999px; background: var(--ink); border: 1px solid var(--line); display: inline-flex; align-items: center; justify-content: center;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.round:hover { background: rgb(22 34 30 / 0.85); }
.round svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.tray { position: absolute; left: 50%; bottom: max(14px, env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; gap: 6px; padding: 6px; border-radius: 18px;
  background: var(--ink); border: 1px solid var(--line); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.slot { position: relative; width: 52px; height: 52px; border-radius: 12px; background: rgb(255 255 255 / 0.07); border: 2px solid transparent; display: grid; place-items: center;
  transition: transform 0.15s, background 0.15s, border-color 0.15s; }
.slot:hover { background: rgb(255 255 255 / 0.15); }
.slot.sep { margin-left: 10px; }
.slot canvas { width: 30px; height: 30px; image-rendering: pixelated; transition: opacity 0.2s, filter 0.2s; }
.slot .key { position: absolute; left: 5px; top: 2px; font-size: 10px; font-weight: 700; color: rgb(255 255 255 / 0.55); }
.slot .count { position: absolute; right: 4px; bottom: 1px; font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; color: #fff; }
.slot.on { border-color: #fff; background: rgb(255 255 255 / 0.2); transform: translateY(-3px); }
.slot.none canvas { opacity: 0.3; filter: grayscale(1); }
.slot.none .count { color: rgb(255 255 255 / 0.45); }
.slot.gain { animation: gain 0.7s ease-out; }
@keyframes gain { 0% { box-shadow: 0 0 0 0 rgb(255 216 77 / 0.9); background: rgb(255 216 77 / 0.45); } 100% { box-shadow: 0 0 0 14px rgb(255 216 77 / 0); } }

.status { position: absolute; left: 50%; bottom: 88px; transform: translateX(-50%); font-size: 13px; font-weight: 600; white-space: nowrap; color: #fff;
  text-shadow: 0 1px 2px rgb(16 30 24 / 0.8), 0 1px 10px rgb(16 30 24 / 0.6); }
.hint { position: absolute; left: 50%; bottom: 114px; transform: translateX(-50%); padding: 8px 14px; border-radius: 9999px; background: var(--ink); border: 1px solid var(--line);
  font-size: 13px; max-width: calc(100vw - 32px); box-sizing: border-box; text-align: center; opacity: 0; transition: opacity 0.8s; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.hint.show { opacity: 1; }
.toast { position: absolute; left: 50%; top: 96px; transform: translate(-50%, -6px); padding: 8px 16px; border-radius: 9999px; background: rgb(255 250 235 / 0.92); color: #23331f;
  font-size: 14px; font-weight: 600; max-width: calc(100vw - 32px); box-sizing: border-box; text-align: center; opacity: 0; transition: opacity 0.4s, transform 0.4s; box-shadow: 0 6px 24px rgb(0 0 0 / 0.18); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.float { position: fixed; left: 0; top: 0; pointer-events: none; font-size: 15px; font-weight: 750; white-space: nowrap; color: #fff8d6;
  text-shadow: 0 1px 2px rgb(30 40 20 / 0.9), 0 2px 12px rgb(30 40 20 / 0.6); animation: rise 1.5s ease-out forwards; }
@keyframes rise { 0% { opacity: 0; translate: -50% 0; } 15% { opacity: 1; } 70% { opacity: 1; } 100% { opacity: 0; translate: -50% -56px; } }

/* ---------- the result panel ---------- */
.card { position: fixed; left: 50%; top: 50%; width: min(330px, calc(100vw - 32px)); box-sizing: border-box; padding: 20px 22px 18px; border-radius: 18px; background: rgb(22 34 30 / 0.84);
  border: 1px solid var(--line); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: 0 20px 60px rgb(0 0 0 / 0.4); text-align: center; opacity: 0; pointer-events: none;
  transform: translate(-50%, -46%) scale(0.96); transition: opacity 0.3s, transform 0.3s; }
.card.show { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%); transition-delay: 0.4s; }
.card h2 { margin: 0; font-size: 22px; line-height: 28px; font-weight: 750; color: var(--leaf); }
.card .sub { margin: 4px 0 12px; font-size: 14px; color: rgb(255 255 255 / 0.75); }
.row { display: flex; justify-content: space-between; align-items: baseline; padding: 5px 0; font-size: 14px; color: rgb(255 255 255 / 0.7); border-bottom: 1px solid rgb(255 255 255 / 0.08); }
.row b { font-size: 16px; color: #fff; font-variant-numeric: tabular-nums; }
.btns { display: flex; gap: 10px; justify-content: center; margin-top: 16px; }
.next, .ghost { height: 38px; padding: 0 18px; border-radius: 9999px; font-size: 14px; font-weight: 650; }
.next { background: #fff; color: #18261c; } .next:hover { background: #e4ffd6; }
.ghost { border: 1px solid var(--line); background: rgb(255 255 255 / 0.06); } .ghost:hover { background: rgb(255 255 255 / 0.14); }

.flash { position: fixed; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.flash.go { animation: flash 0.6s ease-out; }
@keyframes flash { 0% { opacity: 0.85; } 100% { opacity: 0; } }

/* ---------- touch and small screens ---------- */
.touch .slot { width: 50px; height: 54px; }
@media (max-width: 560px) {
  .goal { top: 54px; }
  .toast { top: 136px; }
  .tray { gap: 3px; padding: 4px; border-radius: 14px; }
  .slot, .touch .slot { width: calc((100vw - 64px) / 8); height: calc((100vw - 64px) / 8 + 6px); max-width: 52px; max-height: 58px; border-radius: 10px; }
  .slot.sep { margin-left: 6px; }
  .slot canvas { width: 24px; height: 24px; }
  .status { bottom: 80px; font-size: 12px; }
  .hint { bottom: 104px; font-size: 12px; }
}
