/* ===================================================================
   Mixed Stories – Stylesheet
   =================================================================== */

:root {
  --c-bg:        #f4f1fb;
  --c-surface:   #ffffff;
  --c-surface-2: #f0ebfa;
  --c-border:    #dcd3f0;
  --c-text:      #241d38;
  --c-muted:     #6b6482;
  --c-primary:   #5b3fd6;
  --c-primary-d: #4a31b8;
  --c-accent:    #e0812f;
  --c-danger:    #c8324b;
  --c-ok:        #2f9e63;
  --radius:      14px;
  --shadow:      0 6px 24px rgba(40, 22, 90, 0.12);
  --maxw:        720px;
  --font:        system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-heading: var(--font);
  --heading-transform: none;
  --heading-tracking: normal;
  --heading-style: normal;
  --heading-weight: 800;
}

@media (prefers-color-scheme: dark) {
  :root {
    --c-bg:        #17141f;
    --c-surface:   #211c2e;
    --c-surface-2: #2b2440;
    --c-border:    #3a3350;
    --c-text:      #ede9f7;
    --c-muted:     #a49dbd;
    --c-primary:   #8a72f0;
    --c-primary-d: #7357e8;
    --c-accent:    #f0a256;
    --c-danger:    #f0687f;
    --c-ok:        #57c98c;
    --shadow:      0 6px 24px rgba(0, 0, 0, 0.4);
  }
}

/* ===================================================================
   Skins – jeder Nutzer kann ein eigenes Design waehlen (Profil).
   Ein Skin ueberschreibt saemtliche Farbvariablen fest (unabhaengig vom
   System-Farbschema) und liefert eine eigene Typo-Note fuer Ueberschriften.
   =================================================================== */
:root[data-theme="scifi"] {
  --c-bg: #060a14; --c-surface: #0d1526; --c-surface-2: #131f38;
  --c-border: #24365c; --c-text: #dff3ff; --c-muted: #7f93bd;
  --c-primary: #2fd0ee; --c-primary-d: #1fb3cf; --c-accent: #ff5fb0;
  --c-danger: #ff5470; --c-ok: #4dedb0; --shadow: 0 6px 28px rgba(47, 208, 238, 0.18);
  --font-heading: ui-monospace, "SF Mono", "Cascadia Code", Consolas, monospace;
  --heading-transform: uppercase; --heading-tracking: 0.06em; --heading-weight: 700;
}
:root[data-theme="fantasy"] {
  --c-bg: #150f24; --c-surface: #1e1636; --c-surface-2: #291f47;
  --c-border: #40315f; --c-text: #f3e9d2; --c-muted: #b19fdc;
  --c-primary: #c9a038; --c-primary-d: #a9822a; --c-accent: #9c6dff;
  --c-danger: #ef6a6a; --c-ok: #7fd4a0; --shadow: 0 6px 28px rgba(201, 160, 56, 0.22);
  --font-heading: Georgia, "Iowan Old Style", "Palatino Linotype", serif;
  --heading-style: italic; --heading-tracking: 0.01em; --heading-weight: 700;
}
:root[data-theme="romance"] {
  --c-bg: #2a1420; --c-surface: #3a1c2c; --c-surface-2: #4a2436;
  --c-border: #6b2f47; --c-text: #ffe9ef; --c-muted: #d79eb2;
  --c-primary: #ff6f9c; --c-primary-d: #e85585; --c-accent: #ffb37a;
  --c-danger: #ff6a6a; --c-ok: #7fd8b0; --shadow: 0 6px 28px rgba(255, 111, 156, 0.25);
  --font-heading: Georgia, "Iowan Old Style", serif;
  --heading-style: italic; --heading-weight: 700;
}
:root[data-theme="kids"] {
  --c-bg: #fff8e8; --c-surface: #ffffff; --c-surface-2: #fff1cf;
  --c-border: #ffdd8a; --c-text: #2c2140; --c-muted: #7a6f57;
  --c-primary: #ff5da2; --c-primary-d: #f2418c; --c-accent: #22c1c3;
  --c-danger: #ff5252; --c-ok: #34b76a; --shadow: 0 8px 22px rgba(255, 93, 162, 0.22);
  --font-heading: var(--font); --heading-transform: none; --heading-weight: 900;
  --radius: 20px;
}
:root[data-theme="dreams"] {
  --c-bg: #efe9ff; --c-surface: #fbf8ff; --c-surface-2: #e6ddff;
  --c-border: #d6c9f7; --c-text: #362a52; --c-muted: #7c6f9c;
  --c-primary: #9b7ef0; --c-primary-d: #8264da; --c-accent: #63c9dc;
  --c-danger: #e07a9a; --c-ok: #6bc79b; --shadow: 0 10px 30px rgba(155, 126, 240, 0.18);
  --font-heading: var(--font); --heading-weight: 300; --heading-tracking: 0.02em;
}
:root[data-theme="mystery"] {
  --c-bg: #14161a; --c-surface: #1c1f26; --c-surface-2: #262a33;
  --c-border: #3a3f4a; --c-text: #e7e6e2; --c-muted: #8b8d94;
  --c-primary: #c9a24a; --c-primary-d: #ab8636; --c-accent: #6f9bbf;
  --c-danger: #d5544c; --c-ok: #6fae87; --shadow: 0 6px 28px rgba(0, 0, 0, 0.5);
  --font-heading: ui-monospace, "SF Mono", Consolas, monospace;
  --heading-transform: uppercase; --heading-tracking: 0.08em; --heading-weight: 700;
}
:root[data-theme="horror"] {
  --c-bg: #0a0808; --c-surface: #161010; --c-surface-2: #201415;
  --c-border: #3a1c1c; --c-text: #ede2e2; --c-muted: #a78a8a;
  --c-primary: #d1273f; --c-primary-d: #ac1e33; --c-accent: #ff7a3d;
  --c-danger: #ff4d4d; --c-ok: #5d9c74; --shadow: 0 0 30px rgba(209, 39, 63, 0.35);
  --font-heading: Georgia, "Times New Roman", serif;
  --heading-transform: uppercase; --heading-tracking: 0.05em; --heading-weight: 700;
}
:root[data-theme="adventure"] {
  --c-bg: #f4ecd8; --c-surface: #fbf5e7; --c-surface-2: #ecdfc0;
  --c-border: #d8c393; --c-text: #3a2b1a; --c-muted: #83714f;
  --c-primary: #b5652e; --c-primary-d: #97511f; --c-accent: #4c7a52;
  --c-danger: #b1402f; --c-ok: #4c7a52; --shadow: 0 8px 24px rgba(90, 60, 20, 0.2);
  --font-heading: Georgia, "Iowan Old Style", serif; --heading-weight: 700;
}
:root[data-theme="nature"] {
  --c-bg: #f0f6ec; --c-surface: #ffffff; --c-surface-2: #e4efdc;
  --c-border: #c8ddb9; --c-text: #223420; --c-muted: #647a5e;
  --c-primary: #3f8f5a; --c-primary-d: #327449; --c-accent: #e0a83e;
  --c-danger: #c85a45; --c-ok: #3f8f5a; --shadow: 0 8px 24px rgba(63, 143, 90, 0.2);
  --font-heading: var(--font); --heading-weight: 700;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font);
  background: var(--c-bg);
  color: var(--c-text);
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
}

h1, h2, h3 {
  line-height: 1.25; margin: 0 0 0.5em;
  font-family: var(--font-heading); font-weight: var(--heading-weight);
  text-transform: var(--heading-transform); letter-spacing: var(--heading-tracking);
  font-style: var(--heading-style);
  transition: color 0.3s;
}
p { margin: 0 0 0.8em; }

.hidden { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

body, .modal, .panel, .round-card, .story-block, #topbar {
  transition: background-color 0.35s ease, border-color 0.35s ease, color 0.35s ease;
}

/* -------------------- Skin-Hintergrundpartikel -------------------- */
#themeFx {
  position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none;
}
#topbar, #app, .modal-backdrop, .toast { position: relative; z-index: 1; }
.particle {
  position: absolute; top: 100%; will-change: transform, opacity; user-select: none;
  line-height: 1;
}
@keyframes p-float-up {
  0%   { transform: translateY(0) translateX(0) rotate(0deg); opacity: 0; }
  10%  { opacity: 0.85; }
  90%  { opacity: 0.85; }
  100% { transform: translateY(-108vh) translateX(var(--drift, 0px)) rotate(12deg); opacity: 0; }
}
@keyframes p-twinkle {
  0%, 100% { opacity: 0.15; transform: scale(0.8); }
  50%      { opacity: 1;    transform: scale(1.15); }
}
@keyframes p-drift {
  0%   { transform: translate(-10vw, 0) rotate(0deg); opacity: 0; }
  10%  { opacity: 0.8; }
  90%  { opacity: 0.8; }
  100% { transform: translate(110vw, 6vh) rotate(6deg); opacity: 0; }
}
@keyframes p-rain {
  0%   { transform: translateY(-10vh); opacity: 0.7; }
  100% { transform: translateY(110vh); opacity: 0.3; }
}
@keyframes p-ember {
  0%   { transform: translateY(0) translateX(0); opacity: 0; }
  15%  { opacity: 1; }
  100% { transform: translateY(-90vh) translateX(var(--drift, 0px)); opacity: 0; }
}
@keyframes p-leaf {
  0%   { transform: translateY(-10vh) translateX(0) rotate(0deg); opacity: 0; }
  10%  { opacity: 0.9; }
  100% { transform: translateY(110vh) translateX(var(--drift, 0px)) rotate(340deg); opacity: 0; }
}
.particle.anim-float-up { animation-name: p-float-up; animation-timing-function: linear; }
.particle.anim-twinkle  { animation-name: p-twinkle;  animation-timing-function: ease-in-out; top: var(--y, 20%); color: var(--c-primary); text-shadow: 0 0 6px currentColor; }
.particle.anim-drift    { animation-name: p-drift;    animation-timing-function: linear; top: var(--y, 20%); }
.particle.anim-rain     { animation-name: p-rain;     animation-timing-function: linear; color: var(--c-accent); opacity: 0.6; }
.particle.anim-ember    { animation-name: p-ember;    animation-timing-function: ease-out; color: var(--c-accent); text-shadow: 0 0 6px currentColor; }
.particle.anim-leaf     { animation-name: p-leaf;     animation-timing-function: linear; }
.particle { animation-iteration-count: infinite; }

/* -------------------- Topbar -------------------- */
#topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  padding-top: max(10px, env(safe-area-inset-top));
}
.brand {
  border: 0; background: none; cursor: pointer;
  font-size: 1.1rem; font-weight: 700; color: var(--c-text);
  display: flex; align-items: center; gap: 6px;
  font-family: var(--font-heading); letter-spacing: var(--heading-tracking);
}
.brand-icon { display: inline-block; animation: wiggle 5s ease-in-out infinite; }
@keyframes wiggle {
  0%, 85%, 100% { transform: rotate(0deg); }
  88% { transform: rotate(-8deg); }
  92% { transform: rotate(7deg); }
  95% { transform: rotate(-4deg); }
}
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  border: 0; background: var(--c-surface-2); cursor: pointer;
  width: 38px; height: 38px; border-radius: 50%;
  font-size: 1.1rem; color: var(--c-text);
  display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn:hover { background: var(--c-border); }
.profile-btn {
  border: 0; background: var(--c-surface-2); cursor: pointer;
  display: flex; align-items: center; gap: 8px;
  padding: 4px 12px 4px 4px; border-radius: 999px;
  color: var(--c-text); font-size: 0.9rem; font-weight: 600;
}
.profile-btn:hover { background: var(--c-border); }
.top-username { max-width: 40vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* -------------------- Avatars -------------------- */
.avatar {
  border-radius: 50%; object-fit: cover; background: var(--c-surface-2);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; color: #fff; flex-shrink: 0;
}
.avatar-fallback { background: var(--c-primary); }
.avatar-sm { width: 30px; height: 30px; font-size: 0.8rem; }
.avatar-md { width: 44px; height: 44px; font-size: 1rem; }
.avatar-lg { width: 72px; height: 72px; font-size: 1.6rem; }

/* -------------------- Layout -------------------- */
#app {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 20px 16px 60px;
  padding-bottom: max(60px, env(safe-area-inset-bottom));
}
.view { animation: fade 0.2s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* -------------------- Landing -------------------- */
.landing { text-align: center; padding-top: 5vh; }
.landing-icon { font-size: 3rem; display: inline-block; animation: bob 3.5s ease-in-out infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.landing h1 {
  font-size: 2.2rem; margin-top: 0.2em;
  background: linear-gradient(100deg, var(--c-primary), var(--c-accent), var(--c-primary));
  background-size: 220% auto;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: gradient-shift 6s ease-in-out infinite;
}
@keyframes gradient-shift {
  0%, 100% { background-position: 0% center; }
  50%      { background-position: 100% center; }
}
.landing-tagline { color: var(--c-muted); max-width: 30em; margin: 0.5em auto 1.5em; }
.landing-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* Animierte Schreib-Demo: zeigt live, wie ein Satz getippt und der
   sichtbare Halbsatz an die naechste Person weitergereicht wird. */
.story-demo {
  max-width: 34em; margin: 0 auto 2em; padding: 18px 20px;
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  text-align: left; min-height: 3.6em;
}
.story-demo-label {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--c-muted); margin-bottom: 8px; display: flex; align-items: center; gap: 6px;
}
.story-demo-label .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--c-ok); animation: p-twinkle 1.6s ease-in-out infinite; }
.story-demo-text { font-size: 1.15rem; line-height: 1.6; }
.story-demo-text .hidden-part { color: var(--c-muted); filter: blur(0.02em); opacity: 0.5; }
.story-demo-text .kept-part { color: var(--c-accent); font-weight: 700; }
.caret {
  display: inline-block; width: 2px; height: 1.1em; background: var(--c-primary);
  vertical-align: text-bottom; margin-left: 1px; animation: caret-blink 0.9s step-end infinite;
}
@keyframes caret-blink { 50% { opacity: 0; } }

.landing-steps {
  text-align: left; max-width: 32em; margin: 2.5em auto 0; padding: 0;
  list-style: none; counter-reset: step;
}
.landing-steps li {
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--radius); padding: 14px 16px; margin-bottom: 10px;
  display: flex; gap: 10px;
}

/* -------------------- Buttons -------------------- */
.btn {
  border: 0; border-radius: 10px; cursor: pointer;
  font: inherit; font-weight: 600;
  padding: 10px 18px;
  transition: background 0.15s, transform 0.05s;
  position: relative; overflow: hidden;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--c-primary); color: #fff; }
.btn-primary:hover { background: var(--c-primary-d); }
.btn-primary::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,0.35) 48%, transparent 66%);
  transform: translateX(-120%);
  transition: transform 0.6s ease;
}
.btn-primary:hover::after { transform: translateX(120%); }
.btn-ghost { background: var(--c-surface-2); color: var(--c-text); }
.btn-ghost:hover { background: var(--c-border); }
.btn-danger { background: var(--c-danger); color: #fff; }
.btn-lg { padding: 13px 26px; font-size: 1.05rem; }
.btn-block { display: block; width: 100%; margin-top: 6px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.link-btn {
  border: 0; background: none; cursor: pointer;
  color: var(--c-primary); font: inherit; text-decoration: underline;
  padding: 6px 0;
}
.back-link { margin-bottom: 14px; font-weight: 600; }

/* -------------------- Dashboard -------------------- */
.dash-actions {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
  margin-bottom: 18px;
}
.join-form { display: flex; gap: 6px; flex: 1; min-width: 220px; }
.join-form input {
  flex: 1; text-transform: uppercase; letter-spacing: 0.15em; font-weight: 700;
}
.empty-hint, .loading { color: var(--c-muted); text-align: center; padding: 30px 0; }

.round-group { margin-bottom: 22px; }
.round-group h2 {
  font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--c-muted); margin-bottom: 8px;
}
.round-card {
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--radius); padding: 14px 16px; margin-bottom: 10px;
  cursor: pointer; display: flex; justify-content: space-between; align-items: center;
  gap: 12px; transition: border-color 0.2s, transform 0.15s, box-shadow 0.15s, background-color 0.35s ease;
}
.round-card:hover { border-color: var(--c-primary); transform: translateY(-2px); box-shadow: var(--shadow); }
.round-card h3 { font-size: 1.05rem; margin: 0 0 2px; }
.round-card .meta { color: var(--c-muted); font-size: 0.85rem; }
.badge {
  font-size: 0.72rem; font-weight: 700; padding: 3px 9px; border-radius: 999px;
  white-space: nowrap;
}
.badge-lobby   { background: var(--c-surface-2); color: var(--c-muted); }
.badge-playing { background: color-mix(in srgb, var(--c-accent) 22%, transparent); color: var(--c-accent); }
.badge-revealed{ background: color-mix(in srgb, var(--c-ok) 22%, transparent); color: var(--c-ok); }
.badge-archived{ background: var(--c-surface-2); color: var(--c-muted); }
.badge-turn    { background: var(--c-primary); color: #fff; }

/* -------------------- Round view -------------------- */
.round-head { margin-bottom: 16px; }
.round-head h1 { font-size: 1.5rem; margin-bottom: 4px; }
.round-head .meta { color: var(--c-muted); font-size: 0.9rem; }

.panel {
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--radius); padding: 16px; margin-bottom: 16px;
}
.panel h2 { font-size: 1rem; margin-bottom: 10px; }

/* Invite */
.invite-box { text-align: center; }
.invite-code {
  font-size: 1.8rem; font-weight: 800; letter-spacing: 0.3em;
  background: var(--c-surface-2); border-radius: 10px;
  padding: 10px 6px 10px 16px; margin: 6px 0 12px; display: inline-block;
}
.invite-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

/* Players */
.player-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.player-row {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 4px;
}
.player-row .pname { font-weight: 600; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-row .ptag { font-size: 0.75rem; color: var(--c-muted); }
.player-row.is-done .pname { color: var(--c-muted); }
.status-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c-border); flex-shrink: 0; }
.status-dot.done { background: var(--c-ok); }
.status-dot.pending { background: var(--c-accent); }
.mini-kick { margin-left: auto; }

/* Progress */
.progress-wrap { margin-bottom: 16px; }
.progress-label { display: flex; justify-content: space-between; font-size: 0.85rem; color: var(--c-muted); margin-bottom: 6px; }
.progress-bar { height: 8px; border-radius: 999px; background: var(--c-surface-2); overflow: hidden; }
.progress-bar > span { display: block; height: 100%; background: var(--c-primary); transition: width 0.3s; }

/* Write task */
.hint-card {
  background: var(--c-surface-2); border-left: 4px solid var(--c-accent);
  border-radius: 8px; padding: 12px 14px; margin-bottom: 14px;
  font-size: 1.15rem; font-style: italic;
  animation: reveal-in 0.4s ease both;
}
.hint-card .hint-lead { font-style: normal; font-size: 0.8rem; color: var(--c-muted); display: block; margin-bottom: 4px; }
.first-card {
  background: var(--c-surface-2); border-left: 4px solid var(--c-primary);
  border-radius: 8px; padding: 12px 14px; margin-bottom: 14px; color: var(--c-muted);
  animation: reveal-in 0.4s ease both;
}
@keyframes reveal-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

textarea, input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="search"], input[type="file"] {
  width: 100%; font: inherit; color: var(--c-text);
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: 10px; padding: 10px 12px;
}
textarea { resize: vertical; min-height: 90px; }
input:focus, textarea:focus { outline: 2px solid var(--c-primary); outline-offset: 1px; }

label { display: block; margin-bottom: 12px; font-weight: 600; font-size: 0.9rem; }
label input, label textarea, label select { margin-top: 5px; font-weight: 400; }
.field-label { font-weight: 600; font-size: 0.9rem; margin-bottom: 6px; }

.char-count { text-align: right; font-size: 0.78rem; color: var(--c-muted); margin-top: 3px; }

/* Hint marking */
.mark-help { font-size: 0.85rem; color: var(--c-muted); margin: 10px 0 6px; }
.word-pick { display: flex; flex-wrap: wrap; gap: 4px 0; line-height: 2; margin-bottom: 10px; }
.word-pick .w {
  cursor: pointer; padding: 2px 1px; border-radius: 4px; white-space: pre;
}
.word-pick .w:hover { background: var(--c-surface-2); }
.word-pick .w.in-hint { background: color-mix(in srgb, var(--c-accent) 30%, transparent); }
.hint-preview {
  font-style: italic; color: var(--c-accent); margin-bottom: 12px; min-height: 1.5em;
}

/* Reveal */
.story-block {
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--radius); padding: 18px; margin-bottom: 16px;
  animation: reveal-in 0.5s ease both;
}
.story-title { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.story-title h3 { margin: 0; font-size: 1.1rem; }
.story-flow { font-size: 1.12rem; line-height: 1.7; }
.story-flow .sent { }
.story-sep { color: var(--c-border); }
.story-authors { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--c-border); }
.story-authors ol { margin: 6px 0 0; padding-left: 1.2em; color: var(--c-muted); font-size: 0.88rem; }
.reveal-toggle { margin-bottom: 16px; }

/* -------------------- Modals -------------------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(20, 12, 40, 0.55);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 24px 14px; overflow-y: auto;
  backdrop-filter: blur(2px);
}
.modal {
  background: var(--c-surface); border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: 100%; max-width: 420px; padding: 22px;
  position: relative; margin: auto;
  animation: modal-in 0.22s cubic-bezier(.2,.9,.3,1.2) both;
}
@keyframes modal-in {
  from { opacity: 0; transform: scale(0.94) translateY(8px); }
  to   { opacity: 1; transform: none; }
}
.modal-large { max-width: 640px; }
.modal-close {
  position: absolute; top: 10px; right: 10px;
  border: 0; background: var(--c-surface-2); cursor: pointer;
  width: 32px; height: 32px; border-radius: 50%; font-size: 1rem; color: var(--c-text);
}
.tabs { display: flex; gap: 6px; margin-bottom: 16px; }
.tab-btn {
  flex: 1; border: 0; background: var(--c-surface-2); cursor: pointer;
  padding: 9px; border-radius: 8px; font: inherit; font-weight: 600; color: var(--c-muted);
}
.tab-btn.active { background: var(--c-primary); color: #fff; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

.form-error { color: var(--c-danger); font-size: 0.88rem; min-height: 1em; margin: 0 0 8px; font-weight: 600; }
.form-info  { color: var(--c-ok); font-size: 0.88rem; margin: 0 0 8px; font-weight: 600; }

.profile-avatar-row { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.profile-name { font-weight: 700; font-size: 1.1rem; margin: 0; }
.profile-email { color: var(--c-muted); font-size: 0.85rem; margin: 0; }
.profile-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.modal hr { border: 0; border-top: 1px solid var(--c-border); margin: 16px 0; }

/* Design/Skin-Auswahl */
.theme-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 10px; margin-top: 8px;
}
.theme-swatch {
  border: 2px solid var(--c-border); border-radius: 12px; cursor: pointer;
  padding: 10px 6px 8px; text-align: center; background: var(--c-surface-2);
  color: var(--c-text); font: inherit; transition: transform 0.15s, border-color 0.15s;
}
.theme-swatch:hover { transform: translateY(-2px); }
.theme-swatch.active { border-color: var(--c-primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-primary) 25%, transparent); }
.theme-swatch .ts-emoji { font-size: 1.5rem; display: block; margin-bottom: 4px; }
.theme-swatch .ts-dots { display: flex; justify-content: center; gap: 3px; margin: 4px 0; }
.theme-swatch .ts-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.theme-swatch .ts-label { font-size: 0.72rem; font-weight: 700; display: block; }

.help-content h3 { font-size: 0.98rem; margin-top: 16px; }
.help-content p { color: var(--c-muted); font-size: 0.92rem; }

/* -------------------- Toast -------------------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--c-text); color: var(--c-bg);
  padding: 11px 20px; border-radius: 999px; font-size: 0.9rem; font-weight: 600;
  z-index: 200; box-shadow: var(--shadow); max-width: 90vw; text-align: center;
}

/* -------------------- Desktop -------------------- */
@media (min-width: 640px) {
  .landing h1 { font-size: 2.8rem; }
}

/* -------------------- Bewegung reduzieren -------------------- */
@media (prefers-reduced-motion: reduce) {
  #themeFx { display: none; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
