:root {
  --bg: #060914;
  --panel: rgba(13, 20, 43, 0.9);
  --text: #f3f7ff;
  --muted: #9fb0d3;
  --cyan: #40e7ff;
  --blue: #5d7cff;
  --violet: #b365ff;
  --green: #62ffb4;
  --red: #ff5c7a;
  --yellow: #ffe66d;
  --shadow: 0 18px 60px rgba(0,0,0,.45);
}

* { box-sizing: border-box; }

html[lang|="zh"] body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 20%, rgba(64,231,255,.16), transparent 26%),
    radial-gradient(circle at 80% 5%, rgba(179,101,255,.18), transparent 26%),
    radial-gradient(circle at 50% 105%, rgba(93,124,255,.2), transparent 35%),
    var(--bg);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .32;
  background-image:
    radial-gradient(circle, rgba(255,255,255,.75) 0 1px, transparent 1.4px),
    radial-gradient(circle, rgba(255,255,255,.45) 0 1px, transparent 1.5px);
  background-size: 88px 88px, 143px 143px;
  background-position: 12px 24px, 52px 10px;
}

.app {
  width: min(1120px, calc(100vw - 28px));
  margin: 0 auto;
  padding: 22px 0 36px;
  position: relative;
  z-index: 1;
}

.top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: stretch;
  margin-bottom: 12px;
}

.hero, .stats, .game-card, .side-card, .modal-card {
  backdrop-filter: blur(14px);
}

.hero {
  padding: 0;
  min-width: 0;
}

.hero__head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 6px;
}

.hero__logo-hit {
  flex-shrink: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  border-radius: clamp(8px, 1vw, 14px);
  line-height: 0;
}

.hero__logo-hit:focus-visible {
  outline: 2px solid rgba(64, 231, 255, .65);
  outline-offset: 3px;
}

.hero__favicon {
  display: block;
  flex-shrink: 0;
  width: clamp(56px, 7.5vw, 96px);
  height: clamp(56px, 7.5vw, 96px);
  object-fit: contain;
  border-radius: clamp(8px, 1vw, 14px);
  box-shadow: 0 3px 18px rgba(0, 0, 0, .26);
}

.hero__titles {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: none;
  box-shadow: none;
  font-weight: 950;
  letter-spacing: 0.2em;
  font-size: clamp(1.02rem, 2.4vw, 1.5rem);
  text-transform: uppercase;
  /* Verlauf wie Logo-Zickzack (line-Gradient im favicon.svg) */
  background-image: linear-gradient(118deg, #62ffb4 0%, #40e7ff 52%, #b365ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 14px rgba(64, 231, 255, .35)) drop-shadow(0 0 28px rgba(98, 255, 180, .18));
}

@supports not ((-webkit-background-clip: text) or (background-clip: text)) {
  .brand {
    color: #dffbff;
    background-image: none;
    filter: none;
  }
}

h1 {
  margin: 0;
  font-size: clamp(2.1rem, 4vw, 4.6rem);
  letter-spacing: -.07em;
  line-height: .9;
}

.hero__titles h1#packTitle {
  font-size: clamp(1.45rem, 3.2vw, 2.85rem);
  letter-spacing: -0.04em;
  line-height: 1.05;
  font-weight: 900;
  color: var(--text);
  text-shadow: 0 2px 28px rgba(0, 0, 0, .25);
}

.hero__title-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.start-card .brand {
  margin-inline: auto;
  font-size: clamp(1.2rem, 4.5vw, 1.85rem);
  letter-spacing: 0.22em;
}

.hero__brand-flags {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 1.18rem;
  letter-spacing: 0;
  /* Emoji-Flaggen: Color-Font explizit (Windows-Body-Stack hat oft kein zuverlässiges Emoji-Fallback). */
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "Segoe UI Emoji",
    "Noto Color Emoji",
    "Apple Color Emoji",
    sans-serif;
}

.hero__brand-flag-btn {
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  margin: 0;
  line-height: 1;
  font-size: 25px;
  cursor: pointer;
  opacity: 0.78;
}

.hero__brand-flag-btn:hover,
.hero__brand-flag-btn:focus-visible {
  opacity: 1;
  outline: none;
}

.hero__brand-flag-btn.is-active {
  opacity: 1;
  filter: drop-shadow(0 0 6px rgba(120, 230, 255, 0.65));
}

/* ISO-Badge wenn regionale Emoji-Flaggen auf dem System praktisch nicht gemalt werden */
.zigzag-flag-svg {
  display: inline-block;
  vertical-align: -0.18em;
  width: 1.2em;
  height: auto;
  max-height: 0.95em;
}

.zigzag-flag-svg__box {
  fill: rgba(0, 12, 28, 0.42);
  stroke: rgba(240, 248, 255, 0.42);
}

.zigzag-flag-svg__text {
  /* Fixed color so SVG text stays visible (CSS fill beats presentation attrs). */
  fill: #f3f7ff;
}

.hero__brand-flag-btn .zigzag-flag-svg {
  width: 26px;
  max-height: none;
  vertical-align: middle;
}

.pack-catalog__flag .zigzag-flag-svg {
  width: 1.28em;
  vertical-align: -0.14em;
}

.pack-catalog__chip .zigzag-flag-svg {
  width: 22px;
  vertical-align: -0.22em;
  margin-inline-end: 2px;
}

.hero__question {
  margin: 10px 0 0;
  font-size: clamp(0.92rem, 1.85vw, 1.08rem);
  line-height: 1.48;
  font-weight: 650;
  color: var(--text);
  max-width: min(100%, 920px);
  white-space: normal;
}

.hero__question[hidden] {
  display: none !important;
}

/* Thema-Zeile unter Pack-Beschreibung; Wert/Zeit in .stats */
.hero .level-row {
  margin-top: 10px;
  margin-bottom: 0;
}

.hero .level-row.hero__level-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: flex-start;
  gap: 6px 10px;
}

.hero__theme-label {
  flex-shrink: 0;
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.hero__timer-sep {
  width: 100%;
  margin: 10px 0 12px;
}

#leftLabel,
#rightLabel {
  display: none !important;
}

.hero__target {
  margin-bottom: 4px;
}

.stats-label-mobile {
  display: none;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(78px, 1fr));
  gap: 10px;
  min-width: 330px;
}

.stat {
  background: rgba(255,255,255,.055);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 17px;
  padding: 10px 12px;
}

.stat b {
  display: block;
  font-size: 1.1rem;
  margin-top: 2px;
}

.stat--lives {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 4px;
  padding: 10px 8px;
}

.stat--lives b {
  display: inline;
  margin-top: 0;
  font-size: 1.15rem;
  font-weight: 900;
  line-height: 1;
}

.stat__heart {
  flex-shrink: 0;
  font-size: 1rem;
  line-height: 1;
  color: #ff6b88;
  filter: drop-shadow(0 0 6px rgba(255, 92, 122, .35));
}

.stat span.stats-label-desktop,
.stat span.stats-label-mobile {
  color: var(--muted);
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 8px;
  align-items: start;
}

@media (min-width: 921px) {
  body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
  }

  .app {
    margin-inline: auto;
    margin-block: auto;
    flex-shrink: 0;
    padding: 20px 0 28px;
  }

  /* Hero (links) + Stats (rechts): etwas luftiger; darunter mehr Abstand zum Spielfeld */
  .top {
    gap: 22px;
    margin-bottom: 28px;
  }

  .hero {
    margin-bottom: 0;
  }

  /* Buchstabenfeld und Seitenleiste (Hilfen, Steuerung) */
  .layout {
    gap: 36px;
  }
}

.game-card {
  min-width: 0;
}

/* Balken im Hero: Trenner unter Thema-Zeile zum Lösungswort */
.timer-line--full {
  height: 11px;
}

.side-card {
  --ctrl-gap: 6px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--ctrl-gap);
}

.level-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 0;
  flex-wrap: wrap;
  min-width: 0;
}

.stat--wert b,
.stat--zeit b {
  font-variant-numeric: tabular-nums;
}

.badge {
  color: #dffbff;
  font-weight: 800;
  flex: 0 1 auto;
  min-width: 0;
  max-width: min(100%, 58vw);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timer-line {
  height: 10px;
  width: 100%;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.08);
}

.timer-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--blue), var(--violet));
  transition: width .25s linear, background .2s;
}

.timer-fill.warning {
  background: linear-gradient(90deg, var(--yellow), var(--red));
  animation: pulse .6s infinite alternate;
}

@keyframes pulse { from { filter: brightness(1); } to { filter: brightness(1.8); } }

.target {
  display: grid;
  gap: 5px;
}

.target-top {
  display: flex;
  justify-content: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

.progress {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  min-height: 44px;
}

/* Mehrteilige displayAnswer: unsichtbarer Abstand für echte Leerzeichen */
.progress-space {
  display: inline-block;
  flex: 0 0 auto;
  width: clamp(12px, 3.2vw, 22px);
  height: 42px;
  align-self: center;
  min-height: 42px;
  opacity: 0;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  pointer-events: none;
}

/* Satzzeichen & Sonderzeichen aus displayAnswer — nicht vom Brett wählbar */
.slot.slot--fixed {
  color: rgba(210, 228, 255, .82);
  background: rgba(255, 255, 255, .055);
  border: 1px dashed rgba(255, 255, 255, .22);
  font-weight: 800;
  font-size: clamp(0.92rem, 2.8vw, 1.05rem);
  cursor: default;
  user-select: none;
}

.board-hint-stack {
  display: grid;
  gap: 10px;
  margin-top: 10px;
  margin-bottom: 14px;
}

.controls .board-hint-stack {
  margin-top: 0;
  margin-bottom: 0;
  width: 100%;
  max-width: 100%;
  gap: var(--ctrl-gap, 6px);
}

/* Kein sichtbarer Hinweis: Stack aus dem Layout nehmen (sonst zusaetzlicher Grid-Gap). */
.controls .board-hint-stack:not(:has(.help-box--board:not([hidden]))) {
  display: none;
}

.help-box--board[hidden] {
  display: none !important;
}

.help-box--board:not([hidden]) {
  color: #dce8ff;
  background: rgba(8, 14, 36, .58);
}

.help-box--board.help-tone-question {
  color: #052817;
  background: linear-gradient(180deg, #62ffb4, #31c985);
  border-color: rgba(98,255,180,.55);
}

.help-box--board.help-tone-hint:not([hidden]) {
  color: var(--yellow);
  background: transparent;
  border: none;
  box-shadow: none;
}

.help-box--board.help-tone-strong:not([hidden]) {
  color: #ff9aab;
  background: rgba(8, 14, 36, .58);
}

.slot {
  width: 34px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(255,255,255,.075);
  border: 1px solid rgba(255,255,255,.1);
  font-weight: 900;
  font-size: 1.08rem;
}

button.letter,
.slot,
.slot.slot--fixed {
  font-family:
    system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    "Apple SD Gothic Neo",
    "Geeza Pro", "Al Nile",
    "Kohinoor Devanagari", "Devanagari Sangam MN",
    sans-serif;
}

.slot.filled {
  color: #071019;
  background: linear-gradient(180deg, var(--green), var(--cyan));
  box-shadow: 0 0 22px rgba(64,231,255,.26);
}

.columns {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  min-height: clamp(320px, 52vh, 520px);
  touch-action: manipulation;
  outline: none;
}

/* Lange Lösungswörter: mehr vertikaler Raum fürs Kachelfeld */
.columns.columns--long-word {
  min-height: clamp(344px, 56vh, 560px);
}

.columns:focus-visible {
  box-shadow: 0 0 0 3px rgba(64, 231, 255, .26);
  border-radius: 22px;
}

.swipe-trail-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  pointer-events: none;
  overflow: visible;
}

.columns.is-swiping {
  touch-action: none;
}

.connector-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: visible;
}

.connector-segment {
  position: absolute;
  left: 0;
  top: 0;
  height: 8px;
  min-width: 18px;
  border-radius: 999px;
  transform-origin: 0 50%;
  background: linear-gradient(90deg, #62ffb4, #40e7ff 55%, #b365ff);
}

.connector-segment.connector-guide,
.connector-segment.connector-active {
  filter: drop-shadow(0 0 10px rgba(64, 231, 255, .45));
}

.connector-segment.connector-guide { opacity: .34; }
.connector-segment.connector-active { opacity: 1; }

.column {
  position: relative;
  padding: 13px;
  border-radius: 22px;
  background: rgba(255,255,255,.065);
  border: 1px solid rgba(255,255,255,.12);
  min-height: inherit;
  z-index: auto;
}

.column.next {
  background: rgba(255,255,255,.13);
  border-color: rgba(255,255,255,.36);
  box-shadow: 0 0 30px rgba(255,255,255,.08) inset, 0 0 24px rgba(64,231,255,.12);
}

.column h2 {
  position: relative;
  z-index: 3;
  margin: 0 0 10px;
  text-align: center;
  color: var(--muted);
  font-size: .9rem;
  text-transform: uppercase;
  letter-spacing: .14em;
}

.letter-list {
  position: relative;
  min-height: calc(100% - 32px);
  height: calc(100% - 32px);
}

button.letter {
  appearance: none;
  position: absolute;
  left: calc(50% + var(--letter-x, 0px));
  top: var(--letter-y, 50%);
  width: clamp(64px, 9vw, 92px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%) scale(var(--letter-scale, 1));
  border: 1px solid rgba(255,255,255,.12);
  color: var(--text);
  background: linear-gradient(180deg, rgba(255,255,255,.11), rgba(255,255,255,.045));
  border-radius: 50%;
  min-height: 0;
  font-size: clamp(1.6rem, 4vw, 2.65rem);
  font-weight: 900;
  letter-spacing: .03em;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform .12s, border-color .12s, background .12s, box-shadow .12s, opacity .12s;
  user-select: none;
  z-index: 3;
}

/* Dichte pro Spalte (siehe letterColumnLayout in zigzag-core.js) */
button.letter[data-density="normal"] {
  width: clamp(50px, 7.2vw, 72px);
  font-size: clamp(1.25rem, 3.2vw, 1.95rem);
}

button.letter[data-density="compact"] {
  width: clamp(40px, 5.8vw, 54px);
  font-size: clamp(1.02rem, 2.65vw, 1.45rem);
}

button.letter[data-density="tight"] {
  width: clamp(32px, 4.6vw, 44px);
  font-size: clamp(0.88rem, 2.2vw, 1.12rem);
}

button.letter:hover {
  --letter-scale: 1.06;
  border-color: rgba(64,231,255,.55);
  box-shadow: 0 0 24px rgba(64,231,255,.13);
}

button.letter:focus {
  outline: none;
}

button.letter.selected {
  color: #06121a;
  background: linear-gradient(180deg, var(--green), var(--cyan));
  border-color: rgba(255,255,255,.55);
  box-shadow: 0 0 22px rgba(98,255,180,.3);
  --letter-scale: .98;
}

button.letter.starter-hint:not(.selected) {
  color: #06121a;
  background: linear-gradient(180deg, #d8f96d, #9be65a);
  border-color: rgba(216, 249, 109, .9);
  box-shadow: 0 0 0 4px rgba(216, 249, 109, .12), 0 0 26px rgba(216, 249, 109, .24);
}

button.letter:disabled {
  cursor: not-allowed;
  opacity: .45;
}

button.letter.letter--tone-flash {
  background: linear-gradient(180deg, #ffb45f, #f0723c) !important;
  border-color: rgba(255, 200, 120, .9) !important;
  color: #2a0f04 !important;
  box-shadow: 0 0 22px rgba(255, 160, 70, .45);
  z-index: 5;
}

/* Soundhilfe: alle noch offenen Kacheln gleichzeitig (nicht pro Loesungston). */
button.letter.letter--sound-hint-rest {
  background: linear-gradient(180deg, #ffc98a, #e86838) !important;
  border-color: rgba(255, 210, 140, .95) !important;
  color: #2a0f04 !important;
  box-shadow: 0 0 26px rgba(255, 150, 60, .42);
  z-index: 4;
  animation: sound-hint-rest-pulse 1.05s ease-in-out infinite;
}

@keyframes sound-hint-rest-pulse {
  0%, 100% { filter: brightness(1); box-shadow: 0 0 26px rgba(255, 150, 60, .42); }
  50% { filter: brightness(1.08); box-shadow: 0 0 34px rgba(255, 150, 60, .58); }
}

button.letter.selected.letter--sound-hint-picked {
  box-shadow:
    0 0 0 3px rgba(255, 220, 150, .75),
    0 0 24px rgba(98, 255, 180, .38);
  z-index: 6;
}

.shake { animation: shake .35s; }
@keyframes shake {
  0%,100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  50% { transform: translateX(5px); }
  75% { transform: translateX(-3px); }
}

@keyframes level-celebrate-glow {
  0%, 100% {
    box-shadow: 0 0 0 rgba(64, 231, 255, 0);
    filter: brightness(1);
  }
  18%, 42%, 70% {
    box-shadow:
      0 0 0 2px rgba(98, 255, 180, 0.35),
      0 0 26px rgba(64, 231, 255, 0.45);
    filter: brightness(1.12);
  }
  30%, 55% {
    box-shadow:
      0 0 0 2px rgba(64, 231, 255, 0.4),
      0 0 34px rgba(98, 255, 180, 0.35);
    filter: brightness(1.18);
  }
}

.hero__level-row.celebrate-flash {
  animation: level-celebrate-glow 2.1s ease-in-out;
  border-radius: 14px;
}

.stat.celebrate-flash {
  animation: level-celebrate-glow 2.1s ease-in-out;
}

.message.good { color: #dffff0; }
.message.bad { color: #ffe8ee; }
.message.warn { color: var(--text); }

.controls .message {
  margin-top: 0;
  min-height: 0;
  padding: 10px 12px;
}

.controls-pack {
  margin-top: 6px;
  display: grid;
  gap: 6px;
  text-align: left;
  width: 100%;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 16px;
  background: rgba(255,255,255,.075);
  padding: 12px 13px;
  box-sizing: border-box;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.controls-pack__current {
  margin: 0;
  padding: 0;
  font-size: 0.9rem;
  line-height: 1.3;
  font-weight: 800;
  color: #fff;
}

.controls-pack__label {
  padding: 0 12px;
}

.controls-pack__select {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 9px 11px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(0, 0, 0, .28);
  color: var(--text);
  font: inherit;
  font-weight: 650;
}

.controls-pack__desc {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.45;
  color: #fff;
  white-space: pre-wrap;
  word-break: break-word;
  padding: 0;
  opacity: .94;
}

.controls-pack__desc[hidden] {
  display: none !important;
}

.controls-pack:hover,
.controls-pack:focus-visible {
  background: rgba(255,255,255,.13);
  border-color: rgba(255,255,255,.36);
  box-shadow: 0 0 30px rgba(255,255,255,.08) inset, 0 0 24px rgba(64,231,255,.12);
}

.controls {
  display: grid;
  gap: var(--ctrl-gap, 6px);
}

.controls-tools {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ctrl-gap, 6px);
  align-items: center;
}

.control-btn.icon-btn {
  width: auto;
  min-width: 52px;
  min-height: 52px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.control-btn.icon-btn .icon-btn__svg {
  display: block;
}

.control-btn.icon-btn .icon-btn__svg[hidden] {
  display: none !important;
}

.control-btn.icon-btn .icon-btn__hub-logo {
  display: block;
  width: 28px;
  height: 28px;
  object-fit: contain;
  border-radius: 6px;
}

.control-btn.icon-btn .icon-btn__hub-logo[hidden] {
  display: none !important;
}

.settings-panel {
  position: fixed;
  inset: 0;
  z-index: 81;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  background: rgba(0, 4, 14, .72);
  transition: opacity .28s ease, visibility 0s linear .3s;
}

.settings-panel.is-open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transition-delay: 0s;
}

.settings-panel__backdrop {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.settings-panel__sheet {
  position: absolute;
  inset: clamp(12px, 3vw, 34px);
  z-index: 1;
  display: flex;
  flex-direction: column;
  padding: clamp(18px, 4.5vw, 44px) clamp(16px, 3.5vw, 36px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid rgba(135, 216, 255, .22);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(64, 231, 255, .13) 0%, transparent 42%),
    linear-gradient(165deg, rgba(8, 16, 34, .97) 0%, rgba(4, 9, 20, .99) 100%);
  box-shadow: 0 24px 90px rgba(0, 0, 0, .5), inset 0 0 100px rgba(60, 120, 255, .08);
  transform: translate3d(108%, 0, 0);
  transition: transform .55s cubic-bezier(0.32, 0.72, 0.25, 1);
}

.settings-panel.is-open .settings-panel__sheet {
  transform: translate3d(0, 0, 0);
}

.settings-panel__head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  flex-shrink: 0;
  margin-bottom: 14px;
}

.settings-panel__title {
  margin: 0 72px 8px 0;
  font-size: clamp(2rem, 6vw, 4.4rem);
  line-height: .9;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
  color: #dff8ff;
  text-shadow: 0 6px 30px rgba(64, 231, 255, .28);
}

.settings-panel__close {
  position: absolute;
  top: 16px;
  right: 16px;
  min-width: 44px;
  width: 44px !important;
  max-width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 999px;
  font-size: 1.65rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
}

.settings-panel__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: grid;
  gap: 10px;
}

.control-btn.icon-btn .icon-btn__svg--settings {
  stroke-width: 2.15;
}

.control-btn--link {
  text-align: center;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}

.control-btn--link:hover {
  filter: brightness(1.12);
}

.control-btn, select {
  width: 100%;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 16px;
  padding: 12px 13px;
  color: var(--text);
  background: rgba(255, 255, 255, .075);
  font-weight: 800;
  cursor: pointer;
}

select { font-weight: 700; color: var(--text); }
option { color: #0b1020; }

.control-btn.primary {
  color: #06121a;
  border-color: transparent;
  background: linear-gradient(180deg, var(--cyan), var(--blue));
}

.control-btn.help-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  color: var(--text);
  border-color: rgba(255,255,255,.16);
}

/* Unbenutzte Hilfen: neutral; Farbe nur bei .used (genutzte Stufe) */
.control-btn.help-btn:not(.used) {
  background: rgba(255, 255, 255, .075) !important;
  color: var(--text) !important;
  border-color: rgba(255, 255, 255, .13) !important;
}

.help-btn__ico {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 0;
}

.help-btn__ico svg {
  width: 24px;
  height: 24px;
  display: block;
}

.help-btn__txt {
  text-align: left;
  flex: 1;
  min-width: 0;
}

.control-btn.help-btn.used {
  color: #06121a;
  border-color: rgba(255,255,255,.22);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.28), 0 10px 22px rgba(0,0,0,.16);
}

.control-btn.help-tier-0.used { background: linear-gradient(180deg, #ffffff, #dfefff) !important; }
.control-btn.help-tier-1.used { background: linear-gradient(180deg, #c5efbf, #7dce95) !important; }
.control-btn.help-tier-2.used { background: linear-gradient(180deg, #d8f96d, #9be65a) !important; }
.control-btn.help-tier-3.used { background: linear-gradient(180deg, #ffe66d, #f2c94c) !important; }
.control-btn.help-tier-4.used { background: linear-gradient(180deg, #ffb45f, #f0723c) !important; }
.control-btn.help-tier-5.used {
  color: #fff7f9;
  background: linear-gradient(180deg, #ff5c7a, #b91536) !important;
}

.control-btn.help-btn::after {
  content: none !important;
  display: none !important;
}

.controls-help-row {
  display: grid;
  gap: var(--ctrl-gap, 6px);
  transition: background .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.controls-help-row > .control-btn.help-btn {
  padding: 8px 10px;
  background: rgba(255, 255, 255, .075);
}

.control-btn:hover { filter: brightness(1.12); }
.control-btn.help-btn:not(.used):hover {
  filter: brightness(1.08);
  border-color: rgba(255, 255, 255, .22);
}

.control-btn.help-btn:not(.used):hover,
.control-btn.help-btn:not(.used):focus-visible {
  background: rgba(255,255,255,.13) !important;
  border-color: rgba(255,255,255,.36) !important;
  box-shadow: 0 0 30px rgba(255,255,255,.08) inset, 0 0 24px rgba(64,231,255,.12);
}

.control-btn.help-btn.used:hover,
.control-btn.help-btn.used:focus-visible {
  filter: brightness(1.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.34), 0 12px 24px rgba(0,0,0,.18);
}

.controls-tools .control-btn.icon-btn {
  width: auto;
  flex: 1 1 0;
  min-width: 0;
}

#pauseBtn:hover,
#hallOfFameBtn:hover,
#settingsToggleBtn:hover {
  background: rgba(255,255,255,.13);
  border-color: rgba(255,255,255,.36);
  box-shadow: 0 0 30px rgba(255,255,255,.08) inset, 0 0 24px rgba(64,231,255,.12);
}

.pack-progress {
  padding: 13px;
  border-radius: 18px;
  background: rgba(255,255,255,.045);
  border: 1px solid rgba(255,255,255,.08);
}

.pack-progress strong {
  display: block;
  margin-bottom: 6px;
}

.pack-progress__list {
  display: grid;
  gap: 7px;
  max-height: 230px;
  overflow: auto;
  padding-right: 2px;
}

.pack-progress__row {
  padding: 8px 9px;
  border-radius: 12px;
  background: rgba(255,255,255,.055);
  border: 1px solid rgba(255,255,255,.08);
  color: var(--muted);
  font-size: .8rem;
  line-height: 1.35;
}

.pack-progress__row b {
  display: block;
  color: var(--text);
  font-size: .84rem;
  margin-bottom: 2px;
}

.pack-progress__row.done {
  border-color: rgba(98,255,180,.25);
  background: rgba(98,255,180,.08);
}

.volume-grid {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 8px 10px;
  align-items: center;
  padding: 12px;
  border-radius: 18px;
  background: rgba(255,255,255,.045);
  border: 1px solid rgba(255,255,255,.08);
}

.volume-grid input[type="range"] {
  width: 100%;
  accent-color: var(--cyan);
}

.help-box {
  padding: 13px;
  color: var(--muted);
  line-height: 1.42;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.small {
  font-size: .88rem;
  color: var(--muted);
  line-height: 1.35;
}

.modal,
.start-screen {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(0,0,0,.65);
  place-items: center;
  padding: 20px;
}

.modal.show { display: grid; }
.start-screen.show { display: grid; }
.modal-card,
.start-card {
  width: min(520px, 100%);
  padding: 24px;
  text-align: center;
  border: 1px solid;
  border-radius: 25px;
}
.start-card {
  backdrop-filter: blur(18px);
}

.modal-card {
  backdrop-filter: blur(18px);
}

.modal-card h2 { margin: 0 0 8px; font-size: 2rem; }
.start-card h2 { margin: 6px 0 8px; font-size: 2rem; }
.start-card p { color: var(--muted); line-height: 1.45; }

.start-card__controls {
  margin: 0 auto 0;
  margin-bottom: 25px;
  text-align: left;
  max-width: min(100%, 420px);
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid;
  border-radius: 25px;
}

.start-card__controls label {
  text-align: center;
}

.start-card__pack {
  margin: 16px auto 18px;
  text-align: left;
  max-width: min(100%, 420px);
}

.start-card__pack-current {
  box-sizing: border-box;
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .22);
  background: rgba(0, 0, 0, .38);
  color: var(--text);
  font: inherit;
  font-weight: 650;
  margin: 0;
}
.start-card__banner {
  height: 100%;
  width: 100%;
  aspect-ratio: 1200 / 630;
  object-fit: fill;
  border-radius: 16px;
  display: block;
  margin: 0 0 14px;
}
.modal-card__banner {
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: 34vh;
  aspect-ratio: 1200 / 630;
  object-fit: contain;
  border-radius: 16px;
  display: block;
  margin: 0 0 14px;
}
.modal-card__banner[hidden] {
  display: none !important;
}

.modal-actions {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.hof-panel {
  position: fixed;
  inset: 0;
  z-index: 80;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  background: rgba(0, 4, 14, .72);
  transition: opacity .28s ease, visibility 0s linear .3s;
}

.hof-panel.is-open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transition-delay: 0s;
}

.hof-panel__sheet {
  position: absolute;
  inset: clamp(12px, 3vw, 34px);
  padding: clamp(18px, 4.5vw, 44px) clamp(16px, 3.5vw, 36px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  background:
    linear-gradient(180deg, rgba(64, 231, 255, .13) 0%, transparent 42%),
    linear-gradient(165deg, rgba(8, 16, 34, .97) 0%, rgba(4, 9, 20, .99) 100%);
  border: 1px solid rgba(135, 216, 255, .22);
  border-radius: 24px;
  box-shadow: 0 24px 90px rgba(0, 0, 0, .5), inset 0 0 100px rgba(60, 120, 255, .08);
  transform: translate3d(108%, 0, 0);
  transition: transform .55s cubic-bezier(0.32, 0.72, 0.25, 1);
}

.hof-panel.is-open .hof-panel__sheet { transform: translate3d(0, 0, 0); }

.hof-panel.pack-catalog-panel {
  z-index: 85;
}

.pack-catalog__lang-label {
  display: block;
  margin: 6px 0 4px;
}

.pack-catalog__lang-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 8px;
  align-items: end;
}

.pack-catalog__lang-col {
  min-width: 0;
}

.pack-catalog__lang-link-btn {
  width: 44px;
  min-width: 44px;
  height: 42px;
  padding: 0;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}

.pack-catalog__lang-link-ico-off {
  display: none;
}

.pack-catalog__lang-link-btn:not(.is-linked) .pack-catalog__lang-link-ico {
  display: none;
}

.pack-catalog__lang-link-btn:not(.is-linked) .pack-catalog__lang-link-ico-off {
  display: block;
}

.pack-catalog__lang {
  box-sizing: border-box;
  width: 100%;
  min-height: 42px;
  margin: 0 0 10px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font: 700 14px system-ui, sans-serif;
}

.pack-catalog__search {
  box-sizing: border-box;
  width: 100%;
  min-height: 46px;
  margin: 10px 0 6px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(255, 255, 255, .08);
  color: var(--text);
  font: 800 15px system-ui, sans-serif;
}

.pack-catalog__list {
  margin: 4px 0 0;
  display: flex;
  flex-direction: column;
  max-height: min(56vh, 560px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.pack-catalog__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 10px;
  align-items: center;
  width: 100%;
  margin: 0;
  padding: 9px 0 10px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
  border-radius: 0;
  background: transparent;
  color: inherit;
}

.pack-catalog__row:last-child {
  border-bottom: 0;
}

.pack-catalog__row:hover {
  background: rgba(255, 255, 255, .05);
}

.pack-catalog__row-main {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.pack-catalog__row-main:focus-visible {
  outline: 2px solid rgba(64, 231, 255, .5);
  outline-offset: 4px;
  border-radius: 8px;
}

.pack-catalog__row-side {
  display: inline-flex;
  align-items: center;
}

.pack-catalog__progress-btn {
  min-width: 56px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid rgba(135, 216, 255, .3);
  background: rgba(10, 32, 54, .72);
  color: rgba(220, 240, 255, .95);
  font: 800 12px/1 system-ui, sans-serif;
  padding: 0 10px;
  cursor: pointer;
}

.pack-catalog__progress-btn:hover,
.pack-catalog__progress-btn:focus-visible {
  border-color: rgba(120, 230, 255, .68);
  color: #ecfbff;
  background: rgba(18, 56, 84, .9);
  outline: none;
}

.pack-catalog__progress-btn.is-zero {
  border-color: rgba(255, 120, 140, .48);
  color: rgba(255, 210, 218, .96);
  background: rgba(62, 14, 23, .86);
}

.pack-progress-panel {
  z-index: 86;
}

#packProgressWarning {
  margin: 6px 0 10px;
  color: #ffb6c0;
  background: rgba(96, 16, 30, .38);
  border: 1px solid rgba(255, 120, 140, .45);
  border-radius: 10px;
  padding: 8px 10px;
  line-height: 1.35;
}

.pack-catalog__name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-weight: 850;
  font-size: clamp(0.98rem, 2.2vw, 1.12rem);
  color: #f0f6ff;
  line-height: 1.28;
}

.pack-catalog__flags {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.96em;
  line-height: 1;
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "Segoe UI Emoji",
    "Noto Color Emoji",
    "Apple Color Emoji",
    sans-serif;
}

.pack-catalog__flag {
  display: inline-block;
  filter: saturate(1.05);
}

.pack-catalog__desc {
  display: block;
  margin-top: 3px;
  font-size: 0.76rem;
  line-height: 1.38;
  color: rgba(220, 232, 248, .7);
  white-space: pre-wrap;
  word-break: break-word;
}

.pack-catalog__empty {
  margin: 12px 0 0;
  padding: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.pack-catalog__empty-wrap {
  margin: 4px 0 0;
}

.pack-catalog__prompt-options {
  margin: 0 0 10px;
  padding: 0;
  border: 0;
}

.pack-catalog__prompt-options legend {
  padding: 0;
  margin: 0 0 6px;
  font-size: 0.78rem;
  font-weight: 650;
  color: rgba(220, 232, 248, .88);
}

.pack-catalog__prompt-option {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 6px 0 0;
  max-width: 100%;
  font-size: 0.8rem;
  line-height: 1.38;
  color: rgba(230, 242, 255, .9);
  cursor: pointer;
}

.pack-catalog__prompt-option:first-of-type {
  margin-top: 4px;
}

.pack-catalog__prompt-option input {
  margin: 3px 0 0;
  flex-shrink: 0;
}

.pack-catalog__prompt-intro {
  margin: 10px 0 8px;
  padding: 0;
  font-size: 0.82rem;
  line-height: 1.45;
  color: rgba(220, 232, 248, .78);
}

.pack-catalog__prompt-field {
  box-sizing: border-box;
  display: block;
  width: 100%;
  min-height: 200px;
  max-height: min(42vh, 380px);
  margin: 0;
  padding: 10px 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.7rem;
  line-height: 1.42;
  color: rgba(232, 244, 255, .92);
  background: rgba(2, 8, 20, .55);
  border: 1px solid rgba(135, 216, 255, .22);
  border-radius: 12px;
  resize: vertical;
}

.pack-catalog__prompt-field:focus {
  outline: 2px solid rgba(64, 231, 255, .45);
  outline-offset: 2px;
}

.pack-catalog__prompt-actions {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.pack-catalog__prompt-copy {
  flex-shrink: 0;
}

.pack-catalog__import-label {
  display: block;
  margin: 14px 0 6px;
  font-size: 0.78rem;
  font-weight: 650;
  color: rgba(220, 232, 248, .88);
}

.pack-catalog__import-field {
  box-sizing: border-box;
  display: block;
  width: 100%;
  min-height: 120px;
  max-height: min(28vh, 280px);
  margin: 0 0 8px;
  padding: 10px 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.68rem;
  line-height: 1.38;
  color: rgba(232, 244, 255, .92);
  background: rgba(2, 8, 20, .45);
  border: 1px solid rgba(135, 216, 255, .18);
  border-radius: 12px;
  resize: vertical;
}

.pack-catalog__extra-field {
  box-sizing: border-box;
  display: block;
  width: 100%;
  min-height: 84px;
  margin: 0 0 8px;
  padding: 10px 12px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.78rem;
  line-height: 1.4;
  color: rgba(232, 244, 255, .92);
  background: rgba(2, 8, 20, .45);
  border: 1px solid rgba(135, 216, 255, .18);
  border-radius: 12px;
  resize: vertical;
}

.pack-catalog__extra-field:focus {
  outline: 2px solid rgba(64, 231, 255, .4);
  outline-offset: 2px;
}

.pack-catalog__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 10px;
}

.pack-catalog__chip {
  border: 1px solid rgba(135, 216, 255, .26);
  border-radius: 999px;
  background: rgba(9, 26, 45, .72);
  color: rgba(220, 238, 255, .92);
  font: 700 12px/1.2 system-ui, sans-serif;
  padding: 6px 10px;
  cursor: pointer;
}

.pack-catalog__chip:hover,
.pack-catalog__chip:focus-visible {
  border-color: rgba(120, 230, 255, .62);
  color: #e5f8ff;
  outline: none;
}

.pack-catalog__chip.is-active {
  border-color: rgba(64, 231, 255, .7);
  background: rgba(15, 58, 82, .88);
  color: #eafcff;
  box-shadow: 0 0 0 1px rgba(64, 231, 255, .2) inset;
}

.pack-catalog__import-field:focus {
  outline: 2px solid rgba(64, 231, 255, .4);
  outline-offset: 2px;
}

.pack-catalog__import-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 4px;
}

.pack-catalog__admin-hint {
  margin: 10px 0 0;
  padding: 0;
  font-size: 0.8rem;
  line-height: 1.45;
}

.pack-catalog__admin-hint a {
  color: rgba(120, 210, 255, .95);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.pack-catalog__admin-hint a:hover,
.pack-catalog__admin-hint a:focus-visible {
  color: #dff8ff;
}

.hof-panel__close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: auto;
  min-width: 120px;
}

#packCatalogClose.hof-panel__close {
  min-width: 44px;
  width: 44px !important;
  height: 44px;
  padding: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.65rem;
  line-height: 1;
  font-weight: 500;
}

.hof-panel__title {
  margin: 0 140px 8px 0;
  font-size: clamp(2rem, 6vw, 4.4rem);
  line-height: .9;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
  color: #dff8ff;
  text-shadow: 0 6px 30px rgba(64, 231, 255, .28);
}

.hof-panel__intro,
.hof-panel__lead,
.hof-panel__feedback {
  color: var(--muted);
  line-height: 1.45;
}

.hof-panel__list {
  margin: 18px 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.hof-panel__loading {
  padding: 16px;
  border-radius: 16px;
  color: var(--muted);
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
}

.hof-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px 16px;
  align-items: center;
  padding: 13px 15px;
  border-radius: 16px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.12);
}

.hof-rank {
  min-width: 2ch;
  text-align: right;
  font-size: clamp(1.35rem, 3vw, 2rem);
  font-weight: 950;
  color: rgba(64, 231, 255, .9);
}

.hof-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 850;
  color: #f0f6ff;
}

.hof-score {
  color: var(--green);
  font-weight: 900;
}

.hof-levels {
  display: block;
  margin-top: 2px;
  color: #c5dbf4;
  font-size: .84rem;
  text-align: right;
}

.hof-row--pending {
  border-color: rgba(98, 255, 180, .42);
  background: linear-gradient(180deg, rgba(16, 44, 40, .72), rgba(7, 22, 25, .66));
  box-shadow: 0 10px 24px rgba(98, 255, 180, .12);
}

.hof-panel__actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.hof-inline-register__input {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.08);
  color: var(--text);
  font: 800 16px system-ui, sans-serif;
}

@media (max-width: 920px) {
  .top, .layout { grid-template-columns: 1fr; }
  .layout {
    gap: 6px;
  }
  .stats { min-width: 0; }
}

@media (max-width: 720px) {
  /*
   * Kopf: Hero links, Stats rechts. Flex + align-items: flex-start verhindert,
   * dass der Hero-Bereich auf die Stats-Hoehe mitzieht (Grid-Stretch-Problem).
   * Zeilenhoehe = max(Hero, Stats), game-card sitzt ohne zusaetzliche Luecke.
   */
  .top {
    display: flex;
    flex-flow: row nowrap;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 10px;
    margin-bottom: 8px;
    position: relative;
    z-index: 1;
    overflow: visible;
    width: 100%;
    height: fit-content;
  }

  .hero {
    flex: 1 1 0;
    min-width: 0;
    align-self: flex-start;
    max-width: 100%;
    height: auto;
    padding-right: 0;
    overflow: visible;
  }

  .stats {
    flex: 0 0 auto;
    align-self: flex-start;
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 5px;
    padding: 0;
    margin: 0;
    min-width: 0;
    width: max-content;
    max-width: min(124px, 36vw);
    justify-content: flex-start;
    overflow: visible;
  }

  .stats .stat {
    flex: 0 0 auto;
    width: auto;
    min-width: 0;
    padding: 5px 8px;
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 1px;
  }

  .stats .stat b {
    margin-top: 0;
    font-size: 0.88rem;
    line-height: 1.1;
  }

  .stats .stat--lives {
    flex-direction: row-reverse;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    padding: 5px 8px;
  }

  .stats .stat--lives b {
    font-size: 0.9rem;
  }

  .hero__favicon {
    display: block;
    width: 44px;
    height: 44px;
  }

  .hero__head {
    flex-wrap: nowrap;
    gap: 10px;
    margin-bottom: 4px;
    align-items: center;
  }

  .hero__titles {
    flex: 1;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: flex-start;
    gap: 4px;
    min-width: 0;
  }

  .hero .brand {
    flex-shrink: 0;
    margin: 0;
    padding: 0;
    font-size: clamp(1.15rem, 6.2vw, 1.75rem);
    letter-spacing: 0.16em;
  }

  .hero h1#packTitle {
    flex: 0 1 auto;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    font-size: clamp(0.92rem, 3.5vw, 1.08rem);
    font-weight: 850;
    letter-spacing: -0.02em;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0.9;
  }

  .hero .level-row {
    flex-direction: column;
    align-items: stretch;
    align-self: stretch;
    gap: 8px;
    margin-top: 8px;
    margin-bottom: 6px;
    width: 100%;
  }

  .hero .level-row .hero__theme-label {
    align-self: flex-start;
  }

  .hero__question {
    font-size: clamp(0.88rem, 3.6vw, 1rem);
  }

  .hero__timer-sep {
    margin-top: 4px;
    margin-bottom: 10px;
  }

  .stats-label-desktop {
    display: none !important;
  }

  .stats-label-mobile {
    display: block !important;
    font-size: .58rem !important;
    letter-spacing: .06em !important;
    line-height: 1.1;
  }

  .next-side-callout {
    display: none !important;
  }

  .column h2 {
    display: none !important;
  }

  .letter-list {
    min-height: calc(100% - 8px);
    height: calc(100% - 8px);
  }

  .columns {
    touch-action: none;
    min-height: clamp(280px, 48vh, 480px);
  }

  .columns.columns--long-word {
    min-height: clamp(320px, 54vh, 560px);
  }

  .controls {
    width: 100%;
    max-width: 100%;
  }

  /* Hilfe-Buttons: eine Zeile, nur Icons (Text bleibt fuer SR/Tooltip ueber title) */
  .controls-help-row {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: var(--ctrl-gap, 6px);
  }

  .controls-help-row > .control-btn.help-btn {
    min-height: 44px;
    justify-content: center;
    gap: 0;
    padding: 8px 4px;
    min-width: 0;
  }

  .controls-help-row .help-btn__txt {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
    flex: none;
    min-width: 0;
  }

  .controls-tools {
    display: flex;
    flex-wrap: nowrap;
    width: 100%;
    max-width: 100%;
    gap: var(--ctrl-gap, 6px);
  }

  .controls-tools .control-btn.icon-btn {
    flex: 1 1 0;
    min-width: 0;
    width: auto;
    min-height: 52px;
  }
}

@media (max-width: 560px) {
  .app { width: min(100vw - 16px, 1120px); padding-top: 8px; }
  .columns { gap: 8px; }
  .columns.columns--long-word { min-height: clamp(322px, 52vh, 520px); }
  .column { padding: 7px; min-height: 374px; border-radius: 18px; }
  button.letter { width: clamp(54px, 18vw, 72px); font-size: clamp(1.35rem, 8vw, 2rem); }
  button.letter[data-density="normal"] { width: clamp(44px, 14vw, 58px); font-size: clamp(1.05rem, 6.5vw, 1.45rem); }
  button.letter[data-density="compact"] { width: clamp(34px, 11vw, 46px); font-size: clamp(0.88rem, 5.4vw, 1.12rem); }
  button.letter[data-density="tight"] { width: clamp(28px, 9vw, 38px); font-size: clamp(0.72rem, 4.6vw, 0.98rem); }
  .slot.slot--fixed {
    width: auto;
    min-width: 26px;
    height: 38px;
    font-size: clamp(0.82rem, 5vw, 0.98rem);
    padding: 0 4px;
    border-radius: 10px;
  }
  .slot { width: 29px; height: 38px; border-radius: 10px; }
  .hof-panel__sheet { inset: 8px; border-radius: 18px; }
  .hof-panel__close { position: static; width: 100%; margin-bottom: 12px; }
  .hof-panel__title { margin-right: 0; }
  #packCatalogClose.hof-panel__close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 44px !important;
    margin: 0;
  }
  .pack-catalog__lang-row {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 6px;
  }
  .pack-catalog__lang-link-btn {
    margin-bottom: 10px;
  }
  .settings-panel__sheet { inset: 8px; border-radius: 18px; }
  .settings-panel__close { top: 10px; right: 10px; width: 40px !important; max-width: 40px; height: 40px; min-width: 40px; font-size: 1.45rem; }
  .settings-panel__title { margin-right: 54px; }
  .hof-panel__actions { grid-template-columns: 1fr; }
  .hof-row { grid-template-columns: auto minmax(0, 1fr); }
  .hof-score-wrap { grid-column: 2; }
  .hof-levels { text-align: left; }
}
