/* ============================================================
   Christmas theme — scoped to body.christmas, the same way
   halloween.css scoped the Halloween look (body.halloween).
   Loaded after styles.css on index.html, dukkan.html, rozetler.html
   and pluslar.html so it overrides the red look. Swap the class +
   stylesheet on those pages to change season; halloween.css is kept.
   ============================================================ */

body.christmas {
    background:
        radial-gradient(900px 520px at 50% -10%, rgba(255, 236, 190, 0.18), transparent 60%),
        radial-gradient(1200px 700px at 50% 120%, rgba(60, 120, 200, 0.28), transparent 70%),
        linear-gradient(170deg, #0b1d3a 0%, #122a52 45%, #0a1731 100%);
    color: #f4f7ff;
}

/* ---- Frame: deep night blue with a snowy cap --------------------------- */
body.christmas .frame {
    border: 10px solid #c8102e;
    border-radius: 14px;
    background:
        radial-gradient(700px 360px at 50% 0%, rgba(255, 240, 200, 0.10), transparent 65%),
        linear-gradient(180deg, rgba(18, 42, 82, 0.55), rgba(8, 20, 44, 0.78));
    box-shadow:
        0 0 0 4px #f6fbff,
        0 0 0 8px #1f6b3a,
        0 0 40px rgba(255, 255, 255, 0.18),
        inset 0 0 70px rgba(4, 10, 24, 0.8);
    overflow: hidden;
    padding-bottom: 80px; /* the snow drift sits in the bottom 46 px — keep page content above it */
}
/* snow piled on the top edge of the frame */
body.christmas .frame::before {
    content: "";
    position: absolute;
    left: -12px; right: -12px; top: -14px;
    height: 34px;
    background: url("assets/christmas/snowcap.svg") repeat-x center top / 220px 34px;
    z-index: 3;
    pointer-events: none;
}

/* ---- Decoration layer ------------------------------------------------ */
body.christmas .xm-decor,
body.christmas .xm-decor * { pointer-events: none; }
body.christmas .xm-decor {
    position: absolute;
    inset: 0;
    z-index: 1;
    overflow: hidden;
}

/* String of fairy lights along the top */
body.christmas .xm-lights {
    position: absolute;
    top: 14px; left: 0; right: 0;
    height: 40px;
    background: url("assets/christmas/lights.svg") repeat-x center top / 260px 40px;
    animation: xm-twinkle 1.6s steps(2) infinite;
}
@keyframes xm-twinkle {
    0%, 100% { filter: brightness(1); }
    50%      { filter: brightness(1.35) saturate(1.2); }
}

/* Falling snow: a handful of ❄ characters at different sizes, speeds and lanes */
body.christmas .xm-flake {
    position: absolute;
    top: -40px;
    color: #ffffff;
    font-size: 18px;
    opacity: 0.85;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.7);
    animation: xm-fall linear infinite;
}
body.christmas .xm-flake::before { content: "\2744"; }
body.christmas .xm-flake:nth-child(3n)   { font-size: 26px; opacity: 0.95; }
body.christmas .xm-flake:nth-child(3n+1) { font-size: 14px; opacity: 0.7; }
body.christmas .xm-flake--1  { left: 4%;  animation-duration: 11s; animation-delay: -2s; }
body.christmas .xm-flake--2  { left: 11%; animation-duration: 14s; animation-delay: -7s; }
body.christmas .xm-flake--3  { left: 19%; animation-duration: 9s;  animation-delay: -4s; }
body.christmas .xm-flake--4  { left: 27%; animation-duration: 13s; animation-delay: -9s; }
body.christmas .xm-flake--5  { left: 34%; animation-duration: 10s; animation-delay: -1s; }
body.christmas .xm-flake--6  { left: 42%; animation-duration: 15s; animation-delay: -6s; }
body.christmas .xm-flake--7  { left: 49%; animation-duration: 12s; animation-delay: -3s; }
body.christmas .xm-flake--8  { left: 57%; animation-duration: 9.5s; animation-delay: -8s; }
body.christmas .xm-flake--9  { left: 64%; animation-duration: 13.5s; animation-delay: -5s; }
body.christmas .xm-flake--10 { left: 72%; animation-duration: 10.5s; animation-delay: -10s; }
body.christmas .xm-flake--11 { left: 80%; animation-duration: 12.5s; animation-delay: -2.5s; }
body.christmas .xm-flake--12 { left: 88%; animation-duration: 11.5s; animation-delay: -6.5s; }
body.christmas .xm-flake--13 { left: 95%; animation-duration: 14.5s; animation-delay: -1.5s; }
body.christmas .xm-flake--14 { left: 15%; animation-duration: 16s; animation-delay: -12s; }
body.christmas .xm-flake--15 { left: 60%; animation-duration: 17s; animation-delay: -11s; }
body.christmas .xm-flake--16 { left: 38%; animation-duration: 15.5s; animation-delay: -13s; }
@keyframes xm-fall {
    0%   { transform: translate3d(0, 0, 0) rotate(0deg); }
    50%  { transform: translate3d(14px, 50vh, 0) rotate(180deg); }
    100% { transform: translate3d(-10px, 105vh, 0) rotate(360deg); }
}

/* Big corner pieces: a tree, a snowman, presents (emoji — no assets needed) */
body.christmas .xm-tree,
body.christmas .xm-snowman,
body.christmas .xm-gifts {
    position: absolute;
    bottom: 6px;
    line-height: 1;
    filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.5));
}
body.christmas .xm-tree::before    { content: "\1F384"; }
body.christmas .xm-snowman::before { content: "\26C4"; }
body.christmas .xm-gifts::before   { content: "\1F381\1F381"; letter-spacing: -0.35em; }
body.christmas .xm-tree    { left: 14px;  font-size: 120px; animation: xm-sway 5s ease-in-out infinite; }
body.christmas .xm-gifts   { left: 150px; bottom: 10px; font-size: 54px; }
body.christmas .xm-snowman { right: 18px; font-size: 100px; animation: xm-bob 4s ease-in-out infinite; }
@keyframes xm-sway {
    0%, 100% { transform: rotate(-1.5deg); }
    50%      { transform: rotate(1.5deg); }
}
@keyframes xm-bob {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-6px); }
}

/* A snow drift along the bottom of the frame */
body.christmas .xm-drift {
    position: absolute;
    left: -20px; right: -20px; bottom: -8px;
    height: 46px;
    background: url("assets/christmas/snowcap.svg") repeat-x center bottom / 300px 46px;
    transform: scaleY(-1);
    opacity: 0.95;
}

/* ---- Keep interactive content above the decoration layer ------------- */
body.christmas header,
body.christmas main { position: relative; z-index: 2; }

/* ---- Title ----------------------------------------------------------- */
body.christmas header h1 {
    font-family: "Mountains of Christmas", Georgia, serif;
    font-weight: 700;
    font-size: 3.4rem;
    letter-spacing: 2px;
    color: #ffe9a8;
    text-shadow:
        0 0 6px #0a1731,
        0 0 14px rgba(255, 220, 140, 0.55),
        0 3px 0 #b3101f,
        2px 5px 0 #6a0a16;
}

/* ---- Book buttons: wrapped presents ---------------------------------- */
body.christmas .book-button {
    color: #fff8ec;
    background:
        linear-gradient(90deg, transparent 44%, rgba(255, 240, 200, 0.55) 44%, rgba(255, 240, 200, 0.55) 56%, transparent 56%),
        linear-gradient(160deg, #e8303f 0%, #c8102e 55%, #9c0a22 100%);
    border: 4px solid #1f6b3a;
    box-shadow:
        0 6px 0 #0f4a26,
        0 0 22px rgba(255, 230, 160, 0.25),
        inset 0 2px 8px rgba(255, 240, 220, 0.35);
    text-shadow: 0 2px 0 rgba(0, 0, 0, 0.35);
    letter-spacing: 1px;
}
body.christmas .book-button:not(.disabled):hover {
    background:
        linear-gradient(90deg, transparent 44%, rgba(255, 240, 200, 0.7) 44%, rgba(255, 240, 200, 0.7) 56%, transparent 56%),
        linear-gradient(160deg, #ff4a58 0%, #d8183a 55%, #ad0d28 100%);
    transform: translateY(-2px);
}
body.christmas .book-button:not(.disabled):active {
    transform: translateY(3px);
    box-shadow: 0 2px 0 #0f4a26, inset 0 2px 8px rgba(255, 240, 220, 0.35);
}
/* Locked books: frosted windows */
body.christmas .book-button.disabled {
    color: #d9e8ff;
    background:
        radial-gradient(60px 80px at 50% 40%, rgba(255, 255, 255, 0.14), transparent 70%),
        rgba(40, 70, 120, 0.45);
    border: 3px dashed #7fa6d8;
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.35);
    text-shadow: 0 0 12px rgba(220, 235, 255, 0.7);
}

/* ---- Corner buttons + game badges ------------------------------------ */
body.christmas .achievements-button {
    background: linear-gradient(135deg, #1f8f4a, #0f5a2c);
    border-color: #ffe9a8;
    color: #fff8ec;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5), 0 0 16px rgba(60, 200, 110, 0.35);
}
body.christmas .achievements-button:hover { background: linear-gradient(135deg, #27a658, #166b36); }

body.christmas .shop-button {
    background: linear-gradient(135deg, #e8303f, #b00d26);
    border-color: #ffe9a8;
    color: #fff8ec;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5), 0 0 16px rgba(232, 48, 63, 0.4);
}
body.christmas .shop-button:hover { background: linear-gradient(135deg, #ff4a58, #c8102e); }

/* the Peluşlar (plushes) button under the shop one */
body.christmas .plush-button {
    background: linear-gradient(135deg, #ffd93d, #e8a200);
    border-color: #fff8ec;
    color: #3a2300;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5), 0 0 16px rgba(255, 217, 61, 0.45);
}
body.christmas .plush-button:hover { background: linear-gradient(135deg, #ffe36b, #f0b000); }

body.christmas .game-badge {
    background: linear-gradient(135deg, #ffd93d, #ff8c2b);
    border-color: #1f6b3a;
    color: #2a1700;
}
body.christmas .game-badge--new {
    background: linear-gradient(135deg, #8ef27a, #2ec46b);
    color: #0b2a14;
}

/* ============================================================
   Sub-pages — back button, badges, shop, plushes
   ============================================================ */
body.christmas .back-button {
    background: linear-gradient(160deg, #e8303f 0%, #c8102e 55%, #9c0a22 100%);
    color: #fff8ec;
    border: 4px solid #1f6b3a;
    box-shadow: 0 4px 0 #0f4a26, 0 0 18px rgba(255, 230, 160, 0.25);
}
body.christmas .back-button:hover { transform: translateY(-2px); }

body.christmas .book-text { color: #f4f7ff; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55); }
body.christmas .book-cover img { border-color: #c8102e; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5), 0 0 26px rgba(255, 255, 255, 0.15); }

/* rozetler */
body.christmas .achievement-row {
    background: linear-gradient(180deg, rgba(22, 52, 96, 0.78), rgba(10, 26, 52, 0.86));
    border-color: #c8102e;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4), inset 0 0 24px rgba(255, 255, 255, 0.04);
}
body.christmas .achievement-row.locked { background: rgba(26, 44, 78, 0.5); border-color: #5d7fb0; border-style: dashed; }
body.christmas .achievement-name { color: #ffe9a8; text-shadow: 0 0 10px rgba(255, 233, 168, 0.35); }
body.christmas .achievement-row.locked .achievement-name { color: #9fb6da; }
body.christmas .achievement-desc { color: #e6eeff; }
body.christmas .achievement-icon--placeholder { background-color: rgba(8, 20, 44, 0.6); border-color: #5d7fb0; color: #c9d8f0; }
body.christmas .achievement-empty { color: #b7c8e6; }
body.christmas .achievement-progress {
    background: linear-gradient(180deg, rgba(22, 52, 96, 0.78), rgba(10, 26, 52, 0.9));
    border-color: #c8102e;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4), 0 0 22px rgba(255, 255, 255, 0.08);
}
body.christmas .achievement-progress-head { color: #ffe9a8; }
body.christmas .achievement-progress-track { background-color: rgba(8, 20, 44, 0.7); border-color: #5d7fb0; }
body.christmas .achievement-progress-fill { background: linear-gradient(90deg, #2ec46b, #1f8f4a); box-shadow: 0 0 12px rgba(46, 196, 107, 0.6); }
body.christmas .achievement-section { color: #ffd93d; text-shadow: 0 0 10px rgba(255, 217, 61, 0.35); }
body.christmas .achievement-section-empty { color: #9fb6da; }
body.christmas .achievement-secret-mark {
    background: radial-gradient(circle at 35% 30%, #8fb8ff, #2b4f8a 70%);
    border-color: #c8102e;
    box-shadow: 0 0 14px rgba(143, 184, 255, 0.5);
}

/* dukkan */
body.christmas .balance-card {
    background: linear-gradient(180deg, rgba(22, 52, 96, 0.78), rgba(10, 26, 52, 0.9));
    border-color: #c8102e;
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.5), 0 0 22px rgba(255, 255, 255, 0.08);
    color: #fff3dc;
}
body.christmas .balance-value { color: #ffd93d; text-shadow: 0 0 12px rgba(255, 217, 61, 0.45); }
body.christmas .shop-heading { color: #ffe9a8; letter-spacing: 1px; text-shadow: 0 0 10px rgba(255, 233, 168, 0.35); }
body.christmas .shop-item {
    background: linear-gradient(180deg, rgba(22, 52, 96, 0.78), rgba(10, 26, 52, 0.9));
    border-color: #c8102e;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45), inset 0 0 26px rgba(255, 255, 255, 0.04);
}
body.christmas .shop-item-media { background: #fffdf7; border-right: 3px solid #c8102e; }
body.christmas .shop-item-name { color: #ffe9a8; }
body.christmas .shop-item-desc { color: #e6eeff; }
body.christmas .shop-item-price { color: #ffd93d; }
body.christmas .buy-button {
    background: linear-gradient(160deg, #2ec46b, #1f8f4a);
    color: #fff8ec;
    border-color: #0f4a26;
    box-shadow: 0 4px 0 #0f4a26, 0 0 16px rgba(46, 196, 107, 0.35);
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.3);
}
body.christmas .buy-button:hover:not(:disabled) { background: linear-gradient(160deg, #3dd67c, #27a658); transform: translateY(-2px); }
body.christmas .buy-button:disabled { background: rgba(40, 70, 120, 0.6); color: #d9e8ff; border-color: #5d7fb0; box-shadow: none; text-shadow: none; }
body.christmas .shop-item.owned { border-color: #ffd93d; }
body.christmas .buy-feedback.error { color: #ff8a8a; }
body.christmas .buy-feedback.ok { color: #8ef27a; }

/* pluslar — the plush cabinet */
body.christmas .plush-shelf,
body.christmas .plush-detail {
    background: linear-gradient(180deg, rgba(22, 52, 96, 0.78), rgba(10, 26, 52, 0.9));
    border-color: #c8102e;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45), inset 0 0 26px rgba(255, 255, 255, 0.04);
}
body.christmas .plush-shelf-title,
body.christmas .plush-detail-name { color: #ffe9a8; text-shadow: 0 0 10px rgba(255, 233, 168, 0.35); }
body.christmas .plush-tile { background: #fffdf7; border-color: #c8102e; }
body.christmas .plush-tile.selected { border-color: #ffd93d; box-shadow: 0 0 0 3px rgba(255, 217, 61, 0.45), 0 0 18px rgba(255, 217, 61, 0.5); }
body.christmas .plush-tile.equipped::after { background: #1f8f4a; color: #fff; }
body.christmas .plush-tile-name { color: #2a1700; }
body.christmas .plush-detail-media { background: #fffdf7; border-color: #c8102e; }
body.christmas .plush-detail-desc { color: #e6eeff; }
body.christmas .plush-detail-effect { color: #ffd93d; }
body.christmas .plush-empty, body.christmas .plush-detail-hint { color: #b7c8e6; }
body.christmas .equip-button {
    background: linear-gradient(160deg, #2ec46b, #1f8f4a);
    color: #fff8ec;
    border-color: #0f4a26;
    box-shadow: 0 4px 0 #0f4a26, 0 0 16px rgba(46, 196, 107, 0.35);
}
body.christmas .equip-button:hover { background: linear-gradient(160deg, #3dd67c, #27a658); transform: translateY(-2px); }
body.christmas .equip-button.on {
    background: linear-gradient(160deg, #e8303f, #b00d26);
    border-color: #6a0a16;
    box-shadow: 0 4px 0 #6a0a16, 0 0 16px rgba(232, 48, 63, 0.35);
}

@media (max-width: 768px) {
    body.christmas .shop-item-media { border-right: none; border-bottom: 3px solid #c8102e; }
    body.christmas header h1 { font-size: 2.5rem; }
    body.christmas .xm-tree { font-size: 72px; }
    body.christmas .xm-snowman { font-size: 60px; }
    body.christmas .xm-gifts { left: 96px; font-size: 36px; }
    body.christmas .xm-flake:nth-child(2n) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    body.christmas .xm-flake,
    body.christmas .xm-tree,
    body.christmas .xm-snowman,
    body.christmas .xm-lights { animation: none; }
}

/* skins picker */
body.christmas .skins-button { background: transparent; color: #ffe9a8; border-color: #ffe9a8; }
body.christmas .skins-button:hover { background: rgba(255, 233, 168, 0.12); }
body.christmas .skin-modal-card { background: linear-gradient(180deg, rgba(22, 52, 96, 0.98), rgba(10, 26, 52, 0.98)); border-color: #c8102e; color: #f4f7ff; }
body.christmas .skin-modal-head h2 { color: #ffe9a8; }
body.christmas .skin-modal-close { background: rgba(255, 255, 255, 0.08); color: #ffe9a8; border-color: #ffe9a8; }
body.christmas .skin-modal-hint { color: #b7c8e6; }
body.christmas .skin-tile { background: #fffdf7; border-color: #c8102e; color: #2a1700; }
body.christmas .skin-tile.selected { border-color: #ffd93d; box-shadow: 0 0 0 3px rgba(255, 217, 61, 0.45), 0 0 18px rgba(255, 217, 61, 0.5); }
body.christmas .skin-tile-lock { color: #8b0a1f; }
body.christmas .skin-shop-button { background: linear-gradient(135deg, #ffd93d, #e8a200); color: #3a2300; border-color: #fff8ec; box-shadow: 0 4px 14px rgba(0,0,0,0.4); }
body.christmas .skin-shop-button:hover { background: linear-gradient(135deg, #ffe36b, #f0b000); }
body.christmas .skin-shop-plush { color: #ffe9a8; }
body.christmas .skin-shop-empty { color: #b7c8e6; }
