/* ============ Grundlagen ============ */

:root {
  --app-height: 100vh;
  --font-display: 'Lilita One', 'Arial Rounded MT Bold', system-ui, sans-serif;
  --font-body: 'Nunito', system-ui, sans-serif;

  --ink: #14284a;
  --sky-top: #3aa6ff;
  --sky-mid: #7fd0ff;
  --sky-bottom: #c4f1ff;

  --gold-hi: #fff49a;
  --gold: #ffc61a;
  --gold-lo: #ff9500;
  --gold-edge: #6b3300;

  --red-hi: #ff8a7a;
  --red: #ff4b3e;
  --red-lo: #d1261c;
  --red-edge: #6e0f0a;

  --blue-edge: #0e3f7a;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  --bounce: cubic-bezier(0.3, 1.6, 0.5, 1);
}

@supports (height: 100dvh) {
  :root { --app-height: 100dvh; }
}

/* Installierte Apps brauchen die Höhe inklusive der sicheren Bildschirmränder. */
@media (display-mode: standalone), (display-mode: fullscreen) {
  :root { --app-height: 100vh; }
}

html:lang(th) {
  --font-display: 'Noto Sans Thai', system-ui, sans-serif;
  --font-body: 'Noto Sans Thai', system-ui, sans-serif;
}

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

[hidden] {
  display: none !important;
}

html {
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html,
body {
  margin: 0;
  height: var(--app-height);
  overflow: hidden;
  background: var(--sky-top);
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  overscroll-behavior: none;
}

#app {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--app-height);
  overflow: hidden;
}

/* ============ Hintergrund ============ */

.backdrop {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: linear-gradient(180deg, #1b97e6 0%, #4cc0f2 32%, #9ee6f9 45%, #cdf4ff 57%);
}

/* Leichte Abdunklung an den Rändern lenkt den Blick zur Mitte */
.backdrop::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 120% 90% at 50% 38%, transparent 55%, rgba(8, 40, 90, 0.3) 100%);
}

/* Auch der verdeckte Ersatzhimmel soll im Hauptmenü ruhen. */
body:has(.menu) .backdrop__rays,
body:has(.menu) .backdrop .cloud { animation-play-state: paused; }

.backdrop__rays {
  position: absolute;
  top: -10vmax;
  left: 50%;
  width: 180vmax;
  height: 180vmax;
  margin-left: -90vmax;
  margin-top: -90vmax;
  background: repeating-conic-gradient(rgba(255, 255, 255, 0.13) 0deg 8deg, transparent 8deg 22deg);
  mask-image: radial-gradient(circle, #000 0%, transparent 55%);
  -webkit-mask-image: radial-gradient(circle, #000 0%, transparent 55%);
  animation: spin 90s linear infinite;
}

.backdrop__sun {
  position: absolute;
  top: -30vmin;
  left: 50%;
  width: 90vmin;
  height: 90vmin;
  transform: translateX(-50%);
  background: radial-gradient(
    circle,
    rgba(255, 255, 230, 0.95) 0%,
    rgba(255, 250, 200, 0.4) 28%,
    rgba(255, 255, 255, 0) 62%
  );
}

.cloud {
  position: absolute;
  top: var(--y);
  left: 0;
  width: var(--w);
  height: calc(var(--w) * 0.3);
  background: #fff;
  border-radius: 999px;
  box-shadow: inset 0 -0.6vmax 0 rgba(150, 200, 240, 0.4);
  opacity: 0.95;
  animation: drift var(--t) linear var(--d) infinite;
}

.cloud::before,
.cloud::after {
  content: '';
  position: absolute;
  background: #fff;
  border-radius: 50%;
}

.cloud::before {
  width: 46%;
  height: 150%;
  left: 14%;
  bottom: 25%;
}

.cloud::after {
  width: 34%;
  height: 115%;
  left: 50%;
  bottom: 32%;
}

.backdrop__sea {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 43%;
  background: linear-gradient(180deg, #8fe9ee 0%, #3fd0dc 16%, #12a6d6 58%, #0a78b8 100%);
}

/* ============ Screens & Übergänge ============ */

.screen {
  position: absolute;
  z-index: 1;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(18px, 4vh, 36px);
  padding: calc(24px + var(--safe-top)) 16px calc(24px + var(--safe-bottom));
  text-align: center;
}

.screen--enter {
  z-index: 2;
  animation: screen-in 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.15) both;
}

.screen--leave {
  z-index: 1;
  pointer-events: none;
  animation: screen-out 0.28s ease-in both;
}

/* ============ Buttons ============ */

.btn {
  --hi: #a8ff70;
  --mid: #5fd22f;
  --lo: #3aa617;
  --edge: #1d5c10;

  position: relative;
  overflow: hidden;
  appearance: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-display);
  font-size: clamp(20px, 5.5vw, 28px);
  letter-spacing: 0.02em;
  color: #fff;
  padding: 0.4em 1.3em 0.5em;
  border-radius: 0.6em;
  text-shadow: 0 0.08em 0 var(--edge);
  background: linear-gradient(180deg, var(--hi) 0%, var(--mid) 55%, var(--lo) 100%);
  box-shadow:
    0 0 0 0.12em var(--edge),
    inset 0 -0.16em 0 rgba(0, 0, 0, 0.14),
    0 0.24em 0 0.12em var(--edge),
    0 0.5em 1em rgba(0, 30, 80, 0.35);
  transition:
    translate 0.08s ease,
    scale 0.08s ease,
    box-shadow 0.08s ease;
}

/* Glanz oben */
.btn::before {
  content: '';
  position: absolute;
  left: 0.3em;
  right: 0.3em;
  top: 0.12em;
  height: 42%;
  border-radius: 0.45em 0.45em 0.6em 0.6em;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.08));
  pointer-events: none;
}

/* Lichtreflex, der regelmäßig über den Button wischt */
.btn::after {
  content: '';
  position: absolute;
  top: -50%;
  bottom: -50%;
  width: 30%;
  left: -40%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  transform: skewX(-20deg);
  animation: shine 3.2s ease-in-out 1.6s infinite;
  pointer-events: none;
}

.btn:active,
.btn.is-pressed {
  translate: 0 0.18em;
  scale: 0.97;
  box-shadow:
    0 0 0 0.12em var(--edge),
    inset 0 -0.16em 0 rgba(0, 0, 0, 0.14),
    0 0.06em 0 0.12em var(--edge),
    0 0.2em 0.5em rgba(0, 30, 80, 0.35);
}

.btn--green {
  --hi: #a8ff70;
  --mid: #5fd22f;
  --lo: #3aa617;
  --edge: #1d5c10;
}

.btn--blue {
  --hi: #9fe3ff;
  --mid: #3ea6ff;
  --lo: #1f7ae0;
  --edge: var(--blue-edge);
}

.btn--gold {
  --hi: var(--gold-hi);
  --mid: var(--gold);
  --lo: var(--gold-lo);
  --edge: var(--gold-edge);
}

.btn--red {
  --hi: var(--red-hi);
  --mid: var(--red);
  --lo: var(--red-lo);
  --edge: var(--red-edge);
}

.btn--orange {
  --hi: #ffd08a;
  --mid: #ff9a2f;
  --lo: #e66b16;
  --edge: #8a3908;
}

.btn--big {
  font-size: clamp(24px, min(9vw, 8vh), 46px);
  padding: 0.3em 1.5em 0.42em;
}

/* ============ Hauptmenü ============ */

.menu {
  gap: clamp(28px, 8vh, 72px);
  padding-bottom: calc(10vh + var(--safe-bottom));
}

.menu__scene {
  position: absolute;
  z-index: -1;
  inset: 0;
  overflow: hidden;
  /* Bis die 3D-Bucht da ist: Himmel und Meer als glatter Verlauf, ohne Wolken und Streifen des Hintergrunds */
  background: linear-gradient(180deg, #1b97e6 0%, #4cc0f2 32%, #9ee6f9 45%, #cdf4ff 57%, #5fcfe6 75%, #2aa8d8 100%);
}

.menu__scene .menu__canvas {
  opacity: 0;
  transition: opacity 0.9s ease-out;
}

.menu__scene.is-ready .menu__canvas {
  opacity: 1;
}

.menu__canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.logo {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0;
  font-weight: normal;
  animation: logo-float 4.5s ease-in-out 1.6s infinite;
}

/* Weiches Licht hinter dem Logo, damit es sich von Himmel und Wolken abhebt */
.logo::before {
  content: '';
  position: absolute;
  z-index: -1;
  left: 50%;
  top: 42%;
  width: 160%;
  aspect-ratio: 1.5;
  translate: -50% -50%;
  background: radial-gradient(closest-side, rgba(255, 255, 235, 0.55), rgba(255, 255, 235, 0));
  animation: fade-in 1s ease-out 0.4s both;
}

.logo__mark {
  display: flex;
  font-family: 'Lilita One', 'Arial Rounded MT Bold', system-ui, sans-serif;
  font-size: clamp(84px, min(34vw, 25vh), 220px);
  line-height: 1;
  letter-spacing: 0.02em;
}

.logo__letter {
  position: relative;
  display: inline-block;
  animation: letter-drop 0.75s var(--bounce) calc(0.15s + var(--i) * 0.1s) both;
}

/* Die Buchstaben selbst sind SVG-Text (siehe ui/logo.ts). Das HTML-Zeichen gibt nur die Breite vor. */
.logo__sizer {
  display: block;
  visibility: hidden;
}

.logo__svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  /* weicher Schatten unter dem ganzen Buchstaben */
  filter: drop-shadow(0 0.2em 0.12em rgba(0, 30, 80, 0.35));
}

.logo__svg text {
  font-family: 'Lilita One', 'Arial Rounded MT Bold', system-ui, sans-serif;
  font-size: 1em;
  letter-spacing: 0;
}

/* Dunkler Rand und zwei Tiefenstufen darunter */
.logo__outline,
.logo__depth {
  stroke-width: 0.12em;
  stroke-linejoin: round;
}

.logo__outline {
  fill: var(--gold-edge);
  stroke: var(--gold-edge);
}

.logo__depth {
  fill: #4a2000;
  stroke: #4a2000;
}

/* Goldverlauf mit harter Kante in der Mitte: wirkt wie abgeschrägtes Metall */
.logo__fill {
  fill: url(#logo-gold);
}

/* Unsichtbare Hilfs-SVG, die nur den Goldverlauf bereitstellt */
.logo__defs {
  position: absolute;
  width: 0;
  height: 0;
}

/* Schild "BEYOND" unter dem Schriftzug */
.logo__plate {
  position: relative;
  z-index: 1;
  margin-top: -0.2em;
  font-family: 'Lilita One', 'Arial Rounded MT Bold', system-ui, sans-serif;
  font-size: clamp(17px, min(5.8vw, 5vh), 32px);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #fff;
  animation: plate-in 0.6s cubic-bezier(0.2, 0.9, 0.3, 1.2) 0.55s both;
}

.logo__plate > span {
  display: block;
  /* links mehr Abstand, weil letter-spacing rechts hinter dem letzten Buchstaben Platz lässt */
  padding: 0.3em 1.1em 0.36em 1.28em;
  border-radius: 0.35em;
  background: linear-gradient(180deg, #2a5ba3 0%, #173a73 55%, #0f2a57 100%);
  text-shadow: 0 0.08em 0 rgba(0, 10, 40, 0.6);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    0 0 0 0.09em var(--gold),
    0 0 0 0.18em #0b1f45,
    0 0.35em 0.7em rgba(0, 30, 80, 0.35);
}

/* Goldene Rauten an beiden Enden */
.logo__plate::before,
.logo__plate::after {
  content: '';
  position: absolute;
  z-index: 1;
  top: 50%;
  width: 0.55em;
  height: 0.55em;
  background: linear-gradient(135deg, var(--gold-hi), var(--gold-lo));
  box-shadow: 0 0 0 0.09em #0b1f45;
  transform: translateY(-50%) rotate(45deg);
}

.logo__plate::before {
  left: -0.3em;
}

.logo__plate::after {
  right: -0.3em;
}

.menu__buttons {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 26px;
}

.menu__account-row {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 12px;
  max-width: calc(100vw - 32px - var(--safe-left, 0px) - var(--safe-right, 0px));
}
.menu__account-row .menu__login--named { min-width: 0; flex: 1; }
.menu__account-row a { display: flex; align-items: center; justify-content: center; text-decoration: none; }
.menu__account-row a[hidden] { display: none; }

.menu__install {
  position: absolute;
  top: calc(14px + var(--safe-top));
  right: calc(16px + env(safe-area-inset-right, 0px));
  font-size: 16px;
  min-height: 44px;
  max-width: 45%;
}

/* Hinweis oben links, solange das Menü einen neuen Stand lädt */
.menu__update {
  position: absolute;
  top: calc(14px + var(--safe-top));
  left: calc(16px + env(safe-area-inset-left, 0px));
  margin: 0;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(11, 31, 69, 0.75);
  color: #fff;
  font-size: 14px;
  font-weight: 900;
  pointer-events: none;
}

.install-help,
.patch-notes {
  width: min(380px, 85vw);
  padding: 24px;
  border: 3px solid #14284a;
  border-radius: 18px;
  color: #14284a;
  background: #effaff;
  font-family: var(--font-body);
  font-size: 18px;
}

.patch-notes::backdrop,
.install-help::backdrop { background: #14284aaa; }
.install-help p { line-height: 1.5; }
.patch-notes .btn,
.install-help .btn { font-size: 18px; }

/* Neuigkeiten: Knopf oben links, Fenster mit Versionsreitern; der Update-Hinweis rutscht darunter */
.menu__update { top: calc(66px + var(--safe-top)); }
.menu__patch {
  position: absolute;
  top: calc(14px + var(--safe-top));
  left: calc(16px + env(safe-area-inset-left, 0px));
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  min-height: 44px;
  max-width: 45%;
}
.menu__patch-version { padding: 1px 8px; border-radius: 999px; background: rgba(11, 31, 69, 0.45); font-size: 14px; }

.menu__about {
  position: absolute;
  bottom: calc(14px + var(--safe-bottom));
  right: calc(16px + env(safe-area-inset-right, 0px));
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  font-size: 15px;
  text-decoration: none;
}
@media (max-width: 650px), (max-height: 500px) {
  .menu__about { bottom: calc(54px + var(--safe-bottom)); min-height: 36px; padding: 4px 10px; font-size: 13px; }
}
/* Scrollt per Wischen oder Mausrad, ohne sichtbare Leiste */
.patch-notes { width: min(720px, 92vw); max-height: 88vh; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.patch-notes::-webkit-scrollbar { display: none; }
.patch-notes strong { font-size: 22px; }
.patch-notes h3 { margin: 0 0 6px; font-size: 20px; }
.patch-notes__entry + .patch-notes__entry { margin-top: 14px; padding-top: 14px; border-top: 2px solid #14284a33; }
.patch-notes p { margin: 4px 0; }
.patch-notes { text-align: left; }
.patch-notes strong { display: block; text-align: center; }
.patch-notes__body { margin-top: 6px; }
.patch-notes p { line-height: 1.5; }
.patch-notes ul { margin: 12px 0 18px; padding-left: 24px; list-style: disc outside; }
.patch-notes li { display: list-item; margin: 6px 0; line-height: 1.4; }
.patch-notes li::marker { color: #14284a; }
/* Reiter und Schliessen in einer Leiste oben, sie bleibt beim Scrollen stehen */
.patch-notes__bar {
  position: sticky;
  top: -24px;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: -24px -24px 0;
  padding: 16px 16px 10px;
  background: #effaff;
  border-bottom: 2px solid #14284a33;
}
.patch-notes__tabs { display: flex; gap: 8px; }
.patch-notes__tabs[hidden] { display: none; }
/* Reiter und Schliessen sind normale Spielknöpfe: blau, aktiver Reiter gold, Schliessen rot */
.patch-notes .patch-notes__tab {
  flex: none;
  min-height: 40px;
  font-size: 16px;
}

.menu__languages {
  position: absolute;
  bottom: calc(14px + var(--safe-bottom));
  display: flex;
  justify-content: center;
  gap: 12px;
  max-width: 100%;
  padding: 0 16px;
}

.menu__language {
  min-height: 44px;
  min-width: 90px;
  padding: 8px 18px;
  font-size: 18px;
  line-height: 1.5;
}

.menu__language:lang(th) {
  font-family: 'Noto Sans Thai', system-ui, sans-serif;
}

.menu__language.is-active {
  --hi: #a8ff70;
  --mid: #5fd22f;
  --lo: #3aa617;
  --edge: #1d5c10;
}

.menu__language:focus-visible {
  outline: 3px solid white;
  outline-offset: 5px;
}

.menu__new {
  /* Ruhiges Meergrün statt Rot: Der Spielstand weiterführen bleibt der Hauptknopf */
  --hi: #a6f0dc;
  --mid: #3fc2a6;
  --lo: #23917f;
  --edge: #0f4f48;
  min-width: min(70vw, 300px);
  animation: pop-in 0.55s var(--bounce) 1s both;
}

.menu__play {
  min-width: min(70vw, 300px);
  animation:
    pop-in 0.55s var(--bounce) 0.85s both,
    breathe 1.8s ease-in-out 1.6s infinite;
}

/* ============ Hinweis: Handy quer halten ============ */

.rotate-hint {
  display: none;
}

@media (orientation: portrait) and (pointer: coarse) {
  body:not(:has(.admin-screen)) .rotate-hint {
    position: fixed;
    inset: 0;
    z-index: 20000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    padding: 24px;
    text-align: center;
    background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-mid) 60%, var(--sky-bottom) 100%);
  }

  .rotate-hint svg {
    width: 120px;
    height: 120px;
    filter: drop-shadow(0 6px 0 rgba(0, 30, 80, 0.25));
    animation: rotate-hint 2.2s ease-in-out infinite;
  }

}

@keyframes rotate-hint {
  0%,
  25% {
    transform: none;
  }
  60%,
  100% {
    transform: rotate(-90deg);
  }
}

/* ============ Animationen ============ */

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

@keyframes screen-in {
  from {
    opacity: 0;
    transform: scale(1.08);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes screen-out {
  to {
    opacity: 0;
    transform: scale(0.94);
  }
}

@keyframes letter-drop {
  0% {
    opacity: 0;
    transform: translateY(-120%) scale(0.6, 1.4);
  }
  60% {
    opacity: 1;
    transform: translateY(0) scale(1.25, 0.75);
  }
  100% {
    transform: none;
  }
}

@keyframes logo-float {
  0%,
  100% {
    transform: none;
  }
  50% {
    transform: translateY(-2%);
  }
}

@keyframes plate-in {
  from {
    opacity: 0;
    transform: scaleX(0.3);
  }
  60% {
    opacity: 1;
    transform: scaleX(1.05);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes pop-in {
  from {
    opacity: 0;
    transform: scale(0.3);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes breathe {
  0%,
  100% {
    transform: none;
  }
  50% {
    transform: scale(1.05);
  }
}

@keyframes shine {
  0%,
  60% {
    left: -40%;
  }
  100% {
    left: 130%;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes drift {
  from {
    transform: translateX(-40vmax);
  }
  to {
    transform: translateX(calc(100vw + 10vmax));
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}


/* Touch-Geräte (iPhone, Android, PWA): Titelbildschirm kompakter, damit sich Knöpfe und Sprachen nicht überlappen */
/* Niedrige Bildschirme (Handy quer): „Spiel fortsetzen“ und „Neues Spiel“ nebeneinander, Account darunter, alles kleiner */
@media (max-height: 450px) {
  .menu {
    gap: clamp(8px, 3.5vh, 16px);
    padding-top: calc(8px + var(--safe-top));
    padding-bottom: calc(48px + var(--safe-bottom));
  }
  .menu__buttons { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: clamp(8px, 3vh, 12px) 14px; }
  .menu__play,
  .menu__new { min-width: min(36vw, 230px); min-height: 0; padding: 0.3em 1em 0.4em; font-size: clamp(16px, 6vh, 24px); }
  .menu__account-row { flex-basis: 100%; }
  .menu__account-row .menu__login--named { flex: 0 1 auto; }
  .menu__login { min-height: 0; padding: 0.35em 1.1em 0.45em; font-size: clamp(13px, 4.4vh, 16px); }
  .menu__patch,
  .menu__install { top: calc(8px + var(--safe-top)); min-height: 36px; padding: 4px 12px; font-size: 14px; }
  .menu__update { top: calc(52px + var(--safe-top)); }
  .logo__mark { font-size: clamp(44px, 21vh, 100px); }
  .logo__plate { font-size: clamp(11px, 4.5vh, 20px); }
  .menu__languages { bottom: calc(6px + var(--safe-bottom)); gap: 6px; padding: 0 8px; }
  .menu__language { min-height: 32px; min-width: 0; padding: 2px 10px; font-size: 13px; line-height: 1.3; }
}

@media (pointer: coarse) and (max-width: 480px) {
  .menu__languages { gap: 6px; padding: 0 8px; }
  .menu__language { min-width: 0; padding: 6px 10px; font-size: 14px; }
}

.account-dialog {
  box-sizing: border-box;
  width: min(460px, calc(100vw - 32px));
  max-height: calc(100dvh - 24px - var(--safe-top, 0px) - var(--safe-bottom, 0px));
  margin: auto;
  overflow: auto;
  border: 4px solid var(--ink);
  border-radius: 24px;
  padding: 18px 20px 22px;
  background: #fff9e7;
  color: var(--ink);
  font: 800 16px/1.4 var(--font-body);
  text-align: center;
  touch-action: auto;
  box-shadow: 0 8px 0 rgb(20 40 74 / 35%);
}
.account-dialog::backdrop { background: rgb(20 40 74 / 65%); }
.account-dialog--conflict { width: min(760px, calc(100vw - 32px)); }
.account-dialog__body, .account-dialog__form { display: grid; gap: 14px; }
.account-dialog__header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 52px;
  border-bottom: 3px solid rgb(199 145 84 / 45%);
  padding-bottom: 18px;
}
.account-dialog h2, .account-dialog p { margin: 0; }
.account-dialog h2 { font: 28px/1.1 var(--font-display); text-align: center; }
.account-dialog__close {
  position: absolute;
  top: 0;
  right: 0;
  width: 44px;
  height: 44px;
  padding: 0 0 3px;
  border: 3px solid #8b2921;
  border-radius: 50%;
  cursor: pointer;
  font: 28px/1 var(--font-display);
  color: #fff;
  background: linear-gradient(#ff8a7a, #d1261c);
  box-shadow: 0 3px 0 #6e0f0a;
}
.account-dialog__close:active { transform: translateY(3px); box-shadow: 0 0 0 #6e0f0a; }
.account-dialog__form label { display: grid; gap: 4px; text-align: left; }
.account-dialog input { box-sizing: border-box; width: 100%; min-height: 46px; padding: 8px 12px; border: 2px solid #c79154; border-radius: 12px; font: inherit; background: #fffdf4; color: var(--ink); }
.account-dialog input:focus-visible { outline: 3px solid #3ea6ff; outline-offset: 1px; }
.account-dialog .btn { min-height: 46px; width: 100%; white-space: normal; font-size: 16px; }
.account-dialog__actions { display: grid; gap: 10px; }
.account-dialog__saves { display: grid; gap: 12px; }
.account-dialog__save { display: grid; gap: 10px; padding: 14px; border: 2px solid #c79154; border-radius: 14px; background: #fffdf4; }
.account-dialog__save p { white-space: pre-line; font-size: 14px; }
.account-dialog__more { display: grid; text-align: left; }
.account-dialog__more summary { min-height: 44px; cursor: pointer; }
.account-dialog__more .account-dialog__save { margin-top: 10px; text-align: center; }
.account-dialog__message { color: #a42920; }
.account-dialog__message.is-success { color: #1d5c10; }
.account-dialog__message:empty { display: none; }
.account-dialog__email { overflow-wrap: anywhere; font-size: 18px; }
.account-dialog__player-name { overflow-wrap: anywhere; font-size: 20px; }
.account-dialog__warning { padding: 16px; border: 3px solid #a42920; border-radius: 12px; background: #ffe0dc; color: #a42920; font-size: 20px; }
.account-dialog__sync { display: flex; align-items: center; justify-content: center; gap: 10px; }
.account-dialog__sync .btn { flex: 0 0 46px; width: 46px; font-size: 25px; }
.account-dialog__sync .is-error { color: #a42920; }
.account-dialog button:disabled { opacity: .55; }
.menu__login { min-height: 40px; font-size: 16px; }
.menu__login--named { max-width: calc(100vw - 32px); white-space: normal; overflow-wrap: anywhere; }
.account-dialog .account-dialog__actions--overview { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.account-dialog .account-dialog__actions--overview .btn { width: 100%; }
.account-dialog__footer { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 4px; }

@media (min-width: 520px) {
  .account-dialog__actions .btn { width: auto; }
  .account-dialog__actions { display: flex; flex-wrap: wrap; justify-content: center; }
  .account-dialog__body > .btn, .account-dialog__form .btn { justify-self: center; min-width: 200px; width: auto; }
}

@media (min-width: 700px) {
  .account-dialog__saves { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.account-confirm__details { display: block; margin-top: 10px; text-wrap: balance; }

/* Öffentliche Leseseite mit den vorhandenen Knöpfen und Account-Karten. */
html:has(.public-site) { height: auto; overflow: auto; }
body.public-site { height: auto; min-height: 100dvh; overflow: visible; background: linear-gradient(180deg, var(--sky-top), var(--sky-bottom)) fixed; user-select: text; -webkit-user-select: text; -webkit-touch-callout: default; touch-action: pan-y; overscroll-behavior: auto; padding: 24px max(16px, env(safe-area-inset-right)) 40px max(16px, env(safe-area-inset-left)); }
.public-site .site-header, .public-site main, .public-site footer, .public-site > .site-navigation { max-width: 1100px; margin: 0 auto; }
.site-header { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; }
.site-brand { display: flex; align-items: center; gap: 12px; font: 30px var(--font-display); text-decoration: none; }
.site-brand img { border-radius: 14px; }
.site-languages, .site-navigation { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 24px; }
.site-languages a { min-height: 44px; display: inline-flex; align-items: center; }
.site-languages [aria-current] { text-decoration-thickness: 3px; text-underline-offset: 6px; }
.public-site a { color: var(--ink); overflow-wrap: anywhere; }
.public-site a:focus-visible { outline: 3px solid var(--blue-edge); outline-offset: 5px; }
.public-site .site-navigation { padding: 24px 0; }
.public-site .site-card { width: 100%; max-height: none; overflow: visible; text-align: left; padding: clamp(20px, 3vw, 36px); margin: 0; }
.public-site main { display: grid; gap: 32px; }
.public-site h1 { font: clamp(30px, 5vw, 52px)/1.12 var(--font-display); margin: 12px 0 20px; }
.public-site h2 { font: 28px/1.3 var(--font-display); text-align: left; margin: 0 0 20px; }
.public-site h3 { font: 22px/1.3 var(--font-display); margin: 24px 0 10px; }
.public-site .site-grid h3 { margin-top: 0; }
.public-site p { line-height: 1.7; margin: 0 0 16px; }
.public-site p:last-child { margin-bottom: 0; }
.public-site .site-eyebrow { font: 20px var(--font-display); }
.public-site .site-intro > p:not(.site-eyebrow) { max-width: 75ch; font-size: 18px; }
.site-actions { padding: 16px 4px 12px; }
.public-site .btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; color: white; font-size: 20px; min-height: 44px; }
.public-site .btn::after { animation: none; }
.site-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.site-gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.public-site .site-gallery figure { padding: 12px; }
.site-gallery img { display: block; width: 100%; height: auto; border-radius: 14px; }
.site-gallery figcaption { padding: 12px 4px 4px; line-height: 1.5; font-size: 14px; }
.public-site ol { padding-left: 24px; line-height: 1.7; }
.public-site li + li { margin-top: 12px; }
.public-site footer { margin-top: 24px; }
.public-site section[id] { scroll-margin-top: 24px; }
@media (max-width: 760px) { .site-grid { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .site-gallery { grid-template-columns: 1fr; } .site-header { gap: 8px; } .site-brand { font-size: 26px; } .site-languages { gap: 20px; } }
