/* ⏸ The game frozen by the ZAZA team (world/js/freeze.js, which draws the pixel art and hands it over as --fz-* images).
   Frost and snow over the map but under the HUD (z-index 5), so a tap on the map does nothing and the chat still works;
   the team's card over the HUD. Windows (z-index 20) and fights (30) go over both. Buttons stay plain. */
.freeze[hidden], .fz-wrap[hidden], .fz-pill[hidden], .fz-goal[hidden], .fz-pill [hidden] { display: none; }
.fz-back {
  position: fixed; inset: 0; z-index: 4; overflow: hidden;
  background: radial-gradient(ellipse at center, rgba(8, 24, 72, 0.28), rgba(4, 14, 50, 0.74) 80%);
  box-shadow: inset 0 0 110px 22px rgba(170, 225, 255, 0.4);
  transition: opacity 0.6s ease;
}
.fz-front { position: fixed; inset: 0; z-index: 6; display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); place-items: center; padding: 22px 16px 40px; pointer-events: none; transition: opacity 0.5s ease; }
.freeze.is-gone .fz-back, .freeze.is-gone .fz-front { opacity: 0; }
.freeze.is-thaw .fz-back { opacity: 0.35; }

/* Snow in two layers, the near one bigger and faster. Each moves exactly one tile, so it loops without a jump. */
.fz-snow { position: absolute; left: 0; right: 0; bottom: 0; image-rendering: pixelated; pointer-events: none; }
.fz-snow.far { top: -192px; opacity: 0.55; background: var(--fz-snow-far) 0 0 / 192px 192px; animation: fz-snow-far 22s linear infinite; }
.fz-snow.near { top: -384px; opacity: 0.8; background: var(--fz-snow-near) 40px 0 / 384px 384px; animation: fz-snow-near 13s linear infinite; }
@keyframes fz-snow-far { to { transform: translateY(192px); } }
@keyframes fz-snow-near { 0% { transform: translate(0, 0); } 50% { transform: translate(14px, 192px); } 100% { transform: translate(0, 384px); } }
/* Frost crystals grown into each corner of the screen. */
.fz-corner { position: absolute; width: clamp(170px, 36vmin, 400px); aspect-ratio: 1; image-rendering: pixelated; pointer-events: none; background: no-repeat 0 0 / 100% 100%; }
.fz-corner.tl { left: 0; top: 0; background-image: var(--fz-frost-tl); }
.fz-corner.tr { right: 0; top: 0; background-image: var(--fz-frost-tr); }
.fz-corner.bl { left: 0; bottom: 0; background-image: var(--fz-frost-bl); }
.fz-corner.br { right: 0; bottom: 0; background-image: var(--fz-frost-br); }
.freeze.is-in .fz-corner { animation: fz-frost-in 1.4s cubic-bezier(0.2, 0.8, 0.3, 1) both; }
.freeze.is-in .fz-corner.tl { --o: 0 0; } .freeze.is-in .fz-corner.tr { --o: 100% 0; } .freeze.is-in .fz-corner.bl { --o: 0 100%; } .freeze.is-in .fz-corner.br { --o: 100% 100%; }
@keyframes fz-frost-in { from { clip-path: circle(0 at var(--o)); opacity: 0.4; } to { clip-path: circle(142% at var(--o)); opacity: 1; } }
.freeze.is-in .fz-back { animation: fz-fade-in 0.6s ease both; }
@keyframes fz-fade-in { from { opacity: 0; } }

/* The card: navy with brass studs and frost in its top corners, snow on top, icicles under it. */
.fz-wrap { position: relative; display: flex; flex-direction: column; width: min(var(--fz-w, 430px), 100%); max-height: 100%; pointer-events: auto; transform: translateX(var(--fz-x, 0px)); }
.freeze.is-in .fz-wrap { animation: fz-drop 0.7s cubic-bezier(0.2, 1.4, 0.4, 1) both; }
@keyframes fz-drop { from { opacity: 0; translate: 0 -40px; } }
.fz-card {
  position: relative; min-height: 0; overflow-y: auto; padding: 20px 20px 14px; text-align: center; color: #fff;
  border: 3px solid var(--gold); border-radius: 16px;
  background:
    radial-gradient(circle at 12px 12px, #fff1b8 0 1.5px, #c8961e 2px 3.5px, transparent 4px),
    radial-gradient(circle at calc(100% - 12px) 12px, #fff1b8 0 1.5px, #c8961e 2px 3.5px, transparent 4px),
    radial-gradient(circle at 12px calc(100% - 12px), #fff1b8 0 1.5px, #c8961e 2px 3.5px, transparent 4px),
    radial-gradient(circle at calc(100% - 12px) calc(100% - 12px), #fff1b8 0 1.5px, #c8961e 2px 3.5px, transparent 4px),
    var(--fz-frost-tl) no-repeat 0 0 / 84px 84px,
    var(--fz-frost-tr) no-repeat 100% 0 / 84px 84px,
    linear-gradient(180deg, #1c2b6e, #0e1748 70%);
  box-shadow: 0 0 0 2px #000, inset 0 0 0 2px rgba(190, 235, 255, 0.18), inset 0 0 28px rgba(140, 210, 255, 0.22), 0 0 50px rgba(127, 212, 255, 0.5), 0 18px 40px rgba(0, 0, 0, 0.55);
  image-rendering: pixelated;
}
.fz-cap { position: absolute; z-index: 1; left: 10px; right: 10px; top: -11px; height: 16px; background: var(--fz-cap) repeat-x 0 0 / 96px 16px; image-rendering: pixelated; pointer-events: none; filter: drop-shadow(0 2px 0 rgba(10, 40, 90, 0.35)); }
.fz-icicles { position: absolute; left: 18px; right: 18px; top: calc(100% - 3px); height: 36px; background: var(--fz-icicles) repeat-x 0 0 / 96px 36px; image-rendering: pixelated; pointer-events: none; filter: drop-shadow(0 2px 0 rgba(10, 40, 90, 0.4)); }
.fz-fold { position: absolute; top: 9px; right: 9px; z-index: 2; display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 2px solid var(--gold); border-radius: 50%; background: #141d40; color: #fff; font-size: 22px; line-height: 1; box-shadow: 0 2px 0 #000; }
.fz-fold:hover { background: #22306a; }

/* ZAZA in a block of ice: it shines, he shivers, sparkles twinkle round it; it cracks as the freeze goes on, and
   shatters at the end (.is-thaw) with ZAZA back in colour. */
.fz-ice { position: relative; width: 126px; height: 126px; margin: 0 auto 10px; }
.freeze.is-in .fz-ice { animation: fz-form 0.9s 0.25s cubic-bezier(0.2, 1.3, 0.4, 1) both; }
@keyframes fz-form { from { transform: scale(1.35); opacity: 0; filter: brightness(2.2); } }
.fz-ice.is-hit { animation: fz-knock 0.35s steps(2) 1; }
@keyframes fz-knock { 33% { transform: translate(-2px, 1px); } 66% { transform: translate(2px, -1px); } }
.fz-glass {
  position: absolute; inset: 0; overflow: hidden; display: grid; place-items: center;
  border: 3px solid #e4f8ff; border-radius: 10px;
  background: radial-gradient(circle at 50% 45%, rgba(120, 190, 245, 0.35), rgba(40, 100, 180, 0.55));
  box-shadow: inset 0 0 0 3px rgba(120, 190, 240, 0.55), 0 0 28px rgba(160, 225, 255, 0.7), 0 4px 0 #0a1a6b;
  transition: border-color 0.4s, background 0.4s, box-shadow 0.4s;
}
.fz-glass img { grid-area: 1 / 1; width: 102px; height: 102px; image-rendering: pixelated; filter: drop-shadow(0 2px 0 rgba(10, 40, 90, 0.5)); }
.fz-zaza-ice { animation: fz-shiver 4s steps(1) infinite; }
@keyframes fz-shiver { 0%, 88%, 100% { translate: 0 0; } 90% { translate: -2px 0; } 92% { translate: 2px 0; } 94% { translate: -2px 0; } 96% { translate: 2px 0; } }
.fz-zaza { opacity: 0; transform: scale(0.6); }
.fz-shine { position: absolute; inset: -20%; background: linear-gradient(115deg, transparent 42%, rgba(255, 255, 255, 0.6) 50%, transparent 58%); transform: translateX(-80%); animation: fz-shine 4.6s ease-in-out infinite; pointer-events: none; }
@keyframes fz-shine { 0%, 55% { transform: translateX(-80%); } 85%, 100% { transform: translateX(80%); } }
.fz-shards { position: absolute; inset: 3px; border-radius: 8px; pointer-events: none; }
.fz-shard { position: absolute; inset: 0; background: linear-gradient(140deg, rgba(245, 253, 255, 0.55), rgba(170, 225, 252, 0.14) 48%, rgba(120, 190, 245, 0.3)); }
.fz-cracks { position: absolute; inset: 3px; width: calc(100% - 6px); height: calc(100% - 6px); overflow: visible; pointer-events: none; filter: drop-shadow(0 0 1px #0a2a5a); }
.fz-cracks path { fill: none; stroke: #fff; stroke-width: 2.2; vector-effect: non-scaling-stroke; stroke-linejoin: bevel; stroke-dasharray: 1; stroke-dashoffset: 1; opacity: 0; transition: stroke-dashoffset 0.5s ease-out, opacity 0.2s; }
.fz-cracks path.is-on { stroke-dashoffset: 0; opacity: 1; }
.fz-spark { position: absolute; width: 15px; height: 15px; background: var(--fz-spark) center / 100% no-repeat; image-rendering: pixelated; pointer-events: none; animation: fz-twinkle 2.4s ease-in-out infinite; }
.fz-spark.s1 { left: -10px; top: 14px; }
.fz-spark.s2 { right: -12px; top: 48px; animation-delay: 0.8s; }
.fz-spark.s3 { left: 22px; bottom: -10px; animation-delay: 1.6s; }
@keyframes fz-twinkle { 0%, 100% { transform: scale(0); opacity: 0; } 45% { transform: scale(1) rotate(45deg); opacity: 1; } 70% { transform: scale(0.4); opacity: 0.6; } }
.freeze.is-thaw .fz-shard { transform: translate(var(--dx), var(--dy)) rotate(var(--r)); opacity: 0; transition: transform 0.75s cubic-bezier(0.15, 0.7, 0.3, 1), opacity 0.75s ease-in; }
.freeze.is-thaw .fz-cracks, .freeze.is-thaw .fz-shine, .freeze.is-thaw .fz-zaza-ice { opacity: 0; transition: opacity 0.2s; }
.freeze.is-thaw .fz-glass { border-color: transparent; background: transparent; box-shadow: none; }
.freeze.is-thaw .fz-zaza { opacity: 1; transform: none; animation: fz-hop 0.7s 0.1s cubic-bezier(0.3, 1.6, 0.5, 1) both; }
@keyframes fz-hop { 0% { transform: scale(0.6); } 45% { transform: translateY(-14px) scale(1.08); } 100% { transform: none; } }
.freeze.is-thaw .fz-spark { animation: fz-burst 0.8s ease-out both; }
@keyframes fz-burst { from { transform: scale(0.5); opacity: 1; } to { transform: scale(2.6) rotate(90deg); opacity: 0; } }

/* The title in ice, a snowflake either side. */
.fz-title { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 2px 0 6px; font-family: var(--display); font-size: 30px; font-weight: 400; line-height: 1.1; text-transform: uppercase; }
.fz-title span { background: linear-gradient(180deg, #ffffff 0%, #ecfaff 44%, #9edbff 56%, #d6f3ff 100%); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 3px 0 #0a1a6b) drop-shadow(0 0 10px rgba(127, 212, 255, 0.85)); }
.fz-flake { flex: none; width: 18px; height: 18px; background: var(--fz-flake) center / 100% no-repeat; image-rendering: pixelated; animation: fz-spin 6s linear infinite; }
@keyframes fz-spin { to { transform: rotate(360deg); } }
.freeze.is-over .fz-title span { background: linear-gradient(180deg, #fff6c4, var(--gold) 55%, var(--gold-2)); -webkit-background-clip: text; background-clip: text; }
.fz-text { margin: 0 0 12px; font-size: 22px; line-height: 1.2; color: var(--text); overflow-wrap: anywhere; user-select: text; -webkit-user-select: text; }

/* The countdown, in a frosted slab. */
.fz-clock {
  position: relative; display: grid; justify-items: center; width: max-content; max-width: 100%; margin: 0 auto 14px; padding: 5px 22px 8px; border-radius: 12px;
  background: var(--fz-frost-tl) no-repeat 0 0 / 46px 46px, var(--fz-frost-br) no-repeat 100% 100% / 46px 46px, #070d2e;
  box-shadow: inset 0 2px 0 rgba(0, 0, 0, 0.6), inset 0 0 0 1px #4a6bb0, 0 0 0 2px rgba(190, 235, 255, 0.25);
  image-rendering: pixelated;
}
.fz-clock b { font-size: 64px; font-weight: 400; line-height: 0.95; letter-spacing: 0.04em; color: var(--gold); text-shadow: 3px 3px 0 #000; font-variant-numeric: tabular-nums; }
.fz-clock small { font-size: 16px; color: #bcc5ea; }
.freeze.is-final .fz-clock b { color: #ffe9a0; animation: fz-beat 1s ease-out infinite; }
@keyframes fz-beat { 0% { transform: scale(1.12); } 40%, 100% { transform: scale(1); } }
.freeze.is-over .fz-clock b { color: var(--green); }

/* The X raid's bar: a slab of ice melted by molten gold. Stripes run along the gold, its edge glows hot, a crystal sits at
   each quarter and bursts as the gold passes it, and the padlock at the goal springs open. */
.fz-goal { margin: 0 0 14px; text-align: left; }
.fz-bar-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 0 2px 7px; }
.fz-bar-head span { color: var(--rs-orange); font-size: 19px; text-shadow: 2px 2px 0 #000; }
.fz-bar-head b { font-family: var(--display); font-weight: 400; white-space: nowrap; }
.fz-n { font-style: normal; font-size: 26px; line-height: 1; color: #fff; text-shadow: 2px 2px 0 #000; }
.fz-goal:has(.has-fill) .fz-n { color: var(--gold); }
.fz-bar-head b i { font-style: normal; font-size: 16px; color: #bcc5ea; }
.fz-bar { position: relative; height: 30px; margin: 0 18px 0 4px; border-radius: 999px; background: #050a24; box-shadow: 0 0 0 2px #000, 0 0 0 4px var(--gold-2), 0 0 0 6px #000, 0 6px 14px rgba(0, 0, 0, 0.45); }
.fz-track {
  position: absolute; inset: 3px; overflow: hidden; border-radius: inherit;
  background: var(--fz-icetex) 0 0 / 64px 64px, linear-gradient(180deg, #effbff 0%, #b5e3fa 38%, #74bdee 62%, #a6dbf6 100%);
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.75), inset 0 -3px 0 rgba(20, 60, 120, 0.35);
  image-rendering: pixelated;
}
.fz-fill {
  position: absolute; left: 3px; top: 3px; bottom: 3px; width: 0; overflow: hidden; border-radius: 999px;
  background: linear-gradient(180deg, #fff6c4 0%, #ffd23f 30%, #ffa21f 66%, #ee6a12 100%);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.7), inset 0 -3px 0 rgba(140, 50, 0, 0.45), 0 0 14px rgba(255, 170, 40, 0.75);
  transition: width 0.9s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.fz-bar.has-fill .fz-fill { width: max(18px, calc((100% - 6px) * var(--fz-p))); }
.fz-stripes { position: absolute; inset: 0; background: repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.3) 0 7px, transparent 7px 14px); background-size: 19.8px 100%; animation: fz-stripes 0.7s linear infinite; }
@keyframes fz-stripes { to { background-position: 19.8px 0; } }
.fz-edge { position: absolute; top: -7px; bottom: -7px; left: calc(3px + (100% - 6px) * var(--fz-p, 0) - 12px); width: 24px; display: none; background: radial-gradient(closest-side, #fffbe6, rgba(255, 214, 80, 0.85) 45%, rgba(255, 130, 0, 0) 100%); animation: fz-flicker 0.5s steps(3) infinite; transition: left 0.9s cubic-bezier(0.2, 0.9, 0.3, 1); pointer-events: none; }
.fz-bar.has-fill:not(.is-full) .fz-edge { display: block; }
@keyframes fz-flicker { 0% { opacity: 1; transform: scale(1); } 50% { opacity: 0.75; transform: scale(0.85); } 100% { opacity: 1; transform: scale(1.1); } }
.fz-mile { position: absolute; top: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px; background: var(--fz-flake) center / 100% no-repeat; image-rendering: pixelated; filter: drop-shadow(0 1px 0 #0a2a5a); transition: transform 0.45s cubic-bezier(0.2, 1.4, 0.4, 1), opacity 0.45s; }
.fz-mile.is-hit { opacity: 0; transform: scale(2.4) rotate(60deg); }
.fz-lock { position: absolute; right: -22px; top: 50%; width: 27px; height: 39px; margin-top: -23px; background: var(--fz-lock) center / 100% no-repeat; image-rendering: pixelated; filter: drop-shadow(0 2px 0 #000); }
.fz-bar.is-full .fz-lock { background-image: var(--fz-open); animation: fz-hop 0.6s cubic-bezier(0.3, 1.6, 0.5, 1); }
.fz-bar.is-full .fz-fill { animation: fz-flash 0.9s ease-out 2; }
@keyframes fz-flash { 50% { filter: brightness(1.5); } }
.fz-plus { position: absolute; bottom: 100%; left: calc(3px + (100% - 6px) * var(--fz-p, 0)); translate: -50% 0; font-family: var(--display); font-size: 18px; font-weight: 400; color: #fff3b0; text-shadow: 2px 2px 0 #000; opacity: 0; pointer-events: none; white-space: nowrap; }
.fz-plus.is-on { animation: fz-plus 1.4s ease-out; }
@keyframes fz-plus { 0% { opacity: 0; transform: translateY(8px) scale(0.7); } 15% { opacity: 1; transform: translateY(0) scale(1.15); } 100% { opacity: 0; transform: translateY(-22px) scale(1); } }
.fz-hint { margin: 8px 0 0; font-size: 16px; line-height: 1.2; color: #bcc5ea; }

.fz-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.fz-actions .btn { padding: 8px 14px; font-size: 18px; text-decoration: none; }
.fz-by { margin: 10px 0 0; font-size: 15px; color: #8f9bc8; }

/* Folded: a pill with the frozen ZAZA, the countdown and the bar in small. */
.fz-pill {
  position: absolute; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; align-items: center; gap: 9px; max-width: calc(100vw - 24px); padding: 4px 14px 4px 6px;
  border: 2px solid var(--gold); border-radius: 999px; background: linear-gradient(180deg, #1c2b6e, #0e1748); color: #fff; font-size: 18px; white-space: nowrap; pointer-events: auto;
  box-shadow: 0 0 0 2px #000, 0 0 20px rgba(127, 212, 255, 0.6);
}
.fz-pill img { width: 34px; height: 34px; image-rendering: pixelated; border-radius: 50%; background: rgba(120, 190, 245, 0.35); box-shadow: inset 0 0 0 2px #e4f8ff; }
.fz-pill-clock { color: var(--gold); font-size: 26px; line-height: 1; text-shadow: 2px 2px 0 #000; }
.fz-pill-bar { position: relative; width: 74px; height: 12px; overflow: hidden; border-radius: 999px; background: var(--fz-icetex) 0 0 / 64px 64px, linear-gradient(180deg, #effbff, #74bdee); box-shadow: 0 0 0 2px #000; image-rendering: pixelated; }
.fz-pill-bar i { position: absolute; inset: 0 auto 0 0; width: calc(100% * var(--fz-p, 0)); background: linear-gradient(180deg, #fff6c4, #ffd23f 40%, #ee6a12); transition: width 0.9s ease; }
.fz-pill-n { color: #bcc5ea; }
.fz-pill-up { font-style: normal; color: #bcc5ea; }

/* Phones: the card in the room the chat leaves (world.css --mobile-chat-clearance), ZAZA's ice smaller. */
@media (max-width: 760px), (max-height: 560px) {
  .fz-front { padding: max(18px, var(--mobile-panel-top, 8px)) 12px calc(var(--mobile-chat-clearance, 12px) + 26px); }
  .fz-card { padding: 14px 14px 10px; }
  .fz-ice { width: 88px; height: 88px; margin-bottom: 6px; }
  .fz-glass img { width: 68px; height: 68px; }
  .fz-title { font-size: 24px; }
  .fz-flake { width: 14px; height: 14px; }
  .fz-text { margin-bottom: 8px; font-size: 19px; }
  .fz-clock { margin-bottom: 10px; }
  .fz-clock b { font-size: 48px; }
  .fz-clock small { font-size: 15px; }
  .fz-goal { margin-bottom: 10px; }
  .fz-bar { height: 26px; }
  .fz-pill { bottom: var(--mobile-chat-clearance, 12px); }
}
@media (max-height: 430px) { .fz-ice { display: none; } .fz-icicles { height: 24px; background-size: 64px 24px; } }
@media (prefers-reduced-motion: reduce) {
  .fz-snow, .fz-shine, .fz-zaza-ice, .fz-spark, .fz-flake, .fz-stripes, .fz-edge, .freeze.is-final .fz-clock b { animation: none; }
  .freeze.is-in .fz-corner, .freeze.is-in .fz-back, .freeze.is-in .fz-wrap, .freeze.is-in .fz-ice, .fz-ice.is-hit, .fz-bar.is-full .fz-lock, .fz-bar.is-full .fz-fill, .freeze.is-thaw .fz-zaza, .freeze.is-thaw .fz-spark { animation: none; }
  .fz-spark { opacity: 0.8; transform: none; }
  .fz-fill, .fz-edge, .fz-pill-bar i, .fz-mile, .freeze.is-thaw .fz-shard { transition: none; }
}
