/* =========================================================
   🎄 Χριστούγεννα — «Στόλισε το δέντρο» (js/xmastree.js)
   Σκηνή 16:9 σε στρώματα: ουρανός/καιρός → δωμάτιο (εικόνα με τρύπα στο
   παράθυρο) → χρώμα τοίχου (multiply με μάσκα) → δέντρο & στολίδια →
   «σκοτάδι» → φωτάκια/φωτιά. Κινήσεις ΜΟΝΟ με transform/opacity.
   ========================================================= */
.xt-wrap { position: absolute; inset: 0; display: flex; gap: 10px; padding: 10px; user-select: none; -webkit-user-select: none; }
.xt-stagebox { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; }
.xt-scene { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: 18px; overflow: hidden; isolation: isolate; background: #1b2550; box-shadow: 0 6px 22px rgba(0,0,0,.28); touch-action: none; }
.xt-layer { position: absolute; left: 0; top: 0; width: 100%; height: 100%; display: block; }
.xt-sky, .xt-fb, .xt-room, .xt-tint, .xt-dark, .xt-glow { pointer-events: none; }
.xt-tint { mix-blend-mode: multiply; -webkit-mask-size: 100% 100%; mask-size: 100% 100%; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; }
.xt-dark { background: #080c28; opacity: 0; transition: opacity 1.4s ease; }
/* Χωρίς την εικόνα του δωματίου (δεν φόρτωσε): απλός τοίχος με τρύπα παραθύρου + πάτωμα */
.xt-fb { display: none; background: linear-gradient(var(--wall, #f3e2c0) 0 75.4%, var(--floor, #b98552) 75.4%);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 0 0, 9.2% 13.8%, 9.2% 50.8%, 30.4% 50.8%, 30.4% 13.8%, 9.2% 13.8%); }
.xt-scene.noimg .xt-fb { display: block; }
.xt-scene.noimg .xt-room, .xt-scene.noimg .xt-tint { display: none; }

/* ---- Δέντρο & στολίδια ---- */
.xt-main { cursor: default; }
.xt-it, .xt-msg { cursor: grab; }
.xt-it.xt-moving { cursor: grabbing; opacity: .85; }
/* ΟΧΙ σκέτο «.dragging»: το css/style.css το έχει γενικό κανόνα (ξεθωριάζει ό,τι σέρνεται στο μενού) — ξεθώριαζε όλη τη σκηνή */
.xt-wrap.xt-dragging, .xt-wrap.xt-dragging .xt-it, .xt-wrap.xt-dragging .xt-tile { cursor: grabbing; }
.xt-it.sel { filter: drop-shadow(0 0 3px #fff) drop-shadow(0 0 7px #29b6f6); }
.xt-hang .xt-sw { transform-box: fill-box; transform-origin: 50% 0; }
.xt-hang .xt-sw.drop { animation: xtDrop 1.3s ease-out; }
.xt-hang .xt-sw.sway { animation: xtSway 2.6s ease-in-out; }
.xt-rays { animation: xtPulse 1.5s ease-in-out infinite alternate; }
@keyframes xtDrop { 0% { transform: scale(1.3) rotate(0); } 18% { transform: scale(1) rotate(10deg); } 38% { transform: rotate(-7deg); } 58% { transform: rotate(4deg); } 78% { transform: rotate(-2deg); } 100% { transform: rotate(0); } }
@keyframes xtSway { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(5deg); } 60% { transform: rotate(-4deg); } 85% { transform: rotate(1.5deg); } }
@keyframes xtPulse { from { opacity: .25; } to { opacity: 1; } }

/* ---- Ουρανός & καιρός ---- */
.xt-fl { animation: xtFall 5s linear infinite; }
@keyframes xtFall { from { transform: translate(var(--ux), var(--up)); } to { transform: translate(var(--dx), var(--dn)); } }
.xt-st { animation: xtTw 3s ease-in-out infinite alternate; }
@keyframes xtTw { from { opacity: 1; } to { opacity: .25; } }
.xt-sun { transform-box: fill-box; transform-origin: center; animation: xtSpin 50s linear infinite; }
@keyframes xtSpin { to { transform: rotate(360deg); } }
.xt-au { animation: xtAu 5s ease-in-out infinite alternate; }
@keyframes xtAu { from { opacity: .18; transform: translateX(-30px); } to { opacity: .55; transform: translateX(30px); } }
.xt-sleigh { animation: xtSleigh 36s linear infinite; }
@keyframes xtSleigh { 0% { transform: translateX(var(--x0)); } 24%, 100% { transform: translateX(var(--x1)); } }

/* ---- Φωτιά στο τζάκι ---- */
.xt-fire path { transform-box: fill-box; transform-origin: 50% 100%; animation: xtFlame .46s ease-in-out infinite alternate; }
.xt-fire .f2 { animation-duration: .33s; }
.xt-fire .f3 { animation-duration: .27s; }
@keyframes xtFlame { from { transform: scale(1, 1); } to { transform: scale(.9, 1.14); } }

/* ---- Φωτάκια: προγράμματα ---- */
.p-blink .xt-b { animation: xtBlink 1s steps(1) infinite; }
.p-blink .xt-b.odd { animation-delay: -.5s; }
@keyframes xtBlink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: .1; } }
.p-chase .xt-b { animation: xtChase 1.4s linear infinite; animation-delay: calc(var(--i) * -.12s); }
@keyframes xtChase { 0%, 30% { opacity: 1; } 45%, 100% { opacity: .1; } }
.p-fade .xt-b { animation: xtFade 2.4s ease-in-out infinite alternate; }
.p-twinkle .xt-b { animation: xtFade var(--d, 2s) ease-in-out infinite alternate; animation-delay: calc(var(--r, 0s) * -1); }
@keyframes xtFade { from { opacity: 1; } to { opacity: .1; } }
/* «Άναψε το δέντρο»: ανάβουν ένα-ένα από κάτω προς τα πάνω (αργά, να το δει το παιδί) */
.xt-bulbs.seq .xt-b { animation: xtOn .35s ease-out both; animation-delay: calc(1.1s + var(--o) * 40ms); }
@keyframes xtOn { from { opacity: 0; transform: scale(.2); } to { opacity: 1; transform: scale(1); } }

/* ---- Μπάρα πάνω στο επιλεγμένο στολίδι ---- */
.xt-selbar { position: absolute; z-index: 5; display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: rgba(255,255,255,.95); box-shadow: 0 3px 12px rgba(0,0,0,.3); }
.xt-selbar button { width: 34px; height: 34px; border: 0; border-radius: 50%; background: #eef3f8; font-size: 17px; cursor: pointer; padding: 0; }
.xt-selbar button:hover { background: #ffe082; }
.xt-selbar .hidden, .xt-selbar.hidden { display: none; }

/* ---- Δεξιά στήλη: εργαλειοθήκη, καρτέλες, περιεχόμενο ---- */
.xt-panel { width: clamp(292px, 27vw, 400px); flex: none; display: flex; flex-direction: column; gap: 6px; min-height: 0; padding: 8px; border-radius: 18px; background: rgba(255,255,255,.88); box-shadow: 0 4px 14px rgba(0,0,0,.14); color: #263238; }
.xt-bar { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; }
.xt-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-width: 0; padding: 5px 2px; border: 0; border-radius: 12px; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.18); cursor: pointer; font: inherit; color: #263238; }
.xt-btn span { font-size: 20px; line-height: 1.1; }
.xt-btn b { font-size: 10.5px; font-weight: 600; line-height: 1.1; text-align: center; }
.xt-btn:hover { background: #fff8e1; }
.xt-btn.xt-lit { background: linear-gradient(#ffe082, #ffca28); }
.xt-scene.lit ~ * .xt-lit, .xt-wrap:has(.xt-scene.lit) .xt-lit { background: linear-gradient(#b3e5fc, #81d4fa); }
.xt-tabs { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.xt-tab { display: flex; flex-direction: column; align-items: center; gap: 0; min-width: 0; padding: 4px 1px 3px; border: 2px solid transparent; border-radius: 10px; background: #eceff1; cursor: pointer; font: inherit; color: #37474f; }
.xt-tab span { font-size: 19px; line-height: 1.15; }
.xt-tab b { font-size: 9.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.xt-tab:hover { background: #fff8e1; }
.xt-tab.sel { background: #c62828; color: #fff; border-color: #8e1b1b; }
.xt-help { font-size: 12.5px; line-height: 1.25; padding: 5px 8px; border-radius: 9px; background: #e8f5e9; color: #1b5e20; }
.xt-help.hidden { display: none; }
.xt-body { flex: 1; min-height: 0; overflow-y: auto; padding: 2px 3px 4px 1px; }
.xt-body h4 { margin: 8px 0 4px; font-size: 12.5px; font-weight: 700; color: #8e1b1b; }
.xt-body h4:first-child { margin-top: 2px; }
.xt-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.xt-grid.wide { grid-template-columns: repeat(3, 1fr); }
.xt-tile { aspect-ratio: 1; min-width: 0; padding: 3px; border: 2px solid transparent; border-radius: 12px; background: radial-gradient(circle at 50% 35%, #ffffff, #e3ecf4); box-shadow: 0 1px 4px rgba(0,0,0,.16); cursor: grab; touch-action: none; }
.xt-tile svg { width: 100%; height: 100%; display: block; pointer-events: none; }
.xt-tile:hover { border-color: #ffb300; transform: scale(1.06); }
.xt-tile.armed { border-color: #c62828; background: #fff3e0; }
.xt-count, .xt-note { margin: 8px 2px 2px; font-size: 11.5px; color: #607d8b; }
.xt-row { display: flex; flex-wrap: wrap; gap: 6px; }
.xt-col { display: flex; flex-direction: column; gap: 6px; }
.xt-opt { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-width: 0; padding: 6px 10px; border: 2px solid transparent; border-radius: 10px; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.16); cursor: pointer; font: inherit; font-size: 13px; color: #263238; }
.xt-opt:hover { border-color: #ffb300; }
.xt-opt.sel { border-color: #c62828; background: #fff3e0; }
.xt-opt:disabled, .xt-sw-c:disabled { opacity: .4; cursor: default; }
.xt-opt[data-big] { flex-direction: column; gap: 2px; width: calc(33.33% - 4px); padding: 5px 3px; }
.xt-opt[data-big] svg { width: 100%; height: 58px; }
.xt-opt[data-big] img { width: 100%; aspect-ratio: 16 / 9; border-radius: 6px; display: block; object-fit: cover; }
.xt-opt[data-big] b { font-size: 11px; font-weight: 600; line-height: 1.15; text-align: center; }
.xt-opt[data-room] { width: calc(50% - 3px); }
.xt-opt .e { font-size: 26px; line-height: 1.1; }
.xt-col .xt-opt { justify-content: flex-start; }
.xt-sw-c { width: 32px; height: 32px; padding: 0; border-radius: 50%; border: 3px solid #fff; background: var(--c); box-shadow: 0 0 0 1px #b0bec5; cursor: pointer; }
.xt-sw-c.sel { box-shadow: 0 0 0 3px #c62828; }
.xt-dots { display: inline-flex; gap: 3px; }
.xt-dots i { width: 12px; height: 12px; border-radius: 50%; box-shadow: 0 0 0 1px rgba(0,0,0,.2); }
.xt-text { width: 100%; box-sizing: border-box; margin-bottom: 6px; padding: 8px 10px; border: 2px solid #b0bec5; border-radius: 10px; font: inherit; font-size: 15px; user-select: text; -webkit-user-select: text; }
.xt-text:focus { outline: none; border-color: #c62828; }

/* «Μόνο η σκηνή»: οι καρτέλες κρύβονται, η εργαλειοθήκη αιωρείται πάνω αριστερά */
.xt-wrap.full .xt-panel { position: absolute; left: 22px; top: 22px; width: auto; z-index: 6; padding: 5px; background: rgba(255,255,255,.8); }
.xt-wrap.full .xt-tabs, .xt-wrap.full .xt-help, .xt-wrap.full .xt-body { display: none; }
.xt-wrap.full .xt-bar { grid-template-columns: repeat(5, 64px); }

/* Το στολίδι που σέρνεται από την καρτέλα */
.xt-ghost { position: fixed; left: 0; top: 0; z-index: 9999; pointer-events: none; filter: drop-shadow(0 6px 8px rgba(0,0,0,.35)); will-change: transform; }
.xt-ghost svg { width: 100%; height: 100%; display: block; overflow: visible; }

/* Θέμα Lite: χωρίς κινήσεις — μένουν μόνο τα φωτάκια */
html.th-lite .xt-fl, html.th-lite .xt-st, html.th-lite .xt-sun, html.th-lite .xt-au, html.th-lite .xt-fire path, html.th-lite .xt-rays, html.th-lite .xt-sw { animation: none !important; }
html.th-lite .xt-sleigh { display: none; }
html.th-lite .xt-dark { transition: none; }
html.th-lite .xt-tile:hover { transform: none; }

@media (max-height: 700px) {
  .xt-btn span { font-size: 17px; } .xt-tab span { font-size: 16px; } .xt-opt[data-big] svg { height: 46px; }
}

/* Πρώτη φορά (21/11/2026): οι καρτέλες «κυματίζουν» μία-μία · 👆 σέρνει μια μπάλα στο δέντρο (js: tabsWave / dragDemo) */
.xt-tabs.tour .xt-tab { animation: xtTabWave .7s ease-in-out calc(var(--i, 0) * .13s) both; }
@keyframes xtTabWave { 45% { transform: translateY(-6px) scale(1.14); background: #fff3c4; box-shadow: 0 0 0 3px #ffd54f; } }
.xt-demo { position: fixed; left: 0; top: 0; z-index: 9999; pointer-events: none; opacity: 0; }
.xt-demo i { position: absolute; left: -36px; top: -36px; width: 72px; height: 72px; filter: drop-shadow(0 4px 6px rgba(0,0,0,.35)); }
.xt-demo i svg { width: 100%; height: 100%; display: block; }
.xt-demo b { position: absolute; left: 6px; top: 4px; font-size: 38px; line-height: 1; filter: drop-shadow(0 2px 2px rgba(0,0,0,.35)); }
html.th-lite .xt-tabs.tour .xt-tab { animation: none; }
