/* FROZEN cards: snow-and-ice look. js/ui.js adds class "frozen", a .frost-layer inside the front
   and the FROZEN tag. The card keeps its normal rarity-coloured frame and original artwork box;
   the ice is only a cool tint, frost creeping in from the corners, thin cracks and
   a few drifting snow specks. The centre stays clear and the top badge row is lifted above the
   frost, so the Difficulty and Rarity badges are always fully visible. */

.card.frozen .card-front {
  background:
    radial-gradient(circle at 50% 0%, rgba(225, 248, 255, 0.28), transparent 62%) padding-box,
    linear-gradient(#1c3a5e, #0f2440) padding-box,
    linear-gradient(145deg, color-mix(in srgb, var(--rc) 80%, #bfeaff), color-mix(in srgb, var(--rc) 35%, #0b2038)) border-box;
  animation: frozen-glow 4.5s ease-in-out infinite alternate;
}
@keyframes frozen-glow {
  from { box-shadow: 0 0 8px 1px rgba(150, 220, 255, 0.35), 0 12px 26px rgba(0, 0, 0, 0.45); }
  to   { box-shadow: 0 0 18px 4px rgba(190, 238, 255, 0.6), 0 12px 26px rgba(0, 0, 0, 0.45); }
}

/* the art box keeps its own colours; a cold rim and a pale top sheen make it look iced over */
.card.frozen .card-art {
  box-shadow: inset 0 0 0 2px rgba(205, 240, 255, 0.55), inset 0 10px 18px rgba(235, 250, 255, 0.22), inset 0 -16px 26px rgba(40, 110, 170, 0.3);
}
.card.frozen .card-odds { color: #cdefff; }
.card.frozen .card-desc { color: rgba(225, 245, 255, 0.8); }
.card.frozen .card-name { text-shadow: 0 0 8px rgba(160, 225, 255, 0.55); }

/* keep the Difficulty + Rarity badges above every ice layer */
.card.frozen .card-top { position: relative; z-index: 5; }
.card.frozen .badge-rarity { box-shadow: 0 0 0 2px rgba(235, 250, 255, 0.85), 0 0 10px var(--rc); }
.card.frozen .badge-diff { box-shadow: 0 0 8px rgba(190, 236, 255, 0.6); }

/* frost layer: corner frost, ice cracks, snow specks. Centre is left clear. */
.frost-layer {
  position: absolute; inset: 0; z-index: 2; border-radius: 11px; pointer-events: none; overflow: hidden;
  background:
    /* frost creeping in from the corners */
    radial-gradient(ellipse at 0 0, rgba(235, 250, 255, 0.55), transparent 42%),
    radial-gradient(ellipse at 100% 0, rgba(235, 250, 255, 0.4), transparent 36%),
    radial-gradient(ellipse at 0 100%, rgba(225, 245, 255, 0.5), transparent 40%),
    radial-gradient(ellipse at 100% 100%, rgba(235, 250, 255, 0.6), transparent 44%),
    /* icy blue wash */
    linear-gradient(rgba(150, 215, 255, 0.1), rgba(100, 180, 240, 0.1)),
    /* thin ice cracks */
    linear-gradient(62deg, transparent 46%, rgba(235, 250, 255, 0.35) 46.6%, transparent 47.6%) 0 0 / 55% 30% no-repeat,
    linear-gradient(-28deg, transparent 50%, rgba(235, 250, 255, 0.3) 50.6%, transparent 51.6%) 100% 85% / 45% 26% no-repeat,
    /* fine frosted grain */
    repeating-linear-gradient(35deg, transparent 0 9px, rgba(255, 255, 255, 0.05) 9px 10px);
  box-shadow: inset 0 0 0 1px rgba(225, 247, 255, 0.35), inset 0 0 18px 2px rgba(150, 215, 255, 0.4);
}
/* a few snow specks that drift down slowly */
.frost-layer::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background:
    radial-gradient(circle at 18% 12%, rgba(255, 255, 255, 0.85) 0 1.6px, transparent 2.6px),
    radial-gradient(circle at 78% 22%, rgba(255, 255, 255, 0.75) 0 1.4px, transparent 2.4px),
    radial-gradient(circle at 32% 58%, rgba(255, 255, 255, 0.7) 0 1.5px, transparent 2.5px),
    radial-gradient(circle at 88% 64%, rgba(255, 255, 255, 0.8) 0 1.8px, transparent 2.8px),
    radial-gradient(circle at 56% 88%, rgba(255, 255, 255, 0.75) 0 1.4px, transparent 2.4px),
    radial-gradient(circle at 8% 78%, rgba(255, 255, 255, 0.7) 0 1.6px, transparent 2.6px);
  animation: frozen-snow 6s ease-in-out infinite alternate;
}
@keyframes frozen-snow { from { transform: translateY(-5px); opacity: 0.45; } to { transform: translateY(6px); opacity: 0.95; } }

.tag-frozen { top: 6px; right: 6px; background: linear-gradient(90deg, #3f86c4, #e9f8ff 60%, #a8defa); color: #0d2a47; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6); }
.flash.flash-frozen { background: radial-gradient(circle at 50% 45%, #fff 0, rgba(150, 215, 255, 0.65) 28%, transparent 72%); }
.vi-frozen { color: #8fd8ff; }
.coll-bar.frozen-mode .progress-fill { background: linear-gradient(90deg, #3f86c4, #e9f8ff); }
.coll-bar.frozen-mode .coll-text b { color: #bfeaff; }
.sell-row.is-frozen { background: linear-gradient(90deg, rgba(140, 205, 245, 0.22), rgba(0, 0, 0, 0.22)); }

@media (prefers-reduced-motion: reduce) {
  .card.frozen .card-front, .frost-layer::after { animation: none; }
}
