/* wordle.hoshibi.de – flach, Hoshibi Dark. Keine Inline-Styles (CSP), Statusfarben als Variablen. */
:root {
  --bg: #09090b; --bar: #0d0f14; --surf: #11131a; --raise: #161922; --raise2: #1c202b;
  --line: rgba(255, 255, 255, .08); --line2: rgba(255, 255, 255, .16);
  --tx: #f4f4f6; --mute: #9ca3af;
  --accent: #7fa05a;
  --c2: #4f9d69; --c1: #c9a227; --c0: #2a2e3a; --on: #fff;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}
:root.hc { --c2: #e07a2f; --c1: #5aa9e6; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100dvh; display: flex; flex-direction: column; background: var(--bg); color: var(--tx); font: 16px/1.5 var(--sans); }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.sr, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip:focus { position: fixed; top: 8px; left: 8px; z-index: 50; background: var(--tx); color: var(--bg); padding: 8px 12px; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button { font: inherit; color: inherit; cursor: pointer; }

/* Kopf */
.top { background: var(--bar); border-bottom: 1px solid var(--line); }
.top-in { max-width: 560px; margin: 0 auto; height: 52px; padding: 0 12px; display: flex; align-items: center; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; letter-spacing: .01em; }
.mark { width: 26px; height: 26px; display: grid; place-items: center; background: var(--accent); color: #0b0d08; border-radius: 4px; font-weight: 800; font-size: 15px; }
.eco { display: flex; gap: 14px; margin-left: 6px; font-size: 14px; }
.eco a { color: var(--mute); text-decoration: none; padding: 4px 0; }
.eco a:hover { color: var(--tx); }
.tools { margin-left: auto; display: flex; gap: 2px; }
.ic { width: 40px; height: 40px; display: grid; place-items: center; background: none; border: 0; border-radius: 4px; color: var(--mute); }
.ic:hover { color: var(--tx); background: var(--raise); }
.ic svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Leiste */
.bar { max-width: 560px; width: 100%; margin: 0 auto; padding: 12px 12px 4px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.seg { display: inline-flex; border: 1px solid var(--line2); border-radius: 4px; overflow: hidden; }
.seg button { background: none; border: 0; padding: 7px 14px; color: var(--mute); font-size: 14px; }
.seg button + button { border-left: 1px solid var(--line2); }
.seg button[aria-pressed="true"] { background: var(--raise2); color: var(--tx); box-shadow: inset 0 -2px 0 var(--accent); }
.seg button:disabled { opacity: .4; cursor: not-allowed; }
.seg.small { margin-bottom: 8px; }
.sel select, .opt select { appearance: none; background: var(--surf) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%239ca3af' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 10px center / 10px; color: var(--tx); border: 1px solid var(--line2); border-radius: 4px; padding: 7px 30px 7px 12px; font: inherit; font-size: 14px; max-width: 100%; }
.meta { margin-left: auto; color: var(--mute); font-size: 13px; }

/* Spiel */
main { flex: 1; width: 100%; max-width: 560px; margin: 0 auto; padding: 8px 12px 12px; display: flex; flex-direction: column; align-items: center; gap: 12px; position: relative; }
.banner { width: 100%; border: 1px solid var(--line2); border-left: 3px solid var(--c1); background: var(--surf); padding: 10px 12px; font-size: 14px; }
.toast { position: absolute; top: 4px; left: 50%; transform: translateX(-50%); z-index: 5; background: var(--tx); color: var(--bg); padding: 8px 14px; border-radius: 4px; font-weight: 600; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .15s; white-space: nowrap; max-width: 92%; overflow: hidden; text-overflow: ellipsis; }
.toast.on { opacity: 1; }
.board { display: grid; grid-template-rows: repeat(6, 1fr); gap: 5px; width: min(100%, 330px, calc((100dvh - 360px) * 5 / 6)); min-width: 220px; }
.row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; }
.t { aspect-ratio: 1; display: grid; place-items: center; border: 2px solid var(--line2); border-radius: 3px; background: transparent; font-weight: 800; font-size: clamp(22px, 8vw, 32px); text-transform: uppercase; user-select: none; line-height: 1; }
.t.f { border-color: rgba(255, 255, 255, .38); }
.t.pop { animation: pop .1s ease-out; }
.t.c0, .t.c1, .t.c2 { color: var(--on); border-color: transparent; }
.t.c0 { background: var(--c0); } .t.c1 { background: var(--c1); } .t.c2 { background: var(--c2); }
.t.flip { animation: flip .5s ease-in-out; }
.row.shake { animation: shake .45s; }
.row.bounce .t { animation: bounce .6s; }
@keyframes pop { 50% { transform: scale(1.1); } }
@keyframes flip { 0% { transform: scaleY(1); } 50% { transform: scaleY(0); } 100% { transform: scaleY(1); } }
@keyframes shake { 10%, 90% { transform: translateX(-2px); } 20%, 80% { transform: translateX(4px); } 30%, 50%, 70% { transform: translateX(-6px); } 40%, 60% { transform: translateX(6px); } }
@keyframes bounce { 0%, 20% { transform: translateY(0); } 40% { transform: translateY(-14px); } 50% { transform: translateY(3px); } 60% { transform: translateY(-6px); } 80% { transform: translateY(1px); } 100% { transform: translateY(0); } }
:root.noanim *, :root.noanim *::before { animation: none !important; transition: none !important; }

.after { width: 100%; max-width: 420px; border: 1px solid var(--line); background: var(--surf); padding: 14px; text-align: center; }
.after-res { font-weight: 700; margin-bottom: 10px; }
.after-res .w { font-family: var(--mono); letter-spacing: .12em; color: var(--accent); }
.after-btns { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.after-next { margin-top: 10px; color: var(--mute); font-size: 14px; }
.btn { background: var(--raise); border: 1px solid var(--line2); border-radius: 4px; padding: 9px 14px; font-weight: 600; font-size: 14px; }
.btn:hover { background: var(--raise2); }
.btn.pri { background: var(--accent); border-color: var(--accent); color: #0b0d08; }
.btn.pri:hover { filter: brightness(1.08); }
.btn.danger { color: #f2998a; }
.btn.danger.armed { background: #6e2a20; color: #fff; border-color: #6e2a20; }

/* Tastatur */
.kb { width: 100%; display: flex; flex-direction: column; gap: 6px; margin-top: auto; padding-top: 4px; }
.kr { display: flex; gap: 5px; justify-content: center; }
.k { flex: 1 1 0; min-width: 0; height: clamp(46px, 7.2dvh, 56px); background: var(--raise2); border: 0; border-radius: 4px; font-weight: 700; font-size: 15px; text-transform: uppercase; display: grid; place-items: center; padding: 0; user-select: none; touch-action: manipulation; }
.k.w { flex: 1.6 1 0; font-size: 12px; }
.k:hover { background: #262b39; }
.k:active { transform: translateY(1px); }
.k.c0 { background: var(--c0); color: #6b7280; } .k.c1 { background: var(--c1); color: var(--on); } .k.c2 { background: var(--c2); color: var(--on); }
.k svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.foot { border-top: 1px solid var(--line); background: var(--bar); padding: 12px; display: flex; gap: 8px 16px; flex-wrap: wrap; justify-content: center; font-size: 13px; color: var(--mute); }
.foot a { color: var(--mute); }
.foot a:hover { color: var(--tx); }

/* Dialoge */
dialog { background: var(--surf); color: var(--tx); border: 1px solid var(--line2); border-radius: 6px; padding: 0; width: calc(100% - 24px); max-width: 440px; max-height: calc(100dvh - 24px); overflow: auto; }
dialog::backdrop { background: rgba(0, 0, 0, .7); }
.dh { display: flex; align-items: center; justify-content: space-between; padding: 12px 8px 12px 16px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surf); }
.dh h2 { margin: 0; font-size: 17px; }
.db { padding: 14px 16px 18px; }
.db h3 { margin: 18px 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--mute); }
.db p { margin: 0 0 10px; }
.muted { color: var(--mute); font-size: 14px; }
.ex { margin: 10px 0; }
.ex .row { width: 220px; margin-bottom: 6px; }
.ex .t { font-size: 22px; }
.ex p { font-size: 14px; color: var(--mute); }
.nums { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 12px 0; }
.nums div { text-align: center; border: 1px solid var(--line); padding: 10px 4px; }
.nums dt { color: var(--mute); font-size: 11px; order: 2; text-transform: uppercase; letter-spacing: .04em; }
.nums dd { margin: 0; font: 700 20px var(--mono); white-space: nowrap; font-variant-numeric: tabular-nums; }
.nums div { display: flex; flex-direction: column; }
.dist { display: grid; gap: 4px; margin-bottom: 14px; }
.dist .r { display: grid; grid-template-columns: 14px 1fr; gap: 8px; align-items: center; font: 13px var(--mono); font-variant-numeric: tabular-nums; }
.dist .bar2 { background: var(--c0); min-width: 22px; padding: 1px 6px; text-align: right; color: var(--on); font-weight: 700; }
.dist .bar2.hit { background: var(--c2); }
.opt { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.opt small { display: block; color: var(--mute); font-size: 13px; }
.opt input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--accent); flex: none; }

@media (max-width: 420px) { .eco { display: none; } .meta { width: 100%; margin-left: 0; } }
@media (max-height: 640px) { .bar { padding-top: 6px; } main { gap: 8px; } }
.nums.sol { grid-template-columns: 1fr; }
.nums.sol div { flex-direction: row-reverse; justify-content: space-between; align-items: center; padding: 10px 14px; }
.nums.sol dd { letter-spacing: .12em; color: var(--accent); }
.nums.sol dt { font-size: 13px; }
