/* Partyforte Christmas Room Planner. Tokens mirror the main Kidforte site. */
:root{
  --ink:#17130F; --ink-soft:#6c6358; --paper:#FFFDF9; --cream:#FBF3E7;
  --line:rgba(23,19,15,.12); --red:#EB133F; --red-dark:#C20E33; --shopee:#C7361B; --wa:#128C4A;
  --serif:"Playfair Display",Georgia,"Times New Roman",serif;
  --sans:"Nunito",system-ui,-apple-system,"Segoe UI",sans-serif;
  --radius:18px; --shadow:0 18px 40px -22px rgba(23,19,15,.35);
}
*{box-sizing:border-box}
[hidden]{display:none!important}
html{-webkit-text-size-adjust:100%}
body{margin:0;font-family:var(--sans);color:var(--ink);background:var(--paper);line-height:1.5}
img{max-width:100%}
button{font:inherit;color:inherit;cursor:pointer}
a{color:inherit}
h1,h2,h3{font-family:var(--serif);line-height:1.15;margin:0}

.top{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 16px;
  border-bottom:1px solid var(--line);background:#fff;position:sticky;top:0;z-index:20}
.top__brand img{height:42px;width:auto;display:block}
.top__back{font-weight:800;font-size:.92rem;text-decoration:none;color:var(--ink-soft)}
.top__back:hover{color:var(--red)}

.wrap{max-width:1320px;margin:0 auto;padding:18px 16px 40px}
.intro{max-width:760px;margin-bottom:18px}
.eyebrow{margin:0 0 4px;color:var(--red);font-weight:800;font-size:.8rem;letter-spacing:.12em;text-transform:uppercase}
h1{font-size:clamp(1.8rem,4.6vw,2.7rem)}
.lead{margin:8px 0 0;color:var(--ink-soft);font-weight:600;font-size:1.02rem}

.layout{display:grid;grid-template-columns:minmax(0,1fr) 340px;gap:22px;align-items:start}
@media (max-width:900px){.layout{grid-template-columns:minmax(0,1fr)}}

/* Stage: a fixed 1600-wide logical canvas, scaled to fit */
.stage-wrap{position:relative;width:100%;border-radius:var(--radius);overflow:hidden;background:#e9e1d4;box-shadow:var(--shadow);aspect-ratio:16/10}
.stage{position:absolute;left:0;top:0;width:1600px;height:1000px;transform-origin:0 0;touch-action:pan-y;user-select:none;-webkit-user-select:none}
.stage.editing{touch-action:none}
.bg,.items{position:absolute;inset:0}
.bg svg,.bg img{display:block;width:100%;height:100%}
.bg img{object-fit:cover}
.it{position:absolute;left:0;top:0;transform-origin:50% 50%;cursor:grab;touch-action:none;-webkit-user-drag:none;filter:drop-shadow(0 10px 14px rgba(0,0,0,.25))}
.it.dragging{cursor:grabbing}
.sel{position:absolute;left:0;top:0;transform-origin:50% 50%;pointer-events:none;
  outline:calc(3px * var(--inv,1)) dashed #fff;box-shadow:0 0 0 calc(6px * var(--inv,1)) rgba(235,19,63,.55)}
.h{position:absolute;pointer-events:auto;touch-action:none;width:calc(34px * var(--inv,1));height:calc(34px * var(--inv,1));
  border-radius:50%;border:calc(3px * var(--inv,1)) solid #fff;background:var(--red);padding:0;box-shadow:0 2px 8px rgba(0,0,0,.35)}
.h--scale{right:calc(-17px * var(--inv,1));bottom:calc(-17px * var(--inv,1));cursor:nwse-resize}
.h--rot{left:50%;top:calc(-60px * var(--inv,1));margin-left:calc(-17px * var(--inv,1));cursor:grab;background:#fff;border-color:var(--red)}
.h--rot::before{content:"";position:absolute;left:50%;top:100%;width:calc(3px * var(--inv,1));height:calc(26px * var(--inv,1));background:#fff;transform:translateX(-50%)}
.stage-empty{position:absolute;left:50%;top:14px;transform:translateX(-50%);margin:0;max-width:calc(100% - 32px);
  background:rgba(255,255,255,.92);padding:8px 14px;border-radius:999px;font-weight:700;font-size:.9rem;text-align:center;box-shadow:var(--shadow);pointer-events:none}

/* Toolbar */
.tools{margin-top:12px;display:flex;flex-direction:column;gap:10px}
.tools__item,.tools__main{display:flex;flex-wrap:wrap;gap:6px}
.tools__main{justify-content:flex-end}
.tools button,.linkbtn{border:1px solid var(--line);background:#fff;border-radius:999px;padding:8px 14px;font-weight:800;font-size:.92rem;min-height:40px;min-width:40px}
.tools button:hover:not(:disabled){border-color:var(--ink)}
.tools button:disabled{opacity:.4;cursor:not-allowed}
.tools button.primary{background:var(--red);border-color:var(--red);color:#fff}
.tools button.primary:hover{background:var(--red-dark)}
.tools button.danger{color:var(--red-dark)}
.tools__hint{margin:0;color:var(--ink-soft);font-size:.88rem;font-weight:600}
button:focus-visible,a:focus-visible,.upload:focus-within{outline:3px solid var(--red);outline-offset:2px}

/* Shop this look */
.look{margin-top:22px;background:#fff;border:1px solid var(--line);border-radius:var(--radius);padding:18px}
.look__head{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;margin-bottom:10px}
.look__head h2{font-size:1.35rem}
.wa{background:var(--wa);color:#fff;text-decoration:none;font-weight:800;font-size:.9rem;padding:9px 14px;border-radius:999px}
.wa:hover{filter:brightness(1.08)}
.look__list{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:10px}
.look__list li{display:flex;align-items:center;gap:12px;border:1px solid var(--line);border-radius:14px;padding:8px 10px}
.look__list img{width:52px;height:52px;object-fit:contain;flex:none}
.look__list .nm{flex:1;min-width:0;font-weight:800;font-size:.95rem;line-height:1.25}
.look__list .nm small{display:block;color:var(--ink-soft);font-weight:600}
.look__list a{flex:none;color:var(--shopee);font-weight:800;font-size:.9rem;text-decoration:none;white-space:nowrap}
.look__list a:hover{text-decoration:underline}
.look__empty{margin:0;color:var(--ink-soft);font-weight:600}

/* Side panel */
.panel{background:#fff;border:1px solid var(--line);border-radius:var(--radius);overflow:hidden;position:sticky;top:76px}
@media (max-width:900px){.panel{position:static}}
.tabs{display:grid;grid-template-columns:repeat(3,1fr);border-bottom:1px solid var(--line);background:var(--cream)}
.tabs button{border:0;background:none;padding:12px 6px;font-weight:800;font-size:.95rem;color:var(--ink-soft);border-bottom:3px solid transparent}
.tabs button[aria-selected="true"]{color:var(--ink);border-bottom-color:var(--red);background:#fff}
.pane{padding:14px;max-height:calc(100vh - 160px);overflow:auto}
@media (max-width:900px){.pane{max-height:none}}
.pane h3{font-size:1.02rem;margin:14px 0 8px}
.pane h3:first-child{margin-top:0}
.pane__note{margin:6px 0 10px;color:var(--ink-soft);font-size:.88rem;font-weight:600}
.cat{margin:12px 0 6px;font-size:.78rem;letter-spacing:.1em;text-transform:uppercase;color:var(--ink-soft);font-weight:800}
.cat:first-child{margin-top:0}
.grid{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
@media (max-width:900px){.grid{grid-template-columns:repeat(auto-fill,minmax(100px,1fr))}}
.prod{border:1px solid var(--line);border-radius:14px;background:#fff;padding:8px 6px;display:flex;flex-direction:column;align-items:center;gap:4px;text-align:center}
.prod:hover{border-color:var(--red);transform:translateY(-2px)}
.prod img{width:72px;height:72px;object-fit:contain}
.prod span{font-size:.78rem;font-weight:800;line-height:1.2}
.prod small{font-size:.72rem;font-weight:700;color:var(--ink-soft);line-height:1.1}
.sizes{display:flex;gap:4px}
.sizes:empty{display:none}
.sizes button[aria-pressed="true"]{background:var(--ink);border-color:var(--ink);color:#fff}
.themes{display:grid;gap:10px}
.theme{display:flex;align-items:center;gap:12px;border:1px solid var(--line);border-radius:14px;background:#fff;padding:10px;text-align:left}
.theme:hover{border-color:var(--red)}
.theme__sw{width:46px;height:46px;border-radius:12px;flex:none;display:grid;place-items:center;font-size:1.4rem;border:1px solid var(--line)}
.theme b{display:block}
.theme small{color:var(--ink-soft);font-weight:600}
.rooms{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.room{border:2px solid var(--line);border-radius:12px;background:#fff;padding:6px;font-weight:800;font-size:.82rem}
.room svg{display:block;width:100%;height:auto;border-radius:6px;margin-bottom:4px}
.room[aria-pressed="true"]{border-color:var(--red)}
.walls{display:flex;flex-wrap:wrap;gap:8px}
.wall{width:40px;height:40px;border-radius:50%;border:2px solid var(--line);padding:0}
.wall[aria-pressed="true"]{box-shadow:0 0 0 3px #fff,0 0 0 5px var(--red)}
.upload{display:block;border:2px dashed var(--line);border-radius:14px;padding:14px;text-align:center;font-weight:800;cursor:pointer}
.upload:hover{border-color:var(--red)}
.upload input{position:absolute;opacity:0;width:1px;height:1px}
.linkbtn{margin-top:4px}
.fine{margin:26px 0 0;color:var(--ink-soft);font-size:.85rem;font-weight:600}
.toast{position:fixed;left:50%;bottom:20px;transform:translateX(-50%);background:var(--ink);color:#fff;padding:10px 16px;border-radius:999px;font-weight:700;z-index:50;max-width:calc(100% - 32px);text-align:center}
@media (prefers-reduced-motion:reduce){*{transition:none!important}}
