/* Árvore da Sorte - overlay da sala, 40% da altura; escopo isolado. */
:root{--lt-top-desktop:-150px;--lt-top-mobile: -8px}
.lt-layer[hidden],.lt-dialog[hidden]{display:none!important}
.lt-layer{position:fixed;inset:0;z-index:10550;pointer-events:none;font-family:system-ui,-apple-system,Arial,sans-serif}
.lt-game{position:absolute;left:0;bottom:0;width:100%;height:40vh;height:40dvh;min-height:0;display:flex;flex-direction:column;overflow:hidden;isolation:isolate;pointer-events:auto;color:#fff;background:linear-gradient(to bottom,rgba(124,23,191,0) 0%,rgba(140,29,203,.12) 20%,rgba(146,31,212,.38) 46%,rgba(132,23,202,.77) 74%,#7813bb 100%)}
.lt-terrain{position:absolute;left:0;bottom:0;width:100%;height:50%;object-fit:fill;z-index:0;pointer-events:none;user-select:none}
.lt-game-top{position:relative;z-index:5;height:36px;flex:0 0 36px;padding:5px 9px;display:flex;justify-content:space-between;align-items:center;gap:5px}
.lt-game-top button{background:#fffde9e8;color:#69318d;border:1px solid #ffffffcc;border-radius:16px;padding:5px 10px;font-size:11px;font-weight:700;white-space:nowrap;cursor:pointer}
.lt-game-top .lt-exit{background:#8a29b9;color:white;font-size:18px;min-width:32px;padding:1px 7px}
.lt-tree-area{position:relative;z-index:2;flex:1 1 auto;min-height:0;display:flex;align-items:flex-end;justify-content:center;overflow:visible}
.lt-tree-holder{position:relative;z-index:3;flex:0 1 auto;width:min(55vw,220px);height:100%;max-height:220px;top:var(--lt-top-desktop);transform-origin:center bottom;display:flex;align-items:center;justify-content:center;will-change:transform}
.lt-tree-holder .lt-tree,.lt-tree-holder .lt-tree-png{width:100%;height:100%;object-fit:contain}
.lt-tree-png{position:absolute;inset:0;z-index:1}
.lt-tree-holder.has-png .lt-tree-fallback{visibility:hidden}
.lt-tree-holder.shake{animation:lt-sway 1.05s ease-in-out both}
@keyframes lt-sway{0%,100%{transform:rotate(0)}14%{transform:rotate(-6deg)}29%{transform:rotate(6deg)}43%{transform:rotate(-5deg)}57%{transform:rotate(5deg)}72%{transform:rotate(-3deg)}85%{transform:rotate(2deg)}}
.lt-actions{position:relative;z-index:4;flex:0 0 auto;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:5px;padding:3px 6px 6px}
.lt-actions button{position:relative;isolation:isolate;display:flex;align-items:center;justify-content:center;width:100%;min-width:0;height:38px;min-height:0;padding:0;border:0;border-radius:0;box-shadow:none;background:#60294c;color:#592646;text-shadow:none;cursor:pointer;touch-action:manipulation;clip-path:polygon(12% 0,88% 0,88% 8%,94% 8%,94% 16%,100% 16%,100% 84%,94% 84%,94% 92%,88% 92%,88% 100%,12% 100%,12% 92%,6% 92%,6% 84%,0 84%,0 16%,6% 16%,6% 8%,12% 8%)}
.lt-actions button::before{content:"";position:absolute;inset:3px;z-index:0;background:linear-gradient(to bottom,#55d6d1 0%,#55d6d1 15%,#059fda 15%,#059fda 77%,#0871b8 77%,#0871b8 100%);clip-path:inherit;pointer-events:none}
.lt-actions button::after{content:"";position:absolute;z-index:1;top:7px;left:13%;width:13px;height:4px;background:#fff;box-shadow:-4px 4px 0 #fff;pointer-events:none}
.lt-actions strong{position:relative;z-index:2;font-family:monospace;font-size:17px;font-weight:900;line-height:1;letter-spacing:-.5px;color:#592646}
.lt-actions button:active{transform:translateY(2px);filter:brightness(1.12)}.lt-actions button:disabled{opacity:.55;cursor:not-allowed}
.lt-bottom{position:relative;z-index:5;flex:0 0 auto;min-height:45px;display:flex;align-items:center;justify-content:space-between;gap:8px;padding:7px 12px;background:rgba(117,22,185,.92);color:#fff;font-size:11px}
.lt-bottom label,.lt-bottom span{white-space:nowrap}.lt-bottom input{accent-color:#ffcb4c;vertical-align:middle}
.lt-notice{position:absolute;z-index:6;top:18%;left:5%;width:90%;margin:auto;background:#fff9ec;color:#6c298f;border:1px solid #e5baff;border-radius:14px;padding:8px 10px;font-size:12px;font-weight:700;text-align:center;opacity:0;pointer-events:none;transition:opacity .2s}
.lt-notice.visible{opacity:1}
/* lt-modals-responsive-v1 */
/* Janelas de Regras, Histórico e Ranking: leitura clara sobre fundo escuro. */
#lucky-tree-dialog.lt-dialog{
  box-sizing:border-box;
  width:min(94vw,520px);
  max-width:520px;
  max-height:78vh;
  max-height:78dvh;
  padding:16px 14px 14px;
  border:1px solid #654381;
  border-radius:20px;
  background:#17121f;
  color:#f7f3ff;
  box-shadow:0 18px 65px #100817bb;
  font:13px system-ui,-apple-system,Arial,sans-serif;
  overflow:hidden;
}
#lucky-tree-dialog::backdrop{background:#090312c9}
#lucky-tree-dialog .lt-modal-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:12px}
#lucky-tree-dialog #lt-modal-title{margin:0;color:#fff;font-size:18px;line-height:1.35;font-weight:800;min-width:0}
#lucky-tree-dialog #lt-modal-close{display:grid;place-items:center;flex:none;width:36px;height:36px;border:1px solid #7e638f;border-radius:50%;background:#392b46;color:#fff;font-size:22px;font-weight:700;cursor:pointer}
#lucky-tree-dialog #lt-modal-body{color:#f7f3ff;max-height:calc(78dvh - 92px);overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#8e70a8 transparent;padding:1px 1px 6px}
#lucky-tree-dialog #lt-modal-body p,#lucky-tree-dialog #lt-modal-body span,#lucky-tree-dialog #lt-modal-body strong,#lucky-tree-dialog #lt-modal-body small{color:inherit}
#lucky-tree-dialog .lt-muted,#lucky-tree-dialog .lt-rules-note{color:#d8c9e6}
#lucky-tree-dialog .lt-modal-empty{color:#e7dced;text-align:center;padding:22px 10px}
#lucky-tree-dialog .lt-item{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:9px 0;border-bottom:1px solid #574463;color:#fff}
#lucky-tree-dialog .lt-rewards{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px;margin:10px 0}
#lucky-tree-dialog .lt-reward{display:flex;flex-direction:column;align-items:center;gap:3px;min-width:0;border:1px solid #77518e;background:#2b2039;border-radius:12px;padding:8px 3px;color:#fff}
#lucky-tree-dialog .lt-reward strong{font-size:17px;color:#fff}
#lucky-tree-dialog .lt-reward img{width:50px;height:50px;object-fit:contain}
#lucky-tree-dialog .lt-reward small{text-align:center;font-size:10px;overflow-wrap:anywhere;color:#fff}
#lucky-tree-dialog .lt-fallback{font-size:33px}
/* REGRAS: 4 presentes por linha; 9 itens = 4+4+1. */
#lucky-tree-dialog .lt-rules-intro{font-size:12px;line-height:1.5;margin:2px 2px 12px;color:#f4eafa}
#lucky-tree-dialog .lt-rule-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;align-items:stretch}
#lucky-tree-dialog .lt-rule-card{min-width:0;display:flex;flex-direction:column;align-items:center;justify-content:flex-start;gap:3px;padding:8px 3px 7px;border:1px solid #684780;border-radius:11px;background:linear-gradient(165deg,#382348,#21182d);color:#fff;text-align:center}
#lucky-tree-dialog .lt-rule-icon{height:41px;width:100%;display:flex;align-items:center;justify-content:center;font-size:30px;line-height:1}
#lucky-tree-dialog .lt-rule-icon img{width:39px;height:39px;max-width:95%;object-fit:contain}
#lucky-tree-dialog .lt-rule-icon .lt-fallback{font-size:29px}
#lucky-tree-dialog .lt-rule-name{display:block;width:100%;min-height:25px;font-size:10px;font-weight:750;line-height:1.2;overflow-wrap:anywhere;color:#fff}
#lucky-tree-dialog .lt-rule-price{font-size:10px;font-weight:700;color:#ffe6a3!important;white-space:nowrap}
#lucky-tree-dialog .lt-rule-odds{font-size:9px;font-weight:800;color:#d2bbff!important;white-space:nowrap}
#lucky-tree-dialog .lt-rules-note{margin:12px 3px 4px;font-size:11px;line-height:1.55;color:#d9cae4!important}
/* HISTÓRICO: data/hora e presentes, sem custo nem prêmio total. */
#lucky-tree-dialog .lt-history-list{display:flex;flex-direction:column;gap:10px;padding:2px 0 4px}
#lucky-tree-dialog .lt-history-card{border:1px solid #624979;border-radius:13px;background:#251a32;padding:11px 10px}
#lucky-tree-dialog .lt-history-head{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:9px}
#lucky-tree-dialog .lt-history-opens{display:inline-flex;align-items:center;justify-content:center;min-width:38px;padding:4px 7px;background:#543273;color:#fff;font-weight:900;border-radius:7px;font-size:11px}
#lucky-tree-dialog .lt-history-date{color:#eee3f6;font-size:11px;line-height:1.3}
#lucky-tree-dialog .lt-history-date span{opacity:.6;padding:0 2px}
#lucky-tree-dialog .lt-history-gifts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
#lucky-tree-dialog .lt-history-gift{min-width:0;display:flex;align-items:center;gap:5px;background:#372543;border:1px solid #574064;border-radius:9px;padding:5px 6px;color:#fff}
#lucky-tree-dialog .lt-history-icon{width:25px;height:27px;flex:none;display:flex;align-items:center;justify-content:center;font-size:20px}
#lucky-tree-dialog .lt-history-icon img{width:25px;height:25px;object-fit:contain}
#lucky-tree-dialog .lt-history-icon .lt-fallback{font-size:19px}
#lucky-tree-dialog .lt-history-gift-name{flex:1;min-width:0;font-size:10px;line-height:1.2;overflow-wrap:anywhere}
#lucky-tree-dialog .lt-history-qty{flex:none;font-size:11px;font-weight:900;color:#ffe4a1!important;white-space:nowrap}
#lucky-tree-dialog .lt-empty-gifts{font-size:11px;color:#d9c9e5;margin:0}
/* RANKING: posição + avatar + usuário + aberturas. */
#lucky-tree-dialog .lt-rank-list{display:flex;flex-direction:column;gap:7px;padding:3px 0}
#lucky-tree-dialog .lt-rank-row{display:flex;align-items:center;gap:9px;min-width:0;padding:8px;background:#281d36;border:1px solid #5b406e;border-radius:11px;color:#fff}
#lucky-tree-dialog .lt-rank-position{display:flex;align-items:center;justify-content:center;flex:none;min-width:35px;height:31px;border-radius:8px;background:#503963;font-weight:900;color:#fff}
#lucky-tree-dialog .lt-rank-position.is-gold{background:#79511d;color:#fff1bf}
#lucky-tree-dialog .lt-rank-position.is-silver{background:#535a6a;color:#f4f7ff}
#lucky-tree-dialog .lt-rank-position.is-bronze{background:#734b39;color:#fff1e4}
#lucky-tree-dialog .lt-rank-avatar{width:32px;height:32px;flex:none;border:1px solid #76568a;border-radius:50%;background:#4c3859;display:grid;place-items:center;overflow:hidden;font-size:18px}
#lucky-tree-dialog .lt-rank-avatar img{width:100%;height:100%;object-fit:cover}
#lucky-tree-dialog .lt-rank-user{flex:1;min-width:0;font-size:12px;font-weight:750;color:#fff;overflow-wrap:anywhere}
#lucky-tree-dialog .lt-rank-opens{display:flex;flex-direction:column;align-items:flex-end;justify-content:center;flex:none;color:#fff;gap:1px}
#lucky-tree-dialog .lt-rank-opens strong{font-size:14px;color:#fff}
#lucky-tree-dialog .lt-rank-opens small{font-size:9px;color:#d6c2e6}
@media(max-width:370px){
  #lucky-tree-dialog.lt-dialog{padding:13px 10px}
  #lucky-tree-dialog .lt-rule-grid{gap:4px}
  #lucky-tree-dialog .lt-rule-card{padding:7px 2px 6px}
  #lucky-tree-dialog .lt-rule-icon img{width:35px;height:35px}
  #lucky-tree-dialog .lt-rule-name{font-size:9px}
  #lucky-tree-dialog .lt-rule-price{font-size:9px}
  #lucky-tree-dialog .lt-rule-odds{font-size:8px}
  #lucky-tree-dialog .lt-history-gift{padding:5px 3px}
}

@media(max-width:600px){.lt-tree-holder{width:min(48vw,180px);max-height:180px;top:var(--lt-top-mobile)}.lt-game-top button{padding:5px 6px;font-size:10px}.lt-game-top .lt-exit{font-size:16px}}
@media(max-height:650px){.lt-game-top{height:30px;flex-basis:30px}.lt-game-top button{padding:3px 6px;font-size:10px}.lt-actions{padding-block:3px 5px}.lt-bottom{min-height:32px;padding:3px 8px}.lt-tree-holder{max-height:145px}}
@media(max-width:340px){.lt-actions{gap:4px;padding-inline:5px}.lt-bottom{gap:3px;padding-inline:7px;font-size:10px}}
