@import url('https://fonts.googleapis.com/css2?family=Lilita+One&family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #08070D;
  --bg-elev: #0F0C18;
  --card: #14111F;
  --card-hover: #181425;
  --border: #262034;
  --border-strong: #362D4D;

  --purple: #9146FF;
  --purple-soft: #B389FF;
  --pink: #FF5FA2;
  --orange: #FF9F1C;
  --teal: #21E6A8;
  --red: #FF5470;

  --text: #F4F1FB;
  --text-dim: #9C93B5;
  --text-faint: #675E80;

  --radius: 20px;
  --radius-sm: 12px;
  --font-head: 'Space Grotesk', 'Inter', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Lilita One', var(--font-head);

  --gradient-brand: linear-gradient(90deg, var(--purple) 0%, var(--pink) 60%, var(--orange) 100%);
  --glow-purple: 0 0 0 1px rgba(145,70,255,0.25), 0 8px 28px rgba(145,70,255,0.18);

  --blob-1: 63% 37% 54% 46% / 43% 51% 49% 57%;
  --blob-2: 39% 61% 47% 53% / 56% 45% 55% 44%;
  --blob-3: 55% 45% 68% 32% / 38% 47% 53% 62%;
  --blob-4: 46% 54% 40% 60% / 60% 35% 65% 40%;
}

* { box-sizing: border-box; }

html { color-scheme: dark; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background:
    radial-gradient(720px 420px at 15% -8%, rgba(145,70,255,0.16), transparent 60%),
    radial-gradient(600px 380px at 90% 0%, rgba(255,95,162,0.10), transparent 55%),
    var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--purple-soft); text-decoration: none; font-weight: 600; }
a:hover { color: var(--pink); }

h1, h2, h3 { font-family: var(--font-head); font-weight: 700; letter-spacing: -0.01em; color: var(--text); }

/* ---------- Icon-Basis ---------- */
.icon {
  width: 22px; height: 22px;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
}
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 30px; height: 30px; }
.icon-xl { width: 44px; height: 44px; }

.icon-tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px; height: 56px;
  border-radius: var(--blob-1);
  background: linear-gradient(145deg, rgba(145,70,255,0.22), rgba(255,95,162,0.12));
  border: 2px solid var(--border-strong);
  color: var(--purple-soft);
  margin-bottom: 14px;
  box-shadow: 3px 3px 0 rgba(0,0,0,0.32);
  transition: transform 0.2s ease, border-radius 0.3s ease;
}
.icon-tile .icon { width: 26px; height: 26px; }
.icon-tile.pink { color: var(--pink); background: linear-gradient(145deg, rgba(255,95,162,0.2), rgba(255,159,28,0.1)); border-color: rgba(255,95,162,0.4); }
.icon-tile.orange { color: var(--orange); background: linear-gradient(145deg, rgba(255,159,28,0.2), rgba(255,95,162,0.08)); border-color: rgba(255,159,28,0.4); border-radius: var(--blob-2); }
.icon-tile.teal { color: var(--teal); background: linear-gradient(145deg, rgba(33,230,168,0.2), rgba(145,70,255,0.08)); border-color: rgba(33,230,168,0.4); border-radius: var(--blob-3); }

/* ---------- Deko-Elemente (Comic/Doodle) ---------- */
.squiggle-underline {
  display: block;
  width: 84px; height: 12px;
  color: var(--pink);
  margin: 8px auto 0;
}
.squiggle-underline.left { margin: 8px 0 0; }
.zap-deco { width: 22px; height: 22px; color: var(--orange); flex-shrink: 0; }
.zap-deco.spin-left { transform: rotate(-14deg); }
.zap-deco.spin-right { transform: rotate(14deg); }

/* ---------- Outline-/Comic-Überschriften ---------- */
.heading-outline {
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  -webkit-text-stroke: 1.5px var(--bg);
  paint-order: stroke fill;
}

/* ---------- Header ---------- */
header.top {
  display: flex;
  align-items: center;
  justify-content: center;
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 18px 24px;
  background: rgba(8, 7, 13, 0.75);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.logo-wrap { display: flex; align-items: center; gap: 10px; }
.logo-wrap img { width: 40px; height: 40px; filter: drop-shadow(0 0 14px rgba(145,70,255,0.45)); }
.logo-text { font-family: var(--font-head); font-weight: 700; font-size: 1.5rem; letter-spacing: -0.01em; color: var(--text); }
.logo-text .accent {
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

header.top .account {
  position: absolute;
  right: 24px; top: 50%;
  transform: translateY(-50%);
  display: flex; align-items: center; gap: 10px;
}
header.top .account img.avatar { width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--purple); }
header.top .account .name { font-weight: 600; font-size: 0.88rem; color: var(--text); }

.container { max-width: 1120px; margin: 0 auto; padding: 40px 20px 80px; }

/* ---------- Hero ---------- */
.hero { text-align: center; padding: 30px 12px 10px; position: relative; z-index: 0; }
.hero::before {
  content: '';
  position: absolute;
  inset: -10px -30px auto -30px;
  height: 320px;
  z-index: -1;
  border-radius: 50px;
  background: repeating-linear-gradient(135deg, rgba(145,70,255,0.07) 0 16px, rgba(255,95,162,0.06) 16px 32px, transparent 32px 48px);
  pointer-events: none;
}
.hero-icons { display: flex; justify-content: center; align-items: center; gap: 18px; margin-bottom: 18px; }
.hero-icons .icon { width: 30px; height: 30px; }
.hero-icons .icon:nth-child(1) { color: var(--purple-soft); }
.hero-icons .icon:nth-child(2) { color: var(--pink); }
.hero-icons .icon:nth-child(3) { color: var(--orange); }

.hero-headline { display: flex; align-items: center; justify-content: center; gap: 14px; }
.hero-headline .zap-deco { margin-bottom: 10px; }

.hero h1 {
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  font-size: 2.5rem;
  line-height: 1.22;
  letter-spacing: 0.01em;
  margin: 6px 0 18px;
  -webkit-text-stroke: 2px var(--bg);
  paint-order: stroke fill;
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p { color: var(--text-dim); font-size: 1.08rem; max-width: 660px; margin: 0 auto; line-height: 1.65; }

/* ---------- Explainer intro ---------- */
.explainer {
  text-align: center;
  padding: 6px 12px 4px;
  margin: 40px 0 8px;
}
.explainer h2 { margin: 0 0 14px; font-size: 1.5rem; color: var(--text); }
.explainer > p { color: var(--text-dim); line-height: 1.7; font-size: 1rem; max-width: 700px; margin: 0 auto; }

/* ---------- Callout-Bubbles (Comic/Doodle) ---------- */
.callout-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 22px;
  margin: 28px 0 34px;
}
.callout {
  background: var(--card);
  border: 2px solid var(--border-strong);
  border-radius: var(--blob-1);
  padding: 30px 26px;
  position: relative;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
  box-shadow: 5px 5px 0 rgba(0,0,0,0.28);
}
.callout:nth-child(2) { border-radius: var(--blob-2); }
.callout:nth-child(3) { border-radius: var(--blob-3); }
.callout:nth-child(4) { border-radius: var(--blob-4); }
.callout:hover { transform: translateY(-5px) rotate(-1deg); box-shadow: 7px 7px 0 rgba(0,0,0,0.32); }
.callout .icon-tile { margin-bottom: 16px; }
.callout h3 {
  margin: 0 0 10px; font-size: 1.05rem;
  font-family: var(--font-display); font-weight: 400;
  text-transform: uppercase; letter-spacing: 0.01em;
}
.callout p { color: var(--text-dim); font-size: 0.92rem; line-height: 1.65; margin: 0; }
.callout:nth-child(1) h3 { color: var(--purple-soft); }
.callout:nth-child(2) h3 { color: var(--pink); }
.callout:nth-child(3) h3 { color: var(--orange); }
.callout:nth-child(4) h3 { color: var(--teal); }

/* ---------- Login gate ---------- */
.login-gate {
  text-align: center;
  position: relative;
  border-radius: 40px 40px 40px 8px / 32px 32px 32px 8px;
  padding: 38px 30px;
  margin: 34px 0;
  background: linear-gradient(160deg, rgba(145,70,255,0.16), rgba(255,95,162,0.07));
  border: 2px solid var(--border-strong);
  box-shadow: var(--glow-purple), 6px 6px 0 rgba(0,0,0,0.28);
}
.login-gate h2 {
  margin-top: 0; font-size: 1.5rem;
  font-family: var(--font-display); font-weight: 400; text-transform: uppercase; letter-spacing: 0.02em;
}
.login-gate p { color: var(--text-dim); margin-bottom: 20px; }

/* ---------- Cards / Grid ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 20px; margin-top: 32px; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  border: 2px solid var(--border);
  border-top: 4px solid var(--purple);
  padding: 26px;
  position: relative;
  box-shadow: 4px 4px 0 rgba(0,0,0,0.25);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.card:nth-child(2) { border-top-color: var(--pink); }
.card:nth-child(3) { border-top-color: var(--orange); }
.card.enabled:hover { transform: translateY(-4px); border-color: var(--border-strong); box-shadow: 6px 6px 0 rgba(0,0,0,0.3), var(--glow-purple); background: var(--card-hover); }
.card.disabled { opacity: 0.55; }

.card h3 {
  margin: 0 0 8px; font-size: 1.15rem;
  font-family: var(--font-display); font-weight: 400; text-transform: uppercase; letter-spacing: 0.01em;
}
.card p { color: var(--text-dim); font-size: 0.93rem; line-height: 1.6; margin-bottom: 18px; }

.pill {
  position: absolute; top: 20px; right: 20px;
  font-size: 0.68rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em;
  padding: 5px 11px; border-radius: 999px;
  background: rgba(255,159,28,0.14); color: var(--orange);
  border: 1.5px solid rgba(255,159,28,0.35);
  transform: rotate(4deg);
}
.pill.soon { background: rgba(255,255,255,0.05); color: var(--text-faint); border-color: var(--border-strong); }

/* ---------- Buttons (Sticker-Stil) ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  border: 2.5px solid rgba(244,241,251,0.18);
  background: var(--gradient-brand);
  color: #fff;
  font-weight: 700;
  font-family: var(--font-body);
  font-size: 0.94rem;
  cursor: pointer;
  transition: transform 0.14s ease, box-shadow 0.14s ease, filter 0.18s ease;
  box-shadow: 4px 4px 0 rgba(0,0,0,0.35), 0 8px 22px rgba(145,70,255,0.22);
}
.btn .icon { width: 18px; height: 18px; }
.btn:hover { transform: translate(-2px, -2px); filter: brightness(1.08); text-decoration: none; box-shadow: 6px 6px 0 rgba(0,0,0,0.4), 0 8px 22px rgba(145,70,255,0.28); }
.btn:active { transform: translate(1px, 1px); box-shadow: 2px 2px 0 rgba(0,0,0,0.35); }
.btn.secondary {
  background: rgba(255,255,255,0.04);
  color: var(--text);
  border: 2.5px solid var(--border-strong);
  box-shadow: 3px 3px 0 rgba(0,0,0,0.25);
}
.btn.secondary:hover { background: rgba(255,255,255,0.08); border-color: var(--purple); filter: none; box-shadow: 5px 5px 0 rgba(0,0,0,0.3); }
.btn.danger { background: linear-gradient(90deg, var(--red), var(--orange)); box-shadow: 4px 4px 0 rgba(0,0,0,0.35), 0 8px 22px rgba(255,84,112,0.22); }
.btn.danger:hover { box-shadow: 6px 6px 0 rgba(0,0,0,0.4), 0 8px 22px rgba(255,84,112,0.28); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.big { padding: 15px 30px; font-size: 1.02rem; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 13px; border-radius: 999px;
  font-size: 0.74rem; font-weight: 700;
  border: 1.5px solid transparent;
}
.badge .dot { width: 7px; height: 7px; border-radius: 50%; }
.badge.on { background: rgba(33,230,168,0.12); color: var(--teal); border-color: rgba(33,230,168,0.3); }
.badge.on .dot { background: var(--teal); box-shadow: 0 0 8px var(--teal); }
.badge.off { background: rgba(255,84,112,0.12); color: var(--red); border-color: rgba(255,84,112,0.3); }
.badge.off .dot { background: var(--red); }

footer.foot { text-align: center; color: var(--text-faint); font-size: 0.85rem; padding: 34px; }

/* ---------- Wörterspiel-Seite ---------- */
.game-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; margin-bottom: 22px; }
.game-header h1 {
  font-size: 1.6rem; margin: 0; display: flex; align-items: center; gap: 12px;
  font-family: var(--font-display); font-weight: 400; text-transform: uppercase; letter-spacing: 0.01em;
  -webkit-text-stroke: 1px var(--bg); paint-order: stroke fill;
}
.game-header h1 .icon { color: var(--purple-soft); width: 28px; height: 28px; -webkit-text-stroke: 0; }

.start-screen { text-align: center; background: var(--card); border-radius: var(--radius); border: 2px solid var(--border); padding: 60px 30px; box-shadow: 4px 4px 0 rgba(0,0,0,0.22); }
.start-screen .icon-tile { margin: 0 auto 18px; }
.start-screen p { color: var(--text-dim); max-width: 480px; margin: 14px auto 0; line-height: 1.6; }

.game-layout { display: grid; grid-template-columns: 1fr 2.3fr; gap: 18px; align-items: start; }
@media (max-width: 920px) { .game-layout { grid-template-columns: 1fr; } }

.panel { background: var(--card); border-radius: var(--radius); border: 2px solid var(--border); padding: 18px; }
.panel h4 {
  margin: 0 0 14px; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--text-dim); display: flex; align-items: center; gap: 8px; font-weight: 700;
}
.panel h4 .icon { width: 17px; height: 17px; color: var(--purple-soft); }

.chat-log { height: 460px; overflow-y: auto; display: flex; flex-direction: column; gap: 7px; font-size: 0.87rem; }
.chat-log .msg { line-height: 1.4; }
.chat-log .msg .user { color: var(--purple-soft); font-weight: 700; }
.chat-log .msg.correct { background: rgba(33,230,168,0.10); border-radius: 8px; padding: 5px 8px; }

.level-status { display: flex; align-items: center; justify-content: center; gap: 8px; text-align: center; font-weight: 700; color: var(--teal); min-height: 1.8em; margin: 4px 0 16px; }
.level-status .icon { width: 18px; height: 18px; }

/* ---------- Buchstaben-Board ---------- */
.board-header { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-bottom: 6px; }
.board-level-badge {
  flex-shrink: 0;
  font-family: var(--font-display); font-weight: 400; text-transform: uppercase; font-size: 0.9rem;
  color: var(--purple-soft);
  background: linear-gradient(145deg, rgba(145,70,255,0.2), rgba(255,95,162,0.1));
  border: 2px solid var(--border-strong);
  border-radius: var(--blob-3);
  padding: 10px 18px;
  box-shadow: 3px 3px 0 rgba(0,0,0,0.3);
}
.board-goal { flex: 1; min-width: 220px; }
.goal-label { display: flex; justify-content: space-between; font-size: 0.8rem; color: var(--text-dim); margin-bottom: 6px; font-weight: 600; }
.goal-label .current { color: var(--teal); font-weight: 700; }
.goal-bar-track { height: 14px; border-radius: 999px; background: var(--bg-elev); border: 2px solid var(--border-strong); overflow: hidden; }
.goal-bar-fill { height: 100%; background: var(--gradient-brand); transition: width 0.4s ease; border-radius: 999px; }
.goal-bar-fill.reached { background: linear-gradient(90deg, var(--teal), var(--purple-soft)); }
.board-timer {
  flex-shrink: 0;
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-display); font-weight: 400; font-size: 1.3rem;
  color: var(--text);
  background: var(--bg-elev);
  border: 2px solid var(--border-strong);
  border-radius: 999px;
  padding: 8px 18px;
  box-shadow: 3px 3px 0 rgba(0,0,0,0.28);
}
.board-timer.warning { color: var(--red); border-color: var(--red); background: rgba(255,84,112,0.1); }

.letters-tray { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin: 24px 0 22px; }
.letter-tile {
  width: 52px; height: 52px;
  border-radius: var(--blob-2);
  background: linear-gradient(145deg, rgba(145,70,255,0.22), rgba(255,95,162,0.12));
  border: 2px solid var(--border-strong);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 400; font-size: 1.5rem;
  color: var(--text);
  box-shadow: 3px 3px 0 rgba(0,0,0,0.3);
  text-transform: uppercase;
}
.letter-tile.fake {
  background: linear-gradient(145deg, rgba(255,84,112,0.35), rgba(255,84,112,0.15));
  border-color: var(--red); color: var(--red);
  animation: fakePulse 1s ease infinite alternate;
}
@keyframes fakePulse {
  from { box-shadow: 3px 3px 0 rgba(0,0,0,0.3), 0 0 0 rgba(255,84,112,0.3); }
  to { box-shadow: 3px 3px 0 rgba(0,0,0,0.3), 0 0 18px rgba(255,84,112,0.75); }
}

.word-grid { column-count: 3; column-gap: 22px; }
@media (max-width: 760px) { .word-grid { column-count: 2; } }
@media (max-width: 520px) { .word-grid { column-count: 1; } }
.word-grid-row {
  break-inside: avoid;
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 9px;
}
.word-grid-row .solver-name-left {
  flex-shrink: 0; width: 64px;
  font-size: 0.68rem; font-weight: 700; color: var(--teal);
  text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.word-grid-row .word-boxes { display: flex; gap: 3px; }
.letter-box {
  width: 30px; height: 36px; border-radius: 8px;
  border: 1px solid var(--border-strong); background: var(--bg-elev);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1.02rem; text-transform: uppercase;
  color: var(--text);
}
.letter-box.sm { width: 22px; height: 27px; font-size: 0.8rem; border-radius: 6px; }
.letter-box.solved-box { border-color: var(--teal); background: rgba(33,230,168,0.10); color: var(--teal); }

table.leaderboard { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
table.leaderboard th, table.leaderboard td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border); }
table.leaderboard th { color: var(--text-faint); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; }
table.leaderboard tr:first-child td { font-weight: 700; color: var(--teal); }
table.leaderboard tbody tr:last-child td { border-bottom: none; }

.overlay-link-box {
  display: flex; gap: 10px; align-items: center; margin-top: 10px;
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px;
  font-size: 0.8rem; color: var(--text-dim); word-break: break-all;
}

.status-strip { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
