/* Zockle – im Look von ECHO Tools Hub und Server Center:
   tiefes Blauschwarz, ein violetter Akzent, weiche Karten, gedämpfte Statusfarben. */

:root {
  color-scheme: dark;
  --bg: #0d1016;
  --bg-secondary: #10141c;
  --card: #151a23;
  --card-hover: #1b2130;
  --line: #252c3b;
  --fg: #e6e9f2;
  --muted: #8b93a7;
  --dim: #5f677b;
  --accent: #8b7cf8;
  --accent-strong: #7566ee;
  --accent-dim: rgba(139, 124, 248, 0.14);
  --ok: #4fc79d;
  --warning: #e0b25a;
  --error: #e5616f;
  --radius: 18px;
  --sans: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
}

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

html { font-size: 16px; }

body {
  min-width: 300px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--fg);
  font-family: var(--sans);
  line-height: 1.55;
  background:
    radial-gradient(900px 520px at 50% 0%, rgba(110, 90, 230, 0.22), transparent 70%),
    var(--bg);
}

button, input { font: inherit; }
h1, h2, p { margin-top: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.app-shell {
  width: min(1184px, calc(100% - 48px));
  margin: 0 auto;
  padding: 28px 0 64px;
}

/* ---------- Navigation ---------- */
.tool-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 28px;
}

.tool-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  width: fit-content;
  padding: 0.4rem 0.9rem;
  color: var(--muted);
  font-size: 0.82rem;
  text-decoration: none;
  background: rgba(21, 26, 35, 0.7);
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: color 0.18s ease, border-color 0.18s ease;
}
a.tool-nav-link:hover { color: var(--fg); border-color: var(--accent); }

.nav-arrow {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Kopf ---------- */
.hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 28px;
}

h1 {
  margin-bottom: 6px;
  font-size: clamp(2rem, 5vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.puzzle-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 10px;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0;
  vertical-align: middle;
  background: var(--accent-dim);
  border: 1px solid rgba(139, 124, 248, 0.4);
  border-radius: 999px;
}
.puzzle-badge:empty { display: none; }

h2 {
  margin-bottom: 6px;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.eyebrow {
  display: block;
  margin-bottom: 10px;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.subtitle {
  max-width: 520px;
  margin-bottom: 0;
  color: var(--muted);
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(72px, 1fr));
  margin: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.stats > div { padding: 10px 14px; text-align: center; }
.stats > div + div { border-left: 1px solid var(--line); }
.stats dt {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.stats dd { margin: 0; font-size: 1.4rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.3; }

/* ---------- Karten ---------- */
.panel {
  margin-bottom: 20px;
  padding: 22px 24px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

/* ---------- Hinweise ---------- */
.hints { margin-bottom: 22px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }

.name-pattern {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin-bottom: 16px;
}
.pattern-word { display: inline-flex; gap: 5px; }
.pattern-slot, .pattern-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.9rem;
  height: 2.3rem;
  font-size: 1.05rem;
  font-weight: 700;
  text-transform: uppercase;
}
.pattern-slot {
  background: var(--bg-secondary);
  border: 1px solid var(--line);
  border-radius: 9px;
}
.pattern-slot.is-shown {
  color: #d9d3ff;
  background: var(--accent-dim);
  border-color: rgba(139, 124, 248, 0.55);
}
.pattern-mark { width: auto; min-width: 0.6rem; color: var(--muted); }

.hint-image {
  display: block;
  width: min(100%, 460px);
  height: auto;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  image-rendering: pixelated;
}
.hint-image[hidden] { display: none; }
.hint-note { margin: 0; color: var(--dim); font-size: 0.8rem; }
.hint-note:empty { display: none; }

/* ---------- Eingabe ---------- */
.combo { position: relative; }

#guess-input {
  width: 100%;
  min-height: 52px;
  padding: 12px 18px;
  color: var(--fg);
  font-size: 1.02rem;
  background: var(--bg-secondary);
  border: 1px solid var(--line);
  border-radius: 14px;
  transition: border-color 0.18s ease;
}
#guess-input::placeholder { color: var(--dim); }
#guess-input:hover { border-color: #323b50; }
#guess-input:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }

.suggestions {
  position: absolute;
  z-index: 10;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--card-hover);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}
.suggestion {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 9px;
  cursor: pointer;
}
.suggestion.is-active, .suggestion:hover { background: var(--accent-dim); color: #fff; }
.suggestion-year { color: var(--muted); font-size: 0.85rem; }

.status { min-height: 1.2em; margin: 10px 0 0; color: var(--error); font-size: 0.85rem; }
.status:empty { display: none; }

/* ---------- Ergebnis ---------- */
.result-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 24px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}
.result-meta strong { color: var(--fg); font-variant-numeric: tabular-nums; }

.button {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 20px;
  color: #0d0a22;
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  background: linear-gradient(180deg, #9a8cff, var(--accent-strong));
  border-radius: 12px;
  transition: filter 0.18s ease;
}
.button:hover { filter: brightness(1.08); }

/* ---------- Tipp-Tafel ---------- */
.board {
  margin-bottom: 20px;
  padding: 10px;
  overflow-x: auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.board-row {
  display: grid;
  grid-template-columns: minmax(170px, 1.6fr) 84px repeat(3, minmax(110px, 1fr)) minmax(100px, 0.9fr) minmax(110px, 1fr) 90px 100px;
  gap: 6px;
  min-width: 1020px;
}
#board-rows .board-row { margin-top: 6px; }

.cell {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 56px;
  padding: 8px 10px;
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.3;
  text-align: center;
  overflow-wrap: anywhere;
  border: 1px solid transparent;
  border-radius: 10px;
}
.cell--name {
  position: sticky;
  left: 0;
  z-index: 1;
  justify-content: flex-start;
  text-align: left;
  font-weight: 600;
  background: var(--bg-secondary);
  border-color: var(--line);
}

.board-row--head .cell {
  min-height: 0;
  padding: 4px 10px 6px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: none;
  border: 0;
}

.cell--hit { color: #9be6c8; background: rgba(79, 199, 157, 0.14); border-color: rgba(79, 199, 157, 0.4); }
.cell--near { color: #f0cf8f; background: rgba(224, 178, 90, 0.13); border-color: rgba(224, 178, 90, 0.4); }
.cell--miss { color: #f5a1ab; background: rgba(229, 97, 111, 0.1); border-color: rgba(229, 97, 111, 0.35); }

#board-rows .board-row:first-child .cell:not(.cell--name) { animation: flip 0.35s ease both; }
#board-rows .board-row:first-child .cell:nth-child(3) { animation-delay: 0.05s; }
#board-rows .board-row:first-child .cell:nth-child(4) { animation-delay: 0.1s; }
#board-rows .board-row:first-child .cell:nth-child(5) { animation-delay: 0.15s; }
#board-rows .board-row:first-child .cell:nth-child(6) { animation-delay: 0.2s; }
#board-rows .board-row:first-child .cell:nth-child(7) { animation-delay: 0.25s; }
#board-rows .board-row:first-child .cell:nth-child(8) { animation-delay: 0.3s; }
#board-rows .board-row:first-child .cell:nth-child(9) { animation-delay: 0.35s; }
@keyframes flip { from { transform: rotateX(90deg); } to { transform: rotateX(0); } }

.arrow { font-size: 0.85rem; }

/* ---------- Hilfe ---------- */
.help summary { margin: 0; cursor: pointer; }
.help ul { margin: 14px 0 0; padding-left: 20px; color: var(--muted); font-size: 0.9rem; }
.help li + li { margin-top: 6px; }
.swatch { display: inline-block; width: 0.9em; height: 0.9em; vertical-align: -0.1em; border-radius: 3px; border: 1px solid; }
.swatch--hit { background: rgba(79, 199, 157, 0.35); border-color: var(--ok); }
.swatch--near { background: rgba(224, 178, 90, 0.35); border-color: var(--warning); }
.swatch--miss { background: rgba(229, 97, 111, 0.3); border-color: var(--error); }

@media (max-width: 860px) {
  .hero { flex-direction: column; align-items: stretch; }
}

@media (max-width: 720px) {
  .app-shell { width: min(100% - 32px, 1184px); padding-top: 18px; }
  .panel { padding: 16px; }
  .stats > div { padding: 8px 4px; }
  .board-row { grid-template-columns: 120px 92px repeat(3, 110px) 100px 110px 90px 100px; min-width: 0; width: max-content; }
  .cell--name { font-size: 0.78rem; }
}

@media (max-width: 480px) {
  .name-pattern { gap: 8px 14px; }
  .pattern-word { gap: 3px; }
  .pattern-slot, .pattern-mark { width: 1.35rem; height: 1.8rem; font-size: 0.85rem; }
  .pattern-mark { width: auto; }
}

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