/* SPARK Design System — nach Ministyleguide (Silberschmidt)
   Orbitron Semibold (Display) + Raleway (Text), Boxsystem, keine Rundungen. */

* { box-sizing: border-box; margin: 0; }

:root {
  --black: #111111;
  --white: #ffffff;
  --paper: #f4f4f2;
  --yellow: #f6b600;
  --red:    #a42821;
  --green:  #60993b;
  --blue:   #0089b6;
  --violet: #874b83;
  --muted:  #55584f;
  --frame: 3px solid var(--black);
  --line: 2px solid var(--black);
  --mono: "SFMono-Regular", Menlo, Consolas, "Courier New", monospace;
}

body {
  font-family: "Raleway", sans-serif;
  font-weight: 500;
  background: var(--paper);
  color: var(--black);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.orb, h1, h2, h3, button, .tag, .section-label { font-family: "Orbitron", sans-serif; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }

/* ------------------------------------------------- Header mit Logo-Stack -- */
header { padding: 1.6rem 1.5rem 1rem; display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.logo-stack { display: inline-flex; flex-direction: column; }
.logo-row { display: flex; align-items: stretch; }
.logo-main { border: 0; padding: 0; background: var(--white); display: flex; align-items: center; } /* kein zweiter Rahmen: das Logo bringt seinen Rahmen mit, Weiß liegt exakt innerhalb */
.logo-main img { height: 38px; width: auto; display: block; }
.logo-sub {
  border: var(--frame); border-top: none;
  margin-left: 2.2rem; align-self: flex-start;
  background: var(--violet); color: var(--white);
  padding: 0.22rem 0.9rem;
  font-family: "Orbitron", sans-serif; font-weight: 600;
  font-size: 0.95rem; letter-spacing: 0.14em; text-transform: uppercase;
}
header nav a { color: var(--black); font-size: 0.8rem; font-weight: 700; text-decoration: none; border-bottom: 2px solid var(--black); }
header nav a:hover { color: var(--violet); border-color: var(--violet); }

main { flex: 1; padding: 0 1.5rem 1.5rem; display: flex; flex-direction: column; gap: 1.2rem; max-width: 1150px; width: 100%; margin: 0 auto; }
.panel { background: var(--white); border: var(--frame); padding: 1rem; }
.section-label {
  display: inline-block; background: var(--yellow); border: var(--line);
  padding: 0.15rem 0.6rem; font-size: 0.78rem; margin-bottom: 0.8rem;
}
.intro { color: var(--muted); font-size: 0.95rem; line-height: 1.55; max-width: 780px; }
.intro strong { background: var(--black); color: var(--white); padding: 0.05rem 0.4rem; font-weight: 700; }
.muted { color: var(--muted); font-size: 0.82rem; }

/* ----------------------------------------------------------- Eingabezeile -- */
.input-block { display: grid; grid-template-columns: auto 1fr; border: var(--frame); }
.input-label {
  background: var(--black); color: var(--white); padding: 0.8rem 1rem;
  font-family: "Orbitron", sans-serif; font-weight: 600; font-size: 0.8rem;
  letter-spacing: 0.15em; text-transform: uppercase; display: flex; align-items: center;
}
#word-input {
  border: 0; outline: none; width: 100%; min-width: 0;
  padding: 0.8rem 1.1rem; background: var(--white); color: var(--black);
  font-family: "Orbitron", sans-serif; font-weight: 600; font-size: 1.6rem; letter-spacing: 0.08em;
}
#word-input::placeholder { color: var(--muted); opacity: 0.55; font-family: "Raleway", sans-serif; font-weight: 500; font-size: 1.1rem; letter-spacing: 0; }

/* -------------------------------------------------------- Zeichen-Raster -- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 3px; background: var(--black); border: var(--frame); min-height: 150px; }
.cell { background: var(--white); display: flex; flex-direction: column; min-width: 0; }
.cell.empty { grid-column: 1 / -1; text-align: center; padding: 3rem 1rem; color: var(--muted); font-size: 0.85rem; }
.char-area { position: relative; flex: 1; min-height: 88px; display: flex; align-items: center; justify-content: center; border-bottom: var(--line); padding: 1rem; }
.cell.inv .char-area { background: var(--yellow); }
.char { font-family: "Orbitron", sans-serif; font-weight: 700; font-size: 3.4rem; line-height: 1; }
.char.space { color: transparent; }
.char.space::after { content: "␣"; color: var(--muted); }
.index-tag { position: absolute; top: 6px; left: 8px; font-family: "Orbitron", sans-serif; font-size: 0.6rem; font-weight: 600; letter-spacing: 0.1em; }
.codes { padding: 0.55rem 0.7rem; font-family: var(--mono); font-size: 0.72rem; }
.code-row { display: grid; grid-template-columns: 30px 1fr; gap: 6px; padding: 3px 0; border-top: 1px dashed rgba(17,17,17,0.3); align-items: baseline; }
.code-row:first-child { border-top: none; }
.code-label { font-family: "Orbitron", sans-serif; font-size: 0.6rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.code-val { font-weight: 700; text-align: right; overflow-wrap: anywhere; }

/* --------------------------------------------------------- Bit-Sequenz --- */
.sequence-wrap { border: var(--frame); background: var(--white); }
.sequence-meta { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; padding: 0.55rem 0.9rem; background: var(--black); color: var(--white); font-family: "Orbitron", sans-serif; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.15em; text-transform: uppercase; }
.sequence { padding: 1.2rem 0.9rem; display: flex; flex-wrap: wrap; gap: 5px; }
.byte { font-family: var(--mono); font-weight: 700; font-size: 0.95rem; letter-spacing: 0.1em; padding: 0.4rem 0.6rem; border: var(--line); white-space: nowrap; position: relative; }
.byte.inv { background: var(--yellow); }
@media (hover: hover) {
  .byte:hover { transform: translate(-2px,-2px); box-shadow: 4px 4px 0 var(--black); }
  .byte::before { content: attr(data-char); position: absolute; top: -20px; left: 50%; transform: translateX(-50%); font-family: "Orbitron", sans-serif; font-size: 0.75rem; opacity: 0; transition: opacity .15s; pointer-events: none; }
  .byte:hover::before { opacity: 1; }
}
.sequence-empty { width: 100%; text-align: center; padding: 1.2rem; color: var(--muted); font-size: 0.85rem; }

/* --------------------------------------------------------------- Buttons -- */
button {
  border: var(--frame); background: var(--yellow); color: var(--black);
  padding: 0.6rem 1rem; font-size: 0.85rem; cursor: pointer;
  transition: background .1s, color .1s;
}
button:hover:not(:disabled) { background: var(--black); color: var(--yellow); }
button:disabled { background: var(--paper); color: #9a9d94; border-color: #9a9d94; cursor: not-allowed; }
button.secondary { background: var(--white); border: var(--line); font-size: 0.72rem; padding: 0.4rem 0.7rem; }
button.secondary:hover:not(:disabled) { background: var(--black); color: var(--white); }
button.small-inv { background: var(--white); border: 0; color: var(--black); font-size: 0.68rem; padding: 0.3rem 0.6rem; }
button.small-inv:hover:not(:disabled) { background: var(--yellow); color: var(--black); }
button.danger { background: var(--white); border: var(--line); border-color: var(--red); color: var(--red); font-size: 0.72rem; padding: 0.4rem 0.7rem; }
button.danger:hover:not(:disabled) { background: var(--red); color: var(--white); }

.submit-block { display: grid; grid-template-columns: 1fr auto; border: var(--frame); align-items: stretch; }
.submit-copy { padding: 0.9rem 1.1rem; }
.submit-copy strong { display: block; font-family: "Orbitron", sans-serif; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.12em; margin-bottom: 0.2rem; }
.submit-copy span { font-size: 0.85rem; color: var(--muted); }
.submit-block button { border: 0; border-left: var(--frame); }
.status { min-height: 1.2rem; font-size: 0.85rem; font-weight: 700; margin-top: 0.4rem; }
.status.ok { color: var(--green); }
.status.err { color: var(--red); }

/* ---------------------------------------------------------- Auswertung ---- */
.toolbar { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; }
.toolbar .spacer { flex: 1; }
.day { border: var(--frame); background: var(--white); }
.day-head { display: flex; justify-content: space-between; align-items: center; gap: 0.6rem; padding: 0.6rem 0.9rem; background: var(--black); color: var(--white); flex-wrap: wrap; }
.day-head .date { font-family: "Orbitron", sans-serif; font-weight: 600; font-size: 0.95rem; letter-spacing: 0.06em; text-transform: uppercase; }
.day-head .count { font-size: 0.8rem; opacity: 0.85; }
.entry { display: grid; grid-template-columns: minmax(130px, .5fr) minmax(0, 1.5fr) auto auto; gap: 0.8rem; align-items: center; padding: 0.7rem 0.9rem; border-bottom: 1px dashed rgba(17,17,17,0.3); }
.entry:last-child { border-bottom: 0; }
.entry .name { font-family: "Orbitron", sans-serif; font-weight: 600; font-size: 0.95rem; }
.entry .time { font-size: 0.75rem; color: var(--muted); }
.entry .bin { font-family: var(--mono); font-weight: 700; font-size: 0.78rem; line-height: 1.5; overflow-wrap: anywhere; }
.empty-box { border: var(--frame); border-style: dashed; padding: 2rem; text-align: center; color: var(--muted); }

.login { max-width: 420px; margin: 3rem auto; }
.login label { display: block; font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.4rem; }
.login input { width: 100%; padding: 0.6rem; border: var(--line); font-family: "Raleway", sans-serif; font-size: 1rem; margin-bottom: 0.8rem; }
.login button { width: 100%; }

footer { padding: 0.8rem 1.5rem 1.2rem; color: var(--muted); font-size: 0.8rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
footer a { color: var(--black); }

@media (max-width: 720px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  .char { font-size: 2.6rem; }
  #word-input { font-size: 1.2rem; }
  .submit-block { grid-template-columns: 1fr; }
  .submit-block button { border-left: 0; border-top: var(--frame); }
  .entry { grid-template-columns: 1fr auto; }
  .entry .bin { grid-column: 1 / -1; }
}

/* ================================================= Feedback-spezifisch ==== */
.logo-sub { background: var(--blue); }

.lang-switch { display: inline-flex; border: var(--frame); }
.lang-switch button {
  border: 0; margin: 0; width: auto; padding: 0.45rem 0.9rem;
  background: var(--white); color: var(--black); font-size: 0.85rem;
}
.lang-switch button + button { border-left: var(--line); }
.lang-switch button.active { background: var(--blue); color: var(--white); }
.lang-switch button:hover:not(.active) { background: var(--paper); color: var(--black); }

.q-title { font-family: "Orbitron", sans-serif; font-weight: 600; font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.7rem; }
.q-optional { color: var(--muted); font-family: "Raleway", sans-serif; font-weight: 600; font-size: 0.72rem; text-transform: none; letter-spacing: 0; }

.smileys { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.smiley {
  border: var(--line); background: var(--white); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 0.3rem;
  padding: 0.7rem 0.2rem; margin: 0; width: auto;
}
.smiley .face { font-size: 1.9rem; line-height: 1; filter: grayscale(1); transition: filter .1s, transform .1s; }
.smiley .lab { font-family: "Raleway", sans-serif; font-weight: 600; font-size: 0.68rem; color: var(--muted); text-transform: none; letter-spacing: 0; text-align: center; }
.smiley:hover { background: var(--paper); }
.smiley:hover .face { filter: grayscale(0); }
.smiley.sel { border: var(--frame); background: var(--yellow); }
.smiley.sel .face { filter: grayscale(0); transform: scale(1.15); }
.smiley.sel .lab { color: var(--black); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-btn {
  border: var(--line); background: var(--white); color: var(--black);
  padding: 0.45rem 0.8rem; margin: 0; width: auto;
  font-family: "Raleway", sans-serif; font-weight: 700; font-size: 0.85rem; text-transform: none; letter-spacing: 0;
}
.chip-btn.sel { background: var(--black); color: var(--white); }

.aspect-row { display: grid; grid-template-columns: 1fr auto; gap: 0.6rem; align-items: center; padding: 0.45rem 0; border-top: 1px dashed rgba(17,17,17,0.3); }
.aspect-row:first-of-type { border-top: 0; }
.aspect-name { font-weight: 700; font-size: 0.9rem; }
.tri { display: inline-flex; border: var(--line); }
.tri button { border: 0; margin: 0; width: auto; background: var(--white); padding: 0.35rem 0.7rem; font-size: 1rem; }
.tri button + button { border-left: var(--line); }
.tri button.sel { background: var(--blue); }

textarea {
  width: 100%; border: var(--line); padding: 0.7rem; min-height: 110px;
  font-family: "Raleway", sans-serif; font-weight: 500; font-size: 0.95rem;
  background: var(--white); resize: vertical; outline: none;
}
textarea:focus { border-color: var(--blue); }

details.contact { border: var(--line); background: var(--white); }
details.contact summary {
  cursor: pointer; list-style: none; padding: 0.7rem 0.9rem;
  font-family: "Orbitron", sans-serif; font-weight: 600; font-size: 0.78rem;
  text-transform: uppercase; letter-spacing: 0.08em;
}
details.contact summary::before { content: "+ "; }
details.contact[open] summary::before { content: "− "; }
details.contact .fields { padding: 0 0.9rem 0.9rem; display: grid; gap: 0.6rem; }
details.contact input {
  width: 100%; border: var(--line); padding: 0.55rem;
  font-family: "Raleway", sans-serif; font-size: 0.95rem; outline: none;
}
details.contact input:focus { border-color: var(--blue); }
.privacy-note { font-size: 0.75rem; color: var(--muted); }

.thanks { text-align: center; padding: 3rem 1rem; }
.thanks .big { font-size: 3rem; margin-bottom: 0.8rem; }
.thanks h2 { font-size: 1.3rem; margin-bottom: 0.5rem; }

/* Admin-Statistik */
.statgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.6rem; }
.statbox { border: var(--line); padding: 0.6rem 0.8rem; background: var(--white); }
.statbox .label { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.statbox .value { font-family: "Orbitron", sans-serif; font-weight: 600; font-size: 1.5rem; margin-top: 0.15rem; }
.statbox.hl { background: var(--yellow); border: var(--frame); }
.hbar { display: grid; grid-template-columns: 120px 1fr 34px; gap: 8px; align-items: center; padding: 3px 0; font-size: 0.85rem; }
.hbar .track { background: var(--paper); border: 1px solid var(--black); height: 16px; }
.hbar .fill { background: var(--blue); height: 100%; }
.hbar.r5 .fill { background: var(--green); }
.hbar.r1 .fill, .hbar.r2 .fill { background: var(--red); }
.comment-card { border: var(--line); border-left-width: 10px; border-left-color: var(--blue); background: var(--white); padding: 0.6rem 0.8rem; }
.comment-card .meta { font-size: 0.72rem; color: var(--muted); margin-bottom: 0.25rem; display: flex; gap: 0.8rem; flex-wrap: wrap; align-items: center; }
.comment-card .contact-tag { background: var(--yellow); border: 1px solid var(--black); padding: 0 0.4rem; font-weight: 700; color: var(--black); }
.rating-pill { font-family: "Orbitron", sans-serif; font-weight: 600; }
.cards { display: flex; flex-direction: column; gap: 0.6rem; }

@media (max-width: 560px) {
  .smileys { grid-template-columns: repeat(5, 1fr); }
  .smiley .lab { display: none; }
  .aspect-row { grid-template-columns: 1fr; }
}

/* Fixes: Spans brauchen block-Display für Höhen/Zeilenumbruch */
.statbox .label, .statbox .value { display: block; }
.hbar .track { display: block; }
.hbar .fill { display: block; }

/* Sprachumschalter: zentral oben mittig statt am rechten Rand */
header { position: relative; }
header .lang-switch { position: absolute; left: 50%; top: 1.6rem; transform: translateX(-50%); }
@media (max-width: 640px) {
  header .lang-switch { position: static; transform: none; margin-top: 0.4rem; }
}

/* Logo verlinkt zur Projektübersicht */
a.logo-main { text-decoration: none; cursor: pointer; transition: background .1s; }
a.logo-main:hover { background: var(--paper); }

/* Mobile-Fix: Aspekt-Buttons nicht auf volle Breite strecken */
@media (max-width: 560px) {
  .aspect-row .tri { justify-self: start; width: max-content; }
  footer { justify-content: center; text-align: center; }
}
