/* «Quanto regge?» — page styles (design-ui-impact.md; mobile v3: design-mobile-v3.md rev. 2).
   Shared site styles stay unchanged. */
/* Site fonts, self-hosted: the CSP allows only same-origin fonts, so the Google Fonts stylesheet
   the other pages link never loads here. Same WOFF2 files and unicode-ranges as that stylesheet
   (variable fonts: one file covers weights 400–700); OFL licences in assets/fonts. All five files
   are preloaded by the page, so typing never triggers a later subset download. */
/* DM Sans latin-ext */
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../../assets/fonts/imwt-dm-sans-latin-ext-v17.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308,
    U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113,
    U+2C60-2C7F, U+A720-A7FF;
}
/* DM Sans latin */
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../../assets/fonts/imwt-dm-sans-latin-v17.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
    U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Space Grotesk vietnamese */
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../../assets/fonts/imwt-space-grotesk-vietnamese-v22.woff2') format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0,
    U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
/* Space Grotesk latin-ext */
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../../assets/fonts/imwt-space-grotesk-latin-ext-v22.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308,
    U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113,
    U+2C60-2C7F, U+A720-A7FF;
}
/* Space Grotesk latin */
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../../assets/fonts/imwt-space-grotesk-latin-v22.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
    U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* First-impact compactness: page-scoped overrides of the inherited Arcade spacing. */
.tester-page .tester-main.arcade-main {
  padding-block: 16px 60px;
}
@media (min-width: 1024px) {
  .tester-page .tester-main.arcade-main {
    padding-top: 28px;
  }
}
.tester-main .arcade-intro {
  max-width: 820px;
}
.tester-intro .kicker {
  margin: 0 0 4px;
  color: var(--red);
}
.tester-page .tester-intro h1 {
  font-size: clamp(1.45rem, 4.6vw, 2.75rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 2px 0 6px;
  color: var(--text);
}
.tester-intro h1 em {
  font-style: normal;
  color: var(--red);
}
/* Section identity: the transparent Marvin sits beside the intro at every width. Narrow screens
   float it next to the title, so the field stays in the first screen; wider ones give it a
   column. No background, no animation. */
.tester-intro {
  display: flow-root;
}
.tester-hero-art {
  float: inline-end;
  width: clamp(96px, 28vw, 120px);
  height: auto;
  margin: 0 0 4px;
  margin-inline-start: 10px;
}
@media (min-width: 768px) {
  .tester-main .tester-intro {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    column-gap: clamp(20px, 4vw, 48px);
    max-width: 1040px;
  }
  .tester-intro > * {
    grid-column: 1;
  }
  .tester-intro > .tester-hero-art {
    grid-column: 2;
    grid-row: 1 / span 3;
    float: none;
    width: clamp(170px, 24vw, 280px);
    margin: 0;
  }
}
.tester-page .tester-intro .arcade-lead {
  margin: 0;
  font-size: 1rem;
  line-height: 1.4;
}
.tester-warning {
  margin: 10px 0 12px;
  padding: 8px 12px;
  max-width: 80ch;
  border: 1px solid rgba(255, 228, 119, 0.45);
  border-radius: 14px;
  color: #e4d9e6;
  font-size: 0.9rem;
  line-height: 1.45;
}
.tester-warning a,
.tester-lab a,
.tester-details a,
.tester-forge a:not(.button) {
  color: var(--mint);
}
.tester-fallback {
  margin-block: 16px;
  color: #e4d9e6;
}

/* Lab: field → result → short tip → level and composition, in DOM order at every width.
   Browser QA 1: shrinkable tracks, so no control (the select's longest option included) can
   widen the panel beyond its container. */
.tester-lab {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  margin-block: 0 24px;
  padding: clamp(12px, 3vw, 28px);
  border: 1px solid var(--line);
  border-top: 4px solid var(--red);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(251, 57, 74, 0.08), rgba(251, 57, 74, 0) 160px),
    var(--surface);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}
.tester-lab > * {
  min-width: 0;
}
@media (min-width: 601px) and (max-width: 1023px) {
  .tester-lab {
    max-width: 720px;
  }
}
@media (min-width: 1024px) {
  .tester-lab {
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    grid-template-areas:
      'entry entry'
      'result next'
      'result profile';
    align-items: start;
    column-gap: 32px;
  }
  .tester-entry {
    grid-area: entry;
    max-width: 44rem;
  }
  .tester-result {
    grid-area: result;
  }
  .tester-next {
    grid-area: next;
  }
  .tester-profile {
    grid-area: profile;
  }
}
.tester-lab p,
.tester-details p,
.tester-details li {
  max-width: 70ch;
  color: #e4d9e6;
  line-height: 1.55;
}
.tester-lab p {
  margin: 2px 0;
}
.tester-label,
.tester-scenario-label {
  display: block;
  margin-bottom: 4px;
  font-weight: 700;
}
.tester-scenario-label {
  font-size: 0.9rem;
}
.tester-label {
  color: var(--text);
  font-size: 1.05rem;
}
.tester-hint,
.tester-note {
  font-size: 0.9rem;
}
.tester-note,
.tester-lab .tester-note {
  color: var(--muted);
}

/* Field at full width; Mostra inside its right edge, with the space reserved for it. */
.tester-field {
  position: relative;
}
.tester-input {
  display: block;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 52px;
  padding: 12px 12px;
  padding-inline-end: calc(4.75rem + 12px);
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 14px;
  background: #0b0911;
  color: var(--text);
  font: inherit;
  font-size: 1.1rem;
  scroll-margin-top: 64px;
  scroll-margin-bottom: 200px;
}
.tester-toggle {
  position: absolute;
  top: 4px;
  inset-inline-end: 4px;
  width: 4.75rem;
  min-height: 44px;
  padding: 0 6px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}
.tester-toggle[aria-pressed='true'] {
  background: var(--text);
  color: var(--bg);
}
/* Svuota is secondary: next to the length hint, never on the field row. */
.tester-entry-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}
.tester-lab .tester-hint {
  margin: 0;
  color: var(--muted);
}
.tester-clear {
  margin-inline-start: auto;
  min-width: 44px;
  min-height: 44px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: var(--mint);
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

/* Result: scenario row, large time, short hypothesis, short caveat. */
.tester-result {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
}
.tester-scenario-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
}
.tester-scenario-row .tester-scenario-label {
  margin: 0;
}
.tester-scenario {
  flex: 1 1 14rem;
  min-width: 0;
  max-width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 12px;
  background: #0b0911;
  color: var(--text);
  font: inherit;
}
.tester-lab .tester-time-value {
  margin: 4px 0 0;
  font-size: clamp(1.6rem, 4.2vw, 2.3rem);
  font-weight: 700;
  line-height: 1.15;
  color: var(--text);
  overflow-wrap: anywhere;
}
/* Gate 1 (MV2): every measured state reserves the height of the large time, computed from the
   large size itself (rem/vw), never from the font of the placeholder shown inside it. Two lines
   below 600 px hold every expected form, «Un milione di anni o più» included. */
.tester-lab .tester-time-value[data-state='pending'],
.tester-lab .tester-time-value[data-state='ready'],
.tester-lab .tester-time-value[data-state='state'] {
  min-height: calc(1.15 * clamp(1.6rem, 4.2vw, 2.3rem));
}
@media (max-width: 600px) {
  .tester-lab .tester-time-value[data-state='pending'],
  .tester-lab .tester-time-value[data-state='ready'],
  .tester-lab .tester-time-value[data-state='state'] {
    min-height: calc(2.3 * clamp(1.6rem, 4.2vw, 2.3rem));
  }
}
/* Empty, pending and IME sentences at 16 px; empty and IME keep their natural height. */
.tester-lab .tester-time-value[data-state='empty'],
.tester-lab .tester-time-value[data-state='pending'],
.tester-lab .tester-time-value[data-state='composing'] {
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.45;
  color: var(--muted);
}
.tester-lab .tester-time-value[data-state='empty'],
.tester-lab .tester-time-value[data-state='composing'] {
  min-height: 0;
}
.tester-lab .tester-time-detail {
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--muted);
}
.tester-lab .tester-hypothesis-text {
  margin-top: 2px;
  font-size: 1rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.tester-lab .tester-caveat {
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--muted);
}

/* Short tip: Marvin, operational title, one sentence, one link. */
.tester-next {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  gap: 4px 10px;
  padding: 12px 14px;
  border: 1px solid rgba(156, 241, 204, 0.45);
  border-radius: 18px;
  background: rgba(156, 241, 204, 0.06);
}
.tester-next-marvin {
  display: block;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #fff9f2;
}
.tester-next-title {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.3;
}
.tester-lab .tester-next-text,
.tester-lab .tester-next-more {
  grid-column: 1 / -1;
  margin: 0;
}
.tester-lab .tester-next-text {
  font-size: 1rem;
  line-height: 1.5;
}
.tester-next-more a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 700;
}

/* Level and composition: secondary, after the tip. */
.tester-profile {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}
.tester-level {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(84px, 32%);
  column-gap: 10px;
  align-items: center;
}
.tester-state-title {
  margin: 0;
  font-size: 1.05rem;
}
.tester-meter {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  margin: 0;
}
.tester-meter span {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  transition: background-color 150ms ease;
}
.tester-meter[data-level='0'] span:nth-child(-n + 1),
.tester-meter[data-level='1'] span:nth-child(-n + 2) {
  background: var(--yellow);
}
.tester-meter[data-level='2'] span:nth-child(-n + 3) {
  background: var(--pink);
}
.tester-meter[data-level='3'] span:nth-child(-n + 4),
.tester-meter[data-level='4'] span:nth-child(-n + 5) {
  background: var(--mint);
}
/* Composition: only the categories present, in a neutral row; decorative separators only. */
.tester-composition #tester-length {
  font-size: 1rem;
}
.tester-contains-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 10px;
}
.tester-lab .tester-contains {
  margin: 0;
  font-weight: 700;
}
.tester-indicators {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 0;
  margin: 0;
  padding: 0;
  list-style: none;
  color: #e4d9e6;
  font-size: 1rem;
}
.tester-indicators li {
  padding-inline: 10px;
  border-inline-start: 1px solid rgba(255, 255, 255, 0.3);
  line-height: 1.5;
}
.tester-indicators li:first-child {
  padding-inline-start: 0;
  border-inline-start: 0;
}

/* Deep dives, closed by default. */
.tester-more-title {
  margin: 32px 0 12px;
  padding-inline-start: 12px;
  border-inline-start: 4px solid var(--red);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.5rem;
  line-height: 1.2;
  color: var(--text);
}
.tester-details {
  margin-block: 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
}
.tester-details > summary {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 18px;
  font-weight: 700;
  cursor: pointer;
}
.tester-details-body {
  padding: 0 clamp(16px, 3vw, 24px) 18px;
}
.tester-details h3 {
  margin: 18px 0 8px;
  font-size: 1.1rem;
}
.tester-details ol,
.tester-details ul {
  padding-left: 1.3em;
}
.tester-details li + li {
  margin-top: 8px;
}
.tester-known {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 228, 119, 0.45);
  border-radius: 14px;
}
.tester-quip {
  font-style: italic;
}
.tester-forge {
  margin-block: 18px;
}
.tester-forge .button {
  margin-top: 6px;
}

/* Method table: one semantic table, stacked by CSS only on narrow screens. */
.tester-times-table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 0.95rem;
}
.tester-times-table caption {
  margin-bottom: 8px;
  text-align: left;
  font-weight: 700;
}
.tester-times-table th,
.tester-times-table td {
  padding: 10px 8px;
  border-top: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.tester-times-table thead th {
  color: var(--muted);
  font-size: 0.85rem;
}
.tester-scenario-name {
  display: block;
  font-weight: 700;
}
.tester-hypothesis {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-weight: 400;
}
/* Explicit ARIA roles in the markup keep the table semantics that some browsers drop when
   table display changes. */
@media (max-width: 600px) {
  .tester-times-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .tester-times-table tr,
  .tester-times-table th,
  .tester-times-table td {
    display: block;
  }
  .tester-times-table td {
    border-top: 0;
    padding-top: 0;
  }
}

/* Narrow screens: main column and spacing only. Header and footer keep the shared Arcade metrics;
   field, values, hypotheses and the tip stay at 16 px or more. Browser QA 2: the usable field
   width comes from side spacing only (16 px page margin, 8 px panel sides), never from fonts or
   targets. */
@media (max-width: 600px) {
  .tester-page .tester-main.section-shell {
    width: min(100% - 16px, 600px);
  }
  .tester-page .tester-main.arcade-main {
    padding-top: 10px;
  }
  .tester-page .tester-intro h1 {
    font-size: clamp(1.25rem, 5.6vw, 1.5rem);
    margin: 0 0 4px;
  }
  .tester-intro .kicker {
    display: none;
  }
  .tester-warning {
    margin: 8px 0 10px;
    padding: 6px 10px;
    font-size: 0.875rem;
  }
  .tester-lab {
    gap: 12px;
    padding: 12px 8px;
    border-radius: 18px;
  }
}
@media (max-width: 360px) {
  .tester-lab {
    padding: 10px 8px;
  }
}

/* Focus, hidden content, hidden text, motion. */
.tester-input:focus-visible,
.tester-scenario:focus-visible,
.tester-clear:focus-visible,
.tester-details > summary:focus-visible,
[tabindex='-1']:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 3px;
}
.tester-toggle:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 1px;
}
.tester-page [hidden] {
  display: none;
}
.tester-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
:target {
  scroll-margin-top: 110px;
}
@media (prefers-reduced-motion: reduce) {
  .tester-meter span {
    transition: none;
  }
}
body.reduced-motion .tester-meter span {
  transition: none;
}
