/* MultiCraft — components ("Altın Saat", round 6, SPEC PART 5). ONE implementation of every control, used by the shell,
   hub, lobby, in-game dark menus and progression alike. Class names = the contract between this file and every screen's
   markup (handover: scratchpad r6/progress/foundation.md). States: rest / hover (ONLY inside the hover media query at the
   end of the file) / press / focus-visible / disabled (+ the extra states noted per component).
   Owner: foundation (shared, read-only). Screen-specific layout belongs in style.css (shell), hub.css, lobby.css,
   screens.css. A LEGACY section at the end keeps not-yet-migrated class names readable; delete a legacy rule only when
   grep finds no caller. */

/* ================================================================ 5.1 buttons */
.btn {
  --b-h: var(--ctl-md);
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .5rem; flex: none;
  height: var(--b-h); min-width: var(--b-h); padding: 0 1.125rem; margin: 0;
  border-radius: var(--r-sm); border: 1px solid var(--line-2);
  background: rgba(255, 236, 214, .07); color: var(--text-0);           /* no variant = secondary */
  font-family: var(--font-ui); font-size: var(--fs-md); font-weight: 600; line-height: 1; letter-spacing: .005em;
  white-space: nowrap; text-decoration: none; cursor: pointer; user-select: none; -webkit-user-select: none; touch-action: manipulation;
  transition: background-color var(--dur-2) var(--ease-out), border-color var(--dur-2) var(--ease-out), color var(--dur-2) var(--ease-out),
              transform var(--dur-1) var(--ease-out);
}
.btn > .ico, .btn > svg { width: 1.25rem; height: 1.25rem; flex: none; }
.btn > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--bg-app), 0 0 0 4px var(--focus); }
.btn:active { transform: translateY(1px); }
.btn-sm { --b-h: var(--ctl-sm); padding: 0 .875rem; font-size: var(--fs-sm); gap: .375rem; }
.btn-sm > .ico, .btn-sm > svg { width: 1.125rem; height: 1.125rem; }
.btn-lg { --b-h: var(--ctl-lg); padding: 0 1.5rem; font-size: 1.0625rem; }
.btn-block { display: flex; width: 100%; }
/* primary: the one light (ONE per view) */
.btn-primary { background: var(--accent); border-color: transparent; color: var(--text-on-accent); box-shadow: var(--lit-edge); }
.btn-primary:active { background: var(--accent-press); box-shadow: inset 0 2px 0 rgba(120, 58, 0, .25); }
.btn-primary:focus-visible { box-shadow: var(--lit-edge), 0 0 0 2px var(--bg-app), 0 0 0 4px var(--focus); }
/* secondary: neutral with a real shape */
.btn-secondary { background: rgba(255, 236, 214, .07); border-color: var(--line-2); color: var(--text-0); }
.btn-secondary:active { background: rgba(255, 236, 214, .05); }
.btn-secondary.is-on, .btn-secondary[aria-pressed="true"] { background: var(--sel-bg); border-color: var(--sel-line); color: var(--sel-text); box-shadow: inset 0 0 0 .5px var(--sel-line); }
/* on art: the secondary made opaque enough to read on any key art */
.btn-onart { background: rgba(10, 8, 6, .62); border-color: rgba(255, 236, 214, .22); color: var(--text-0); }
/* ghost: toolbar / low priority, ALWAYS with an icon (R4) */
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-1); }
/* danger: solid only to CONFIRM; danger-line to ENTER a destructive flow (own class: no cascade can turn it into a primary) */
.btn-danger { background: var(--danger-solid); border-color: transparent; color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18); }
.btn-danger-line { background: transparent; border-color: rgba(255, 107, 95, .5); color: var(--danger-text); }
/* icon button: square, aria-label always */
.btn-icon { padding: 0; width: var(--b-h); }
.btn-icon.btn-ghost { color: var(--text-2); }
.btn-icon::before { content: ""; position: absolute; inset: min(0px, calc((var(--b-h) - var(--tap)) / 2)); }   /* >= 44 px hit area */
/* states */
.btn:disabled, .btn[aria-disabled="true"], .btn.is-disabled {
  background: rgba(255, 236, 214, .06); border-color: transparent; color: var(--text-disabled); box-shadow: none; cursor: not-allowed; transform: none;
}
.btn.is-loading { pointer-events: none; }
.btn.is-loading > .spin { width: 1.125rem; height: 1.125rem; }
/* timed state (respawn, auto start): full style + a 2 px line drains along the bottom edge + a small number after the label */
.btn.is-timed { overflow: hidden; }
.btn.is-timed::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--accent);
  transform-origin: left center; transform: scaleX(var(--t, 1)); transition: transform 1s linear; }
.btn-primary.is-timed::after { background: rgba(30, 18, 6, .55); }
.btn .btn-num { font-family: var(--font-display); font-weight: 700; font-feature-settings: "tnum" 1; opacity: .8; }
.btn > .kbd { margin-left: .25rem; }
html.is-touch .btn > .kbd, html.is-touch .kbd.desk { display: none; }
.btn-group { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }
.btn-group.tight { gap: .5rem; }
.btn-duo { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.btn-duo > .btn { width: 100%; min-width: 0; }

/* ================================================================ 5.2 close = .btn.btn-icon.btn-ghost + i-x (dialog headers) */
.btn-close { color: var(--text-2); }
@media (hover: hover) and (pointer: fine) { .dlg-head .btn-close { --b-h: var(--ctl-sm); } }

/* ================================================================ 5.3 keycap */
.kbd, :where(.menu-root, .dlg-root) kbd {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  min-width: 1.5rem; height: 1.5rem; padding: 0 .375rem; margin: 0;
  border-radius: var(--r-xs); background: rgba(255, 236, 214, .08); border: 1px solid var(--line-2); border-bottom-width: 2px;
  font: 600 .75rem/1 var(--font-ui); color: var(--text-1); letter-spacing: .02em; white-space: nowrap; word-break: normal;
}
.kbd.listening { border-color: var(--accent); box-shadow: 0 0 0 1.5px var(--accent); color: var(--amber-100); }

/* ================================================================ 5.4 text field */
.field { display: grid; gap: .375rem; min-width: 0; align-content: start; }
.field > label, .field > .label, .label {
  display: flex; align-items: center; gap: .5rem; min-height: 1.375rem; margin: 0;
  font-size: var(--fs-sm); font-weight: 500; color: var(--text-2); line-height: 1.2;
}
.lbl-slot { margin-left: auto; display: inline-flex; align-items: center; gap: .5rem; min-width: 0; }
.lbl-slot:empty { display: none; }
.label .opt { color: var(--text-3); font-weight: 400; }
.input {
  display: block; width: 100%; min-width: 0; height: var(--ctl-md); padding: 0 .875rem; margin: 0;
  border-radius: var(--r-sm); background: var(--surface-sunken); border: 1px solid var(--line-field);
  color: var(--text-0); font: 400 max(16px, var(--fs-md))/1.2 var(--font-ui);   /* never below 16 px: no iOS zoom */
  caret-color: var(--accent); outline: none; -webkit-appearance: none; appearance: none;
  transition: border-color var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out);
}
.input::placeholder { color: var(--text-placeholder); opacity: 1; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 178, 63, .18); }
.input.is-error, .input[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(255, 107, 95, .14); }
.input.is-ok { border-color: rgba(91, 210, 122, .55); }
.input:disabled, .input[readonly].is-locked { color: var(--text-3); background: rgba(10, 8, 7, .5); border-color: var(--line-1); }
.input[readonly] { cursor: text; }
textarea.input { height: auto; min-height: 6rem; padding: .75rem .875rem; line-height: 1.45; resize: vertical; }
.input:-webkit-autofill { -webkit-text-fill-color: var(--text-0); -webkit-box-shadow: 0 0 0 100px #1A140F inset; caret-color: var(--accent); }
.input-wrap { position: relative; display: flex; align-items: center; min-width: 0; }
.input-wrap > .input { padding-right: 3rem; }
.input-wrap.has-action > .input { padding-right: 7.75rem; }
.input-wrap > .trail { position: absolute; right: .25rem; top: 50%; transform: translateY(-50%); }
.input-wrap > .trail:active { transform: translateY(calc(-50% + 1px)); }
.input-wrap > .trail.btn-icon { --b-h: calc(var(--ctl-md) - .5rem); color: var(--text-2); }
.input-wrap > .trail.btn-sm:not(.btn-icon) { right: .3125rem; --b-h: calc(var(--ctl-md) - .625rem); }
.input-wrap > .ok-tick { position: absolute; right: .875rem; top: 50%; transform: translateY(-50%); color: var(--success); pointer-events: none; width: 1.125rem; height: 1.125rem; }
.input-wrap > .trail ~ .ok-tick { right: 3rem; }
.hint, .err { display: flex; gap: .375rem; align-items: flex-start; margin: 0; font-size: var(--fs-sm); line-height: 1.4; }
.hint { color: var(--text-3); }
.err { color: var(--danger-text); font-weight: 500; }
.err > .ico, .hint > .ico { width: 1rem; height: 1rem; margin-top: .1rem; flex: none; }
.caps { display: inline-flex; align-items: center; gap: .25rem; height: 1.375rem; padding: 0 .5rem; border-radius: var(--r-xs);
  background: var(--warning-soft); color: var(--warning-text); font-size: var(--fs-xs); font-weight: 600; white-space: nowrap; }
.caps > .ico { width: .875rem; height: .875rem; }
/* quiet strength meter: 4 short segments + one word, in the label row (no green bars, no extra row) */
.meter { display: inline-flex; align-items: center; gap: 3px; font-size: var(--fs-xs); color: var(--text-2); font-weight: 500; }
.meter > i { width: 1.125rem; height: 4px; border-radius: 1px; background: rgba(255, 236, 214, .12); }
.meter > i.on { background: var(--paper-2); }
.meter > span { margin-left: .375rem; min-width: 2.5rem; }
.meter.weak > span { color: var(--danger-text); }
/* search field */
.search { position: relative; display: flex; align-items: center; min-width: 0; }
.search > .ico { position: absolute; left: .75rem; width: 1.125rem; height: 1.125rem; color: var(--text-3); pointer-events: none; }
.search > .input { padding-left: 2.5rem; padding-right: 2.75rem; }
.search > .trail { position: absolute; right: .25rem; --b-h: calc(var(--ctl-md) - .5rem); }

/* ================================================================ 5.5 select (custom trigger; listbox = popMenu rows) */
.select {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem; width: 100%; min-width: 0; height: var(--ctl-md);
  padding: 0 .625rem 0 .875rem; border-radius: var(--r-sm); background: var(--surface-sunken); border: 1px solid var(--line-field);
  color: var(--text-0); font: 400 var(--fs-md)/1.2 var(--font-ui); text-align: left; cursor: pointer;
}
.select > .sel-val { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.select > .sel-val small { color: var(--text-3); font-size: var(--fs-sm); margin-left: .5rem; }
.select > .ico { color: var(--text-2); width: 1.125rem; height: 1.125rem; transition: transform var(--dur-2) var(--ease-out); }
.select[aria-expanded="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 178, 63, .18); }
.select[aria-expanded="true"] > .ico { transform: rotate(180deg); }
.select:disabled { color: var(--text-3); cursor: not-allowed; }

/* ================================================================ 5.6 code cells (4 letters) */
.code-cells { display: flex; justify-content: center; gap: .5rem; }
.code-cells > input {
  width: 3rem; height: 3.5rem; padding: 0; text-align: center; border-radius: var(--r-sm);
  background: var(--surface-sunken); border: 1px solid var(--line-field); color: var(--amber-200); caret-color: var(--accent);
  font: 800 1.75rem/1 var(--font-display); text-transform: uppercase; letter-spacing: 0; outline: none;
}
.code-cells > input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 178, 63, .18); }
.code-cells.is-error > input { border-color: var(--danger); }
.code-cells.shake { animation: shake .36s var(--ease-out); }
@media (max-width: 599px) { .code-cells > input { width: 2.75rem; height: 3.25rem; } }

/* ================================================================ 5.7 checkbox (opt-ins like "Beni hatırla"; settings use switches) */
.check { position: relative; display: inline-flex; align-items: center; gap: .625rem; min-height: var(--tap); cursor: pointer;
  font-size: var(--fs-md); font-weight: 400; color: var(--text-1); user-select: none; -webkit-user-select: none; }
.check > input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
.check > .box, .check > .check-box {
  width: 1.25rem; height: 1.25rem; border-radius: var(--r-xs); border: 1.5px solid var(--line-field); background: var(--surface-sunken);
  display: grid; place-items: center; color: transparent; flex: none; transition: background-color var(--dur-2), border-color var(--dur-2);
}
.check > .box > .ico, .check > .check-box > .ico { width: .875rem; height: .875rem; stroke-width: 3; }
.check > input:checked + .box, .check > input:checked + .check-box, .check.on > .box { background: var(--accent); border-color: var(--accent); color: var(--text-on-accent); }
.check > input:focus-visible + .box, .check > input:focus-visible + .check-box { box-shadow: 0 0 0 2px var(--bg-app), 0 0 0 4px var(--focus); }
.check > input:disabled ~ * { opacity: .55; }

/* ================================================================ 5.8 switch (ALWAYS at the right end of its row) */
.switch {
  position: relative; flex: none; width: var(--switch-w); height: var(--switch-h); padding: 0; margin: 0;
  border-radius: var(--r-pill); background: #2A231D; border: 1px solid var(--line-field); cursor: pointer;
  transition: background-color var(--dur-2) var(--ease-out), border-color var(--dur-2) var(--ease-out);
}
.switch::before { content: ""; position: absolute; inset: calc((var(--switch-h) - var(--tap)) / 2) 0; }   /* 44 x 44 hit */
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: calc(var(--switch-h) - 6px); height: calc(var(--switch-h) - 6px);
  border-radius: 50%; background: var(--paper-2); box-shadow: 0 1px 2px rgba(0, 0, 0, .5);
  transition: transform var(--dur-2) var(--ease-out), background-color var(--dur-2); }
.switch[aria-checked="true"], .switch.on { background: var(--accent); border-color: var(--accent); }
.switch[aria-checked="true"]::after, .switch.on::after { transform: translateX(calc(var(--switch-w) - var(--switch-h))); background: #fff; }
.switch:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--bg-app), 0 0 0 4px var(--focus); }
.switch:disabled, .switch.locked { opacity: .5; cursor: not-allowed; }
.switch.danger[aria-checked="true"], .switch.danger.on { background: var(--danger-solid); border-color: var(--danger-solid); }

/* ================================================================ 5.9 segmented (<= 4 short options, equal columns) */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 2px; padding: 2px; min-width: 0;
  border-radius: var(--r-sm); background: var(--surface-sunken); border: 1px solid var(--line-field); }
.seg > button, .seg > .seg-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .375rem; min-width: 0; margin: 0;
  height: calc(var(--ctl-md) - .375rem - 2px); padding: 0 .625rem; border: 0; border-radius: 4px;
  background: transparent; color: var(--text-2); font: 500 var(--fs-sm)/1 var(--font-ui); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer;
  transition: background-color var(--dur-2), color var(--dur-2);
}
.seg > button > .ico, .seg > .seg-btn > .ico { width: 1.125rem; height: 1.125rem; }
.seg > .on, .seg > [aria-checked="true"], .seg > [aria-selected="true"], .seg > .active {
  background: var(--sel-bg); color: var(--sel-text); font-weight: 600; box-shadow: inset 0 0 0 1.5px var(--sel-line);
}
.seg > button:focus-visible, .seg > .seg-btn:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--focus); }
.seg > button:disabled, .seg > .seg-btn:disabled { color: var(--text-disabled); cursor: not-allowed; }
.seg.sm > button, .seg.sm > .seg-btn { height: calc(var(--ctl-sm) - .375rem - 2px); }
.seg.fit { grid-auto-columns: auto; justify-content: start; }
.seg .c { margin-left: .125rem; color: var(--text-3); font-weight: 500; font-family: var(--font-display); font-size: var(--fs-k2); letter-spacing: .04em; }
.seg.locked { opacity: .6; pointer-events: none; }

/* ================================================================ 5.10 slider (native range: keyboard for free; JS sets --fill) */
input.range { -webkit-appearance: none; appearance: none; display: block; width: 100%; min-width: 8rem; height: var(--tap); margin: 0;
  background: transparent; cursor: pointer; touch-action: pan-y; --fill: 50%; }
input.range::-webkit-slider-runnable-track { height: 4px; border-radius: 2px;
  background: linear-gradient(to right, var(--accent) 0 var(--fill), rgba(255, 236, 214, .12) var(--fill) 100%); }
input.range::-moz-range-track { height: 4px; border-radius: 2px; background: rgba(255, 236, 214, .12); }
input.range::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--accent); }
input.range::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 1.25rem; height: 1.25rem; margin-top: calc(2px - .625rem);
  border: 0; border-radius: 50%; background: var(--paper-0); box-shadow: 0 0 0 4px rgba(255, 178, 63, .25), 0 1px 3px rgba(0, 0, 0, .5); }
input.range::-moz-range-thumb { width: 1.25rem; height: 1.25rem; border: 0; border-radius: 50%; background: var(--paper-0);
  box-shadow: 0 0 0 4px rgba(255, 178, 63, .25), 0 1px 3px rgba(0, 0, 0, .5); }
input.range:focus-visible { outline: none; }
input.range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 2px var(--bg-app), 0 0 0 4px var(--focus); }
input.range:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 2px var(--bg-app), 0 0 0 4px var(--focus); }
input.range:disabled { opacity: .5; cursor: not-allowed; }
.val { font-family: var(--font-display); font-weight: 700; color: var(--amber-200); font-size: 1.0625rem; letter-spacing: .02em; font-feature-settings: "tnum" 1; }

/* ================================================================ 5.11 radio card · 5.12 preset card · 5.13 postcard tile */
.rcards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; }
.rcard { position: relative; display: flex; flex-direction: column; min-width: 0; padding: 0; margin: 0; overflow: hidden; cursor: pointer; text-align: left;
  border-radius: var(--r-md); border: 1px solid var(--line-2); background: var(--surface-2); color: inherit; font: inherit;
  transition: border-color var(--dur-2), background-color var(--dur-2); }
.rcard > .art { aspect-ratio: 16 / 9; }
.rcard > .art > img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rcard .rbody { display: grid; gap: .25rem; padding: .625rem .75rem .75rem; min-width: 0; }
.rcard .rtitle { font-size: var(--fs-md); font-weight: 600; color: var(--text-0); line-height: 1.25; }
.rcard .rdesc { font-size: var(--fs-sm); color: var(--text-3); line-height: 1.35; }
.rcard .radio { position: absolute; top: .5rem; right: .5rem; width: 1.5rem; height: 1.5rem; border-radius: 50%; display: grid; place-items: center;
  border: 2px solid rgba(255, 248, 238, .85); background: rgba(10, 8, 6, .55); color: var(--text-on-accent); }
.rcard .radio > .ico { width: .875rem; height: .875rem; stroke-width: 3; visibility: hidden; }
.rcard.on, .rcard[aria-checked="true"] { border-color: var(--accent); box-shadow: 0 0 0 .5px var(--accent), inset 0 0 0 .5px var(--accent); background: var(--sel-card-bg); }
.rcard.on .radio, .rcard[aria-checked="true"] .radio { border-color: var(--accent); background: var(--accent); }
.rcard.on .radio > .ico, .rcard[aria-checked="true"] .radio > .ico { visibility: visible; }
.rcard.on .rtitle, .rcard[aria-checked="true"] .rtitle { color: var(--amber-100); }
.rcard.locked, .rcard:disabled { opacity: .55; cursor: not-allowed; }
.rcard:focus-visible, .preset:focus-visible, .postcard:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--bg-app), 0 0 0 4px var(--focus); }
@media (max-width: 599px) {
  .rcards { grid-template-columns: minmax(0, 1fr); gap: .5rem; }
  .rcard { flex-direction: row; align-items: center; min-height: 4.5rem; padding-right: 2.75rem; }
  .rcard > .art { width: 4rem; height: 4rem; aspect-ratio: auto; flex: none; margin: .25rem 0 .25rem .25rem; border-radius: var(--r-sm); overflow: hidden; }
  .rcard .radio { top: 50%; margin-top: -.75rem; right: .75rem; }
}
.presets { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .625rem; }
.preset { position: relative; display: grid; gap: .25rem; align-content: start; padding: .75rem .875rem; margin: 0; text-align: left; cursor: pointer; min-width: 0;
  border-radius: var(--r-md); border: 1px solid var(--line-2); background: var(--surface-2); color: inherit; font: inherit; }
.preset .pt { display: flex; align-items: center; gap: .5rem; font-weight: 600; color: var(--text-0); font-size: var(--fs-md); }
.preset .ps { font-size: var(--fs-sm); color: var(--text-3); line-height: 1.3; }
.preset .bars { display: flex; gap: 3px; margin-top: .25rem; }
.preset .bars > i { width: 1.125rem; height: 4px; border-radius: 1px; background: rgba(255, 236, 214, .14); }
.preset .bars > i.on { background: var(--text-2); }
.preset.on, .preset[aria-checked="true"] { border-color: var(--accent); box-shadow: 0 0 0 .5px var(--accent), inset 0 0 0 .5px var(--accent); background: var(--sel-card-bg); }
.preset.on .pt, .preset[aria-checked="true"] .pt { color: var(--amber-100); }
.preset.on .bars > i.on, .preset[aria-checked="true"] .bars > i.on { background: var(--accent); }
@media (max-width: 599px) { .presets { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.postcards { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .625rem; }
.postcard { position: relative; display: grid; gap: .375rem; padding: 0; margin: 0; border: 0; background: none; color: var(--text-1); text-align: left; cursor: pointer; min-width: 0; font: inherit; }
.postcard > .pc-art { position: relative; aspect-ratio: 16 / 10; border-radius: var(--r-md); overflow: hidden; background: var(--carbon-0); box-shadow: inset 0 0 0 1px var(--line-2); }
.postcard > .pc-art > canvas, .postcard > .pc-art > img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: cover; image-rendering: pixelated; }
.postcard > .pc-label { font-size: var(--fs-sm); font-weight: 600; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.postcard > .pc-check { position: absolute; top: .375rem; right: .375rem; width: 1.375rem; height: 1.375rem; border-radius: 50%; display: none; place-items: center; background: var(--accent); color: var(--text-on-accent); }
.postcard > .pc-check > .ico { width: .875rem; height: .875rem; stroke-width: 3; }
.postcard.on > .pc-art, .postcard[aria-checked="true"] > .pc-art { box-shadow: 0 0 0 1.5px var(--accent); }
.postcard.on > .pc-label, .postcard[aria-checked="true"] > .pc-label { color: var(--amber-100); }
.postcard.on > .pc-check, .postcard[aria-checked="true"] > .pc-check { display: grid; }
@media (max-width: 839px) {
  .postcards { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 8.5rem; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; padding-bottom: .125rem; }
  .postcards::-webkit-scrollbar { display: none; }
}

/* ================================================================ 5.14 tabs (underline) */
.tabs { display: flex; min-width: 0; border-bottom: 1px solid var(--line-2); }
.tabs > button, .tabs > a, .tabs > [role="tab"] {
  position: relative; flex: 1 1 0; display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-width: 0;
  height: var(--ctl-md); padding: 0 .75rem; margin: 0; border: 0; background: none; cursor: pointer; text-decoration: none;
  color: var(--text-2); font: 500 var(--fs-md)/1 var(--font-ui); white-space: nowrap; transition: color var(--dur-2);
}
.tabs > * > .ico { width: 1.25rem; height: 1.25rem; color: var(--text-3); }
.tabs > .on, .tabs > [aria-selected="true"] { color: var(--text-0); font-weight: 600; }
.tabs > .on > .ico, .tabs > [aria-selected="true"] > .ico { color: var(--accent); }
.tabs > .on::after, .tabs > [aria-selected="true"]::after { content: ""; position: absolute; left: .75rem; right: .75rem; bottom: -1px; height: 2px; border-radius: 2px 2px 0 0; background: var(--accent); }
.tabs > *:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--focus); border-radius: var(--r-xs); }
.tabs.start > * { flex: none; }
.tabs.scroller { overflow-x: auto; scrollbar-width: none; }
.tabs.scroller::-webkit-scrollbar { display: none; }
.tabs.scroller > * { flex: none; }

/* ================================================================ 5.19 chips, tags, badges, counts, dots, status chip, pips */
.chip { position: relative; display: inline-flex; align-items: center; gap: .375rem; height: 1.75rem; padding: 0 .625rem; border-radius: var(--r-xs); border: 0;
  background: rgba(255, 236, 214, .07); color: var(--text-2); font: 500 var(--fs-sm)/1 var(--font-ui); white-space: nowrap; flex: none; }
.chip > .ico { width: .875rem; height: .875rem; }
button.chip { cursor: pointer; }
button.chip::before { content: ""; position: absolute; inset: calc((1.75rem - var(--tap)) / 2) 0; }
.chip.sel, .chip[aria-pressed="true"], .chip[aria-checked="true"] { background: var(--sel-bg); color: var(--sel-text); box-shadow: inset 0 0 0 1.5px var(--sel-line); }
.chip.live { background: rgba(10, 8, 6, .82); color: var(--text-0); font-family: var(--font-display); font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; font-size: var(--fs-k2); }
.chip.live > .dot { width: .4375rem; height: .4375rem; box-shadow: 0 0 0 2px rgba(91, 210, 122, .25); }
.tag { display: inline-flex; align-items: center; gap: .25rem; height: 1.375rem; padding: 0 .4375rem; border-radius: var(--r-xs); flex: none;
  background: rgba(255, 236, 214, .08); color: var(--text-2); white-space: nowrap; line-height: 1; vertical-align: middle;
  font-family: var(--font-display); font-weight: 700; font-size: var(--fs-k3); letter-spacing: .08em; text-transform: uppercase; }
.tag > .ico { width: .8125rem; height: .8125rem; stroke-width: 2.4; }
.tag.ok { background: var(--success-soft); color: var(--success-text); }
.tag.warn { background: var(--warning-soft); color: var(--warning-text); }
.tag.danger { background: var(--danger-soft); color: var(--danger-text); }
.tag.accent { background: var(--accent-soft); color: var(--amber-200); }
.tag.info { background: var(--info-soft); color: var(--info-text); }
.badge-n { display: inline-grid; place-items: center; min-width: 1.125rem; height: 1.125rem; padding: 0 .3125rem; border-radius: var(--r-pill);
  background: var(--accent); color: var(--text-on-accent); font: 700 .6875rem/1 var(--font-ui); }
.count { display: inline-grid; place-items: center; min-width: 1.5rem; height: 1.5rem; padding: 0 .375rem; border-radius: var(--r-xs); flex: none;
  background: rgba(255, 236, 214, .08); color: var(--text-2); font-family: var(--font-display); font-weight: 700; font-size: var(--fs-k2); letter-spacing: .04em; }
.dot { display: inline-block; flex: none; width: .5rem; height: .5rem; border-radius: 50%; background: var(--online); box-shadow: 0 0 0 3px rgba(91, 210, 122, .18); }
.dot.idle { background: var(--paper-4); box-shadow: none; }
.dot.bad { background: var(--danger); box-shadow: 0 0 0 3px rgba(255, 107, 95, .2); }
.dot.amber { background: var(--accent); box-shadow: 0 0 0 3px rgba(255, 178, 63, .2); }
.status-chip { display: inline-flex; align-items: center; gap: .375rem; height: 1.75rem; padding: 0 .625rem; border-radius: var(--r-xs); flex: none;
  background: var(--success-soft); color: var(--success-text); font: 500 var(--fs-sm)/1 var(--font-ui); white-space: nowrap; }
.status-chip > .ico { width: 1rem; height: 1rem; stroke-width: 2.4; }
.status-chip.saving { background: rgba(255, 236, 214, .07); color: var(--text-2); }
.status-chip.failed { background: var(--danger-soft); color: var(--danger-text); }
.status-chip.failed > button { border: 0; background: none; padding: 0; color: inherit; font: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.pips { display: inline-flex; gap: 2px; align-items: center; }
.pips > i { width: var(--pip); height: var(--pip); border-radius: 1px; background: rgba(255, 236, 214, .14); }
.pips > i.on { background: var(--text-1); }
.pips.full > i.on { background: var(--amber-300); }

/* ================================================================ 5.20 avatars */
.av { position: relative; flex: none; display: inline-block; width: var(--avatar-32); height: var(--avatar-32); border-radius: var(--r-xs); background: var(--carbon-4); vertical-align: middle; }
.av > img, .av > canvas { display: block; width: 100%; height: 100%; border-radius: inherit; image-rendering: pixelated; box-shadow: 0 0 0 1px rgba(0, 0, 0, .55); }
.av.s24 { width: var(--avatar-24); height: var(--avatar-24); } .av.s28 { width: 1.75rem; height: 1.75rem; }
.av.s40 { width: var(--avatar-40); height: var(--avatar-40); } .av.s56 { width: var(--avatar-56); height: var(--avatar-56); }
.av.s96 { width: var(--avatar-96); height: var(--avatar-96); border-radius: var(--r-sm); }
.av > .pres { position: absolute; right: -3px; bottom: -3px; width: .75rem; height: .75rem; border-radius: 50%; background: var(--online); box-shadow: 0 0 0 2.5px var(--band); }
.av-stack { display: inline-flex; align-items: center; }
.av-stack > .av + .av { margin-left: -.375rem; }
.av-stack > .av > img, .av-stack > .av > canvas { box-shadow: 0 0 0 2px var(--band); }

/* ================================================================ 5.21 cards */
.card { position: relative; background: var(--surface-1); border: 1px solid var(--line-1); border-radius: var(--r-md); box-shadow: var(--elev-1);
  transition: transform var(--dur-3) var(--ease-out), border-color var(--dur-3) var(--ease-out); }
.panel { position: relative; background: var(--surface-1); border: 1px solid var(--line-1); border-radius: var(--r-md); color: var(--text-1); }
.art { position: relative; overflow: hidden; background: var(--carbon-0); }
.art > img { display: block; width: 100%; height: 100%; object-fit: cover; }
.wcard { position: relative; display: flex; flex-direction: column; min-width: 0; overflow: hidden; cursor: pointer; text-align: left;
  background: var(--surface-1); border: 1px solid var(--line-1); border-radius: var(--r-md); box-shadow: var(--elev-1); color: inherit; font: inherit; padding: 0;
  transition: transform var(--dur-3) var(--ease-out), border-color var(--dur-3) var(--ease-out); }
.wcard > .thumb { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--carbon-0); }
.wcard > .thumb > img, .wcard > .thumb > canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.wcard > .thumb > .chip.live { position: absolute; left: .5rem; top: .5rem; }
.wcard .wbody { display: grid; gap: .375rem; padding: .75rem 3rem .875rem .875rem; min-width: 0; }
.wcard .wtitle { margin: 0; font-size: var(--fs-md); font-weight: 600; color: var(--text-0); line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wcard .wtitle > .tag { margin-left: .375rem; vertical-align: .1em; }
.wcard > .more { position: absolute; right: .375rem; bottom: .5rem; }
.wcard.sel, .wcard[aria-current="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--elev-2); }
.wcard.sel .wtitle, .wcard[aria-current="true"] .wtitle { color: var(--amber-100); }
.wcard:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--bg-app), 0 0 0 4px var(--focus); }
.wcard.create { align-items: center; justify-content: center; gap: .5rem; padding: 1rem; text-align: center; background: transparent; box-shadow: none;
  border: 1px dashed var(--line-3); color: var(--text-2); min-height: 10rem; }
.wcard.create .plus { width: 3rem; height: 3rem; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--amber-300); }
.wcard.create .ct { font-weight: 600; color: var(--text-0); font-size: var(--fs-md); }
.wcard.create .cs { font-size: var(--fs-sm); color: var(--text-3); line-height: 1.35; }
.playdisc { position: absolute; left: 50%; top: 50%; width: 3.25rem; height: 3.25rem; margin: -1.625rem 0 0 -1.625rem; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: var(--text-on-accent); box-shadow: 0 8px 24px rgba(0, 0, 0, .5); opacity: 0; transform: scale(.88); pointer-events: none;
  transition: opacity var(--dur-2) var(--ease-out), transform var(--dur-2) var(--ease-out); }
.playdisc > .ico { width: 1.375rem; height: 1.375rem; margin-left: 2px; }
.wcard:focus-visible .playdisc { opacity: 1; transform: none; }
.mcard { position: relative; display: block; min-width: 0; overflow: hidden; aspect-ratio: 16 / 9; isolation: isolate; cursor: pointer; text-decoration: none; text-align: left;
  border-radius: var(--r-md); background: var(--carbon-0); border: 1px solid var(--line-1); color: inherit; font: inherit; padding: 0;
  transition: transform var(--dur-3) var(--ease-out), border-color var(--dur-3) var(--ease-out); }
.mcard > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.mcard::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(to top, rgba(8, 6, 5, .94) 0%, rgba(8, 6, 5, .6) 30%, rgba(8, 6, 5, 0) 56%); }
.mcard .mcopy { position: absolute; left: .875rem; right: .875rem; bottom: .75rem; display: grid; gap: .3125rem; min-width: 0; }
.mcard .kunye { color: var(--paper-1); }
.mcard > .chip.live { position: absolute; top: .5rem; left: .5rem; }
.mcard.sel, .mcard[aria-current="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--elev-2); }
.mcard.sel .mtitle, .mcard[aria-current="true"] .mtitle { color: var(--amber-100); }
.mcard:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--bg-app), 0 0 0 4px var(--focus); }
.mcard:focus-visible .playdisc { opacity: 1; transform: none; }

/* ================================================================ 5.22 rows */
.row { display: flex; align-items: center; gap: .875rem; min-height: 3.5rem; padding: .5rem .75rem; border-radius: var(--r-sm); text-decoration: none;
  color: inherit; background: none; border: 0; width: 100%; text-align: left; font: inherit; }
button.row, a.row { cursor: pointer; }
.row > .row-ico { width: 2.5rem; height: 2.5rem; border-radius: var(--r-sm); display: grid; place-items: center; flex: none; background: rgba(255, 236, 214, .06); color: var(--text-2); }
.row .grow { display: grid; gap: .125rem; }
.row .title { font-size: var(--fs-md); font-weight: 600; color: var(--text-0); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.25; }
.row .sub { font-size: var(--fs-sm); color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.3; }
.row .meta { margin-left: auto; color: var(--text-3); font-family: var(--font-display); font-weight: 700; letter-spacing: .04em; font-feature-settings: "tnum" 1; }
.row > .chev { color: var(--text-3); width: 1.25rem; height: 1.25rem; flex: none; }
.row.danger .title, .row.danger > .row-ico { color: var(--danger-text); }
.row:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--focus); }
.rows > .row + .row { border-top: 1px solid var(--line-1); border-radius: 0; }
.wrow { display: flex; align-items: center; gap: .875rem; padding: .625rem 0; border-top: 1px solid var(--line-1); min-width: 0; }
.wrow:first-child { border-top: 0; }
.wrow > .thumb { position: relative; width: 6rem; aspect-ratio: 16 / 9; border-radius: var(--r-sm); overflow: hidden; flex: none; background: var(--carbon-0); }
.wrow > .thumb > img, .wrow > .thumb > canvas { width: 100%; height: 100%; object-fit: cover; display: block; }
.wrow .grow { display: grid; gap: .3rem; }
.wrow .wtitle { font-size: var(--fs-md); font-weight: 600; color: var(--text-0); line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wrow.create > .thumb { display: grid; place-items: center; background: transparent; border: 1px dashed var(--line-3); color: var(--amber-300); }
.prow { display: flex; align-items: center; gap: .75rem; padding: .625rem 0; border-top: 1px solid var(--line-1); min-width: 0; }
.prow:first-of-type { border-top: 0; }
.prow .grow { display: grid; gap: .125rem; }
.prow .pn { font-weight: 600; color: var(--text-0); font-size: var(--fs-md); line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prow .pw { font-size: var(--fs-sm); color: var(--text-3); line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prow .pw b { color: var(--text-2); font-weight: 500; }
.prow2 { display: flex; align-items: center; gap: .75rem; padding: .5rem .875rem; min-height: 3.5rem; border-top: 1px solid var(--line-1); min-width: 0; }
.prow2:first-child { border-top: 0; }
.prow2 .grow { display: grid; gap: .1875rem; min-width: 0; justify-items: start; }
.prow2 .pn { font-weight: 600; color: var(--text-0); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prow2.mine { background: var(--tc-soft, rgba(255, 236, 214, .04)); box-shadow: inset 3px 0 0 var(--tc, var(--accent)); }
.prow2.invite { color: var(--text-2); }
.prow2.invite .plus { width: 2.5rem; height: 2.5rem; border-radius: var(--r-xs); display: grid; place-items: center; border: 1px dashed var(--line-3); color: var(--amber-300); flex: none; }
.srow { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .375rem 1.5rem; padding: .875rem 0; border-top: 1px solid var(--line-1); }
.srow:first-child { border-top: 0; }
.srow .lbl { display: flex; align-items: baseline; flex-wrap: wrap; gap: .5rem; font-size: var(--fs-md); font-weight: 500; color: var(--text-0); line-height: 1.3; }
.srow .desc { margin-top: .125rem; font-size: var(--fs-sm); color: var(--text-3); line-height: 1.4; }
.srow .desc.note { display: flex; gap: .375rem; align-items: center; color: var(--info-text); }
.srow .ctl { display: flex; align-items: center; justify-content: flex-end; min-width: 0; gap: .5rem; }
.srow .ctl > input.range { width: 15rem; }
.srow.wide { grid-template-columns: 1fr; }
@media (max-width: 599px) {
  .srow.block { grid-template-columns: minmax(0, 1fr); }
  .srow.block .ctl { justify-content: stretch; }
  .srow.block .ctl > * { width: 100%; }
}
.group { display: grid; gap: .25rem; }
.group + .group { margin-top: 1.75rem; }
.group-h { display: flex; align-items: baseline; gap: .75rem; margin: 0 0 .5rem; }
.group-h .t-lg { font-size: 1.0625rem; }
.sbox { background: var(--surface-2); border: 1px solid var(--line-1); border-radius: var(--r-md); padding: 0 1.125rem; }
.disclose { display: flex; align-items: center; gap: .75rem; width: 100%; min-height: 3.25rem; padding: 0 1.125rem; margin: 0; cursor: pointer; text-align: left;
  border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line-1); color: var(--text-0); font: 500 var(--fs-md)/1.3 var(--font-ui); }
.disclose .dim { font-weight: 400; font-size: var(--fs-sm); }
.disclose > .ico:last-child { margin-left: auto; color: var(--text-3); transition: transform var(--dur-2); }
.disclose[aria-expanded="true"] > .ico:last-child { transform: rotate(180deg); }
.hr { height: 1px; background: var(--line-1); border: 0; margin: 0; }
.divider-or { display: flex; align-items: center; gap: .75rem; color: var(--text-3); font-size: var(--fs-sm); line-height: 1; }
.divider-or::before, .divider-or::after { content: ""; flex: 1; height: 1px; background: var(--line-2); }
.link { display: inline-flex; align-items: center; min-height: var(--tap); padding: 0; margin: 0; border: 0; background: none; cursor: pointer;
  color: var(--amber-200); font: 500 var(--fs-sm)/1.2 var(--font-ui); text-decoration: underline; text-decoration-color: rgba(255, 223, 166, .4); text-underline-offset: .2em; }
.link:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--focus); border-radius: var(--r-xs); }

/* ================================================================ 5.23 dialog / sheet (one component) */
.dlg-root { position: fixed; inset: 0; z-index: var(--z-modal); display: flex; align-items: center; justify-content: center;
  padding: calc(var(--safe-t) + 1.5rem) calc(var(--safe-r) + 1.5rem) calc(var(--safe-b) + 1.5rem) calc(var(--safe-l) + 1.5rem);
  background: var(--scrim); animation: fadeIn var(--dur-3) var(--ease-out); color: var(--text-1); }
.dlg-root.in-game { background: var(--scrim-game-strong); }
.dlg-root.closing { animation: fadeOut var(--dur-2) var(--ease-in) forwards; pointer-events: none; }
.dlg { position: relative; display: flex; flex-direction: column; min-height: 0; min-width: 0; width: min(var(--dlg-w), 100%); max-height: var(--dlg-max-h);
  --dlg-w: var(--dlg-w-md); background: var(--surface-1); border: 1px solid var(--line-2); border-radius: var(--r-lg); box-shadow: var(--elev-3);
  overflow: hidden; outline: none; animation: rise var(--dur-3) var(--ease-out); }
.dlg.sm { --dlg-w: var(--dlg-w-sm); } .dlg.md { --dlg-w: var(--dlg-w-md); } .dlg.lg { --dlg-w: var(--dlg-w-lg); }
.dlg-root.closing .dlg { animation: sink var(--dur-2) var(--ease-in) forwards; }
.dlg-head { display: flex; align-items: center; gap: .75rem; min-height: 3.75rem; padding: .625rem .75rem .625rem 1.5rem; border-bottom: 1px solid var(--line-1); flex: none; }
.dlg-head > .t-xl { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.dlg-head > .dlg-back { display: none; margin-left: -.75rem; }
.dlg-head > .head-thumb { width: 2.5rem; height: 2.5rem; border-radius: var(--r-sm); overflow: hidden; flex: none; }
.dlg-head > .head-thumb > img, .dlg-head > .head-thumb > canvas { width: 100%; height: 100%; object-fit: cover; display: block; }
.dlg-head > .head-actions { display: flex; align-items: center; gap: .5rem; flex: none; }
.dlg-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; touch-action: pan-y; padding: 1.5rem;
  scrollbar-width: thin; scrollbar-color: var(--carbon-5) transparent; }
.dlg-body > p, .dlg-text { margin: 0; color: var(--text-2); line-height: var(--lh-body); max-width: 46ch; }
.dlg-body > p + p { margin-top: .75rem; }
.dlg-foot { display: flex; align-items: center; justify-content: flex-end; gap: .75rem; padding: .875rem 1.5rem; border-top: 1px solid var(--line-1); flex: none; background: var(--surface-1); }
.dlg-foot > .note, .dlg-foot > .foot-note { margin-right: auto; }
/* QA r6: a centred dialog on a narrow phone (the in-game reconnect dialog) stacks its actions full width like a bottom sheet
   (primary on top) instead of pushing "Ana Menüye Dön" off the card's left edge */
@media (max-width: 599px) {
  .dlg-root.v-center .dlg-foot { flex-direction: column-reverse; align-items: stretch; gap: .625rem; padding: .75rem 1.25rem 1rem; }
  .dlg-root.v-center .dlg-foot > .btn { width: 100%; }
  .dlg-root.v-center .dlg-head { padding-left: 1.25rem; }
  .dlg-root.v-center .dlg-body { padding: 1.25rem; }
}
.dlg.no-head .dlg-body { padding-top: 1.5rem; }
/* small confirmations: the object's thumb + name above the consequence sentence */
.confirm-obj { display: flex; align-items: center; gap: .75rem; margin-bottom: 1rem; min-width: 0; }
.confirm-obj > .thumb { width: 4rem; aspect-ratio: 16 / 9; border-radius: var(--r-sm); overflow: hidden; flex: none; background: var(--carbon-0); }
.confirm-obj > .thumb > img, .confirm-obj > .thumb > canvas { width: 100%; height: 100%; object-fit: cover; display: block; }
.confirm-obj > b { font-weight: 600; color: var(--text-0); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* bare: the content brings its own frame (the settings component) */
.dlg.bare { background: none; border: 0; box-shadow: none; border-radius: 0; overflow: visible; }
.dlg.bare > .dlg-body { padding: 0; overflow: visible; display: flex; }
.dlg.bare.lg { width: min(var(--dlg-w-lg), 100%); height: var(--dlg-max-h); }
/* --- full-screen sheet (phones portrait): header 56 with back arrow, sticky full-width primary at the bottom --- */
.dlg-root.v-full { padding: 0; align-items: stretch; justify-content: stretch; background: var(--bg-app); }
.dlg-root.v-full > .dlg { width: 100%; max-width: none; height: 100%; max-height: none; border: 0; border-radius: 0; box-shadow: none; animation: rise var(--dur-3) var(--ease-out); }
.dlg-root.v-full .dlg-head { min-height: calc(3.5rem + var(--safe-t)); padding: var(--safe-t) calc(.75rem + var(--safe-r)) 0 calc(.75rem + var(--safe-l)); gap: .5rem; background: var(--band); }
.dlg-root.v-full .dlg-head > .t-xl { font-size: var(--fs-lg); }
.dlg-root.v-full .dlg-head > .dlg-back { display: inline-flex; margin-left: 0; }
.dlg-root.v-full .dlg-head > .btn-close { display: none; }
.dlg-root.v-full .dlg-body { padding: 1rem calc(1rem + var(--safe-r)) 1.5rem calc(1rem + var(--safe-l)); }
.dlg-root.v-full .dlg-foot { padding: .75rem calc(1rem + var(--safe-r)) calc(.75rem + var(--safe-b)) calc(1rem + var(--safe-l)); background: var(--band); flex-direction: column-reverse; align-items: stretch; }
.dlg-root.v-full .dlg-foot > .btn { width: 100%; }
.dlg-root.v-full .dlg-foot > .is-dismiss { display: none; }
.dlg-root.v-full .dlg.bare > .dlg-body { overflow: hidden; }
.dlg-root.v-full .dlg.bare { height: 100%; }
/* --- bottom sheet (phones: confirmations, menus, invite, code entry) --- */
.dlg-root.v-bottom { padding: var(--safe-t) 0 0; align-items: flex-end; justify-content: stretch; }
.dlg-root.v-bottom > .dlg { width: 100%; max-width: 40rem; margin: 0 auto; max-height: 88%; border-radius: var(--r-lg) var(--r-lg) 0 0; border-bottom: 0; animation: sheetUp var(--dur-3) var(--ease-out); }
.dlg-root.v-bottom.closing > .dlg { animation: sheetDown var(--dur-2) var(--ease-in) forwards; }
.dlg-root.v-bottom .sheet-grab { display: block; }
.dlg-root.v-bottom .dlg-head { border-bottom: 0; padding: .25rem .5rem .25rem 1.25rem; min-height: 3.25rem; }
.dlg-root.v-bottom .dlg-head > .t-xl { font-size: var(--fs-lg); }
.dlg-root.v-bottom .dlg-body { padding: .25rem 1.25rem 1rem; }
.dlg-root.v-bottom .dlg-foot { flex-direction: column-reverse; align-items: stretch; gap: .625rem; border-top: 0; padding: .25rem 1.25rem calc(1rem + var(--safe-b)); }
.dlg-root.v-bottom .dlg-foot > .btn { width: 100%; }
.dlg-root.v-bottom .dlg-foot > .note { margin: 0 0 .25rem; order: 9; }
.sheet-grab { display: none; width: 2.25rem; height: 4px; border-radius: 2px; background: var(--line-3); margin: .5rem auto 0; flex: none; }
/* --- landscape phones: full screen, primary in the header, no footer --- */
.dlg-root.v-land { padding: 0; align-items: stretch; justify-content: stretch; background: var(--bg-app); }
.dlg-root.v-land > .dlg { width: 100%; max-width: none; height: 100%; max-height: none; border: 0; border-radius: 0; box-shadow: none; }
.dlg-root.v-land .dlg-head { min-height: 3rem; padding: 0 calc(.75rem + var(--safe-r)) 0 calc(.5rem + var(--safe-l)); background: var(--band); gap: .5rem; }
.dlg-root.v-land .dlg-head > .t-xl { font-size: var(--fs-lg); }
.dlg-root.v-land .dlg-head > .dlg-back { display: inline-flex; margin-left: 0; }
.dlg-root.v-land .dlg-head > .btn-close { display: none; }
.dlg-root.v-land .dlg-body { padding: .75rem calc(1.25rem + var(--safe-r)) 1rem calc(1.25rem + var(--safe-l)); }
.dlg-root.v-land .dlg-foot { display: none; }
.dlg-root.v-land .dlg.bare > .dlg-body { overflow: hidden; }
.dlg-root.v-land .dlg.bare { height: 100%; }

/* ---------------------------------------------------------------- popover menu (desktop) / bottom-sheet menu (touch) */
.pop-menu { position: fixed; z-index: var(--z-popover); min-width: 13.5rem; max-width: min(22rem, calc(100vw - 1rem)); padding: .375rem;
  background: var(--surface-1); border: 1px solid var(--line-2); border-radius: var(--r-md); box-shadow: var(--elev-2); color: var(--text-1);
  animation: fadeIn var(--dur-2) var(--ease-out); }
.pop-menu.closing { animation: fadeOut var(--dur-1) var(--ease-in) forwards; pointer-events: none; }
.pop-menu .pop-title { display: flex; align-items: center; gap: .625rem; padding: .5rem .625rem .625rem; margin-bottom: .25rem; border-bottom: 1px solid var(--line-1); font-weight: 600; color: var(--text-0); min-width: 0; }
/* the thumb boxes of the popover title, the sheet header and the confirm object hold absolutely placed pictures (QA r6: from hub.css) */
.pop-title > .av { position: relative; overflow: hidden; }
.confirm-obj > .thumb, .dlg-head > .head-thumb { position: relative; }
.pop-item { display: flex; align-items: center; gap: .75rem; width: 100%; min-height: 2.75rem; padding: 0 .75rem; margin: 0; border: 0; border-radius: var(--r-sm);
  background: transparent; color: var(--text-1); font: 500 var(--fs-md)/1.2 var(--font-ui); text-align: left; cursor: pointer; }
.pop-item > .ico { width: 1.25rem; height: 1.25rem; color: var(--text-3); flex: none; }
.pop-item > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pop-item > .chk { color: var(--accent); }
.pop-item.sel { color: var(--amber-100); font-weight: 600; }
.pop-item:focus-visible { outline: none; background: rgba(255, 236, 214, .07); box-shadow: inset 0 0 0 2px var(--focus); }
.pop-item.danger, .pop-item.danger > .ico { color: var(--danger-text); }
.pop-item:disabled { color: var(--text-disabled); cursor: default; }
.pop-sep { height: 1px; margin: .375rem .5rem; background: var(--line-1); }
.dlg .menu-list { display: grid; gap: .125rem; margin: 0 -.5rem; }
.dlg .menu-list .pop-item { min-height: 3.5rem; font-size: var(--fs-md); }
.dlg .menu-list .pop-sep { margin: .5rem; }

/* ================================================================ 5.24 toast = altyazı (ONE system for hub and game) */
.toast-lane { position: fixed; z-index: var(--z-toast); display: flex; flex-direction: column; gap: .5rem; pointer-events: none; width: min(var(--toast-w), calc(100vw - 2rem)); }
.toast-lane[data-lane="top"] { top: calc(var(--safe-t) + var(--band-h) + 1rem); right: calc(var(--safe-r) + var(--pad-x)); }
.toast-lane[data-lane="above-tabbar"] { left: calc(var(--safe-l) + .75rem); right: calc(var(--safe-r) + .75rem); width: auto; bottom: calc(var(--safe-b) + var(--tabbar-h) + .75rem); flex-direction: column-reverse; }
.toast-lane[data-lane="bottom"] { left: 50%; transform: translateX(-50%); bottom: calc(var(--safe-b) + 1rem); flex-direction: column-reverse; }
.toast-lane[data-lane="bottom-band"] { left: 50%; transform: translateX(-50%); bottom: calc(var(--safe-b) + var(--lane-offset, 9rem)); flex-direction: column-reverse; }
/* login stage (splash / account): over the key art, never over the band and its buttons (placed by dialogs.js from the .shot rect) */
.toast-lane[data-lane="stage"] { left: var(--lane-x, 50%); transform: translateX(-50%); bottom: var(--lane-b, 1rem); width: min(var(--toast-w), var(--lane-w, calc(100vw - 2rem))); flex-direction: column-reverse; }
.toast-lane[data-lane="game"] { top: calc(var(--safe-t) + var(--mm-w, 7.25rem) + 2.25rem); right: calc(var(--safe-r) + .5rem); width: min(20rem, calc(100vw - 1rem)); }
/* land hub: the bottom lane centres on the content column, not on the rail + content */
@media (min-width: 600px) and (max-height: 500px) { .menu-root[data-view="hub"] ~ .toast-lane[data-lane="bottom"] { left: calc(50% + var(--rail-w) / 2 + var(--safe-l) / 2); } }
/* xl hub with the social band: the top lane stays in the main column */
@media (min-width: 1600px) and (min-height: 700px) { html.hub-social .toast-lane[data-lane="top"] { right: calc(var(--safe-r) + var(--social-w) + var(--pad-x)); } }
.toast { position: relative; display: flex; align-items: flex-start; gap: .75rem; width: 100%; padding: .75rem .875rem .75rem 1rem; pointer-events: auto; cursor: pointer;
  background: var(--surface-toast); border: 1px solid var(--line-2); border-radius: var(--r-sm); box-shadow: var(--elev-2);
  font: 400 var(--fs-sm)/1.4 var(--font-ui); color: var(--text-2); animation: toastIn var(--dur-3) var(--ease-out); touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.toast-lane[data-lane="above-tabbar"] .toast, .toast-lane[data-lane="bottom"] .toast, .toast-lane[data-lane="bottom-band"] .toast, .toast-lane[data-lane="stage"] .toast { animation-name: toastInUp; }
.toast::before { content: ""; position: absolute; left: -1px; top: -1px; bottom: -1px; width: 3px; border-radius: var(--r-sm) 0 0 var(--r-sm); background: var(--info); }
.toast.ok::before { background: var(--success); } .toast.err::before { background: var(--danger); } .toast.warn::before { background: var(--warning); } .toast.ach::before { background: var(--accent); }
.toast > .ico { width: 1.25rem; height: 1.25rem; flex: none; margin-top: .05rem; color: var(--info); }
.toast.ok > .ico { color: var(--success); } .toast.err > .ico { color: var(--danger); } .toast.warn > .ico { color: var(--warning); } .toast.ach > .ico { color: var(--amber-300); }
.toast > .av { margin-top: -.0625rem; }
.toast > .tx { flex: 1; min-width: 0; display: grid; gap: .125rem; overflow-wrap: anywhere; }
.toast > .tx > b { color: var(--text-0); font-weight: 600; }
.toast > .btn { margin: -.25rem -.25rem -.25rem 0; align-self: center; }
.toast.leaving { opacity: 0; transform: translateY(-.5rem); transition: opacity var(--dur-2) var(--ease-in), transform var(--dur-2) var(--ease-in); }
.toast-lane[data-lane="above-tabbar"] .toast.leaving, .toast-lane[data-lane="bottom"] .toast.leaving, .toast-lane[data-lane="bottom-band"] .toast.leaving, .toast-lane[data-lane="stage"] .toast.leaving { transform: translateY(.5rem); }

/* ================================================================ 5.25 banners and notes */
.banner { display: flex; align-items: center; gap: .75rem; min-height: 3rem; padding: .5rem var(--pad-x); background: var(--surface-2); border-bottom: 1px solid var(--line-1); color: var(--text-1); font-size: var(--fs-sm); line-height: 1.35; }
.banner > .ico { width: 1.25rem; height: 1.25rem; flex: none; }
.banner > .tx { flex: 1; min-width: 0; }
.banner > .tx > b { font-weight: 600; color: var(--text-0); }
.banner > .tx > b + span::before { content: " · "; color: var(--text-3); }
@media (max-width: 599px) {
  .banner > .tx > b, .banner > .tx > b + span { display: block; }
  .banner > .tx > b + span { color: var(--text-2); }
  .banner > .tx > b + span::before { content: none; }
}
.banner.conn { background: #2A1512; border-color: rgba(255, 107, 95, .3); }
.banner.conn > .ico { color: var(--danger); }
.invite-card { display: flex; align-items: center; gap: .75rem; padding: .625rem .75rem; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--line-2);
  font-size: var(--fs-sm); color: var(--text-1); line-height: 1.35; }
.invite-card b { color: var(--text-0); font-weight: 600; }
.invite-card > .ico { width: 1.5rem; height: 1.5rem; color: var(--amber-300); flex: none; }
.alert { display: flex; gap: .75rem; align-items: flex-start; padding: .75rem .875rem; border-radius: var(--r-sm); background: var(--danger-soft);
  border: 1px solid rgba(255, 107, 95, .35); color: var(--text-1); font-size: var(--fs-sm); line-height: 1.4; }
.alert > .ico { width: 1.25rem; height: 1.25rem; flex: none; color: var(--danger); margin-top: .05rem; }
.alert b { display: block; color: var(--text-0); font-weight: 600; font-size: .9375rem; margin-bottom: .125rem; }
.alert.info { background: var(--info-soft); border-color: rgba(108, 198, 192, .35); }
.alert.info > .ico { color: var(--info); }
.note { display: flex; gap: .375rem; align-items: flex-start; margin: 0; font-size: var(--fs-sm); color: var(--info-text); line-height: 1.4; }
.note > .ico { width: 1rem; height: 1rem; flex: none; margin-top: .1rem; }
.note.warn { color: var(--warning-text); }

/* ================================================================ 5.26 empty, loading, error placeholders */
.empty { display: flex; flex-direction: column; align-items: flex-start; gap: .5rem; padding: 1.5rem 0; max-width: 36rem; }
.empty.center { align-items: center; text-align: center; margin: 0 auto; }
.empty > .empty-ico { width: 2.5rem; height: 2.5rem; border-radius: var(--r-sm); display: grid; place-items: center; background: rgba(255, 236, 214, .06); color: var(--text-2); margin-bottom: .25rem; }
.empty > .empty-ico.bad { background: var(--danger-soft); color: var(--danger); }
.empty > .t-lg { margin: 0; }
.empty > p { margin: 0; color: var(--text-2); line-height: var(--lh-body); text-wrap: balance; }
.empty > .btn { margin-top: .5rem; }
.sk { display: block; background: rgba(255, 236, 214, .06); border-radius: var(--r-xs); }   /* static: no shimmer (P11) */

/* ================================================================ 5.27 progress and spinner */
.spin { display: inline-block; flex: none; width: 1.125rem; height: 1.125rem; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent;
  animation: spin .8s linear infinite; vertical-align: middle; }
.spin.lg { width: 1.5rem; height: 1.5rem; border-width: 2.5px; }
.spin.muted { border-color: rgba(255, 236, 214, .18); border-top-color: var(--accent); border-right-color: rgba(255, 236, 214, .18); }
.gate { position: relative; height: var(--gate-h); background: var(--gate); overflow: hidden; }
.gate > i { position: absolute; left: 0; top: 0; bottom: 0; width: var(--g, 0%); background: var(--accent); box-shadow: 0 0 12px rgba(255, 178, 63, .55); }
.gate.run > i { width: 40%; background: linear-gradient(90deg, rgba(255, 178, 63, 0), var(--accent)); animation: gateRun 1.4s var(--ease-inout) infinite; }
.progress { position: relative; height: var(--progress-h); background: var(--gate); overflow: hidden; }
.progress > i { position: absolute; inset: 0; background: var(--accent); transform-origin: left center; transform: scaleX(var(--p, 0)); transition: transform var(--dur-3) var(--ease-out); box-shadow: 0 0 12px rgba(255, 178, 63, .55); }
.steps { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .75rem; margin: 0; padding: 0; list-style: none; font-size: var(--fs-sm); color: var(--text-3); }
.steps > li { display: inline-flex; align-items: center; gap: .3125rem; }
.steps > li + li::before { content: ""; width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .55; margin-right: .4375rem; color: var(--text-3); }
.steps > li.done { color: var(--text-2); } .steps > li.done > .ico { color: var(--success); width: .875rem; height: .875rem; stroke-width: 2.6; }
.steps > li.cur { color: var(--text-0); font-weight: 500; }

/* ================================================================ 5.28 stage + gate + shelf (signature; page CSS sets the stage height) */
.stage { position: relative; overflow: hidden; isolation: isolate; display: flex; flex-direction: column; justify-content: flex-end; background: var(--carbon-0); }
.stage > .bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; transition: opacity var(--dur-4) var(--ease-inout); }
.stage > .scrim { position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(to right, rgba(10, 8, 6, .82) 0%, rgba(10, 8, 6, .45) 34%, rgba(10, 8, 6, 0) 62%),
              linear-gradient(to top, rgba(10, 8, 6, .9) 0%, rgba(10, 8, 6, .35) 38%, rgba(10, 8, 6, 0) 66%); }
.stage-copy { display: flex; flex-direction: column; align-items: flex-start; gap: .625rem; padding: 1.25rem var(--pad-x); max-width: 46rem; min-width: 0; }
.stage-copy .display { text-shadow: 0 2px 24px rgba(0, 0, 0, .45); }
.stage-copy .hook { font-size: var(--fs-lg); color: var(--text-1); line-height: 1.4; max-width: 34rem; text-shadow: 0 1px 2px rgba(0, 0, 0, .6); }
.stage-actions { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin-top: .5rem; }
.social-line { display: inline-flex; align-items: center; gap: .625rem; font-size: var(--fs-md); color: var(--text-1); text-shadow: 0 1px 2px rgba(0, 0, 0, .6); }
.social-line b { color: var(--text-0); font-weight: 600; }
.gate-bar { position: relative; height: var(--gate-h); background: var(--gate); flex: none; }
.gate-bar > i { position: absolute; top: 0; bottom: 0; background: var(--accent); box-shadow: 0 0 12px rgba(255, 178, 63, .55); transition: transform var(--dur-3) var(--ease-out), width var(--dur-3) var(--ease-out); }
.shelf { padding: 1rem var(--pad-x) 1.25rem; }
.shelf-head { display: flex; align-items: center; gap: .75rem; min-height: var(--ctl-md); margin-bottom: .75rem; flex-wrap: wrap; }
.shelf-head > .t-lg { white-space: nowrap; }
.shelf-head > .end { margin-left: auto; display: flex; align-items: center; gap: .5rem; }
.strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); }

/* ================================================================ 5.29 social band pieces, people panel rows, MOTD card */
.motd { border-radius: var(--r-md); overflow: hidden; background: var(--surface-1); border: 1px solid var(--line-1); position: relative; }
.motd > .art { aspect-ratio: 16 / 8; }
.motd .m-body { display: grid; gap: .5rem; padding: .875rem 1rem 1rem; }
.motd .m-title { font-size: var(--fs-md); font-weight: 600; color: var(--text-0); line-height: 1.3; }
.motd .m-text { font-size: var(--fs-sm); color: var(--text-2); line-height: 1.45; }
.motd > .m-close { position: absolute; top: .25rem; right: .25rem; }

/* ================================================================ 5.31 letterbox (pause, loading, big moments) */
.lb-top, .lb-bot { position: absolute; left: 0; right: 0; z-index: 3; display: flex; align-items: center; gap: 1rem; padding: 0 var(--pad-x); background: var(--band); }
.lb-top { top: 0; height: max(52px, 9%); border-bottom: 1px solid var(--line-1); padding-top: var(--safe-t); }
.lb-bot { bottom: 0; height: max(52px, 9%); border-top: 1px solid var(--line-1); padding-bottom: var(--safe-b); }
.frozen { position: absolute; inset: 0; background-repeat: no-repeat; }
.frozen::after { content: ""; position: absolute; inset: 0; background: var(--scrim-game); }
@media (max-width: 599px) { .lb-top { height: calc(3.25rem + var(--safe-t)); } .lb-bot { display: none; } }
@media (min-width: 600px) and (max-height: 500px) { .lb-top, .lb-bot { height: 2.5rem; } }

/* ================================================================ 5.32 stone family (slot screens; vanilla identity, integer steps)
   --su = the stone pixel unit (2 px phones, 3 px laptops/tablets, 4 px when >= 1280x1000): slot 18su, icon 16su, bevel 1su.
   (--su, not --u: --u is the HUD's frozen gui-scale unit.) */
.stone { --su: 3px; position: relative; background: var(--stone-1); border-radius: calc(var(--su) * 1.5); padding: calc(var(--su) * 6); color: var(--stone-ink); font-family: var(--font-ui);
  box-shadow: inset var(--su) var(--su) 0 var(--stone-hi), inset calc(var(--su) * -1) calc(var(--su) * -1) 0 var(--stone-lo),
              0 0 0 calc(var(--su) * .75) var(--stone-line), 0 30px 80px -20px rgba(0, 0, 0, .75); }
@media (max-width: 599px), (max-height: 500px) { .stone { --su: 2px; } }
@media (min-width: 1280px) and (min-height: 1000px) { .stone { --su: 4px; } }
.stone-title { margin: 0; font-family: var(--font-pixel); font-weight: 400; font-size: 21px; line-height: 1; color: var(--stone-ink); font-synthesis: none;
  text-shadow: 2px 2px 0 rgba(0, 0, 0, .18); }
@media (min-width: 1280px) and (min-height: 1000px) { .stone-title { font-size: 32px; text-shadow: 3px 3px 0 rgba(0, 0, 0, .18); } }
.stone-label { margin: 0; font: 600 14px/1.2 var(--font-ui); color: var(--stone-ink-2); }
.slots { display: grid; grid-template-columns: repeat(var(--cols, 9), calc(var(--su) * 18)); grid-auto-rows: calc(var(--su) * 18); gap: 0; }
.slot { position: relative; width: calc(var(--su) * 18); height: calc(var(--su) * 18); background: var(--stone-slot);
  box-shadow: inset var(--su) var(--su) 0 var(--stone-edge), inset calc(var(--su) * -1) calc(var(--su) * -1) 0 var(--stone-hi); }
.slot > img, .slot > canvas { position: absolute; left: 50%; top: 50%; width: calc(var(--su) * 16); height: calc(var(--su) * 16); margin: calc(var(--su) * -8) 0 0 calc(var(--su) * -8); image-rendering: pixelated; }
.slot.held { box-shadow: inset var(--su) var(--su) 0 var(--stone-edge), inset calc(var(--su) * -1) calc(var(--su) * -1) 0 var(--stone-hi), 0 0 0 2px var(--amber-400); }
.slot:focus-visible { outline: none; box-shadow: inset var(--su) var(--su) 0 var(--stone-edge), inset calc(var(--su) * -1) calc(var(--su) * -1) 0 var(--stone-hi), 0 0 0 2px var(--stone-ink); }
.sbtn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .375rem; min-width: calc(var(--su) * 13); height: calc(var(--su) * 13);
  padding: 0 calc(var(--su) * 3); margin: 0; border: 0; cursor: pointer; color: var(--stone-ink); background: var(--stone-0); font: 600 14px/1 var(--font-ui);
  box-shadow: inset var(--su) var(--su) 0 var(--stone-hi), inset calc(var(--su) * -1) calc(var(--su) * -1) 0 var(--stone-lo), 0 0 0 calc(var(--su) * .5) var(--stone-line); }
.sbtn > .ico { width: calc(var(--su) * 6.5); height: calc(var(--su) * 6.5); stroke-width: 2.25; }
.sbtn::before { content: ""; position: absolute; inset: min(0px, calc((var(--su) * 13 - 44px) / 2)); }
.sbtn.on, .sbtn[aria-pressed="true"] { background: #E9C27A; color: #3A2405; }
.sbtn:active { box-shadow: inset calc(var(--su) * -1) calc(var(--su) * -1) 0 var(--stone-hi), inset var(--su) var(--su) 0 var(--stone-lo), 0 0 0 calc(var(--su) * .5) var(--stone-line); }
.sbtn:focus-visible { outline: none; box-shadow: inset var(--su) var(--su) 0 var(--stone-hi), inset calc(var(--su) * -1) calc(var(--su) * -1) 0 var(--stone-lo), 0 0 0 2px var(--stone-ink); }
.stone-field { display: block; width: 100%; height: calc(var(--su) * 12); padding: 0 calc(var(--su) * 3); border: 0; border-radius: 0; background: var(--stone-field); color: var(--stone-ink);
  font: 500 max(16px, 14px)/1 var(--font-ui); box-shadow: inset var(--su) var(--su) 0 var(--stone-edge); outline: none; }
.stone-field:focus { box-shadow: inset var(--su) var(--su) 0 var(--stone-edge), 0 0 0 2px var(--amber-500); }
.ptip { position: fixed; z-index: var(--z-tooltip); display: grid; gap: .25rem; min-width: 10rem; max-width: 20rem; padding: .5rem .75rem .625rem; pointer-events: none;
  background: rgba(16, 12, 10, .97); border: 1px solid rgba(255, 236, 214, .16); border-radius: 4px; box-shadow: 0 0 0 1px #000, var(--elev-2); font: 400 14px/1.35 var(--font-ui); color: var(--text-1); }
.ptip .pt { font: 600 16px/1.2 var(--font-ui); color: var(--rar-common); }
.ptip .pt.uncommon { color: var(--rar-uncommon); } .ptip .pt.rare { color: var(--rar-rare); } .ptip .pt.epic { color: var(--rar-epic); } .ptip .pt.legendary { color: var(--rar-legendary); }
.ptip .pk { font: 700 12px/1 var(--font-display); letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.ptip .pl { display: flex; justify-content: space-between; gap: 1rem; } .ptip .pl > span:first-child { color: var(--text-2); } .ptip .pl > span:last-child { color: var(--text-0); font-variant-numeric: tabular-nums; }
.ptip .ph { display: flex; align-items: center; gap: .375rem; margin-top: .25rem; padding-top: .375rem; border-top: 1px solid var(--line-1); color: var(--text-3); font-size: 12px; }
html.is-touch .ptip .ph { display: none; }
.infobar { display: flex; align-items: center; gap: .625rem; min-height: 2.5rem; padding: .25rem .75rem; border-radius: var(--r-sm); background: rgba(16, 12, 10, .92); border: 1px solid var(--line-2); color: var(--text-1); font: 500 14px/1.3 var(--font-ui); }
.infobar > img, .infobar > canvas { width: 20px; height: 20px; image-rendering: pixelated; flex: none; }

/* ================================================================ tooltip (hover help on desktop) */
.ui-tooltip { position: fixed; z-index: var(--z-tooltip); pointer-events: none; max-width: 18rem; padding: .375rem .625rem; border-radius: var(--r-sm);
  background: var(--surface-toast); border: 1px solid var(--line-2); box-shadow: var(--elev-2); color: var(--text-1); font-size: var(--fs-sm); line-height: 1.35; }

/* ================================================================ hover: ONLY where hovering exists (P12 / UX-27) */
@media (hover: hover) and (pointer: fine) {
  .btn:hover { background: rgba(255, 236, 214, .11); border-color: var(--line-3); }
  .btn-primary:hover { background: var(--accent-hover); border-color: transparent; }
  .btn-secondary:hover { background: rgba(255, 236, 214, .11); border-color: var(--line-3); }
  .btn-secondary.is-on:hover, .btn-secondary[aria-pressed="true"]:hover { background: rgba(255, 178, 63, .2); border-color: var(--sel-line); }
  .btn-onart:hover { background: rgba(10, 8, 6, .8); border-color: rgba(255, 236, 214, .3); }
  .btn-ghost:hover { background: rgba(255, 236, 214, .07); border-color: transparent; color: var(--text-0); }
  .btn-icon.btn-ghost:hover { color: var(--text-0); }
  .btn-danger:hover { background: var(--red-500); border-color: transparent; }
  .btn-danger-line:hover { background: var(--danger-soft); border-color: var(--danger); }
  .btn:disabled:hover, .btn.is-disabled:hover, .btn[aria-disabled="true"]:hover { background: rgba(255, 236, 214, .06); border-color: transparent; }
  .input:hover:not(:focus):not(:disabled):not(.is-error) { border-color: var(--line-field-hover); }
  .select:hover:not(:disabled) { border-color: var(--line-field-hover); }
  .check:hover > .box, .check:hover > .check-box { border-color: var(--line-field-hover); }
  .check:hover > input:checked + .box, .check:hover > input:checked + .check-box { border-color: var(--accent-hover); background: var(--accent-hover); }
  .switch:hover:not(:disabled):not(.locked) { border-color: var(--line-field-hover); }
  .seg > button:hover:not(.on):not([aria-checked="true"]):not(.active):not(:disabled), .seg > .seg-btn:hover:not(.on):not(.active):not(:disabled) { color: var(--text-0); background: rgba(255, 236, 214, .05); }
  .rcard:hover:not(.on):not(.locked), .preset:hover:not(.on) { border-color: var(--line-3); }
  .postcard:hover:not(.on) > .pc-art { box-shadow: inset 0 0 0 1px var(--line-3); }
  .tabs > *:hover { color: var(--text-0); }
  button.chip:hover:not(.sel) { background: rgba(255, 236, 214, .11); color: var(--text-1); }
  .card.hoverable:hover, .wcard:not(.create):hover, .mcard:hover { transform: translateY(-3px); border-color: var(--accent-line); box-shadow: var(--elev-2); }
  .wcard.sel:hover, .mcard.sel:hover { border-color: var(--accent); }
  .wcard:hover .playdisc, .mcard:hover .playdisc { opacity: 1; transform: none; }
  .wcard.create:hover { border-color: var(--accent-line); color: var(--text-1); }
  button.row:hover, a.row:hover { background: rgba(255, 236, 214, .05); }
  .disclose:hover { border-color: var(--line-2); }
  .pop-item:hover:not(:disabled) { background: rgba(255, 236, 214, .07); color: var(--text-0); }
  .pop-item.danger:hover { background: var(--danger-soft); color: var(--danger-text); }
  .link:hover { text-decoration-color: currentColor; }
  .toast:hover { border-color: var(--line-3); }
  .sbtn:hover { background: #E7E4DE; }
  .sbtn.on:hover { background: #F0CD88; }
}

/* ================================================================ LEGACY (round 1-5 class names, restyled on the new tokens).
   Callers migrate to the PART 5 names above; QA deletes a rule when grep finds no caller. ============== */
.btn.primary { background: var(--accent); border-color: transparent; color: var(--text-on-accent); box-shadow: var(--lit-edge); }
.btn.primary:active { background: var(--accent-press); box-shadow: inset 0 2px 0 rgba(120, 58, 0, .25); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-1); }
.btn.danger { background: var(--danger-solid); border-color: transparent; color: #fff; }
.btn.good { background: var(--green-600); border-color: transparent; color: #fff; }
.btn.small, .btn.tiny { --b-h: var(--ctl-sm); padding: 0 .875rem; font-size: var(--fs-sm); gap: .375rem; }
.btn.small > .ico, .btn.tiny > .ico { width: 1.125rem; height: 1.125rem; }
.btn.big { --b-h: var(--ctl-lg); padding: 0 1.5rem; font-size: 1.0625rem; }
.btn.icon { padding: 0; width: var(--b-h); }
.btn.wide { display: flex; width: 100%; }
.btn.loading { pointer-events: none; }
.btn.loading::before { content: ""; width: 1.125rem; height: 1.125rem; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; flex: none; }
.btn:disabled.primary, .btn:disabled.danger, .btn:disabled.good { background: rgba(255, 236, 214, .06); color: var(--text-disabled); box-shadow: none; }
.btn.loading:disabled.primary { background: var(--accent); color: var(--text-on-accent); }
.btn-row { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }
.btn-row.center { justify-content: center; }
.field-label { font-size: var(--fs-sm); font-weight: 500; color: var(--text-2); line-height: 1.2; }
.color-input { width: 2.875rem; height: 2.5rem; padding: 0; border: 1px solid var(--line-field); border-radius: var(--r-sm); background: none; cursor: pointer; }
.seg.wrap { grid-auto-flow: row; grid-template-columns: repeat(auto-fit, minmax(6.5rem, 1fr)); }
.badge { display: inline-flex; align-items: center; gap: .25rem; height: 1.375rem; padding: 0 .4375rem; border-radius: var(--r-xs); white-space: nowrap;
  font-family: var(--font-display); font-weight: 700; font-size: var(--fs-k3); letter-spacing: .08em; text-transform: uppercase; line-height: 1;
  color: var(--text-2); background: rgba(255, 236, 214, .08); }
.badge .ico { width: .8125rem; height: .8125rem; }
.badge.mode, .badge.warm, .badge.gold { background: var(--accent-soft); color: var(--amber-200); }
.badge.bad { background: var(--danger-soft); color: var(--danger-text); }
.badge.info { background: var(--info-soft); color: var(--info-text); }
.badge.ok { background: var(--success-soft); color: var(--success-text); }
.steps-list { margin: .375rem 0 .625rem; padding-left: 1.3em; color: var(--text-2); }
.avatar { display: block; border-radius: var(--r-xs); image-rendering: pixelated; }
.avatar.rich { image-rendering: auto; }
.spinner { display: inline-block; width: 1.125rem; height: 1.125rem; flex: none; border-radius: 50%; border: 2px solid rgba(255, 236, 214, .18); border-top-color: var(--accent); animation: spin .8s linear infinite; }
.glass { background: var(--surface-1); border: 1px solid var(--line-1); }
.muted { color: var(--text-2); }
.small { font-size: .875em; }
@media (hover: hover) and (pointer: fine) {
  .btn.primary:hover { background: var(--accent-hover); border-color: transparent; }
  .btn.ghost:hover { background: rgba(255, 236, 214, .07); border-color: transparent; color: var(--text-0); }
  .btn.danger:hover { background: var(--red-500); }
}
html.is-touch .btn.small, html.is-touch .btn.tiny { --b-h: var(--ctl-sm); }
