/*
 * OpenYardage · username.css
 * Gehört zu public/js/username.js (Benutzername statt Klarname, Pflichtschritt
 * nach der ersten Anmeldung).
 * Einbindung durch die Integration:  <link rel="stylesheet" href="css/username.css">
 *
 * Design-Tokens aus dem :root von index.html. Jede Angabe trägt denselben Wert
 * als Fallback, damit der Dialog auch allein läuft (Testseite, ds/-Karte).
 * Papier #ece7db, Karte #fffdf7, Ink #21251f, gedämpft #6b6252, schwach #8a8170,
 * Linien #d8d1c0, Grün #2f6b46.
 * Rot #b23a2e ausschliesslich für Fehler: für einen belegten Namen, für einen
 * abgebrochenen Nachzug. NICHT für den Dialog selbst. Er ist kein Alarm,
 * sondern eine Frage, die einmal beantwortet werden will.
 * Georgia für Fliesstext, 'Courier New' für alle Beschriftungen in
 * Grossbuchstaben, Radien durchgehend 3px.
 */

/* ==========================================================================
   Overlay. Deckt die Seite ab, denn der Schritt ist Pflicht: was darunter
   liegt, ist gerade nicht bedienbar und soll auch nicht danach aussehen.
   Etwas dunkler als beim Melde-Dialog, weil hier nichts zum Wegklicken ist.
   ========================================================================== */
.oy-un-ovl {
  position: fixed; inset: 0; z-index: 960;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 24px 14px;
  background: rgba(33, 37, 31, .58);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
/* [hidden] muss gegen display:flex und display:grid gewinnen */
.oy-un-ovl[hidden],
.oy-un [hidden] { display: none !important; }

.oy-un {
  width: 100%; max-width: 520px; margin: auto;
  background: var(--card2, #fffdf7);
  border: 1.5px solid var(--line2, #c9c1ad); border-radius: 3px;
  box-shadow: 0 10px 34px rgba(33, 37, 31, .26);
  color: var(--ink, #21251f);
}

/* Kurzer Ruck, wenn jemand Escape drückt oder daneben klickt. Keine Farbe,
   kein Ton: der Dialog schimpft nicht, er bleibt nur stehen. */
.oy-un-nope { animation: oy-un-shake .22s ease-in-out; }
@keyframes oy-un-shake {
  0%, 100% { transform: translateX(0); }
  25%      { transform: translateX(-4px); }
  75%      { transform: translateX(4px); }
}
@media (prefers-reduced-motion: reduce) {
  .oy-un-nope { animation: none; }
}

/* ==========================================================================
   Kopf
   ========================================================================== */
.oy-un-head {
  padding: 16px 18px 13px;
  border-bottom: 1px solid var(--line, #d8d1c0);
  background: var(--card, #faf7ef);
}
.oy-un-title {
  margin: 0;
  font-family: var(--mono, 'Courier New', Courier, monospace);
  font-size: 13px; font-weight: 700; letter-spacing: .17em;
  color: var(--ink, #21251f);
}
.oy-un-sub {
  margin-top: 5px;
  font-family: var(--mono, 'Courier New', Courier, monospace);
  font-size: 10.5px; font-weight: 700; letter-spacing: .1em;
  color: var(--faint, #8a8170);
}

/* ==========================================================================
   Rümpfe
   ========================================================================== */
.oy-un-body,
.oy-un-prog,
.oy-un-done { padding: 16px 18px 18px; }

.oy-un-p {
  margin: 0 0 12px;
  font-family: var(--serif, Georgia, 'Times New Roman', serif);
  font-size: 13.5px; line-height: 1.6;
  color: var(--ink2, #4a463c);
}

/* Der eine Satz, der das Problem zeigt: hier stünde sonst der Klarname.
   Sieht aus wie ein Zettel, nicht wie eine Warnung. */
.oy-un-now {
  margin: 0 0 16px;
  padding: 9px 11px;
  border: 1px dashed var(--line2, #c9c1ad); border-radius: 3px;
  background: var(--card, #faf7ef);
  font-family: var(--serif, Georgia, 'Times New Roman', serif);
  font-size: 12.5px; line-height: 1.5; font-style: italic;
  color: var(--mut, #6b6252);
}
.oy-un-now b { font-style: normal; color: var(--ink, #21251f); }

/* ==========================================================================
   Eingabefeld
   ========================================================================== */
.oy-un-field { margin: 0 0 16px; }

.oy-un-lb {
  display: block; margin: 0 0 6px;
  font-family: var(--mono, 'Courier New', Courier, monospace);
  font-size: 9.5px; font-weight: 700; letter-spacing: .16em;
  color: var(--mut, #6b6252);
}

.oy-un-inwrap {
  display: flex; align-items: stretch;
  border: 1px solid var(--line2, #c9c1ad); border-radius: 3px;
  background: var(--card2, #fffdf7);
  overflow: hidden;
}
.oy-un-inwrap:focus-within {
  border-color: var(--green, #2f6b46);
  box-shadow: 0 0 0 2px var(--green-bg, #f2f6ee);
}
.oy-un-at {
  display: flex; align-items: center;
  padding: 0 2px 0 11px;
  font-family: var(--mono, 'Courier New', Courier, monospace);
  font-size: 15px; font-weight: 700;
  color: var(--ghost, #b8ae98);
}
.oy-un-in {
  flex: 1; min-width: 0;
  padding: 10px 11px 10px 3px;
  border: 0; outline: none; background: none;
  font-family: var(--mono, 'Courier New', Courier, monospace);
  font-size: 15px; letter-spacing: .04em;
  color: var(--ink, #21251f);
}
.oy-un-in::placeholder { color: var(--ghost, #b8ae98); letter-spacing: .02em; }

/* ---------- Rückmeldung unter dem Feld ----------
   Eine Zeile, immer an derselben Stelle. Sie ist per aria-live verdrahtet,
   deshalb darf sie nicht springen: min-height hält den Platz frei. */
.oy-un-status {
  margin: 7px 0 0; min-height: 15px;
  font-family: var(--mono, 'Courier New', Courier, monospace);
  font-size: 10.5px; font-weight: 700; letter-spacing: .08em;
  color: var(--mut, #6b6252);
}
.oy-un-status.ok     { color: var(--green, #2f6b46); }
.oy-un-status.fehler { color: var(--red, #b23a2e); }
.oy-un-status.warte  { color: var(--faint, #8a8170); }
.oy-un-status.warn   { color: var(--gold, #a08c4f); }

.oy-un-rules {
  margin: 7px 0 0;
  font-family: var(--serif, Georgia, 'Times New Roman', serif);
  font-size: 12px; line-height: 1.5;
  color: var(--faint, #8a8170);
}

/* ==========================================================================
   Vorschläge
   ========================================================================== */
.oy-un-sugg { margin: 0 0 14px; }

.oy-un-chips {
  display: flex; flex-wrap: wrap; gap: 7px;
  min-height: 30px;
}
.oy-un-chip {
  font-family: var(--mono, 'Courier New', Courier, monospace);
  font-size: 11.5px; font-weight: 700; letter-spacing: .04em;
  padding: 7px 10px;
  border: 1px solid var(--line, #d8d1c0); border-radius: 3px;
  background: var(--card, #faf7ef); color: var(--ink2, #4a463c);
  cursor: pointer;
  transition: color .12s, border-color .12s, background .12s;
}
.oy-un-chip:hover,
.oy-un-chip:focus-visible {
  color: var(--green, #2f6b46);
  border-color: var(--green, #2f6b46);
  background: var(--green-bg, #f2f6ee);
  outline: none;
}

.oy-un-wait {
  display: inline-flex; align-items: center;
  font-family: var(--mono, 'Courier New', Courier, monospace);
  font-size: 10.5px; font-weight: 700; letter-spacing: .1em;
  color: var(--ghost, #b8ae98);
}

.oy-un-more {
  margin-top: 9px; padding: 0;
  border: 0; background: none;
  font-family: var(--mono, 'Courier New', Courier, monospace);
  font-size: 9.5px; font-weight: 700; letter-spacing: .12em;
  color: var(--faint, #8a8170);
  text-decoration: underline; text-underline-offset: 3px;
  cursor: pointer;
}
.oy-un-more:hover:not([disabled]),
.oy-un-more:focus-visible { color: var(--mut, #6b6252); outline: none; }
.oy-un-more[disabled] { color: var(--ghost, #b8ae98); cursor: default; }

/* ==========================================================================
   Hinweis: was der Name kostet. Steht bewusst VOR dem Knopf, nicht danach.
   ========================================================================== */
.oy-un-note {
  margin: 0 0 16px;
  padding: 10px 12px;
  border-left: 2px solid var(--line2, #c9c1ad);
  font-family: var(--serif, Georgia, 'Times New Roman', serif);
  font-size: 12.5px; line-height: 1.55;
  color: var(--mut, #6b6252);
}

/* ==========================================================================
   Fuss und Knöpfe
   ========================================================================== */
.oy-un-foot {
  display: flex; align-items: center; gap: 10px;
  padding-top: 4px;
}

.oy-un-go {
  font-family: var(--mono, 'Courier New', Courier, monospace);
  font-size: 11px; font-weight: 700; letter-spacing: .14em;
  padding: 11px 18px;
  border: 1px solid var(--green, #2f6b46); border-radius: 3px;
  background: var(--green, #2f6b46); color: #fffdf7;
  cursor: pointer;
  transition: background .12s, border-color .12s;
}
.oy-un-go:hover:not([disabled]),
.oy-un-go:focus-visible {
  background: var(--green-dk, #1d4a2f); border-color: var(--green-dk, #1d4a2f);
  outline: none;
}
.oy-un-go:focus-visible { box-shadow: 0 0 0 2px var(--green-bg, #f2f6ee); }
.oy-un-go[disabled] {
  background: var(--card, #faf7ef);
  border-color: var(--line, #d8d1c0);
  color: var(--ghost, #b8ae98);
  cursor: default;
}

/* "SPÄTER" erscheint erst, wenn der Name steht und nur noch der Nachzug
   aussteht. Zurückhaltend: es ist der Ausweg, nicht der Weg. */
.oy-un-later {
  font-family: var(--mono, 'Courier New', Courier, monospace);
  font-size: 10.5px; font-weight: 700; letter-spacing: .12em;
  padding: 11px 14px;
  border: 1px solid var(--line, #d8d1c0); border-radius: 3px;
  background: none; color: var(--mut, #6b6252);
  cursor: pointer;
}
.oy-un-later:hover,
.oy-un-later:focus-visible {
  color: var(--ink, #21251f); border-color: var(--line2, #c9c1ad);
  background: var(--card, #faf7ef); outline: none;
}

/* ==========================================================================
   Fortschritt beim Nachziehen der Books
   ========================================================================== */
.oy-un-log {
  margin: 0 0 12px; padding: 0; list-style: none;
  border: 1px solid var(--line, #d8d1c0); border-radius: 3px;
  background: var(--card, #faf7ef);
}
.oy-un-logline {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line3, #eee8da);
  font-family: var(--mono, 'Courier New', Courier, monospace);
  font-size: 10.5px; font-weight: 700; letter-spacing: .08em;
  color: var(--mut, #6b6252);
}
.oy-un-logline:last-child { border-bottom: 0; }
.oy-un-logline.ok     { color: var(--green, #2f6b46); }
.oy-un-logline.warte  { color: var(--faint, #8a8170); }
.oy-un-logline.fehler { color: var(--red, #b23a2e); background: var(--red-bg, #fdf6f4); }
/* Der erklärende Satz nach einem Abbruch ist Fliesstext, keine Protokollzeile. */
.oy-un-logline.hinweis {
  font-family: var(--serif, Georgia, 'Times New Roman', serif);
  font-size: 12.5px; font-weight: 400; letter-spacing: 0; line-height: 1.55;
  color: var(--mut, #6b6252);
}

/* ==========================================================================
   Schmale Geräte
   ========================================================================== */
@media (max-width: 480px) {
  .oy-un-ovl { padding: 12px 10px; }
  .oy-un-body,
  .oy-un-prog,
  .oy-un-done { padding: 14px 14px 16px; }
  .oy-un-foot { flex-wrap: wrap; }
  .oy-un-go { width: 100%; }
}
