/* Sunny Rooms Makeover: all interface styling. Colours live in the variables below. */
:root {
  /* the shell theme (data/theme.json) sets --gs-*; these follow it */
  --bg: var(--gs-bg, #e7d6bd);        /* page + canvas background */
  --bg2: #fffaf2;       /* cards */
  --text: #3b3029;
  --muted: #8a7563;
  --accent: var(--gs-accent, #c0603a);    /* primary buttons, selection */
  --accent2: #e8a25b;
  --line: #dcc7a8;
  --good: #5f9a52;
  --bad: #c9473b;
  --coin: #d49a1c;
  --shadow: 0 6px 20px rgba(80, 50, 30, .16);
  --r: 14px;
  font: 15px/1.35 var(--gs-font-body, system-ui), -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); overflow: hidden; -webkit-tap-highlight-color: transparent; user-select: none; }
#game { position: fixed; inset: 0; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; }

.btn { background: var(--bg2); border: 1px solid var(--line); border-radius: 999px; padding: 8px 16px; box-shadow: 0 2px 0 var(--line); font-weight: 700; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.btn:hover { filter: brightness(1.03); }
.btn:active { transform: translateY(1px); box-shadow: none; }
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary { background: var(--accent); border-color: #a24c2b; color: #fff; box-shadow: 0 2px 0 #8f3f22; }
.btn.small { padding: 5px 11px; font-size: 13px; }
.btn.danger { color: var(--bad); }
.btn.link, button.link { background: none; border: 0; box-shadow: none; color: var(--muted); text-decoration: underline; padding: 4px 6px; }
.icon { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg2); font-size: 20px; line-height: 1; box-shadow: 0 2px 0 var(--line); }
.icon.small { width: 30px; height: 30px; font-size: 18px; box-shadow: none; }
.icon:disabled { opacity: .4; }
.coin { color: var(--coin); font-weight: 800; }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; transition: opacity .3s; zoom: var(--gs-text, 1); }
#hud.away { opacity: 0; }
#hud.away * { pointer-events: none !important; }
#hud > * { pointer-events: auto; }
#top .gs-icon { width: 40px; height: 40px; }
#top { position: absolute; left: 8px; right: 8px; top: 8px; display: flex; align-items: center; gap: 8px; padding: 6px; background: rgba(255, 250, 242, .92); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
#top .grow { flex: 1; }
#lvl-name { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
#lvl-name b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#lvl-name small { color: var(--muted); }
.pill { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 3px 10px; display: flex; flex-direction: column; line-height: 1.1; min-width: 74px; position: relative; overflow: hidden; }
.pill small { font-size: 11px; color: var(--muted); }
.pill b { font-size: 15px; }
.pill b.low { color: var(--bad); }
.pill.meter i { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--good); transition: width .3s; }
#btn-brief em { font-style: normal; color: var(--accent); }
#btn-brief.on { background: #fde9d8; }
#btn-reveal { opacity: .75; }
#btn-reveal.ready { opacity: 1; animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(192, 96, 58, .18), 0 2px 0 #8f3f22; } }
#sandbox-acts { display: flex; gap: 6px; }

#brief { position: absolute; top: 74px; right: 8px; width: 290px; max-height: calc(100% - 74px - 170px); overflow: auto; background: rgba(255, 250, 242, .96); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 12px 14px; transform: translateX(110%); transition: transform .25s; }
#brief.open { transform: none; }
.brief-head { display: flex; justify-content: space-between; align-items: center; }
.brief-head h3 { margin: 0; }
#brief h4 { margin: 12px 0 4px; font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }
.client { display: flex; gap: 10px; align-items: flex-start; margin-top: 8px; }
.client p { margin: 2px 0 0; font-size: 13px; color: var(--muted); font-style: italic; }
.avatar { flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--accent2); color: #fff; font-weight: 900; display: grid; place-items: center; font-size: 18px; border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.checks li { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.checks li i { width: 20px; height: 20px; border-radius: 6px; border: 2px solid var(--line); display: grid; place-items: center; font-style: normal; font-size: 13px; font-weight: 900; color: #fff; flex: none; }
.checks li.ok i { background: var(--good); border-color: var(--good); }
.checks li.ok { color: var(--muted); }
.checks li.bad i { background: var(--bad); border-color: var(--bad); }
.checks small { color: var(--muted); }
.tags { display: grid; gap: 6px; }
.tagbar { display: grid; grid-template-columns: 64px 1fr 34px; align-items: center; gap: 6px; font-size: 13px; }
.tagbar span { font-weight: 800; color: var(--c); }
.tagbar small { text-align: right; color: var(--muted); }
.bar { height: 8px; background: #efe3d1; border-radius: 9px; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 9px; transition: width .3s; }
.avoid { font-size: 13px; margin: 10px 0 0; }
.chip { display: inline-block; border: 1px solid var(--c); color: var(--c); border-radius: 9px; padding: 0 7px; margin-right: 4px; font-weight: 700; text-decoration: line-through; }
.tip { font-size: 13px; background: #fff3dc; border-radius: 10px; padding: 8px 10px; margin: 12px 0 0; }

#catalog { position: absolute; left: 8px; right: 8px; bottom: 8px; background: rgba(255, 250, 242, .95); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 6px 6px 8px; }
#tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
.tab { flex: none; display: flex; align-items: center; gap: 4px; padding: 3px 10px 3px 4px; border: 1px solid transparent; border-radius: 999px; background: none; font-weight: 700; font-size: 13px; color: var(--muted); }
.tab img { width: 26px; height: 26px; }
.tab.on { background: #fde9d8; border-color: #f0c9a8; color: var(--accent); }
#cards { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 2px; scrollbar-width: thin; }
.card { flex: none; width: 104px; height: 120px; display: flex; flex-direction: column; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 6px 4px 5px; position: relative; box-shadow: 0 2px 0 var(--line); }
.card img { width: 84px; height: 62px; object-fit: contain; pointer-events: none; }
.card .swatch { width: 70px; height: 56px; border-radius: 10px; margin: 3px 0; border: 1px solid var(--line); }
.card b { font-size: 12px; line-height: 1.1; text-align: center; margin-top: 2px; }
.card small { font-size: 12px; color: var(--accent); font-weight: 800; }
.card .dots { position: absolute; top: 6px; right: 6px; display: flex; flex-direction: column; gap: 2px; }
.card .dots i { width: 8px; height: 8px; border-radius: 50%; display: block; }
.card.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.card.dear { opacity: .5; }
.card.locked img, .card.locked .swatch { filter: grayscale(1) opacity(.55); }
.card.locked small { color: var(--coin); }

#placebar, #selbar { position: absolute; left: 50%; transform: translateX(-50%); bottom: 182px; display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 14px; background: var(--bg2); border: 1px solid var(--line); border-radius: 999px; box-shadow: var(--shadow); white-space: nowrap; max-width: calc(100% - 16px); overflow-x: auto; }
#placebar span { color: var(--muted); font-size: 13px; }
.sel-name { display: flex; flex-direction: column; line-height: 1.1; margin-right: 4px; }
.sel-name em { font-style: normal; font-size: 11px; font-weight: 700; margin-left: 4px; }
.sel-name em.paired { color: var(--good); } .sel-name em.unpaired { color: var(--bad); }
.warn { font-size: 13px; color: var(--bad); margin: 8px 0 0; }
.sel-name small { color: var(--muted); font-size: 12px; }

/* ---------- layouts ---------- */
body.wide #brief { top: 74px; }
body:not(.wide) #brief { left: 8px; right: 8px; width: auto; top: 70px; max-height: calc(100% - 70px - 190px); }
body.phone #top { flex-wrap: wrap; gap: 6px; border-radius: 14px; }
body.phone #lvl-name { flex: 1 1 0; }
body.phone #top .grow { display: none; }
body.phone #budget, body.phone #style, body.phone #btn-brief { order: 3; flex: 1 1 28%; }
body.phone #btn-brief { justify-content: center; }
body.phone #btn-reveal span { display: none; }
body.phone #placebar, body.phone #selbar { bottom: 176px; left: 8px; right: 8px; transform: none; flex-wrap: wrap; justify-content: center; border-radius: 16px; white-space: normal; padding: 6px 8px; }
body.phone .sel-name { flex: 1 1 100%; flex-direction: row; gap: 8px; align-items: baseline; justify-content: center; }
body.phone .card { width: 92px; height: 112px; }
body.phone .card img { width: 76px; height: 56px; }

/* ---------- Reveal (inside the shell results dialog) ---------- */
.reveal-d .gs-panel { max-width: 760px; }
.reveal-x { margin-top: 6px; }
.compare { position: relative; border-radius: 14px; overflow: hidden; height: min(19vh, 210px); background: var(--bg); touch-action: none; cursor: ew-resize; border: 2px solid var(--gs-line); }
.compare img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.compare .before { position: absolute; inset: 0; clip-path: inset(0 calc(100% - var(--x)) 0 0); }
.compare.anim .before { transition: clip-path 1.1s ease-in-out; }
.compare.anim .handle { transition: left 1.1s ease-in-out; }
.compare .handle { position: absolute; top: 0; bottom: 0; left: var(--x); width: 4px; margin-left: -2px; background: #fff; box-shadow: 0 0 6px rgba(0, 0, 0, .3); }
.compare .handle::after { content: '⇆'; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 34px; height: 34px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-style: normal; color: var(--accent); font-weight: 900; box-shadow: 0 1px 4px rgba(0, 0, 0, .25); }
.compare .lab { position: absolute; top: 10px; background: rgba(59, 48, 41, .72); color: #fff; font-size: 12px; font-weight: 800; padding: 2px 10px; border-radius: 999px; text-transform: uppercase; letter-spacing: 1px; }
.compare .lab.l { left: 10px; } .compare .lab.r { right: 10px; background: var(--accent); }
.cmp-foot { display: flex; justify-content: space-between; align-items: center; font: 700 calc(13px * var(--gs-text)) var(--gs-font-body); color: var(--gs-muted); margin: 4px 2px 0; }
.quote { display: flex; gap: 10px; align-items: center; justify-content: center; margin: 0 0 8px; }
.quote p { margin: 0; font-style: italic; color: var(--gs-muted); text-align: left; font-size: calc(16px * var(--gs-text)); }
.miss-list { grid-template-columns: 1fr 1fr; }
.checks li.miss { color: var(--bad); font-weight: 700; }
.checks li.miss i { background: var(--bad); border-color: var(--bad); }

/* stars: gold on, sand off (shell default is accent on dark) */
.gs-stars i, .gs-res-stars i { background: #e3d0b3; }
.gs-stars i.on, .gs-res-stars i.on { background: var(--coin); }
.gs-res-stars i.on { filter: drop-shadow(0 2px 0 #b47b16) drop-shadow(0 0 8px rgba(242, 177, 60, .5)); }
.reveal-d .gs-res-stars i { width: 34px; height: 34px; }
.reveal-d .gs-res-stars { margin: 0 0 4px; }
.reveal-d .gs-badge { margin-top: 4px; }
.reveal-d .gs-res-head h2 { margin: 0; }
.reveal-d .gs-stats { margin: 8px 0; }
.reveal-d .gs-stat { padding: 4px 10px; }

/* ---------- menu side panel, rooms footer, help ---------- */
.side-top { display: flex; justify-content: space-between; align-items: baseline; margin: 0 0 8px; font: 700 calc(20px * var(--gs-text)) var(--gs-font-display); color: var(--gs-fg); }
.side-top .coin { font: 800 calc(17px * var(--gs-text)) var(--gs-font-body); }
.apt-line { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center; font: 700 calc(14px * var(--gs-text)) var(--gs-font-body); color: var(--gs-fg); margin-bottom: 7px; }
.apt-line .stars-t { color: var(--coin); }
.apt-line.locked { color: #b8a58c; }
.pbar { grid-column: 1 / -1; height: 8px; border-radius: 99px; background: #eadbc3; overflow: hidden; display: block; box-shadow: inset 0 1px 2px rgba(59, 48, 41, .2); }
.pbar b { display: block; height: 100%; background: var(--gs-good); border-radius: 99px; }
.coin::before { content: ''; display: inline-block; width: .9em; height: .9em; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #ffe08a, var(--coin) 60%, #a8740d); vertical-align: -1px; margin-right: 4px; box-shadow: 0 1px 0 #8a5e0a; }
.sandbox-row { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 8px 12px; border: 2px dashed #d9c09a; border-radius: 14px; background: rgba(247, 237, 221, .6); color: var(--gs-fg); }
.sandbox-row b { font: 700 calc(18px * var(--gs-text)) var(--gs-font-display); }
.sandbox-row span { flex: 1; color: var(--gs-muted); font-size: calc(14px * var(--gs-text)); }
.sandbox-row .gs-btn { min-width: 120px; min-height: 48px; }
.help-d .gs-body { color: var(--gs-fg); }
.tips { margin: 6px 0 0; padding-left: 20px; color: var(--gs-fg); font-size: calc(16px * var(--gs-text)); }
.tips li { margin: 4px 0; }
.keys { width: 100%; border-collapse: collapse; font-size: calc(15px * var(--gs-text)); color: var(--gs-fg); }
.keys td { padding: 4px 6px; border-bottom: 1px solid var(--gs-line); }
.keys td:first-child { font-weight: 800; white-space: nowrap; }
.budget-line { font-size: 13px; color: var(--muted); margin: 10px 0 0; }

/* ---------- Game Shell on the light Sunny Rooms theme (shell.css defaults are dark) ---------- */
.gs-banner { aspect-ratio: 880 / 237; padding-top: 0; padding-bottom: 3.2%; width: min(460px, 88%); }
.gs-banner span { color: var(--gs-ink); font-weight: 700; letter-spacing: 1.5px; text-shadow: 0 3px 0 #7d3418, 0 0 6px rgba(80, 30, 10, .35); }
.gs-btn { font-weight: 700; letter-spacing: .3px; color: var(--gs-ink); text-shadow: 0 2px 0 #7d3418; border-width: 20px 26px; border-image-width: 20px 26px; }
.gs-btn small { color: #ffe6d4; text-shadow: 0 1px 0 #7d3418; }
.gs-btn:hover, .gs-btn:focus-visible { filter: drop-shadow(0 0 8px rgba(240, 150, 90, .55)); }
.gs-btn.gs-sec { color: var(--gs-fg); text-shadow: 0 1px 0 rgba(255, 250, 240, .8); }
.gs-btn.gs-sec small { color: var(--gs-muted); text-shadow: none; }
.gs-btn.gs-danger { color: var(--gs-danger); text-shadow: 0 1px 0 rgba(255, 250, 240, .8); }
.gs-panel { --gs-pw: 40px; }
.gs-panel-sm { --gs-pw: 30px; }
.gs-dialog .gs-title, .gs-res-head h2, .gs-pause-info b, .gs-slot-n, .gs-level-n, .gs-level-name { color: var(--gs-fg); }
.gs-res-head h2 { font-weight: 700; }
.gs-stat { background: var(--gs-card); border: 2px solid var(--gs-line); border-radius: 12px; }
.gs-stat b { color: var(--gs-fg); font-weight: 800; }
.gs-stat.gs-hi b { color: var(--gs-accent); }
.gs-badge { border-color: var(--gs-line); background: var(--gs-card); color: var(--coin); }
.gs-badge.gs-best { background: rgba(212, 154, 28, .12); border: 2px solid var(--coin); }
.gs-results.gs-won::before { background: radial-gradient(ellipse at 50% 35%, rgba(255, 230, 160, .35), transparent 60%); }
.gs-seg { border: 2px solid #d9c09a; border-radius: 10px; background: var(--gs-card); }
.gs-seg button { background: transparent; color: var(--gs-muted); }
.gs-seg button + button { border-left: 1px solid #e3d0b3; }
.gs-seg button.gs-on { background: var(--gs-accent); color: #fff; }
.gs-select { border: 2px solid #d9c09a; border-radius: 10px; background: var(--gs-card); color: var(--gs-fg); }
.gs-level { background: #fff; border: 2px solid var(--gs-line); border-radius: 14px; color: var(--gs-fg); box-shadow: 0 3px 0 var(--gs-line); }
.gs-level-sub { color: var(--gs-muted); }
.gs-level.gs-done { background: #fff8ec; }
.gs-level-thumb { background-color: var(--gs-card); border-radius: 10px; }
.gs-toast { background: rgba(59, 48, 41, .92); border-color: #6b5538; color: #fffaf2; }
.gs-toast.gs-bad { background: var(--gs-danger); border-color: #8d2f24; }
.gs-saved { background: var(--gs-panel); border: 2px solid #d9b98a; color: var(--gs-good); }
.gs-tut-box { background: var(--gs-panel); border: 3px solid var(--gs-accent); }
.gs-tut-box p { color: var(--gs-fg); }
.gs-tut-hole { box-shadow: 0 0 0 9999px rgba(59, 48, 41, .55); border-width: 3px; border-radius: 12px; }
.gs-studio { color: var(--gs-fg); }
.gs-studio b { color: var(--gs-accent); }
.gs-splash { background: radial-gradient(ellipse at 50% 45%, #fff6e8, var(--gs-bg) 62%, var(--gs-bg2)); }
.gs-line { background: linear-gradient(90deg, transparent, #c9ab84, transparent); height: 2px; }
.gs-madewith { color: var(--gs-muted); } .gs-madewith b { color: var(--gs-fg); } .gs-skip { color: #a8937c; }
.gs-keyart::after { background: linear-gradient(0deg, rgba(231, 214, 189, .88) 0, rgba(231, 214, 189, .2) 20%, transparent 40%); }
.gs-loading .gs-logo { width: min(560px, 82vw); height: min(190px, 30vh); filter: drop-shadow(0 6px 10px rgba(80, 50, 20, .3)); }
.gs-lrow { color: var(--gs-fg); text-shadow: 0 1px 2px rgba(255, 250, 242, .9); }
.gs-tip { width: auto; max-width: min(760px, 92vw); padding: 7px 18px; border-radius: 99px; background: rgba(255, 250, 242, .94); color: var(--gs-fg); box-shadow: 0 2px 8px rgba(60, 40, 20, .2); }
.gs-menu-shade { background: linear-gradient(90deg, rgba(231, 214, 189, .97) 0%, rgba(231, 214, 189, .85) 26%, rgba(231, 214, 189, 0) 46%), linear-gradient(0deg, rgba(231, 214, 189, .6), transparent 18%); }
.gs-menu .gs-logo { width: min(420px, 34vw); height: min(170px, 23vh); top: 3vh; filter: drop-shadow(0 6px 10px rgba(80, 50, 20, .3)); }
.gs-menu-col { top: calc(5vh + min(170px, 23vh)); }
.gs-foot { color: var(--gs-muted); }
@media (max-width: 760px) and (orientation: portrait) {
  .gs-menu .gs-logo { width: 86vw; }
  .gs-menu-col { top: auto; }
  .gs-menu-shade { background: linear-gradient(0deg, rgba(231, 214, 189, .98) 0%, rgba(231, 214, 189, .93) 44%, rgba(231, 214, 189, .1) 64%, rgba(231, 214, 189, 0) 80%, rgba(231, 214, 189, .6) 100%); }
  .gs-menu .gs-logo { height: 15vh; top: 6vh; }
  .miss-list { grid-template-columns: 1fr; }
  .sandbox-row { flex-wrap: wrap; }
}

.gs-level.gs-locked:hover { filter: none; border-color: var(--gs-line); }
.gs-level.gs-locked { background: #efe4d3; color: #a8937c; filter: none; opacity: .75; }
.gs-level.gs-locked .gs-level-thumb { filter: grayscale(1) opacity(.5); }
.gs-results.gs-lost .gs-banner span { color: var(--gs-ink); }

/* short screens (phones held sideways): a slimmer catalog so the room keeps most of the height */
@media (max-height: 520px) {
  #top { top: 4px; padding: 3px 6px; }
  #top .gs-icon, .icon { width: 34px; height: 34px; }
  .pill { padding: 1px 8px; } .pill b { font-size: 13px; }
  #catalog { padding: 3px 4px 4px; bottom: 4px; }
  .tab span { display: none; }
  .tab img { width: 22px; height: 22px; }
  .card { width: 76px; height: 82px; padding: 3px; }
  .card img { width: 60px; height: 40px; }
  .card b { font-size: 10.5px; }
  .card small { font-size: 11px; }
  #placebar, #selbar { bottom: 132px; }
  #brief { top: 52px; max-height: calc(100% - 52px - 130px); }
}
.reveal-d .gs-btns { flex-wrap: nowrap; gap: 8px; }
.reveal-d .gs-btns .gs-btn { min-width: 0; flex: 0 1 auto; padding-left: 14px; padding-right: 14px; }
