/* Temporary debug panel and experimental settings. */

/* Panel */
.debug-panel { position: fixed; z-index: 20; left: max(12px, env(safe-area-inset-left, 0px)); bottom: max(12px, env(safe-area-inset-bottom, 0px)); max-width: calc(100vw - 2 * max(12px, env(safe-area-inset-left, 0px))); padding: 4px; font-size: 14px; line-height: 1.3; color: var(--ink); background: color-mix(in srgb, var(--surface) 68%, transparent); -webkit-backdrop-filter: blur(12px) saturate(1.3); backdrop-filter: blur(12px) saturate(1.3); border: 1px solid color-mix(in srgb, var(--field-edge) 30%, transparent); border-radius: var(--radius-md); box-shadow: var(--pop-shadow); }
.debug-panel summary { display: flex; align-items: center; gap: 8px; min-height: 28px; padding: 0 6px 0 10px; font-weight: 600; list-style: none; cursor: pointer; border-radius: var(--radius-sm); }
.debug-panel summary::-webkit-details-marker { display: none; }
.debug-panel svg { flex: none; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.debug-panel .debug-min { margin-left: auto; color: var(--muted); }
@media (hover: hover) { .debug-panel summary:hover { background: color-mix(in srgb, var(--accent-soft) 70%, transparent); } }
/* Collapsed panel: a small square with an icon, the label stays for the screen reader */
.debug-panel:not([open]) summary { justify-content: center; width: 28px; padding: 0; }
.debug-panel:not([open]) .debug-min { display: none; }
.debug-panel:not([open]) .debug-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.debug-panel label { display: flex; align-items: center; gap: 8px; min-height: 28px; padding: 2px 10px; cursor: pointer; border-radius: var(--radius-sm); }
.debug-panel input { flex: none; margin: 0; accent-color: var(--accent); }
@media (hover: hover) { .debug-panel label:hover { background: color-mix(in srgb, var(--accent-soft) 70%, transparent); } }
@media (pointer: coarse) { .debug-panel summary, .debug-panel label { min-height: 44px; } .debug-panel:not([open]) summary { width: 44px; } }

/* Icon choice: a grid of numbered variants, the list scrolls so the panel does not cover the page */
.debug-logos { padding: 6px 6px 2px; border-top: 1px solid color-mix(in srgb, var(--field-edge) 30%, transparent); margin-top: 4px; }
.debug-sub { display: block; padding: 0 4px 4px; font-weight: 600; }
.debug-logo-grid { display: grid; grid-template-columns: repeat(auto-fill, 40px); gap: 2px; width: min(360px, calc(100vw - 48px)); max-height: min(300px, 45vh); overflow-y: auto; }
.debug-logo-grid button { display: grid; justify-items: center; gap: 1px; padding: 3px 0 1px; font: inherit; font-size: 10px; line-height: 1; color: var(--muted); background: none; border: 0; border-radius: var(--radius-sm); cursor: pointer; }
.debug-logo-grid img { display: block; width: 24px; height: 24px; object-fit: contain; }
.debug-logo-grid button[aria-pressed="true"] { color: var(--ink); background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
@media (hover: hover) { .debug-logo-grid button:hover { background: color-mix(in srgb, var(--accent-soft) 70%, transparent); } }

/* Blurred background: one style for all elements with the .glass class, the checkbox turns it on everywhere at once. The element sets color and density through variables.
   Only elements the user interacts with and layers that open on an action get the blur. Labels and text do not need it, see docs/plan/themes.md */
:root { --glass-blur: blur(10px) saturate(1.3); }
:root[data-exp~="blur"] .glass { background: color-mix(in srgb, var(--glass-tint, var(--surface)) var(--glass-alpha, 58%), transparent); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); }

/* A blurred field becomes a separate layer and would cover an icon that comes before it in the markup */
:root[data-exp~="blur"] .search-ico { z-index: 1; }

/* Address and tags on the card: on a white background they need a border */
:root[data-exp~="blur"] :is(.ip, .tag).glass { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--field-edge) 35%, transparent); }
:root[data-exp~="blur"] .ip.glass { --muted: var(--ink); }
:is(.ip, .tag).glass { --glass-tint: var(--surface-2); }
.tag.hit.glass { --glass-tint: var(--accent-soft); --glass-alpha: 84%; }
.card.down :is(.ip, .tag).glass { --glass-tint: var(--surface); --glass-alpha: 62%; }
@media (hover: hover) and (scripting: enabled) { .ip.glass[data-copy-area]:hover { --glass-tint: var(--accent-soft); --glass-alpha: 78%; } }
.ip.glass[data-copy-area]:has(.done) { --glass-tint: var(--done); --glass-alpha: 88%; }

/* On the panorama. The header buttons already have a semi-transparent color, so the density is 100%. On hover the .glass rule is stronger than the :hover background, so the color changes through a variable */
.examples a.glass { --glass-tint: var(--hero-edge); --glass-alpha: 72%; }
@media (hover: hover) { .examples a.glass:hover { --glass-tint: var(--hero-on); --glass-alpha: 92%; } }
.top-avatar.glass { --glass-tint: var(--top-pill); --glass-alpha: 100%; }

/* Popup layers: text is read in them, so the background is denser */
.suggest.glass { --glass-tint: var(--pop-bg); --glass-alpha: 88%; }
.top-profile-menu.glass { --glass-tint: var(--pop-bg); --glass-alpha: 88%; }
.tip-body.glass { --glass-tint: var(--tip-bg); --glass-alpha: 88%; }
.joinhelp.glass { --glass-alpha: 88%; }
.filters-done.glass { --glass-alpha: 72%; }

/* An image across the whole card. Gray text gets lost on it, so inside the card it becomes the main color */
:root[data-exp~="full-art"] .card { --muted: var(--ink); }
/* The card-color veil is made with a mask: the image shows through at 26–70%, under it is the card's solid background, visually it is the same veil at 74–30%.
   It cannot be made as a layer on top: the card's ::before is taken by the rank number, ::after by the border */
:root[data-exp~="full-art"] .card-art {
  display: block; inset: 0; width: 100%; min-width: 0; max-width: none; height: 100%; border-radius: calc(var(--radius) - var(--edge-w));
  -webkit-mask-image: linear-gradient(100deg, rgb(0 0 0 / .26), rgb(0 0 0 / .44) 55%, rgb(0 0 0 / .7)); mask-image: linear-gradient(100deg, rgb(0 0 0 / .26), rgb(0 0 0 / .44) 55%, rgb(0 0 0 / .7));
}
/* The veil pulls colors towards white, saturation compensates for it. A switched-off server stays gray */
:root[data-exp~="full-art"] .card:not(.down) .card-art { filter: saturate(1.3); }
:root[data-exp~="full-art"] .card :is(h3 a, .slogan, .meta, .online > span, .plat-head:not(.only), .plat-meta) { text-shadow: 0 0 1px var(--card-bg), 0 0 3px var(--card-bg), 0 0 6px var(--card-bg), 0 0 12px var(--card-bg), 0 0 20px var(--card-bg); }
/* The image as it is: no veil and no compensation of its colors. The gray of a switched-off server stays, only the paleness goes away */
:root[data-exp~="full-art"][data-exp~="solid-art"] .card-art { -webkit-mask-image: none; mask-image: none; }
:root[data-exp~="full-art"][data-exp~="solid-art"] .card:not(.down) .card-art { filter: none; }
:root[data-exp~="full-art"][data-exp~="solid-art"] .card.down .card-art { opacity: 1; }
/* The selector is the same as in the strongest rule with padding in site.css, the file is included later */
:root[data-exp~="full-art"] .card:has(.card-art:not(.pano)) .slogan { padding-right: 0; }
