/* Rregullo: "Prej një çeshmeje që pikon…" mini-game. Builds on site.css (tokens, header, buttons, footer). */

.loja-page { min-height: 100svh; display: flex; flex-direction: column; }
.loja-page .foot { margin-top: auto; }
.loja-page .top { width: 100%; }

/* Header: the sound switch sits opposite the logo */
.sound-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 40px; padding: 0 14px 0 12px; border: 0; border-radius: 999px;
  background: transparent; color: var(--mute); box-shadow: inset 0 0 0 1px var(--line);
  font: inherit; font-size: 14px; font-weight: 500; cursor: pointer;
  transition: color .2s var(--ease-out), box-shadow .2s var(--ease-out);
}
.sound-toggle svg { width: 18px; height: 18px; flex: none; }
.sound-toggle .wave { display: none; }
.sound-toggle[aria-pressed="true"] { color: var(--paper); box-shadow: inset 0 0 0 1px var(--line-strong); }
.sound-toggle[aria-pressed="true"] .wave { display: inline; }
.sound-toggle[aria-pressed="true"] .mute { display: none; }
.sound-toggle:hover { color: var(--paper); box-shadow: inset 0 0 0 1px var(--line-strong); }
.sound-toggle:focus-visible { border-radius: 999px; }

/* Layout: copy and stage, the same 5/6 split as the homepage hero */
.loja {
  display: grid; align-items: center; gap: clamp(8px, 3vw, 56px);
  grid-template-columns: minmax(0, 1fr);
  width: 100%; max-width: calc(var(--max) + 2 * var(--gutter)); margin: 0 auto;
  padding: clamp(20px, 4vh, 48px) var(--gutter) clamp(32px, 6vh, 72px);
}
@media (min-width: 960px) {
  .loja { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); min-height: min(calc(100svh - 160px), 760px); }
}

.loja-copy { display: flex; flex-direction: column; align-items: flex-start; }
.loja-title { margin-top: 16px; font-size: clamp(30px, 3.9vw, 54px); line-height: 1.04; letter-spacing: -.035em; }

/* The panel keeps one height for both states, so nothing moves when the job is done */
.loja-panel { display: grid; width: 100%; max-width: 460px; margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line); }
.loja-panel > * { grid-area: 1 / 1; }
.loja-panel > .is-off { visibility: hidden; }
.step { font-size: clamp(20px, 1.7vw, 24px); font-weight: 700; line-height: 1.25; letter-spacing: -.02em; }
.hint { margin-top: 8px; color: var(--mute); max-width: 36ch; }

.panel-done { display: grid; grid-template-columns: auto 1fr; gap: 0 18px; align-content: start; }
.done-o { width: 52px; height: auto; aspect-ratio: 148 / 139; margin-top: 2px; }
.done-head { font-size: clamp(22px, 2vw, 28px); font-weight: 700; line-height: 1.15; letter-spacing: -.025em; }
.done-head:focus { outline: none; }
.done-sub { margin-top: 8px; color: var(--mute); max-width: 32ch; }
.done-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.btn-quiet { background: transparent; color: var(--paper); box-shadow: inset 0 0 0 1px var(--line-strong); padding: 0 22px; min-height: 52px; }
.btn-quiet:hover { background: rgba(241, 242, 239, .06); box-shadow: inset 0 0 0 1px rgba(171, 226, 63, .55); }
.btn:focus-visible { border-radius: 999px; }

/* Stage: the SVG and its hit areas share one coordinate box (viewBox 60 200 560 500) */
.loja-stage { position: relative; width: 100%; aspect-ratio: 560 / 500; isolation: isolate; }
.scene { position: absolute; inset: 0; width: 100%; height: 100%; overflow: hidden; user-select: none; -webkit-user-select: none; }

.hit {
  position: absolute; z-index: 1; padding: 0; border: 0; border-radius: 28px;
  background: transparent; cursor: grab; touch-action: none;
  -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; user-select: none;
}
.hit:active, .is-dragging .hit { cursor: grabbing; }
.hit:focus { outline: none; }
.hit:focus-visible { outline: 2px solid var(--lime); outline-offset: 0; }
.hit-handle { left: 16.07%; top: 4.4%; width: 35.71%; height: 18%; }
.hit-wrench { left: 14.29%; top: 17%; width: 53.57%; height: 25%; }

/* Scene details */
.drop { fill: url(#dropFill); stroke: rgba(241, 242, 239, .55); stroke-width: .8; }
.drop-glint { fill: #F8FAF7; }
.puddle { fill: rgba(196, 212, 218, .07); stroke: rgba(241, 242, 239, .14); stroke-width: .8; }
.ripple { fill: none; stroke: #F1F2EF; stroke-width: 1; }
.splash { fill: #DCE5E8; }

.hint-arc { opacity: 0; transition: opacity .5s var(--ease-out); }
.hint-arc.is-on { opacity: .5; }
.nut-ring { fill: none; stroke: var(--lime); stroke-width: 1.6; opacity: 0; }
@media (prefers-reduced-motion: no-preference) {
  .hint-arc.is-on { animation: hint-breathe 2.4s ease-in-out infinite; }
  .nut-ring.is-on { animation: ring-call 1.3s ease-out 2; }
  .panel-play, .panel-done { transition: opacity .35s var(--ease-out), transform .45s var(--ease-out); }
  .panel-play.is-out { opacity: 0; transform: translateY(-6px); }
  .panel-done.is-in-start { opacity: 0; transform: translateY(8px); }
  .step.is-new { animation: step-in .4s var(--ease-out); }
  /* the level comes true: the bubble settles to the centre, ident easing (identity 2.4) */
  .done-bubble { transition: transform 1.1s cubic-bezier(.25, .6, .4, 1) .15s; }
  .panel-done.is-in-start .done-bubble { transform: translateX(-13px); transition: none; }
}
@media (prefers-reduced-motion: reduce) {
  .nut-ring.is-on { opacity: .9; }
}
@keyframes hint-breathe { 0%, 100% { opacity: .5; } 50% { opacity: .22; } }
@keyframes ring-call { 0% { opacity: 0; } 25% { opacity: .95; } 100% { opacity: 0; } }
@keyframes step-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Phones and tablets: title, the tap right under it, then the instruction and the result.
   The tap and the drop's landing stay in the first screen even on small phones. */
@media (max-width: 959px) {
  .loja { align-content: start; gap: 0; padding-top: clamp(16px, 3vh, 32px); }
  .loja-copy { display: contents; }
  .loja-stage { order: 1; margin-top: 8px; width: min(calc(100% + 2 * var(--gutter)), 640px); justify-self: center; }
  .loja-panel { order: 2; margin-top: 4px; padding-top: 16px; max-width: 560px; }
}
@media (max-width: 480px) {
  .sound-toggle { min-height: 40px; font-size: 13px; padding: 0 12px 0 10px; }
  .loja-title { font-size: clamp(28px, 8.2vw, 36px); }
  .step { font-size: 20px; }
  .hint { font-size: 15.5px; }
  .done-actions .btn { flex: 1 1 auto; justify-content: center; width: auto; }
}
@media (max-width: 380px) {
  .done-actions { gap: 8px; }
  .done-actions .btn { padding: 0 14px; font-size: 15px; }
}
