/* MultiCraft — HUB panes ("Altın Saat", round 6; owner: hub). Dünyalar (stage + gate + shelf / phone hero + rows / land
   split / welcome), Yeni Dünya + Dünya Ayarları (one two-column form), the invite sheet, Profil, Karakter, the Kontrol
   Rehberi and the seed postcards. Components (buttons, fields, cards, dialogs, toasts…) come from components.css and the
   hub frame (top band, tab bar, rail, social band, room bar) from style.css: this file holds hub LAYOUT only.
   Tiers (SPEC 2.5): base = phone portrait · land = (min-width 600px) and (max-height 500px) · wide = (min-width 840px) and
   (min-height 501px) · lg = (min-width 1200px) and (min-height 501px) · xl = (min-width 1600px) and (min-height 700px).
   Hover rules live only inside @media (hover: hover) and (pointer: fine). */

/* (round 6 QA: the base-component overrides that lived here moved into components.css / style.css) */

/* ================================================================ seed postcards + world pictures (G1, SPEC 5.13) */
.pc-host { position: absolute; inset: 0; display: block; overflow: hidden; }
.pc-host > canvas { position: absolute; left: 0; bottom: 0; display: block; image-rendering: pixelated; }
.wthumb { position: absolute; inset: 0; display: block; overflow: hidden; background: var(--carbon-0); }
.wthumb > .cap { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity var(--dur-3) var(--ease-out); }
.wthumb.has-cap > .cap { opacity: 1; }

/* ================================================================ DÜNYALAR (SPEC 8.1-8.3) */
/* the pane is a flex column chain, so a page (and the offline / error stage) fills the visible height */
.hub-pane-worlds { display: flex; flex-direction: column; }
.hub-pane-worlds > .hub-pane-inner { flex: 1 0 auto; display: flex; flex-direction: column; }
.hub-pane-worlds .worlds-tab { flex: 1 0 auto; display: flex; flex-direction: column; }
.wpage { display: flex; flex-direction: column; flex: 1 0 auto; }
.wpage > .wshelf { flex: 1 0 auto; }

/* ---- stage: the selected world, projected (the art dissolves on selection) */
.wstage { flex: none; height: min(46dvh, 23.75rem); }
.wstage > .stage-art { position: absolute; inset: 0; z-index: -2; }
.wstage > .stage-art > .layer { transition: opacity var(--dur-4) var(--ease-inout); }
.wstage > .stage-art > .layer.enter { opacity: 0; }
.wstage > .scrim { background: linear-gradient(to top, var(--bg-app) 0%, rgba(13, 10, 8, .93) 34%, rgba(13, 10, 8, .45) 62%, rgba(13, 10, 8, 0) 86%); }
.wstage .stage-copy { width: 100%; max-width: none; padding: 0 var(--pad-x) 1.25rem; gap: .5rem; }
.wstage .stage-copy.swap { animation: fadeIn var(--dur-3) var(--ease-out); }
.wstage .kicker { text-shadow: 0 1px 2px rgba(0, 0, 0, .6); }
.wstage .wname { overflow-wrap: anywhere; }
.wstage .kunye { color: var(--paper-1); text-shadow: 0 1px 2px rgba(0, 0, 0, .7); width: 100%; }
.wstage .kunye > .tag { text-shadow: none; }
.wstage .kunye > .tag + *::before { display: none; }
.wstage .social-line .av-stack .av { width: 1.5rem; height: 1.5rem; }
.wstage .stage-actions { width: 100%; margin-top: .375rem; flex-wrap: nowrap; gap: .625rem; }
.wstage .stage-actions > .go { flex: 1 1 auto; min-width: 0; }
.wstage .stage-actions > .inv, .wstage .stage-actions > .more { width: var(--b-h); padding: 0; flex: none; }
.wstage .stage-actions > .inv > span { display: none; }
.wstage .w-only { display: none; }

/* skeleton stage (static: no shimmer, P11) */
.wstage.is-skel { background: var(--surface-1); }
.wstage.is-skel .sk-k { height: .875rem; }
.wstage.is-skel .sk-t { height: 2.25rem; }
.wstage.is-skel .sk-b { height: var(--ctl-lg); border-radius: var(--r-sm); }
.wstage.is-skel .stage-actions > .sk-b:first-child { flex: 1; }

/* ---- gate bar: the amber segment sits above the selected card's column */
.wgate > .gsel { left: 0; width: 0; opacity: 0; transition: transform var(--dur-3) var(--ease-out), width var(--dur-3) var(--ease-out), opacity var(--dur-2); }

/* ---- shelf */
.wshelf { padding: .875rem var(--pad-x) 1.5rem; }
.wshelf > .shelf-head { flex-wrap: nowrap; margin-bottom: .25rem; }
.wshelf > .shelf-head > .t-lg { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.wfilter { margin-left: auto; grid-auto-columns: auto; flex: none; }
.wfilter > button { padding: 0 .75rem; }
.wfilter .c { font-size: var(--fs-k2); }
/* Duyuru (MOTD): compact strip on phones, a card on the stage's free corner (lg), after the shelf (wide) */
.wmotd .motd { display: flex; align-items: stretch; }
.wmotd .motd > .art { width: 8rem; aspect-ratio: auto; flex: none; }
.wmotd .motd > .m-body { flex: 1; min-width: 0; padding-right: 3rem; }
.wmotd.compact { padding: .25rem var(--pad-x) .5rem; }
.wmotd.compact .motd > .art, .wmotd.compact .motd .m-text, .wmotd.compact .motd .kunye { display: none; }
.wmotd.compact .motd > .m-body { gap: .125rem; padding: .625rem 3rem .625rem .875rem; }
.wmotd.compact .m-title { font-size: var(--fs-sm); }
.wmotd.after { padding: 0 var(--pad-x) 1.75rem; }
.wmotd.after .motd { max-width: 40rem; }
.wstage > .wmotd.float { position: absolute; right: var(--pad-x); bottom: 1.75rem; width: min(22rem, calc(100% - 46rem - 3 * var(--pad-x))); z-index: 1; }
.wstage > .wmotd.float .motd { box-shadow: var(--elev-2); }
.wstage > .wmotd.float .motd > .art { width: 6.5rem; }
@media (max-width: 1439px) { .wstage > .wmotd.float .motd > .art { display: none; } }

/* cards (desktop / tablet) */
ul.strip { list-style: none; margin: 0; padding: 0; }
.wstrip > li { min-width: 0; }
/* long lists (P9): cards and rows below the first dozen render only near the viewport */
.wstrip > li:nth-child(n+13) { content-visibility: auto; contain-intrinsic-size: auto 15rem; }
.wrows > .wrow:nth-child(n+13) { content-visibility: auto; contain-intrinsic-size: auto 4.5rem; }
.wcard-slot { display: grid; }
.wcard-slot > .wcard.create { height: 100%; width: 100%; }
.wcard .thumb { display: block; }
.wcard .thumb > .chip.live { position: absolute; left: .5rem; top: .5rem; z-index: 1; pointer-events: none; }
.wcard .wtitle { display: flex; align-items: center; gap: .5rem; }
.wcard .wtitle > .wt, .wrow .wtitle > .wt { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wcard .wtitle > .tag, .wrow .wtitle > .tag { margin: 0; }
.wcard .wbody > .kunye { color: var(--text-3); }
.wcard > .hit { position: absolute; inset: 0; z-index: 1; margin: 0; padding: 0; border: 0; border-radius: inherit; background: transparent; cursor: pointer; }
.wcard > .hit:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--focus), inset 0 0 0 4px var(--bg-app); }
.wcard > .more { z-index: 2; color: var(--text-2); }
.wcard .thumb > .playdisc { z-index: 2; border: 0; cursor: pointer; }
.wcard.is-skel { pointer-events: none; box-shadow: none; }
.wcard.is-skel .thumb > .sk-fill { position: absolute; inset: 0; border-radius: 0; }
.wcard.is-skel .wbody { gap: .625rem; padding-right: .875rem; }
.wcard.is-skel .sk-l { height: 1rem; } .wcard.is-skel .sk-s { height: .75rem; }
.shelf-head .sk-c { width: 1.5rem; height: 1.5rem; }

/* rows (phones) */
.wrows { display: grid; }
.wrow { gap: .625rem; padding: .5rem 0; }
.wrow-main { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: .875rem; margin: 0; padding: 0; border: 0; border-radius: var(--r-sm);
  background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.wrow-main:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--bg-app), 0 0 0 4px var(--focus); }
.wrow-main > .thumb { position: relative; width: 6rem; aspect-ratio: 16 / 9; border-radius: var(--r-sm); overflow: hidden; flex: none; background: var(--carbon-0); }
.wrow-main > .grow { display: grid; gap: .3125rem; min-width: 0; }
.wrow .wtitle { display: flex; align-items: center; gap: .5rem; min-width: 0; }
.wrow .kunye { color: var(--text-3); }
.wrow .live-dot { position: absolute; left: .375rem; top: .375rem; width: .5rem; height: .5rem; border-radius: 50%; background: var(--online); box-shadow: 0 0 0 2px rgba(10, 8, 6, .85); }
.wrow > .wplay { flex: none; }
.wrow.create .plus-thumb { display: grid; place-items: center; background: transparent; border: 1px dashed var(--line-3); color: var(--amber-300); }
.wrow.create .hint { display: block; font-size: var(--fs-sm); color: var(--text-3); line-height: 1.35; }
.wrow.create .chev { color: var(--text-3); flex: none; margin-left: auto; }
.wrow.is-skel { pointer-events: none; }
.wrow.is-skel .thumb > .sk-fill { position: absolute; inset: 0; border-radius: 0; }
.wrow.is-skel .sk-l { height: 1rem; } .wrow.is-skel .sk-s { height: .75rem; }

/* states (offline, load error) */
/* the stage fills the pane with a quiet night postcard and carries the message (never a small block on a blank page) */
.wpage.is-state > .wstage { flex: 1 1 auto; height: auto; min-height: min(46dvh, 23.75rem); }
.wstage.is-state .stage-copy { gap: .625rem; }
.wstate-ico { display: grid; place-items: center; width: 3rem; height: 3rem; margin-bottom: .25rem; border-radius: var(--r-md); background: rgba(10, 8, 6, .62);
  border: 1px solid rgba(255, 236, 214, .22); color: var(--text-1); }
.wstate-ico.bad { color: var(--danger-text); border-color: rgba(255, 107, 95, .5); }
.wstate-ico > .ico { width: 1.5rem; height: 1.5rem; }
.wstage.is-state .t-xl { text-shadow: 0 1px 2px rgba(0, 0, 0, .6); }
.wstate-text { max-width: 46ch; color: var(--text-1); line-height: 1.45; text-shadow: 0 1px 2px rgba(0, 0, 0, .7); }

/* ---- welcome (no world of your own yet) */
.welcome { display: grid; gap: 1.5rem; padding: 1.75rem var(--pad-x) 1.25rem; align-content: start; }
.wl-head { display: grid; gap: .5rem; }
.wl-head > .display { font-size: var(--fs-d4); overflow-wrap: anywhere; }
.wl-sub { color: var(--text-2); font-size: var(--fs-lg); line-height: 1.45; max-width: 40rem; }
.wl-choices { display: grid; gap: var(--gap); }
.wl-card { display: flex; flex-direction: column; min-width: 0; overflow: hidden; border-radius: var(--r-md); background: var(--surface-1); border: 1px solid var(--line-1); box-shadow: var(--elev-1); }
.wl-card > .art { position: relative; aspect-ratio: 16 / 7; overflow: hidden; background: var(--carbon-0); }
.wl-card > .art > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.wl-card > .art > .collage { position: absolute; inset: 0; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 2px; background: var(--band); }
.wl-card > .art > .collage > img { width: 100%; height: 100%; object-fit: cover; min-height: 0; }
.wl-body { display: grid; gap: .375rem; padding: 1rem 1.125rem 1.125rem; align-content: start; justify-items: start; }
.wl-body > p { color: var(--text-2); font-size: var(--fs-sm); }
.wl-body > .btn { margin-top: .5rem; }
.wl-now { display: grid; gap: .25rem; }
.wl-now-list { display: grid; column-gap: var(--gap); }
.now-row .nthumb { position: relative; width: 4.5rem; aspect-ratio: 16 / 9; border-radius: var(--r-xs); overflow: hidden; flex: none; background: var(--carbon-0); }
.now-row .nthumb > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* ---- phones portrait: hero at the top of the scroll, then the rows */
/* short phones (F3 + 8.2 ACCEPT "hero primary + 2 rows at 360x640"): the Duyuru strip moves under the list */
@media (max-width: 599px) and (max-height: 700px) {
  .wstage { height: min(44dvh, 23.75rem); } .wstage .social-line { display: none; }
  .wpage.lay-phone > .wmotd.compact { order: 9; padding-top: 0; padding-bottom: 1.25rem; }
}
/* narrow phones: "Dünyaların 4" + "Benim | Herkese Açık 2" share one line without truncating the title */
@media (max-width: 399px) {
  .wshelf > .shelf-head { gap: .5rem; }
  .wfilter > button { padding: 0 .5rem; }
}
@media (max-width: 599px) {
  .wl-choices { grid-template-columns: minmax(0, 1fr); }
  .wl-card { flex-direction: row; }
  .wl-card > .art { width: 6.5rem; aspect-ratio: auto; flex: none; }
  .wl-body { padding: .875rem 1rem 1rem; }
  .wl-body > .btn { margin-top: .25rem; }
}
@media (min-width: 600px) and (max-width: 839px) and (min-height: 501px) {
  .wpage.lay-phone > .wshelf, .wpage.lay-phone > .wmotd, .welcome { max-width: 44rem; width: 100%; margin-inline: auto; }
  .wl-choices { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---- phones landscape: stage left (48 %), list right (scrolls, fades) */
@media (min-width: 600px) and (max-height: 500px) {
  .hub-pane-worlds, .hub-pane-worlds > .hub-pane-inner, .hub-pane-worlds .worlds-tab { height: 100%; min-height: 0; }
  .wpage.lay-land { display: grid; grid-template-columns: 48% minmax(0, 1fr); height: 100%; min-height: 0; }
  .wpage.lay-land > .wstage { height: 100%; }
  .wpage.lay-land > .wshelf { min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; padding: .5rem calc(1.25rem + var(--safe-r)) 1rem 1.25rem;
    border-left: 1px solid var(--line-1); background: var(--band); }
  .wpage.lay-land > .wshelf::-webkit-scrollbar { display: none; }
  .wpage.lay-land .shelf-head { min-height: var(--ctl-sm); }
  .wpage.lay-land .wfilter { display: none; }
  .wpage.lay-land .wrow-main > .thumb { width: 5rem; }
  .wstage > .scrim { background: linear-gradient(to top, rgba(10, 8, 6, .94) 0%, rgba(10, 8, 6, .55) 46%, rgba(10, 8, 6, 0) 74%); }
  .wstage .stage-copy { padding: 1rem 1.25rem 1.125rem calc(1.25rem + var(--safe-l) * 0); gap: .375rem; }
  .wstage .wname { font-size: 1.875rem; }
  .wstage .social-line { font-size: var(--fs-sm); }
  .wpage.lay-land.is-welcome { display: block; height: 100%; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; }
  /* the welcome page scrolls as one: its public-worlds shelf must not become a second (unsized) scroller that swallows the
     drag (overscroll-behavior: contain stopped the page under the list from scrolling) */
  .wpage.lay-land.is-welcome > .wshelf { min-height: auto; overflow: visible; overscroll-behavior: auto; border-left: 0; }
  .wpage.lay-land.is-state { display: flex; height: 100%; }
  .wpage.lay-land.is-state > .wstage { min-height: 0; }
  .welcome { padding: 1rem var(--pad-x); gap: 1rem; }
  .wl-head > .display { font-size: 1.875rem; }
  .wl-choices { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wl-card > .art { aspect-ratio: 16 / 6; }
}

/* ---- desktop / tablet: stage + gate + shelf; the shelf's first row always fits (SPEC 5.28 formulas) */
@media (min-width: 840px) and (min-height: 501px) {
  .wstage { height: clamp(15rem, calc(100dvh - var(--band-h) - 22rem), 26rem); }
  .wstage > .scrim { background: linear-gradient(to right, rgba(10, 8, 6, .8) 0%, rgba(10, 8, 6, .42) 34%, rgba(10, 8, 6, 0) 60%),
                                  linear-gradient(to top, rgba(10, 8, 6, .88) 0%, rgba(10, 8, 6, .3) 40%, rgba(10, 8, 6, 0) 64%); }
  .wstage .stage-copy { padding: 2rem var(--pad-x) 1.75rem; gap: .625rem; max-width: 46rem; }
  .wstage .wname { font-size: var(--fs-d3); }
  .wstage .w-only { display: inline; }
  .wstage .stage-actions { width: auto; margin-top: .5rem; }
  .wstage .stage-actions > .go { flex: none; min-width: 11rem; }
  .wstage .stage-actions > .inv { width: auto; padding: 0 1.25rem; }
  .wstage .stage-actions > .inv > span { display: inline; }
  .wstage.is-skel .stage-actions > .sk-b:first-child { flex: none; }
  .wshelf { padding: 1rem var(--pad-x) 1.75rem; }
  .wshelf > .shelf-head { margin-bottom: .75rem; }
  .wfilter { margin-left: 1rem; }
  .welcome { padding: 2.25rem var(--pad-x) 1.5rem; gap: 1.75rem; }
  .wl-head > .display { font-size: var(--fs-d3); }
  .wl-choices { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* the two choices fill the first screen like the stage does (no empty half page on a new player's home) */
  .wl-card > .art { aspect-ratio: auto; height: clamp(12rem, calc(100dvh - var(--band-h) - 22rem), 26rem); }
  .welcome.has-now .wl-card > .art { height: clamp(10rem, calc(100dvh - var(--band-h) - 32rem), 22rem); }   /* + Şimdi oynayanlar in view */
  .wl-now-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1200px) and (min-height: 501px) {
  .wstage .wname { font-size: var(--fs-d2); }
  .wstage .stage-copy { padding-bottom: 2.25rem; }
}
@media (min-width: 1600px) and (min-height: 700px) {
  .wstage { height: clamp(18rem, calc(100dvh - var(--band-h) - 24rem), 38rem); }
}
/* short laptop windows (a 768 px screen minus the browser chrome): a compact copy block, no social line */
@media (min-width: 840px) and (min-height: 501px) and (max-height: 720px) {
  .wstage .wname { font-size: var(--fs-d3); }
  .wstage .stage-copy { gap: .375rem; padding-top: 1.25rem; padding-bottom: 1.25rem; }
  .wstage .stage-actions { margin-top: .25rem; }
  .wstage .social-line { display: none; }
}
@media (hover: hover) and (pointer: fine) {
  .wcard:hover .thumb > .playdisc { pointer-events: auto; }
  .wrow-main:hover .wtitle > .wt { color: var(--amber-100); }
  .wcard > .more:hover { color: var(--text-0); }
}

/* ================================================================ YENİ DÜNYA + DÜNYA AYARLARI (one form, SPEC 8.4 / 8.5) */
.cw { display: flex; flex-direction: column; min-height: 0; }
.cw.busy { opacity: .6; pointer-events: none; }
.cw-scroll { display: block; }
.cw-col { display: flex; flex-direction: column; gap: 1.5rem; min-width: 0; padding: 1rem var(--pad-x) 1.25rem; }
.cw-col.b { padding-top: .25rem; padding-bottom: 2rem; }
.cw-group { display: grid; grid-template-columns: minmax(0, 1fr); gap: .5rem; min-width: 0; }   /* the track may shrink: the one-line
   "Gelişmiş" summary (nowrap) must never widen the column past the dialog */
.cw .disclose { min-width: 0; }
.cw-col > .group + .group { margin-top: 0; }          /* the column gap is the group rhythm (no double 28 + 24 px) */
.cw-group > .group-h { margin: 0; }
.cw .cw-hint { margin-top: .125rem; }
.cw .opt { color: var(--text-3); font-weight: 400; }
.cw-two { display: grid; gap: 1rem; align-items: start; }
.cw .seed-field { display: none; }
.cw .seed-field.shown { display: grid; }
.cw .seed-reveal { justify-self: start; gap: .375rem; }
.cw .seed-reveal > .ico { width: 1rem; height: 1rem; }
.cw .note.lock-note { margin-top: .125rem; }
.cw .sbox { padding: 0 1rem; }
.cw .srow .lbl { align-items: center; }
.cw .srow .lbl.is-danger { color: var(--danger-text); }
.cw .srow .lbl > .ico { width: 1.125rem; height: 1.125rem; }
.cw .srow .desc.lock-note { color: var(--info-text); }
.cw .disclose > .disc-tx { display: grid; gap: .125rem; min-width: 0; padding: .625rem 0; text-align: left; line-height: 1.3; }
.cw .disclose > .disc-tx > .dim { color: var(--text-3); }
.cw .disclose > .ico:first-child { color: var(--text-2); width: 1.25rem; height: 1.25rem; flex: none; }
.cw .disclose + .sbox { margin-top: .5rem; }
.cw .rcard > .art > img { pointer-events: none; }
.cw .postcard > .pc-label { white-space: normal; line-height: 1.2; min-height: 2.4em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cw .postcard > .pc-art { background: var(--carbon-0); }
/* member chips */
.mchips-box { display: flex; flex-wrap: wrap; align-items: center; gap: .375rem; min-height: var(--ctl-md); padding: .3125rem; border-radius: var(--r-sm);
  background: var(--surface-sunken); border: 1px solid var(--line-field); }
.mchips-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 178, 63, .18); }
.mchips { display: contents; }
.mchips-box > .input { flex: 1 1 10rem; min-width: 8rem; height: calc(var(--ctl-md) - .75rem); padding: 0 .5rem; border: 0; background: transparent; box-shadow: none; }
.mchips-box > .input:focus { box-shadow: none; }
.mchip { padding-right: .125rem; color: var(--text-1); }
.mchip-x { position: relative; display: grid; place-items: center; width: 1.5rem; height: 1.5rem; margin: 0; padding: 0; border: 0; border-radius: var(--r-xs); background: none; color: var(--text-2); cursor: pointer; }
.mchip-x::before { content: ""; position: absolute; inset: -.625rem -.5rem; }
.mchip-x:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--focus); }
/* footer: postcard + künye summary (create), what changed (settings) */
.cw-sum { display: flex; align-items: center; gap: .75rem; min-width: 0; }
.cw-sum-pc { position: relative; width: 40px; height: 25px; border-radius: 3px; overflow: hidden; flex: none; box-shadow: inset 0 0 0 1px var(--line-2); }
.cw-sum-tx { display: grid; gap: .125rem; min-width: 0; }
.cw-sum .kunye { color: var(--text-1); }
.cw-status { color: var(--text-3); }
.dlg-root.v-full .cw-dlg .foot-note, .dlg-root.v-land .cw-dlg .foot-note { display: none; }
.cw-dlg .dlg-foot > .btn-primary { min-width: 12rem; }
.dlg-root.v-full .cw-dlg .dlg-foot > .btn-primary { min-width: 0; }
/* phones portrait: the sheet body scrolls as one column */
.dlg-root.v-full .cw-dlg > .dlg-body { padding: 0; }
@media (max-width: 599px) {
  .cw .seed-field:not(.shown) { display: none; }
}
@media (min-width: 600px) {
  .cw .seed-reveal { display: none; }
  .cw .seed-field { display: grid; }
}
/* phones landscape: two columns, both scroll; the primary sits in the header (dialogs.js) */
.dlg-root.v-land .cw-dlg > .dlg-body { padding: 0; overflow: hidden; display: flex; }
.dlg-root.v-land .cw { flex: 1; }
.dlg-root.v-land .cw-scroll { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.dlg-root.v-land .cw-col { min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; gap: 1rem; padding: .75rem 1rem 1rem calc(1.25rem + var(--safe-l)); }
.dlg-root.v-land .cw-col::-webkit-scrollbar { display: none; }
.dlg-root.v-land .cw-col.b { padding: .75rem calc(1.25rem + var(--safe-r)) 1.5rem 1rem; border-left: 1px solid var(--line-1); }
.dlg-root.v-land .cw-two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .625rem; }
.dlg-root.v-land .cw-two.one { grid-template-columns: minmax(0, 1fr); }
.dlg-root.v-land .cw .rcards { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
.dlg-root.v-land .cw .rcard { flex-direction: column; align-items: stretch; min-height: 0; padding-right: 0; }
.dlg-root.v-land .cw .rcard > .art { width: 100%; height: auto; aspect-ratio: 16 / 9; margin: 0; border-radius: 0; }
.dlg-root.v-land .cw .rcard .rbody { padding: .375rem .5rem .5rem; }
.dlg-root.v-land .cw .rcard .rtitle { font-size: var(--fs-sm); }
.dlg-root.v-land .cw .rcard .rdesc { display: none; }
.dlg-root.v-land .cw .rcard .radio { top: .375rem; right: .375rem; margin-top: 0; width: 1.25rem; height: 1.25rem; }
.dlg-root.v-land .cw-group .group-h .t-lg { font-size: 1rem; }
/* the five world types scroll sideways (with the edge fade) instead of squeezing their labels */
.dlg-root.v-land .cw .postcards { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 6.75rem; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; }
.dlg-root.v-land .cw .postcards::-webkit-scrollbar { display: none; }
/* desktop / tablet: a two-column sheet of a fixed height; the left column holds the decisions, the right one scrolls */
.dlg-root.v-center .dlg.cw-dlg { height: var(--dlg-max-h); }
.dlg-root.v-center .cw-dlg > .dlg-body { padding: 0; overflow: hidden; display: flex; }
.dlg-root.v-center .cw { flex: 1; }
.dlg-root.v-center .cw-scroll { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1.06fr) minmax(0, 1fr); }
.dlg-root.v-center .cw-col { min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--carbon-5) transparent; padding: 1.5rem 1.75rem 2rem; gap: 1.75rem; }
.dlg-root.v-center .cw-col.b { border-left: 1px solid var(--line-1); padding-top: 1.5rem; }
.dlg-root.v-center .cw-two { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
.dlg-root.v-center .cw-two.one { grid-template-columns: minmax(0, 1fr); }
.dlg-root.v-center .cw .rcards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dlg-root.v-center .cw .rcard { flex-direction: column; align-items: stretch; padding-right: 0; min-height: 0; }
.dlg-root.v-center .cw .rcard > .art { width: 100%; height: auto; aspect-ratio: 16 / 9; margin: 0; border-radius: 0; }
.dlg-root.v-center .cw .rcard .radio { top: .5rem; right: .5rem; margin-top: 0; }
.dlg-root.v-center .cw .postcards { grid-template-columns: repeat(5, minmax(0, 1fr)); grid-auto-flow: row; grid-auto-columns: auto; overflow: visible; }
.dlg-root.v-center .cw-dlg .dlg-foot { min-height: 4.5rem; }

/* ================================================================ DAVET ET (the one invite sheet, SPEC 8.6) */
.dlg-titles { flex: 1; min-width: 0; display: grid; gap: .125rem; }
.dlg-titles > .t-xl { overflow-wrap: anywhere; }
.invite-ctx { font-size: var(--fs-sm); color: var(--text-3); line-height: 1.3; overflow-wrap: anywhere; }
.invite-sheet { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.invite-qr { display: grid; place-items: center; }
.qr-tile { line-height: 0; border-radius: var(--r-md); overflow: hidden; background: #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .25); }
.qr-tile > canvas.qr { display: block; image-rendering: pixelated; }
.qr-none { max-width: 13rem; padding: 2rem 1.25rem; color: #2e2b27; font-size: var(--fs-sm); line-height: 1.45; }
.invite-side { display: grid; gap: 1rem; align-content: start; min-width: 0; }
.invite-lead { color: var(--text-2); line-height: var(--lh-body); max-width: 46ch; }
.invite-url { display: flex; align-items: center; height: var(--ctl-md); padding: 0 .875rem; border-radius: var(--r-sm); background: var(--surface-sunken); border: 1px solid var(--line-field);
  font: 400 var(--fs-sm)/1.2 var(--font-ui); color: var(--text-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: text; user-select: all; -webkit-user-select: all; }
.invite-url:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 178, 63, .18); }
.invite-actions { display: grid; gap: .625rem; }
.invite-code { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem .75rem; }
.invite-code > .label, .invite-alts > .label { width: 100%; }
.code-show { display: flex; gap: .375rem; }
.code-show > span { width: 2.5rem; height: 3rem; display: grid; place-items: center; border-radius: var(--r-sm); background: var(--surface-sunken); border: 1px solid var(--line-field);
  font: 800 1.625rem/1 var(--font-display); color: var(--amber-200); text-transform: uppercase; }
.invite-alts { display: flex; flex-wrap: wrap; align-items: center; gap: .375rem; }
.invite-alts > .chip { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.invite-notes { display: grid; gap: .5rem; }
.invite-notes:empty { display: none; }
/* phones portrait: QR on top, everything full width */
@media (max-width: 599px) {
  .dlg-root.v-bottom .invite-sheet, .dlg-root.v-full .invite-sheet { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
  .dlg-root.v-bottom .invite-lead { text-align: center; margin-inline: auto; }
}
/* landscape phones (~330 px of usable height): QR left, the link and two side-by-side actions right, no lead sentence */
@media (min-width: 600px) and (max-height: 500px) {
  .invite-sheet { gap: 1.25rem; }
  .invite-side { gap: .75rem; }
  .invite-lead { display: none; }
  .invite-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dlg-root.v-bottom > .dlg.invite-modal { max-width: min(48rem, calc(100% - 2rem)); }
}

/* ================================================================ PROFİL (SPEC 8.7): max three surfaces */
.profile { padding: 1rem var(--pad-x) 2rem; }
.pf-grid { display: grid; gap: 1.25rem; align-items: start; grid-template-columns: minmax(0, 1fr); grid-template-areas: "a" "b" "c"; }
.pf-col { display: grid; gap: 1.25rem; min-width: 0; align-content: start; }
.pf-col-a { grid-area: a; } .pf-col-b { grid-area: b; } .pf-col-c { grid-area: c; }
.pf-h { display: flex; align-items: center; gap: .75rem; margin-bottom: .625rem; }
/* player card: full-body render on a floor glow */
.pf-card { display: flex; align-items: center; gap: 1.125rem; padding: 1rem 1.125rem; overflow: hidden; }
.pf-figure { position: relative; flex: none; width: 4.75rem; height: 9.5rem; display: grid; grid-template: 100% / 100%; place-items: end center; }
.pf-figure::before { content: ""; position: absolute; left: -35%; right: -35%; top: 4%; bottom: 18%; border-radius: 50%; background: radial-gradient(closest-side, rgba(255, 178, 63, .16), rgba(255, 178, 63, 0)); }
.pf-figure > .pf-glow { position: absolute; left: 50%; bottom: -.125rem; width: 130%; height: 1.25rem; transform: translateX(-50%); border-radius: 50%;
  background: radial-gradient(closest-side, rgba(0, 0, 0, .55), rgba(0, 0, 0, 0)), radial-gradient(closest-side, rgba(255, 178, 63, .3), rgba(255, 178, 63, 0)); }
.pf-figure > canvas { position: relative; height: 100%; max-height: 100%; width: auto; max-width: 100%; aspect-ratio: 1 / 2; min-height: 0; }
.pf-figure > canvas.rich { image-rendering: auto; }
.pf-id { display: grid; gap: .5rem; min-width: 0; justify-items: start; }
.pf-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-tags { display: flex; flex-wrap: wrap; gap: .375rem; }
.pf-since { color: var(--text-3); }
.pf-id > .pf-edit { margin-top: .25rem; }
/* guest upgrade (first for guests) */
.pf-upgrade { padding: 1.125rem 1.25rem 1.25rem; border-color: rgba(255, 178, 63, .38); background: linear-gradient(180deg, rgba(255, 178, 63, .07), rgba(255, 178, 63, 0) 45%), var(--surface-1); }
.pf-up-head { display: flex; gap: .875rem; align-items: flex-start; margin-bottom: 1rem; }
.pf-up-ico { display: grid; place-items: center; width: 2.5rem; height: 2.5rem; flex: none; border-radius: var(--r-sm); background: var(--accent-soft); color: var(--amber-300); }
.pf-up-head p { margin-top: .25rem; color: var(--text-2); font-size: var(--fs-sm); line-height: 1.45; max-width: 46ch; }
.pf-form { display: grid; gap: 1rem; }
.pf-form.busy .field { opacity: .6; pointer-events: none; }
/* statistics: one panel, hairline grid (3-up desktop, 2-up phones, never an orphan) */
.pf-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; overflow: hidden; background: var(--line-1); }
.pf-tile { display: grid; gap: .375rem; align-content: start; padding: .875rem 1rem 1rem; background: var(--surface-1); min-width: 0; }
.pf-tile > .num { color: var(--text-0); font-size: var(--fs-n2); white-space: nowrap; }
.pf-tile > span { font-size: var(--fs-sm); color: var(--text-2); }
.pf-tile:last-child:nth-child(odd) { grid-column: 1 / -1; }
.pf-empty { display: grid; gap: .75rem; justify-items: start; padding: 1rem 1.125rem; border-radius: var(--r-md); border: 1px dashed var(--line-2); color: var(--text-2); line-height: 1.5; }
p.pf-empty { display: block; }
/* account list + leaving */
.pf-rows { padding: .25rem; }
.pf-rows .row .sub { white-space: normal; }
.pf-leave { margin-top: .875rem; }
.pf-foot { display: grid; gap: .375rem; padding-top: .25rem; }
.pf-foot .hint { font-size: var(--fs-xs); max-width: 60ch; }
.credits-list { display: grid; gap: .25rem; margin: 0 0 1rem; }
.credits-list > dt { color: var(--text-3); font-size: var(--fs-sm); margin-top: .5rem; }
.credits-list > dt:first-child { margin-top: 0; }
.credits-list > dd { margin: 0; color: var(--text-1); line-height: 1.4; }
@media (min-width: 600px) {
  .pf-tiles { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .pf-tile { grid-column: span 2; }
  .pf-tile:nth-child(n+4) { grid-column: span 3; }
  .pf-tile:last-child:nth-child(odd) { grid-column: span 3; }
  .pf-leave { flex-wrap: nowrap; }
}
@media (min-width: 600px) and (max-height: 500px) {
  .profile { padding: .75rem calc(var(--pad-x) + var(--safe-r)) 1.5rem var(--pad-x); }
  .pf-grid { grid-template-columns: 15rem minmax(0, 1fr); grid-template-areas: "a b" "a c"; gap: 1rem 1.25rem; }
  .pf-card { flex-direction: column; align-items: flex-start; }
  .pf-figure { width: 4rem; height: 8rem; }
}
@media (min-width: 600px) and (max-width: 839px) and (min-height: 501px) { .profile { max-width: 44rem; margin: 0 auto; } }
@media (min-width: 840px) and (min-height: 501px) {
  .profile { padding: 2rem var(--pad-x) 3rem; }
  .pf-grid { grid-template-columns: 18rem minmax(0, 1fr); grid-template-areas: "a b" "a c"; gap: 1.5rem 2rem; }
  .pf-card { flex-direction: column; align-items: stretch; gap: 1rem; padding: 0 0 1.25rem; }
  .pf-figure { width: 100%; height: 15rem; padding-top: 1.5rem;
    background: radial-gradient(90% 70% at 50% 100%, rgba(255, 178, 63, .1), rgba(255, 178, 63, 0) 70%), var(--surface-2); border-bottom: 1px solid var(--line-1); }
  .pf-figure > canvas { height: 12.5rem; max-height: none; max-width: none; margin-bottom: 1.25rem; }
  .pf-figure > .pf-glow { bottom: .75rem; width: 9rem; }
  .pf-id { padding: 0 1.25rem; }
  .pf-tile > .num { font-size: var(--fs-n1); }
  .pf-upgrade { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 1.5rem; align-items: start; }
  .pf-up-head { margin-bottom: 0; }
}
@media (min-width: 1200px) and (min-height: 501px) { .pf-grid { grid-template-columns: 22rem minmax(0, 1fr); } .pf-figure { height: 17rem; } .pf-figure > canvas { height: 14rem; } }
@media (min-width: 1600px) and (min-height: 700px) {
  .pf-grid { grid-template-columns: 22rem minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "a b c"; }
  .pf-upgrade { display: block; }
  .pf-up-head { margin-bottom: 1rem; }
}

/* ================================================================ KONTROL REHBERİ (one component, SPEC 8.9) */
.dlg-root.v-center .dlg.ctl-dlg { height: min(44rem, var(--dlg-max-h)); }
.ctl-dlg > .dlg-body { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.ctl-host { flex: 1; min-height: 0; display: flex; }
.ctl-guide { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.ctl-tabs-row { flex: none; padding: 0 1.5rem; }
.ctl-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; scrollbar-width: thin; scrollbar-color: var(--carbon-5) transparent;
  display: grid; gap: 1.5rem; align-content: start; padding: 1.25rem 1.5rem 1.75rem; }
.ctl-scroll:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--focus); }
.ctl-foot { flex: none; display: flex; justify-content: flex-end; gap: .75rem; padding: .75rem 1.5rem; border-top: 1px solid var(--line-1); }
.ctl-sec { display: grid; gap: .25rem; min-width: 0; }
.ctl-h { margin: 0 0 .25rem; }
.ctl-rows { display: grid; }
.ctl-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 1.5rem; min-height: 3rem; padding: .5rem 0; border-top: 1px solid var(--line-1); }
.ctl-row:first-child { border-top: 0; }
/* keyboard / gamepad: the sections flow in two balanced columns when the sheet is wide enough */
.ctl-cols { columns: 2 22rem; column-gap: 3rem; }
.ctl-cols > .ctl-sec { break-inside: avoid; margin-bottom: 1.5rem; }
.ctl-cols > .ctl-sec:last-child { margin-bottom: 0; }
.ctl-what { font-weight: 500; color: var(--text-1); line-height: 1.35; min-width: 0; }
.ctl-keys { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: .25rem; min-width: 0; }
.kbd.kbd-ico { padding: 0; width: 1.5rem; }
.kbd.kbd-ico > .ico { width: .875rem; height: .875rem; stroke-width: 2.6; }
.ctl-plus { color: var(--text-3); font-size: var(--fs-xs); padding: 0 .125rem; }
.ctl-guide .note { margin-top: .25rem; }
/* touch: the round-5 layout on a canonical landscape phone, numbered */
.ctl-diagram { margin: 0; max-width: 40rem; }
.ctl-diagram > svg { display: block; width: 100%; height: auto; }
.ctl-diagram .dg-phone { fill: var(--carbon-0); stroke: var(--line-3); stroke-width: 2; }
.ctl-diagram .dg-screen { fill: var(--carbon-4); }
.ctl-diagram .dg-ground { fill: var(--carbon-3); }
.ctl-diagram .dg-cross { stroke: rgba(255, 248, 238, .5); stroke-width: 3; stroke-linecap: round; fill: none; }
.ctl-diagram .dg-btn { fill: rgba(10, 8, 6, .62); stroke: rgba(255, 248, 238, .55); stroke-width: 2; }
.ctl-diagram .dg-btn.big { stroke-width: 3; }
.ctl-diagram .dg-ico { fill: var(--paper-0); color: var(--paper-0); }
.ctl-diagram .dg-map { fill: var(--carbon-2); stroke: rgba(255, 248, 238, .45); stroke-width: 2; }
.ctl-diagram .dg-k { font-family: var(--font-display); font-weight: 700; fill: var(--paper-1); }
.ctl-diagram .dg-slot { fill: rgba(10, 8, 6, .5); stroke: rgba(255, 248, 238, .28); stroke-width: 1.5; }
.ctl-diagram .dg-slot.on { stroke: var(--paper-0); stroke-width: 3; }
.ctl-diagram .dg-dots circle { fill: var(--paper-0); }
.ctl-diagram .dg-stick { fill: rgba(10, 8, 6, .35); stroke: rgba(255, 248, 238, .4); stroke-width: 2; }
.ctl-diagram .dg-knob { fill: rgba(255, 248, 238, .28); stroke: rgba(255, 248, 238, .6); stroke-width: 2; }
/* callouts: an 18 px disc with a 12 px number on screen at any diagram width (--dgk = 1 / scale, set by a ResizeObserver) */
.ctl-diagram { --dgk: 1.36; }
.ctl-diagram .dg-badge circle { r: calc(9px * var(--dgk)); fill: var(--surface-3); stroke: var(--paper-2); stroke-width: calc(1.5px * var(--dgk)); }
.ctl-diagram .dg-badge text { font-family: var(--font-display); font-weight: 700; font-size: calc(12px * var(--dgk)); fill: var(--paper-0); }
.ctl-diagram .dg-k { font-size: calc(11px * var(--dgk)); }
/* touch tab: wide = diagram | gestures, then the numbered buttons; narrow = diagram, buttons, gestures */
.ctl-scroll[data-tab="touch"] { grid-template-areas: "dia" "btns" "side"; }
.ctl-scroll[data-tab="touch"] > .ctl-diagram { grid-area: dia; }
.ctl-scroll[data-tab="touch"] > .ctl-btns { grid-area: btns; }
.ctl-scroll[data-tab="touch"] > .ctl-side { grid-area: side; display: grid; gap: 1.25rem; align-content: start; min-width: 0; }
@media (min-width: 840px) and (min-height: 501px) {
  .ctl-scroll[data-tab="touch"] { grid-template-columns: minmax(0, 40rem) minmax(0, 1fr); grid-template-areas: "dia side" "btns btns"; column-gap: 2rem; }
}
.dlg-root.v-land .ctl-scroll[data-tab="touch"] { grid-template-columns: minmax(0, 30rem) minmax(0, 1fr); grid-template-areas: "dia side" "btns btns"; column-gap: 1.5rem; }
/* landscape phones: the footer action lives in the header (dialogs.js land variant) */
.dlg-root.v-land .head-actions > .ctl-foot { padding: 0; border: 0; }
.dlg-root.v-land .head-actions > .ctl-foot > .btn { --b-h: var(--ctl-sm); padding: 0 .875rem; font-size: var(--fs-sm); }
.ctl-num { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); column-gap: 1.5rem; }
.ctl-num > li { display: flex; align-items: flex-start; gap: .75rem; padding: .625rem 0; border-top: 1px solid var(--line-1); min-width: 0; }
.ctl-n { flex: none; display: grid; place-items: center; width: 1.5rem; height: 1.5rem; margin-top: .0625rem; border-radius: 50%; background: var(--surface-3);
  box-shadow: inset 0 0 0 1.5px var(--paper-3); font: 700 .8125rem/1 var(--font-display); color: var(--text-0); }
.ctl-num .ctl-what { display: grid; gap: .125rem; }
.ctl-num .ctl-what > b { font-weight: 600; color: var(--text-0); }
.ctl-num .ctl-what > span { color: var(--text-2); font-size: var(--fs-sm); font-weight: 400; }
.ctl-bul { margin: 0; padding-left: 1.25rem; display: grid; gap: .5rem; color: var(--text-1); line-height: 1.45; }
.ctl-pad-state { display: flex; align-items: center; gap: .625rem; padding: .625rem .875rem; border-radius: var(--r-sm); background: var(--surface-2); color: var(--text-2); font-size: var(--fs-sm); }
.ctl-pad-state.on { background: var(--success-soft); color: var(--success-text); }
/* phones: keys under the action, stacked tabs that always fit 360 px */
@media (max-width: 599px) {
  .ctl-tabs-row { padding: 0 1rem; }
  .ctl-tabs > [role="tab"] { flex-direction: column; height: auto; min-height: 3.5rem; padding: .5rem .25rem .625rem; gap: .25rem; font-size: var(--fs-sm); }
  .ctl-scroll { padding: 1rem 1rem 1.5rem; gap: 1.25rem; }
  .ctl-row { grid-template-columns: minmax(0, 1fr); gap: .375rem; }
  .ctl-keys { justify-content: flex-start; }
  .ctl-foot { padding: .75rem 1rem calc(.75rem + var(--safe-b)); }
  .ctl-foot > .btn { flex: 1; }
}
.dlg-root.v-land .ctl-tabs-row { padding: 0 calc(1.25rem + var(--safe-r)) 0 calc(1.25rem + var(--safe-l)); }
.dlg-root.v-land .ctl-scroll { padding: .875rem calc(1.25rem + var(--safe-r)) 1.25rem calc(1.25rem + var(--safe-l)); }
.dlg-root.v-land .ctl-tabs > [role="tab"] { height: 2.75rem; }
.dlg-root.v-land .ctl-diagram { max-width: 30rem; }

/* ================================================================ KARAKTER (dressing room, SPEC 8.8) */
.hub-pane-character, .hub-pane-character > .hub-pane-inner { height: 100%; min-height: 0; }
/* phones: a full-screen editor (its own header, no hub bars) so the preview stays pinned while the cards scroll */
@media (max-width: 599px) { .hub-view[data-tab="character"] > .topband, .hub-view[data-tab="character"] > .tabbar { display: none; } }
@media (min-width: 600px) and (max-height: 500px) { .hub-view[data-tab="character"] > .rail { display: none; } }

.cs-root { display: flex; flex-direction: column; height: 100%; min-height: 0; background: var(--bg-app); }
.cs-head { display: none; flex: none; align-items: center; gap: .25rem; height: calc(3.5rem + var(--safe-t)); padding: var(--safe-t) calc(.75rem + var(--safe-r)) 0 calc(.25rem + var(--safe-l));
  background: var(--band); border-bottom: 1px solid var(--line-1); }
.cs-head-t { flex: 1; min-width: 0; margin: 0; font-size: var(--fs-lg); font-weight: 600; color: var(--text-0); }
/* stage: the model on a floor disc (3D), a warm backlight (rim) behind it */
.cs-stage { position: relative; flex: none; height: 38dvh; min-height: 12rem; overflow: hidden; isolation: isolate;
  background: radial-gradient(42% 46% at 50% 44%, rgba(255, 178, 63, .2), rgba(255, 178, 63, .05) 55%, rgba(255, 178, 63, 0) 75%),
              radial-gradient(130% 80% at 50% 108%, var(--carbon-4), var(--carbon-1) 62%); }
.cs-stage > .cs-gl, .cs-stage > .cs-2d { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; z-index: 0; }
.cs-stage > .cs-gl:active { cursor: grabbing; }
.cs-title { position: absolute; left: 1rem; right: 1rem; top: .75rem; z-index: 1; display: grid; gap: .25rem; justify-items: start; pointer-events: none; }
.cs-title > .kicker { display: none; }
.cs-name { font-size: 1.375rem; text-shadow: 0 2px 16px rgba(0, 0, 0, .55); }
.cs-desc { display: none; max-width: 28rem; font-size: var(--fs-sm); color: var(--text-2); line-height: 1.4; text-shadow: 0 1px 2px rgba(0, 0, 0, .7); }
.cs-tools { position: absolute; left: 50%; bottom: .75rem; z-index: 1; display: flex; transform: translateX(-50%); }
.cs-tools > .btn { border-radius: 0; margin-left: -1px; }
.cs-tools > .btn:first-child { border-radius: var(--r-sm) 0 0 var(--r-sm); margin-left: 0; }
.cs-tools > .btn:last-child { border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.cs-tools > .btn[aria-pressed="true"] { background: var(--sel-bg); border-color: var(--sel-line); color: var(--sel-text); position: relative; z-index: 1; }
/* editor: tabs, one chip scroller, the card grid, the save bar */
.cs-editor { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.cs-tabs-row { flex: none; padding: 0 .5rem; }
.cs-chips { flex: none; display: flex; gap: .375rem; padding: .625rem 1rem .25rem; }
.cs-chips > .chip { flex: none; }
.cs-body { flex: 1 1 auto; min-height: 0; padding: .5rem 1rem 1.25rem; }
.cs-body:focus { outline: none; }
.cs-actions { flex: none; display: flex; align-items: center; gap: .5rem; padding: .625rem calc(1rem + var(--safe-r)) calc(.625rem + var(--safe-b)) calc(1rem + var(--safe-l));
  background: var(--band); border-top: 1px solid var(--line-1); }
.cs-actions > .grow { flex: 1; }
.cs-sec { display: grid; gap: .625rem; }
.cs-sec + .cs-sec, .cs-grid + .cs-sec { margin-top: 1.5rem; }
.cs-sec-h { margin: 0; font-size: var(--fs-md); font-weight: 600; color: var(--text-0); }
.cs-sec > .hint { margin-top: -.375rem; }
.cs-grid { display: grid; gap: .5rem; grid-template-columns: repeat(auto-fill, minmax(5rem, 1fr)); }
.cs-grid.g-full { grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr)); }
.cs-tile { position: relative; display: grid; gap: .375rem; align-content: start; min-width: 0; margin: 0; padding: .375rem .375rem .5rem; border-radius: var(--r-md);
  border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text-1); font: inherit; text-align: center; cursor: pointer;
  transition: border-color var(--dur-2) var(--ease-out), background-color var(--dur-2) var(--ease-out); }
.cs-art { position: relative; display: grid; place-items: center; aspect-ratio: 1; overflow: hidden; border-radius: var(--r-sm);
  background: radial-gradient(circle at 50% 38%, rgba(255, 236, 214, .08), rgba(255, 236, 214, 0) 68%), var(--carbon-1); }
.cs-tile.k-full .cs-art { aspect-ratio: 5 / 8; }
.cs-thumb { width: 100%; height: 100%; object-fit: contain; display: block; image-rendering: pixelated; }
.cs-thumb.rich { image-rendering: auto; }
.cs-none { display: grid; place-items: center; width: 100%; height: 100%; color: var(--text-3); }
.cs-lbl { font-size: var(--fs-sm); font-weight: 500; line-height: 1.2; min-height: 2.4em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  overflow-wrap: break-word; hyphens: auto; }   /* words wrap at spaces ("Kovboy / Şapkası"), never mid-word ("Kapüşonl/u") */
.cs-check { position: absolute; top: .375rem; right: .375rem; display: none; place-items: center; width: 1.25rem; height: 1.25rem; border-radius: 50%; background: var(--accent); color: var(--text-on-accent); }
.cs-check > .ico { width: .75rem; height: .75rem; stroke-width: 3; }
.cs-tile.on { border-color: var(--accent); background: var(--sel-card-bg); box-shadow: 0 0 0 .5px var(--accent), inset 0 0 0 .5px var(--accent); }
.cs-tile.on .cs-lbl { color: var(--amber-100); }
.cs-tile.on .cs-check { display: grid; }
.cs-tile:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--bg-app), 0 0 0 4px var(--focus); }
/* swatches: 32 px squares, 44 px hit, selected = amber ring with a 2 px gap */
.cs-sw { display: flex; flex-wrap: wrap; gap: .625rem; }
.sw { position: relative; flex: none; display: grid; place-items: center; width: 2rem; height: 2rem; margin: 0; padding: 0; border: 0; border-radius: var(--r-xs); cursor: pointer;
  background: var(--sw, var(--surface-3)); color: var(--text-1); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .22); }
.sw::before { content: ""; position: absolute; inset: -.375rem; }
.sw.on { box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .35), 0 0 0 2px var(--bg-app), 0 0 0 4px var(--accent); }
.sw:focus-visible { outline: none; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .35), 0 0 0 2px var(--bg-app), 0 0 0 4px var(--focus); }
.sw-auto, .sw-custom { background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--line-3); }
.sw-auto > .ico, .sw-custom > .ico { width: 1rem; height: 1rem; }
.sw-auto.on, .sw-custom.on { box-shadow: inset 0 0 0 1px var(--line-3), 0 0 0 2px var(--bg-app), 0 0 0 4px var(--accent); }
.sw-custom > input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; border: 0; opacity: 0; cursor: pointer; }
.sw-custom:focus-within { box-shadow: inset 0 0 0 1px var(--line-3), 0 0 0 2px var(--bg-app), 0 0 0 4px var(--focus); }

/* phones portrait: header + pinned preview + editor + docked save bar (the status chip sits in the header) */
@media (max-width: 599px) {
  .cs-head { display: flex; }
  .cs-actions > .cs-status, .cs-actions > .grow { display: none; }
  .cs-actions > .btn { flex: 1 1 0; min-width: 0; }
  .cs-tabs-row .tabs > [role="tab"] { flex-direction: column; height: auto; min-height: 3.5rem; padding: .5rem .125rem .625rem; gap: .25rem; font-size: var(--fs-xs); }
  .cs-tabs-row .tabs > [role="tab"] > .ico { width: 1.375rem; height: 1.375rem; }
  .cs-grid { grid-template-columns: repeat(auto-fill, minmax(4.5rem, 1fr)); }
  .cs-grid.g-full { grid-template-columns: repeat(auto-fill, minmax(5rem, 1fr)); }
  /* 4 per row at 390 px: 12.5 px labels on a 75 px line hold the longest single words (“Laboratuvar” 74 px) */
  .cs-tile { padding: .3125rem .25rem .5rem; }
  .cs-lbl { font-size: .78125rem; }
}
/* very narrow phones (360 px): 3 bigger cards per row instead of 4 tiny ones with broken words */
@media (max-width: 379px) { .cs-grid, .cs-grid.g-full { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 599px) and (max-height: 700px) { .cs-stage { height: 32dvh; min-height: 10rem; } .cs-name { font-size: 1.125rem; } }
/* portrait tablets: the phone layout, the hub bars stay */
@media (min-width: 600px) and (max-width: 839px) and (min-height: 501px) {
  .cs-stage { height: 40dvh; }
  .cs-title > .kicker, .cs-desc { display: block; }
}
/* phones landscape: preview left (35 %, status + Geri Al under it), editor right, icon-only tabs */
@media (min-width: 600px) and (max-height: 500px) {
  .cs-root { display: grid; grid-template-columns: 35% minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr) auto;
    grid-template-areas: "head tabs" "stage chips" "stage body" "act body"; }
  .cs-head { display: flex; grid-area: head; height: 3rem; padding: 0 .5rem 0 calc(.25rem + var(--safe-l)); }
  .cs-head > .cs-status { display: none; }
  .cs-stage { grid-area: stage; height: auto; min-height: 0; border-right: 1px solid var(--line-1); }
  .cs-editor { display: contents; }
  .cs-tabs-row { grid-area: tabs; padding: 0 calc(.75rem + var(--safe-r)) 0 .75rem; background: var(--band); border-bottom: 1px solid var(--line-1); }
  .cs-tabs-row .tabs { border-bottom: 0; height: 3rem; }
  .cs-tabs-row .tabs > [role="tab"] { height: 3rem; }
  .cs-tabs-row .tabs > [role="tab"] > span { display: none; }
  .cs-chips { grid-area: chips; padding: .5rem calc(1rem + var(--safe-r)) .25rem 1rem; }
  .cs-body { grid-area: body; padding: .375rem calc(1rem + var(--safe-r)) 1rem 1rem; }
  .cs-actions { grid-area: act; padding: .5rem .75rem calc(.5rem + var(--safe-b)) calc(.75rem + var(--safe-l)); border-right: 1px solid var(--line-1); gap: .375rem; }
  .cs-actions > .grow { display: none; }
  .cs-actions > .cs-status { margin-right: auto; }
  .cs-actions > .cs-rand > span, .cs-actions > .cs-undo > span { display: none; }
  .cs-actions > .cs-rand, .cs-actions > .cs-undo { flex: none; width: var(--b-h); padding: 0; }
  .cs-actions { min-width: 0; overflow: hidden; }
  .cs-actions > .cs-status { min-width: 0; flex: 0 1 auto; overflow: hidden; }
  .cs-actions > .cs-status > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .cs-title { left: .75rem; top: .5rem; }
  .cs-name { font-size: 1.125rem; }
  .cs-tools { bottom: .5rem; }
  .cs-tools > .btn > span { display: none; }
  .cs-tools > .btn { width: var(--b-h); padding: 0; }
  .cs-grid { grid-template-columns: repeat(auto-fill, minmax(5.25rem, 1fr)); }
  .cs-lbl { font-size: .8125rem; }
}
/* desktop / tablet: preview panel (40 %) + editor panel side by side, full height of the page */
@media (min-width: 840px) and (min-height: 501px) {
  .cs-root { display: grid; grid-template-columns: minmax(20rem, 40%) minmax(0, 1fr); gap: var(--gap); padding: 1.25rem var(--pad-x) 1.5rem; }
  .cs-stage { height: auto; min-height: 0; border-radius: var(--r-md); border: 1px solid var(--line-1); }
  .cs-title { left: 1.5rem; right: 1.5rem; top: 1.25rem; }
  .cs-title > .kicker, .cs-desc { display: block; }
  .cs-name { font-size: var(--fs-d5); }
  .cs-tools { bottom: 1.25rem; }
  .cs-editor { min-height: 0; overflow: hidden; border-radius: var(--r-md); background: var(--surface-1); border: 1px solid var(--line-1); box-shadow: var(--elev-1); }
  .cs-tabs-row { padding: 0 1rem; }
  .cs-chips { padding: .875rem 1.25rem .375rem; }
  .cs-body { padding: .625rem 1.25rem 1.5rem; }
  .cs-actions { padding: .75rem 1.25rem; background: var(--surface-1); }
  .cs-grid { grid-template-columns: repeat(auto-fill, minmax(6rem, 1fr)); gap: .625rem; }
  .cs-grid.g-full { grid-template-columns: repeat(auto-fill, minmax(6.75rem, 1fr)); }
}
@media (min-width: 1600px) and (min-height: 700px) { .cs-root { grid-template-columns: minmax(24rem, 38%) minmax(0, 1fr); } .cs-grid { grid-template-columns: repeat(auto-fill, minmax(6.75rem, 1fr)); } }
@media (hover: hover) and (pointer: fine) {
  .cs-tile:hover:not(.on) { border-color: var(--line-3); background: var(--surface-3); }
}

/* ================================================================ LEGACY panes (round 5, moved by foundation): removed as each
   pane is rebuilt on the round-6 components. */
.se-cols { display: grid; grid-template-columns: minmax(220px, 300px) minmax(0, 1fr); gap: 16px; align-items: start; }
.se-left { padding: 14px; display: flex; flex-direction: column; gap: 10px; align-items: stretch; position: sticky; top: 0; }
.se-right { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.se-section { padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.preview-box { position: relative; display: grid; place-items: center; padding: 8px; border-radius: var(--r-md); background: radial-gradient(circle at 50% 30%, rgba(255, 190, 85, 0.14), rgba(0, 0, 0, 0.3)); border: 1px solid var(--hairline); }
.skin-preview { width: min(200px, 60vw); height: auto; cursor: pointer; }
.preview-hint { font-size: var(--fs-xs); color: var(--c-dim); }
.preset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.preset-card { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 6px; border-radius: var(--r-md); border: 1px solid var(--hairline); background: rgba(255, 240, 225, 0.035); color: var(--c-text); font-weight: 600; font-size: var(--fs-xs); cursor: pointer; }
.preset-card.active { border-color: var(--accent); box-shadow: inset 0 0 0 .5px var(--accent); background: var(--sel-card-bg); }
.preset-swatch { width: 34px; height: 54px; border-radius: 6px; border: 1px solid rgba(0, 0, 0, 0.5); }
.preset-name { text-align: center; line-height: 1.15; }
.color-rows { display: flex; flex-direction: column; gap: 10px; }
.color-row { display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.color-label { font-weight: 600; color: var(--c-muted); font-size: var(--fs-sm); }
.swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.swatch { width: 32px; height: 32px; border-radius: 4px; border: 1px solid rgba(0, 0, 0, 0.5); cursor: pointer; padding: 0; }
.swatch.active { outline: 2px solid var(--accent); outline-offset: 2px; }
.is-touch .swatch { width: 38px; height: 38px; }
.preset-card:focus-visible, .swatch:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
@media (max-width: 720px) {
  .se-cols { grid-template-columns: minmax(0, 1fr); }
  .se-left { position: static; }
}
