/* Theme catalogue: visual overrides only, never change puzzle geometry or rarity colors. */
body[data-theme]:not([data-theme=origin]){
--paper:#fff4df;--ink:#193c29;--muted:#735f43;--purple:#527c45;--line:#dcc299;--accent:#ac9a59;
--theme-cream:#fff3d9;--theme-base:#e7cf9f;--theme-border:#bf9456;--theme-green:#689540;--theme-deep:#294e24;--theme-tray:#243b32;--theme-tile:#496050;--theme-decor-x:0%;--theme-decor-y:100%;
--theme-scene:url('assets/theme-seasons-v1.png');
background:linear-gradient(#fff9ed70,#fff4df90),var(--theme-scene) center/cover fixed;color:var(--ink);
}
body[data-theme=zen]:not([data-theme=origin]){--ink:#593729;--muted:#765342;--purple:#a75e79;--accent:#d890a8;--theme-cream:#fff0db;--theme-base:#eed2b3;--theme-border:#b89a72;--theme-green:#718b38;--theme-deep:#405321;--theme-tray:#493642;--theme-tile:#705260;--theme-decor-x:0%;--theme-decor-y:0%;--theme-scene:url('assets/theme-zen-v1.png')}
body[data-theme=french]:not([data-theme=origin]){--ink:#183222;--muted:#6b603d;--purple:#53783c;--accent:#b99136;--theme-cream:#fff4dd;--theme-base:#e6d1a7;--theme-border:#c69d46;--theme-green:#416b32;--theme-deep:#153b26;--theme-tray:#26382c;--theme-tile:#4b6143;--theme-decor-x:100%;--theme-decor-y:0%;--theme-scene:url('assets/theme-french-v1.png')}
body[data-theme=calm]:not([data-theme=origin]){--ink:#283b26;--muted:#6d674b;--purple:#567e56;--accent:#ae9c61;--theme-cream:#fff5dd;--theme-base:#e7d6b5;--theme-border:#aa8650;--theme-green:#80983c;--theme-deep:#3a572e;--theme-tray:#2b3e40;--theme-tile:#4b6864;--theme-decor-x:100%;--theme-decor-y:100%;--theme-scene:url('assets/theme-calm-v1.png')}
body[data-theme]:not([data-theme=origin]) :is(button:not(.cell):not(.element-card):not(.companion-touch):not(.garden-elemental):not(.garden-pot):not(.refuge-slot):not(#sanctuary-spirit):not(.game-companion),select){
position:relative;background:linear-gradient(145deg,var(--theme-cream),var(--theme-base));color:var(--ink);border-color:var(--theme-border);box-shadow:inset 0 2px 0 #fff9,0 3px 0 var(--theme-border);
}
body[data-theme]:not([data-theme=origin]) :is(.primary,#home>.primary,.level-button.current,.level-button.done){
background:linear-gradient(160deg,var(--theme-green),var(--theme-deep));color:#fff7df;border-color:var(--theme-border);box-shadow:inset 0 2px 0 #ffffff60,0 4px 0 var(--theme-deep);
}
body[data-theme]:not([data-theme=origin]) :is(.primary:hover,#home>.primary:hover){background:linear-gradient(160deg,var(--theme-green),var(--theme-deep))}
body[data-theme]:not([data-theme=origin]) :is(button:not(.cell):not(.companion-touch):not(.garden-elemental)):disabled{opacity:.6}
body[data-theme]:not([data-theme=origin]) :is(.primary,.text-button,.admin-button,.admin-level,.world-pages button,.daily-button,.home-menu button,.daily-bouquet,.tools button,.element-card):before,
body[data-theme]:not([data-theme=origin]) .icon-button:after{
background-image:url('assets/theme-corners-v2.png');background-size:200% 200%;background-position:var(--theme-decor-x) var(--theme-decor-y);background-repeat:no-repeat;transform:none;filter:none;
}
body[data-theme]:not([data-theme=origin]) :is(.logo,.logo-icon,.logo-dot,h1,h2,h3,.scene-title .eyebrow,.message,.game-progress,.level-note,.completion-state){color:var(--ink)}
body[data-theme]:not([data-theme=origin]) :is(dialog,.current-adventure,.companion-card,.map-progress,.game-nav,.help-step b){background:linear-gradient(140deg,var(--theme-cream),var(--theme-base));border-color:var(--theme-border);color:var(--ink);box-shadow:inset 0 2px 0 #fff9,0 3px 0 var(--theme-border)}
body[data-theme]:not([data-theme=origin]) :is(.home-scene,.world-icon,.world-cover){background-image:var(--theme-scene);border-color:var(--theme-border)}
body[data-theme]:not([data-theme=origin]) .home-scene:before{background:linear-gradient(var(--theme-cream),transparent 43%,#fff1d330)}
body[data-theme]:not([data-theme=origin]) :is(.world-cover,.world-icon){background-size:cover}
body[data-theme]:not([data-theme=origin]) :is(.world-copy small,.daily-button small,.companion-copy small,#win-copy,.help-extra,.setting,.game-nav>div>span){color:var(--muted)}
body[data-theme]:not([data-theme=origin]) :is(.fill-track,.world-track,.companion-track){background:var(--theme-base)}
body[data-theme]:not([data-theme=origin]) :is(#fill-bar,#companion-progress,.world-track i,#win-progress .done){background:var(--theme-green)}
body[data-theme]:not([data-theme=origin]) .board{background:var(--theme-tray);border-radius:10%;border:3px solid var(--theme-border);box-shadow:0 5px 0 var(--theme-deep),inset 0 0 0 10px var(--theme-base)}
body[data-theme]:not([data-theme=origin]) .board:before{inset:4%;width:92%;height:92%;border:6px double var(--theme-border);border-radius:7%;background:none;box-shadow:0 0 0 8px var(--theme-base);z-index:3}
body[data-theme]:not([data-theme=origin]) .board:not(.finished):after{content:'';display:block;position:absolute;left:-2%;bottom:-2%;top:auto;right:auto;width:24%;height:24%;background:url('assets/theme-corners-v2.png') var(--theme-decor-x) var(--theme-decor-y)/200% 200% no-repeat;transform:none;z-index:4;pointer-events:none}
body[data-theme]:not([data-theme=origin]) .tiles{background:var(--theme-tray)}
body[data-theme]:not([data-theme=origin]) .tile{background:linear-gradient(145deg,var(--theme-tile),var(--theme-tray));border-color:#ffffff20}
body[data-theme]:not([data-theme=origin]) .board-title{background:linear-gradient(var(--theme-cream),var(--theme-base));color:var(--ink);border-color:var(--theme-border)}
body[data-theme]:not([data-theme=origin]) .home-emblem svg>path:nth-child(2){stroke:var(--theme-green)}
body[data-theme]:not([data-theme=origin]) :is(.daily-button>.button-icon:first-child,.help-step b){background:var(--theme-base);color:var(--ink)}
body[data-theme]:not([data-theme=origin]) .level-button.current small,body[data-theme]:not([data-theme=origin]) .level-button.done small{color:#fff8df}
body[data-theme]:not([data-theme=origin]) .win-flower{background-image:var(--theme-scene);color:var(--purple)}
body[data-theme]:not([data-theme=origin]) #launch{background:var(--theme-scene) center/cover}
body[data-theme]:not([data-theme=origin]) #launch-art{opacity:0}
body[data-theme]:not([data-theme=origin]) #launch:after{content:'Garden';font:900 48px 'Nunito',sans-serif;color:var(--ink);background:var(--theme-cream);padding:15px 30px;border:2px solid var(--theme-border);border-radius:22px;position:absolute}
#shop-button{height:44px;min-height:44px;flex:0 0 44px;border-radius:18px;font-size:12px;display:flex;align-items:center;justify-content:center;gap:8px;padding:6px 16px}
#shop-button .button-icon{width:20px;height:20px}
#theme-shop{height:min(720px,calc(100dvh - 24px));max-width:430px;padding:16px;overflow:hidden}
#theme-shop[open]{display:flex;flex-direction:column;gap:8px}
.theme-wallet{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:12px}
.theme-wallet .text-button{padding:8px 14px}
.theme-art{flex:1;min-height:70px;border-radius:22px;background-position:center;background-size:cover;border:2px solid var(--theme-border,#ccb083);box-shadow:inset 0 0 20px #0002}
.theme-copy h3{font:800 20px 'Nunito',sans-serif;margin:3px 0}.theme-copy p{font-size:11px;line-height:1.4;margin:5px 0}.theme-copy small{font-size:10px}.theme-copy>strong{font-size:12px}
.theme-pages{height:44px;flex-shrink:0;margin:0}.theme-pages button{width:44px;height:44px;font-size:28px}.theme-pages span{font-size:11px}
.theme-actions{display:flex;gap:8px}.theme-actions button{flex:1;min-width:0;min-height:48px;font-size:11px;padding:8px}
#theme-end-preview{font-size:11px;margin:0;padding:6px;flex-shrink:0}
.theme-billing-note,#theme-payment-note{font-size:10px;line-height:1.4;text-align:center;margin:0}
#theme-preview-return{position:fixed;top:max(4px,env(safe-area-inset-top));left:50%;transform:translateX(-50%);z-index:50;min-height:44px;padding:7px 16px;font-size:11px;border:2px solid #be9852;box-shadow:0 3px 8px #0003}
body[data-theme-preview=true] .top{padding-top:44px;flex-basis:94px;height:94px}

@media(max-height:650px){#home{gap:7px}#shop-button{flex-basis:44px}.theme-copy h3{font-size:17px}#theme-shop[open]{gap:5px}.theme-copy p{margin:3px 0}.theme-billing-note{font-size:9px}}
@media(orientation:landscape) and (max-height:500px){#home{grid-template-rows:minmax(0,1fr) 50px 55px 44px}.home-scene{grid-row:1/5}#shop-button{grid-column:2}#theme-shop[open]{display:grid;grid-template-columns:1fr 1fr;grid-template-rows:44px 44px 1fr 44px 48px auto;gap:5px}#theme-shop{width:min(740px,calc(100vw - 24px));max-width:740px}.dialog-head{grid-column:1/3}.theme-wallet{grid-column:2;grid-row:2}.theme-art{grid-column:1;grid-row:2/6}.theme-copy{grid-column:2;grid-row:3}.theme-pages{grid-column:2;grid-row:4}.theme-actions{grid-column:2;grid-row:5}#theme-end-preview{grid-column:1;grid-row:6}.theme-billing-note{grid-column:2;grid-row:6}#theme-payment-note{grid-column:1/3}body[data-theme-preview=true] .top{padding-top:0;padding-right:135px;height:44px;flex-basis:44px}#theme-preview-return{left:auto;right:8px;transform:none}}

body[data-theme]:not([data-theme=origin]) .garden-tile:not(.rock){background:linear-gradient(145deg,var(--theme-tile),var(--theme-tray));border:1px solid #ffffff20;border-radius:14%;box-shadow:inset 0 1px 2px #ffffff10}
body[data-theme]:not([data-theme=origin]) .board-title{top:3.8%;left:28%;width:44%;border:1px solid var(--theme-border);border-radius:12px;padding:3px 0;text-shadow:none}

.home-menu{grid-template-columns:repeat(4,minmax(0,1fr))}.home-menu button,#shop-button{font-size:10px;gap:3px;min-height:64px;height:auto;flex-direction:column;padding:4px 2px}#shop-button .button-icon{width:24px;height:24px}#shop-button>span{display:none}
body[data-theme-preview=true] .top{padding-top:0;flex-basis:44px;height:44px}body:not([data-screen=game]) #theme-preview-return{display:none}
@media(orientation:landscape) and (max-height:500px){#home{grid-template-rows:minmax(0,1fr) 55px 57px}.home-scene{grid-row:1/4}#shop-button{grid-column:auto}.home-menu button,#shop-button{min-height:55px}.home-menu{height:55px}}

body[data-theme]:not([data-theme=origin]) #home .scene-title h1,body[data-theme]:not([data-theme=origin]) :is(#current-level,#current-world,#home-progress){color:var(--ink)}
body[data-theme]:not([data-theme=origin]) :is(#current-level,#home>.primary,.dialog-head h2,.theme-copy h3){font-family:Georgia,serif}
body[data-theme=zen] .home-emblem svg image,body[data-theme=seasons] .home-emblem svg image,body[data-theme=calm] .home-emblem svg image{filter:hue-rotate(40deg)}body[data-theme=french] .home-emblem svg image{filter:grayscale(1) brightness(1.7)}

.game-nav .icon-button{width:44px;height:44px;min-height:44px;flex-shrink:0}

.theme-menu-art{display:none}
body[data-theme=zen]{--theme-icon-row:0%}body[data-theme=french]{--theme-icon-row:33.333%}body[data-theme=seasons]{--theme-icon-row:66.666%}body[data-theme=calm]{--theme-icon-row:100%}
body[data-theme]:not([data-theme=origin]) .logo-icon{font-size:0;width:34px;height:34px;flex-shrink:0;background:url('assets/theme-icons-v1.png') 0 var(--theme-icon-row)/400% 400% no-repeat;filter:none}
body[data-theme]:not([data-theme=origin]) .theme-menu-art{display:block;width:28px;height:28px;flex-shrink:0;background:url('assets/theme-icons-v1.png') 33.333% var(--theme-icon-row)/400% 400% no-repeat}
body[data-theme]:not([data-theme=origin]) :is(#worlds-button,#home-collection,#home-help)>.button-icon{display:none}
body[data-theme]:not([data-theme=origin]) #home-collection .theme-menu-art{background-position:66.666% var(--theme-icon-row)}body[data-theme]:not([data-theme=origin]) #home-help .theme-menu-art{background-position:100% var(--theme-icon-row)}
body[data-theme]:not([data-theme=origin]) .daily-button>.button-icon:first-child{background:url('assets/theme-icons-v1.png') 0 var(--theme-icon-row)/400% 400% no-repeat;box-shadow:none;padding:0;width:36px;height:36px}
body[data-theme]:not([data-theme=origin]) .daily-button>.button-icon:first-child use{opacity:0}

@media(max-width:370px){body[data-theme]:not([data-theme=origin]) .logo{font-size:25px;gap:5px}body[data-theme]:not([data-theme=origin]) .logo-icon{width:28px;height:28px}.top{gap:5px}}

@media(orientation:landscape) and (max-height:500px){#theme-shop[open]{grid-template-rows:44px 44px minmax(0,1fr) 44px 48px 44px}.theme-copy p{display:none}.theme-copy h3{font-size:17px}#theme-payment-note:not([hidden]){position:absolute;inset:auto 16px 16px;background:var(--theme-cream,#fff4df);padding:12px;border:1px solid #c7a570;border-radius:12px}}

body[data-theme]:not([data-theme=origin]) :is(#garden-pots,.level-map){background:linear-gradient(#fff5df30,#fff5df50),var(--theme-scene) center/cover;border-color:var(--theme-border)}
body[data-theme]:not([data-theme=origin]) .plant-plaque{background:var(--theme-cream);color:var(--ink);border-color:var(--theme-border)}

body[data-theme]:not([data-theme=origin]) #element-detail[data-rarity]{background:linear-gradient(145deg,var(--card-top),var(--card-bottom));border-color:var(--rarity);color:var(--rarity-ink)}
@media(orientation:landscape) and (max-height:500px){#help{width:min(640px,calc(100vw - 32px));max-width:640px}#help .help-step{margin:5px 0}#help .help-step p{line-height:1.4}#help .help-extra{margin:10px 0}}

body[data-theme]:not([data-theme=origin]) #garden-pots{background:linear-gradient(#fff6e3b8,#fff6e3b8),var(--theme-scene) center/cover}
body[data-theme]:not([data-theme=origin]) .garden-pages{border-radius:18px;background:var(--theme-cream);color:var(--ink);padding:2px 5px}
body[data-theme]:not([data-theme=origin]) :is(#garden-count,#garden-page,.garden-caption){color:var(--ink)}

/* Atlas cells retain their source proportions; frame ornaments stay outside play cells. */
body[data-theme]:not([data-theme=origin]) .board:not(.finished):after{left:0;bottom:0;width:10%;height:auto;aspect-ratio:1}
body[data-theme]:not([data-theme=origin]) :is(.primary,.text-button,.admin-button,.admin-level,.world-pages button,.daily-button,.home-menu button,.daily-bouquet,.tools button,.element-card):before{width:24px;height:24px}
body[data-theme]:not([data-theme=origin]) .primary:before{width:30px;height:30px}
body[data-theme]:not([data-theme=origin]) #home>.primary:before{width:36px;height:36px}
body[data-theme]:not([data-theme=origin]) .icon-button:after{width:18px;height:18px;transform:rotate(-90deg)}
body[data-theme]:not([data-theme=origin]) .logo-icon{width:34px;height:27.21px}
body[data-theme]:not([data-theme=origin]) .theme-menu-art{width:32px;height:25.61px}
body[data-theme]:not([data-theme=origin]) .daily-button>.button-icon:first-child{width:36px;height:28.81px}
@media(max-width:370px){body[data-theme]:not([data-theme=origin]) .logo-icon{width:30px;height:24.01px}body[data-theme]:not([data-theme=origin]) #home>.primary:before{width:30px;height:30px}}



/* Keep the preview inside the header; botanical materials follow each control's curve. */
#theme-preview-return{position:static;transform:none;min-height:44px;padding:6px 14px;border-radius:16px;font-size:11px;box-shadow:none}
.game-nav>div{min-width:0;display:flex;align-items:center;justify-content:center}
body[data-theme-preview=true] #game-world{display:none}
body[data-theme]:not([data-theme=origin]) :is(.primary,.text-button,.admin-button,.admin-level,.world-pages button,.daily-button,.home-menu button,.daily-bouquet,.tools button,.element-card):before,
body[data-theme]:not([data-theme=origin]) .icon-button:after{display:none}
body[data-theme]:not([data-theme=origin]) .board{border-radius:6%;border:2px solid var(--theme-border);box-shadow:inset 0 0 0 4px var(--theme-base),0 3px 0 var(--theme-border)}
body[data-theme]:not([data-theme=origin]) .board:before{inset:1%;width:98%;height:98%;border:1px solid var(--theme-border);border-radius:5%;box-shadow:none}
body[data-theme]:not([data-theme=origin]) .board:not(.finished):after{display:none}
body[data-theme]:not([data-theme=origin]) :is(.tiles,.cells,#lines){left:6%;top:8%;width:88%;height:88%}
body[data-theme]:not([data-theme=origin]) .board-title{top:.7%;left:27%;width:46%;font-size:clamp(12px,4vw,19px);border-radius:0 0 12px 12px;padding:2px 0;box-shadow:0 2px 3px #0002}
body[data-theme]:not([data-theme=origin])[data-screen=game]{background:linear-gradient(#fff4df66,#fff4df88),var(--theme-scene) center/cover fixed}
body[data-theme]:not([data-theme=origin]) .game-nav{padding:0 4px;border-radius:22px}
body[data-theme]:not([data-theme=origin]) :is(.game-progress,.level-note,.message:not(:empty)){background:var(--theme-cream);color:var(--ink)}
body[data-theme]:not([data-theme=origin]) .tools button{background:linear-gradient(145deg,var(--theme-cream),var(--theme-base));color:var(--ink);border:1px solid var(--theme-border);box-shadow:inset 0 0 0 2px #ffffff60,0 3px 0 var(--theme-border)}
body[data-theme]:not([data-theme=origin]) .tools button:disabled{opacity:1;color:var(--muted);box-shadow:inset 0 0 0 2px #ffffff60,0 1px 0 var(--theme-border)}
body[data-theme]:not([data-theme=origin]) .tools button:disabled .button-icon{opacity:.5}
body[data-theme]:not([data-theme=origin]) :is(.home-menu button,.daily-button,.icon-button,.primary){box-shadow:inset 0 0 0 2px #ffffff40,0 3px 0 var(--theme-border)}

body[data-theme]:not([data-theme=origin]) .game-nav{border:0;box-shadow:none}
body[data-theme]:not([data-theme=origin]) .tools #hint{background:linear-gradient(145deg,var(--theme-cream),var(--theme-base));color:var(--ink);border-color:var(--theme-border);box-shadow:inset 0 0 0 2px #ffffff60,0 3px 0 var(--theme-border)}

.game-nav{height:44px;min-height:44px}
body[data-theme]:not([data-theme=origin]) .tools{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
body[data-theme]:not([data-theme=origin]) .tools :is(#undo,#reset,#hint):disabled{opacity:1;color:var(--muted)}

/* Three new gardens reuse the lightweight themed interface and Android layers. */
body[data-theme=moon]:not([data-theme=origin]){--ink:#352c56;--muted:#62577f;--purple:#7762ac;--accent:#c0abd9;--theme-cream:#f2edff;--theme-base:#d5c9e9;--theme-border:#a694bf;--theme-green:#7862a6;--theme-deep:#44365f;--theme-tray:#28233d;--theme-tile:#504361;--theme-icon-row:0%;--theme-scene:url('assets/theme-moon-v1.png')}
body[data-theme=tropical]:not([data-theme=origin]){--ink:#174d40;--muted:#4d7362;--purple:#278b77;--accent:#dc8766;--theme-cream:#eff9e8;--theme-base:#cae5bb;--theme-border:#8cb682;--theme-green:#329c79;--theme-deep:#17634f;--theme-tray:#1c4944;--theme-tile:#3e7166;--theme-icon-row:50%;--theme-scene:url('assets/theme-tropical-v1.png')}
body[data-theme=winter]:not([data-theme=origin]){--ink:#294c65;--muted:#57738a;--purple:#668bab;--accent:#c5ae79;--theme-cream:#f4faff;--theme-base:#d0e3ef;--theme-border:#91b4ca;--theme-green:#658ba7;--theme-deep:#3b647c;--theme-tray:#293f53;--theme-tile:#506a80;--theme-icon-row:100%;--theme-scene:url('assets/theme-winter-v1.png')}
body[data-theme=moon]:not([data-theme=origin]){background:linear-gradient(#211b3530,#211b3540),var(--theme-scene) center/cover fixed}
body[data-theme=moon]:not([data-theme=origin])[data-screen=game]{background:linear-gradient(#211b3520,#211b3530),var(--theme-scene) center/cover fixed}
body:is([data-theme=moon],[data-theme=tropical],[data-theme=winter]):not([data-theme=origin]) :is(.logo-icon,.theme-menu-art,.daily-button>.button-icon:first-child){background-image:url('assets/theme-icons-v2.png');background-size:400% 300%}
body:is([data-theme=moon],[data-theme=tropical],[data-theme=winter]):not([data-theme=origin]) .logo-icon{width:30px;height:30px}
body:is([data-theme=moon],[data-theme=tropical],[data-theme=winter]):not([data-theme=origin]) .theme-menu-art{width:28px;height:28px}
body:is([data-theme=moon],[data-theme=tropical],[data-theme=winter]):not([data-theme=origin]) .daily-button>.button-icon:first-child{width:32px;height:32px}
body[data-theme=moon] .home-emblem svg image{filter:hue-rotate(280deg)}
body[data-theme=tropical] .home-emblem svg image{filter:hue-rotate(45deg)}
body[data-theme=winter] .home-emblem svg image{filter:hue-rotate(160deg)}

body[data-theme=moon] #logo{color:#f3eafa;text-shadow:0 2px 3px #20182e}
body[data-theme=moon] #logo .logo-dot{color:#c9b9ef}

body[data-theme]:not([data-theme=origin]) #sanctuary-scene{background-image:radial-gradient(ellipse at 50% 45%,#e4eec633,#59794533),var(--theme-scene);border-color:var(--theme-border)}body[data-theme]:not([data-theme=origin]) .decor-choice.selected{border:2px solid var(--theme-green);background:linear-gradient(145deg,var(--theme-cream),#d1e2b9);box-shadow:0 2px var(--theme-green)}
