/* SHA Innovation CI – colours and type taken from sha-innovation.ch */

/* Poppins, self-hosted (no Google Fonts). Source: @fontsource/poppins 5.3.0,
   subsets latin and latin-ext, weights 400/500/600/700, normal style only.
   Font files and licence: /fonts/ (OFL.txt, SIL Open Font License 1.1). */
@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/poppins-latin-400-normal.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;
}
@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/poppins-latin-ext-400-normal.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-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/poppins-latin-500-normal.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;
}
@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/poppins-latin-ext-500-normal.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-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/poppins-latin-600-normal.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;
}
@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/poppins-latin-ext-600-normal.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-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/poppins-latin-700-normal.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;
}
@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/poppins-latin-ext-700-normal.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-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}

:root {
  --charcoal: #22272a;
  --grey: #39393b;
  --grey-light: #4a4a4d;
  --rose: #dda092;
  --rose-light: #e8b8ad;
  --slate: #5b6670;
  --sand: #ead7cb;
  --white: #ffffff;
  --ink: #22272a;
  --muted: rgba(255, 255, 255, 0.65);
  --line: rgba(255, 255, 255, 0.18);
  --success: #8fbf9a;
  --wrong: #a9483d;
  --radius: 18px;
  --radius-small: 12px;
  --font: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
  /* Content width of the page header, the page footer and the landing page. */
  --page-width: min(94%, 87.5rem);
  /* Main button: rosé in the game views; body.site-design switches it to white. */
  --btn-bg: var(--rose);
  --btn-bg-hover: var(--rose-light);
  --btn-fg: var(--ink);
}

@media (max-width: 760px) {
  :root {
    --page-width: calc(100% - 36px);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--charcoal);
  color: var(--white);
  font-family: var(--font);
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

/* Form controls don't inherit the page font by default; Poppins everywhere (M6). */
button,
input,
select,
textarea,
dialog {
  font-family: inherit;
}

::placeholder {
  font-family: inherit;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1,
h2,
h3 {
  font-weight: 700;
  line-height: 1.15;
  text-wrap: balance;
}

a {
  color: var(--rose);
}

.logo {
  display: block;
  height: 44px;
  width: auto;
}

.eyebrow {
  color: var(--rose);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.85rem;
}

.muted {
  color: var(--muted);
}

.accent {
  color: var(--rose);
}

.hidden {
  display: none !important;
}

/* ---------- Buttons & inputs ---------- */

/* One shape for every button (M5): 10px corners, 1px border, normal weight. The colours come
   from --btn-*, so a page's own variant (e.g. .btn--danger) still wins with one class. The
   padding is 1px smaller to keep today's size despite the border. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  padding: calc(0.85em - 1px) calc(1.8em - 1px);
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font: inherit;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.4;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s, opacity 0.15s;
}

.btn:hover {
  background: var(--btn-bg-hover);
}

.btn:active {
  transform: scale(0.97);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.btn:focus-visible,
.input:focus-visible {
  outline: 3px solid var(--rose-light);
  outline-offset: 3px;
}

.btn--ghost {
  border-color: rgba(255, 255, 255, 0.4);
  background: transparent;
  color: var(--white);
}

.btn--ghost:hover {
  background: rgba(255, 255, 255, 0.08);
}

.btn--small {
  padding: calc(0.5em - 1px) calc(1.1em - 1px);
  font-size: 0.875rem;
}

.btn--block {
  width: 100%;
}

.input {
  width: 100%;
  padding: 0.85em 1.1em;
  border: 2px solid transparent;
  border-radius: var(--radius-small);
  background: var(--white);
  color: var(--ink);
  font: inherit;
  font-size: 1.1rem;
  line-height: 1.4;
}

.input:focus {
  border-color: var(--rose);
  outline: none;
}

.field {
  display: grid;
  gap: 0.4rem;
}

.field label {
  font-weight: 600;
  font-size: 0.9rem;
}

.form-error {
  min-height: 1.4em;
  color: var(--rose);
  font-weight: 600;
}

.card {
  background: var(--grey);
  border-radius: var(--radius);
  padding: 24px;
}

/* ==========================================================================
   New design (006): landing page, legal pages, join form, start page, editor

   Contract for the pages (markup as shown, classes as named):

   1. Switch. A page in the new design sets class="site-design" on <body>. Without it a page
      keeps the game look (beamer, phone after joining). /beitreten shows both and toggles it:
        document.body.classList.toggle('site-design', joinFormIsShown);
      The switch makes the main .btn white with dark text and .btn--ghost transparent with
      border and text in the text colour (.btn--danger from start.css stays red), headings
      weight 500, running text line-height 1.8 and letter-spacing .02em, and adds a dark gap
      inside the focus ring of buttons. Tables, forms, cards, dialogs and inputs keep
      line-height 1.4 and normal letter-spacing. Game views change nothing but the button shape.

   2. Skip link, first element in <body>, aiming at <main id="inhalt">:
        <a class="skip-link" href="#inhalt">Zum Inhalt</a>

   3. Header, full width, dark, shadow below, logo at the size of the design:
        <header class="page-header">
          <div class="page-header__inner">
            <a class="logo-link" href="/">
              <img class="logo" src="/img/logo-white.png" alt="SHA Innovation, zur Startseite">
            </a>
            <div class="page-header__end">… page-specific elements …</div>
          </div>
        </header>
      A text link on the right: <a class="page-header__link" href="…">…</a>.
      A logo that must not navigate: the same <a class="logo-link"> without href (looks the
      same, not clickable, not focusable), with alt="SHA Innovation".

   4. Footer, full width, graphite, stacked up to 760px; in a flex-column body it sits at the
      bottom (margin-top: auto):
        <footer class="page-footer">
          <div class="page-footer__inner">
            <p class="page-footer__copy"><span class="flag" aria-hidden="true"></span>© <span data-year>2026</span> SHA Innovation</p>
            <nav class="page-footer__links" aria-label="Rechtliches">
              <a href="/datenschutz">Datenschutz</a>
              <a href="/nutzungsbedingungen">Nutzungsbedingungen</a>
              <a href="/impressum">Impressum</a>
            </nav>
          </div>
        </footer>
        <script src="/js/site-footer.js"></script>  (keeps the year current)

   Skip link, header, footer and logo link work with or without .site-design and without
   site.css. --page-width sets the width of header and footer content; a page may override it.
   The game views keep .play-bar / .host-bar with the 44px .logo.
   ========================================================================== */

body.site-design {
  --btn-bg: var(--white);
  --btn-bg-hover: #e7e7e7;
  --btn-fg: var(--ink);
  line-height: 1.8;
  letter-spacing: 0.02em;
}

.site-design :where(h1, h2, h3) {
  font-weight: 500;
  letter-spacing: -0.01em;
}

.site-design :where(table, form, dialog, .card, .input) {
  line-height: 1.4;
  letter-spacing: normal;
}

.site-design .btn--ghost {
  border-color: currentColor;
  color: inherit;
}

.site-design .btn--ghost:hover {
  background: rgba(255, 255, 255, 0.07);
}

/* The dark gap keeps the ring visible around white buttons and on white surfaces. */
.site-design .btn:focus-visible {
  box-shadow: 0 0 0 3px var(--charcoal);
}

/* ---------- White box with three steps ----------
   «So funktioniert es» on the landing page (site.css adds the outer margin) and in the
   overview of start.html (start.css adds the margin to the content above). Markup:
     <section class="how" aria-labelledby="…">
       <h2 id="…">…</h2>
       <ol class="steps"><li><div class="step-index">Schritt 1:</div><h3>…</h3><p>…</p></li> …</ol>
     </section>
   The inside (colours, padding, type, lines, gaps) is defined only here; width and outer
   margin come from the page. Needs body.site-design for the heading weight and line height. */

.how {
  padding: clamp(22px, 3vw, 46px);
  border-radius: 10px;
  background: var(--white);
  color: var(--ink);
}

.how h2 {
  margin-bottom: 28px;
  font-size: clamp(1.7rem, 2.7vw, 2.45rem);
  line-height: 1.35;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(22px, 3.3vw, 54px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.steps li {
  min-width: 0;
  padding-top: 16px;
  border-top: 1px solid rgba(34, 39, 42, 0.27);
}

.step-index {
  font-size: 0.95rem;
}

.steps h3 {
  margin: 3px 0 8px;
  font-size: clamp(1.16rem, 1.7vw, 1.5rem);
  line-height: 1.45;
}

.steps p {
  font-size: clamp(1rem, 1.35vw, 1.18rem);
  line-height: 1.8;
}

@media (max-width: 760px) {
  .how h2 {
    margin-bottom: 20px;
  }

  .steps {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .steps li {
    padding-top: 14px;
  }
}

/* ---------- Skip link ---------- */

.skip-link {
  position: fixed;
  z-index: 20;
  top: max(8px, env(safe-area-inset-top));
  left: 8px;
  padding: 10px 20px;
  border-radius: 10px;
  background: var(--white);
  color: var(--ink);
  text-decoration: none;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

.skip-link:focus-visible {
  outline: 3px solid var(--rose-light);
  outline-offset: 3px;
}

/* ---------- Logo as a link ---------- */

.logo-link {
  display: inline-block;
  flex-shrink: 0;
  border-radius: 4px;
}

.logo-link:not([href]) {
  cursor: default;
}

.logo-link:focus-visible {
  outline: 3px solid var(--rose-light);
  outline-offset: 6px;
}

/* ---------- Page header ---------- */

.page-header {
  position: relative;
  z-index: 3;
  padding-top: env(safe-area-inset-top);
  background: var(--charcoal);
  box-shadow: 0 5px 18px rgba(0, 0, 0, 0.13);
  line-height: 1.8;
  letter-spacing: 0.02em;
}

.page-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: var(--page-width);
  min-height: clamp(76px, 7.4vw, 104px);
  margin-inline: auto;
}

.page-header .logo {
  width: clamp(126px, 12vw, 160px);
  height: auto;
}

.page-header__end {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.page-header__link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 5px 0 5px 10px;
  color: var(--white);
  font-size: clamp(1rem, 1.5vw, 1.28rem);
  letter-spacing: 0.015em;
  text-decoration: none;
}

.page-header__link:hover,
.page-footer__links a:hover {
  text-decoration: underline;
  text-underline-offset: 5px;
}

.page-header__link:focus-visible,
.page-footer__links a:focus-visible {
  border-radius: 4px;
  outline: 3px solid var(--rose-light);
  outline-offset: 4px;
}

/* ---------- Page footer ---------- */

.page-footer {
  margin-top: auto;
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--grey);
  color: var(--white);
  font-size: 0.9rem;
  line-height: 1.8;
  letter-spacing: 0.02em;
}

.page-footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: var(--page-width);
  margin-inline: auto;
  padding-block: 26px;
}

.page-footer__copy {
  display: flex;
  align-items: center;
  gap: 8px;
}

.page-footer__links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 22px;
}

.page-footer__links a {
  color: inherit;
  text-decoration: none;
}

@media (max-width: 760px) {
  .page-header__inner {
    min-height: 72px;
  }

  .page-footer__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .page-footer__links {
    gap: 12px 17px;
  }
}

/* Swiss flag (footer, landing page) */
.flag {
  position: relative;
  display: inline-block;
  flex: none;
  width: 16px;
  height: 16px;
  background: #d52b1e;
}

.flag::before,
.flag::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  background: var(--white);
  transform: translate(-50%, -50%);
}

.flag::before {
  width: 10px;
  height: 3px;
}

.flag::after {
  width: 3px;
  height: 10px;
}

/* ---------- Views ---------- */

.view {
  display: none;
}

.view.active {
  display: flex;
}

/* ---------- Answer colours (letter is the primary cue) ---------- */

.c-A {
  --tile-bg: var(--rose);
  --tile-fg: var(--ink);
  --badge-bg: rgba(34, 39, 42, 0.14);
}

.c-B {
  --tile-bg: var(--slate);
  --tile-fg: var(--white);
  --badge-bg: rgba(255, 255, 255, 0.18);
}

.c-C {
  --tile-bg: var(--sand);
  --tile-fg: var(--ink);
  --badge-bg: rgba(34, 39, 42, 0.12);
}

.c-D {
  --tile-bg: var(--grey);
  --tile-fg: var(--white);
  --badge-bg: rgba(255, 255, 255, 0.15);
  --tile-ring: inset 0 0 0 3px rgba(255, 255, 255, 0.85);
}

.tile {
  display: flex;
  align-items: center;
  gap: 0.8em;
  border-radius: var(--radius);
  background: var(--tile-bg);
  color: var(--tile-fg);
  box-shadow: var(--tile-ring, none);
}

.badge {
  flex: none;
  display: grid;
  place-items: center;
  width: 1.9em;
  height: 1.9em;
  border-radius: var(--radius-small);
  background: var(--badge-bg);
  font-weight: 700;
}

.connection-banner {
  position: fixed;
  inset: 0 0 auto;
  z-index: 10;
  padding: 0.5rem 1rem;
  background: var(--rose);
  color: var(--ink);
  font-weight: 600;
  text-align: center;
}
