/* Ravenser – Oberfläche. Layout: Kopfzeile mit Rohstoffen, Karte oder Panel in der Mitte, Bauleiste und Reiter unten. */
@font-face { font-family: "Alegreya Sans"; font-weight: 400; font-display: swap; src: url(fonts/alegreya-sans-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Alegreya Sans"; font-weight: 700; font-display: swap; src: url(fonts/alegreya-sans-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "Alegreya Sans"; font-weight: 800; font-display: swap; src: url(fonts/alegreya-sans-latin-800-normal.woff2) format("woff2"); }
@font-face { font-family: "Alegreya SC"; font-weight: 500; font-display: swap; src: url(fonts/alegreya-sc-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "Alegreya SC"; font-weight: 700; font-display: swap; src: url(fonts/alegreya-sc-latin-700-normal.woff2) format("woff2"); }

:root {
  --ink: #131b17;
  --panel: #1d2822;
  --panel-2: #28352d;
  --panel-3: #314037;
  --line: #3a4a40;
  --text: #eef0e4;
  --muted: #9eae9f;
  --accent: #e3a83b;
  --accent-soft: #3b3422;
  --bad: #e5735c;
  --good: #9dcc72;
  --f-display: "Alegreya SC", Georgia, "Times New Roman", serif;
  --f-body: "Alegreya Sans", "Segoe UI", system-ui, sans-serif;
  --gutter-l: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));
  color-scheme: dark;
}
* , *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--ink); color: var(--text);
  font-family: var(--f-body); font-size: 15px; line-height: 1.4;
  -webkit-tap-highlight-color: transparent; overflow: hidden;
  padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px);
}
[hidden] { display: none !important; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }

.boot { height: 100%; display: grid; place-items: center; color: var(--muted); font-family: var(--f-display); font-size: 22px; }

/* ---------- Startseite mit Anmeldung ---------- */
.auth { height: 100%; overflow-y: auto; overflow-x: hidden; background: linear-gradient(180deg, #14272f 0, var(--ink) 720px); -webkit-overflow-scrolling: touch; }
.lp-top { display: flex; justify-content: space-between; align-items: center; max-width: 1180px; margin: 0 auto; padding: 14px var(--gutter-r) 0 var(--gutter-l); }
.lp-brand { font-family: var(--f-display); font-size: 26px; font-weight: 700; letter-spacing: .02em; }
.lp-top .langs { margin: 0; }
.lp { max-width: 1180px; margin: 0 auto; padding: 8px var(--gutter-r) 24px var(--gutter-l); display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; }
.lp-hero h1 { font-family: var(--f-display); font-weight: 700; font-size: clamp(34px, 6vw, 58px); line-height: 1.02; margin: 18px 0 14px; max-width: 14ch; text-wrap: balance; }
.lp-lead { font-size: 18px; line-height: 1.5; color: #c9d4c8; max-width: 52ch; margin: 0 0 18px; }
.lp-cta { display: inline-block; text-decoration: none; font-size: 16px; padding: 12px 20px; }
#heroCanvas { display: block; width: 100%; height: 260px; border-radius: 18px; border: 1px solid #2b4a57; background: #2f6e9a; }
.lp-hero { display: flex; flex-direction: column-reverse; gap: 4px; }
.lp-side .auth-card { width: 100%; max-width: 420px; margin: 0 auto; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 22px; box-shadow: 0 18px 40px rgba(0, 0, 0, .35); }
.auth-title { font-family: var(--f-display); font-size: 26px; margin: 0 0 14px; }
.field-hint { font-size: 12.5px; line-height: 1.3; margin-top: -2px; }
.field-hint:empty { display: none; }
.field-hint.ok { color: var(--good); }
.field-hint.bad { color: var(--bad); }
.switch-hint { margin: 10px 0 0; font-size: 14px; color: var(--muted); text-align: center; }
.switch-hint .link { font-size: 14px; padding: 0; }
.lp-sec h2 { font-family: var(--f-display); font-size: clamp(26px, 4vw, 34px); line-height: 1.1; margin: 0 0 18px; text-wrap: balance; }
.lp-sec { padding-top: 28px; border-top: 1px solid var(--line); }
.lp-features { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 22px 32px; }
.lp-features li { display: grid; grid-template-columns: 52px 1fr; gap: 14px; align-items: start; }
.lp-features canvas { width: 52px; height: 52px; }
.lp-features h3, .lp-steps h3 { font-size: 17px; margin: 2px 0 4px; }
.lp-features p, .lp-steps p, .lp-story p, .lp-sec details p { margin: 0; color: #b9c6b8; line-height: 1.5; max-width: 60ch; }
.lp-shots { display: grid; grid-auto-flow: column; grid-auto-columns: 62%; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; margin: 0 calc(-1 * var(--gutter-r)) 0 calc(-1 * var(--gutter-l)); padding-inline: var(--gutter-l) var(--gutter-r); scrollbar-width: thin; }
.lp-shots figure { margin: 0; scroll-snap-align: start; }
.lp-shots img { display: block; width: 100%; height: auto; aspect-ratio: 390 / 760; object-fit: cover; object-position: top; border-radius: 22px; border: 5px solid #2a3a32; background: var(--panel); }
.lp-shots figcaption { font-size: 14px; color: var(--muted); margin-top: 8px; line-height: 1.4; }
.lp-story { position: relative; }
.lp-story p + p { margin-top: 10px; color: var(--text); font-family: var(--f-display); font-size: 20px; }
.lp-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px 28px; counter-reset: step; }
.lp-steps li { counter-increment: step; }
.lp-steps li::before { content: counter(step); display: block; font-family: var(--f-display); font-size: 40px; font-weight: 700; color: var(--accent); line-height: 1; margin-bottom: 6px; }
.lp-sec details { border-bottom: 1px solid var(--line); padding: 12px 0; }
.lp-sec details:first-of-type { border-top: 1px solid var(--line); }
.lp-sec summary { cursor: pointer; font-weight: 700; font-size: 16px; list-style-position: outside; }
.lp-sec details p { margin-top: 8px; }
.lp-foot { max-width: 1180px; margin: 0 auto; padding: 0 var(--gutter-r) 28px var(--gutter-l); }
.lp-foot .legal-links { text-align: left; }
@media (min-width: 980px) {
  .lp { grid-template-columns: minmax(0, 1fr) 380px; column-gap: 40px; align-items: start; }
  .lp-main { grid-column: 1; grid-row: 1; }
  .lp-side { grid-column: 2; grid-row: 1 / span 2; position: sticky; top: 16px; }
  .lp-more { grid-column: 1; grid-row: 2; }
  .lp-cta { display: none; }
  #heroCanvas { height: 320px; }
  .lp-shots { grid-auto-flow: row; grid-template-columns: repeat(4, minmax(0, 1fr)); overflow: visible; margin: 0; padding: 0; }
}
.lp-more { display: grid; gap: 36px; }
.legal.lp-legal { max-width: none; margin: 0; padding: 18px 0 0; }
.legal.lp-legal h1 { font-size: clamp(32px, 5vw, 46px); margin: 6px 0 16px; }
.lp-legal h2 { font-size: 18px; }
.lp-legal p, .lp-legal li { color: #c9d4c8; }
.lp-back { font-size: 14px; margin: 0; }
.legal-links a[aria-current] { color: var(--accent); text-decoration: none; font-weight: 700; }
.signed-in { margin: 0 0 12px; color: var(--muted); }
.wide-btn { display: block; text-align: center; text-decoration: none; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--panel-2); border-radius: 10px; padding: 3px; gap: 3px; }
.seg button { border: 0; background: transparent; border-radius: 8px; padding: 8px; font-weight: 700; color: var(--muted); }
.seg button[aria-selected="true"], .seg button.on { background: var(--panel-3); color: var(--text); }
.form { display: flex; flex-direction: column; gap: 6px; margin-top: 16px; }
.form label { font-size: 13px; font-weight: 700; color: var(--muted); margin-top: 6px; }
.hint-s { font-weight: 400; }
input, select { background: var(--ink); border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; width: 100%; min-width: 0; }
select { padding: 9px 8px; }
.form .btn { margin-top: 14px; }
.form-err { color: var(--bad); min-height: 1.4em; margin: 12px 0 0; }

.btn { border-radius: 10px; padding: 10px 14px; border: 1px solid var(--line); background: var(--panel-2); font-weight: 700; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #1d1708; }
.btn.small { padding: 6px 10px; font-size: 14px; border-radius: 8px; }
.btn.danger { border-color: var(--bad); color: var(--bad); background: transparent; }
.btn svg { width: 16px; height: 16px; vertical-align: -3px; flex: 0 0 auto; }
.btn:disabled { opacity: .45; cursor: default; }

/* Sprachumschalter */
.langs { display: flex; justify-content: flex-end; gap: 4px; margin-bottom: 10px; }
.langs button { border: 1px solid var(--line); background: transparent; color: var(--muted); border-radius: 999px; padding: 3px 10px; font-size: 12.5px; font-weight: 700; }
.langs button.on { background: var(--panel-3); color: var(--text); border-color: var(--panel-3); }

/* ---------- Spielansicht ---------- */
#app { height: 100%; display: flex; flex-direction: column; }
.top { background: var(--panel); border-bottom: 1px solid var(--line); padding: 8px var(--gutter-r) 8px var(--gutter-l); position: relative; z-index: 2; }
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.title { display: flex; align-items: baseline; gap: 8px; min-width: 0; flex-wrap: wrap; }
.place { font-family: var(--f-display); font-weight: 700; font-size: 21px; line-height: 1.05; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60vw; }
.rank { font-size: 11.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); white-space: nowrap; }
.atag { font-size: 11.5px; font-weight: 800; letter-spacing: .06em; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 0 5px; }
.icon-btn { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2); display: grid; place-items: center; flex: 0 0 auto; }
.icon-btn svg { width: 18px; height: 18px; }

.res { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 5px; margin-top: 8px; }
.r { background: var(--panel-2); border-radius: 8px; padding: 4px 6px 3px; min-width: 0; }
.r .v { display: flex; align-items: center; gap: 4px; font-weight: 800; font-variant-numeric: tabular-nums; font-size: 14.5px; line-height: 1.2; white-space: nowrap; overflow: hidden; }
.r .v svg { width: 14px; height: 14px; flex: 0 0 auto; }
.r .v small { font-weight: 400; color: var(--muted); font-size: 11px; }
.r .d { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r .d.up { color: var(--good); }
.r .d.down { color: var(--bad); }
.r.full .v { color: var(--accent); }
@media (max-width: 520px) {
  .res { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .r { display: flex; align-items: baseline; justify-content: space-between; gap: 4px; padding: 4px 6px; }
  .r .v small { display: none; }
  #r-pop .v small { display: inline; }
  #r-pop .d { flex: 0 1 auto; }
}

.goal { display: flex; align-items: center; gap: 10px; margin-top: 7px; }
.goal-text { font-size: 12.5px; color: var(--muted); flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.goal-text b { color: var(--text); }
.bar { height: 6px; border-radius: 3px; background: var(--panel-3); overflow: hidden; }
.goal .bar { width: 80px; flex: 0 0 auto; }
.bar i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 3px; transition: width .4s; }
.bar.good i { background: var(--good); }

.main { position: relative; flex: 1; min-height: 0; }
.stage { position: absolute; inset: 0; overflow: hidden; background: #0f1612; }
#map { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; display: block; cursor: grab; }
#map.building { cursor: crosshair; }

.hint, .visitbar { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; border-radius: 999px; padding: 6px 6px 6px 14px; font-size: 14px; max-width: calc(100% - 32px); z-index: 3; }
.hint { background: var(--accent-soft); border: 1px solid var(--accent); }
.visitbar { background: #20303a; border: 1px solid #6fa3c0; }
.hint span, .visitbar span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.hint button, .visitbar button { border: 0; border-radius: 999px; padding: 5px 12px; font-weight: 800; flex: 0 0 auto; }
.hint button { background: var(--accent); color: #1d1708; }
.visitbar button { background: #6fa3c0; color: #0d1a21; }

.toasts { position: absolute; top: 56px; left: 0; right: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; z-index: 6; padding: 0 var(--gutter-r) 0 var(--gutter-l); }
.toast { background: rgba(20, 28, 24, .95); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; font-size: 14px; max-width: 440px; box-shadow: 0 6px 18px rgba(0, 0, 0, .35); animation: tin .25s ease-out; }
.toast.bad { border-color: var(--bad); }
.toast.good { border-color: var(--good); }
.toast.gold { border-color: var(--accent); color: #fbe7bd; }
@keyframes tin { from { transform: translateY(-6px); opacity: 0; } to { transform: none; opacity: 1; } }

.sheet { position: absolute; left: var(--gutter-l); right: var(--gutter-r); bottom: 12px; margin-inline: auto; max-width: 460px; max-height: calc(100% - 24px); overflow: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px 14px; box-shadow: 0 10px 28px rgba(0, 0, 0, .45); z-index: 4; }
.sheet-head { display: flex; align-items: center; gap: 10px; }
.sheet-head canvas { width: 40px; height: 40px; flex: 0 0 auto; }
.sheet-head h2 { margin: 0; font-family: var(--f-display); font-size: 20px; line-height: 1.1; flex: 1; min-width: 0; }
.sheet-head h2 small { display: block; font-family: var(--f-body); font-size: 12px; color: var(--muted); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.pill { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; border-radius: 999px; padding: 3px 8px; white-space: nowrap; }
.pill.on { background: rgba(157, 204, 114, .16); color: var(--good); }
.pill.off { background: rgba(229, 115, 92, .16); color: var(--bad); }
.pill.run { background: rgba(227, 168, 59, .16); color: var(--accent); }
.pill.mute { background: var(--panel-3); color: var(--muted); }
.x { width: 32px; height: 32px; border-radius: 8px; border: 0; background: transparent; color: var(--muted); font-size: 22px; line-height: 1; flex: 0 0 auto; }
.sheet p { margin: 8px 0 0; color: var(--muted); max-width: 60ch; }
.stats { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-variant-numeric: tabular-nums; font-size: 14px; }
.stats span, .cost span { display: inline-flex; align-items: center; gap: 4px; }
.stats svg { width: 14px; height: 14px; }
.upbox { margin-top: 12px; padding: 10px 12px; background: var(--panel-2); border-radius: 10px; display: grid; gap: 8px; }
.upbox .head { display: flex; justify-content: space-between; gap: 8px; font-weight: 700; flex-wrap: wrap; }
.upbox .head span { color: var(--muted); font-weight: 400; font-size: 13.5px; }
.cost { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.cost svg { width: 13px; height: 13px; }
.cost .poor { color: var(--bad); }
.wide { width: 100%; }
.demo { margin-top: 10px; width: 100%; border: 1px solid var(--line); background: transparent; border-radius: 10px; padding: 9px; font-weight: 700; color: var(--muted); }
.demo.confirm { border-color: var(--bad); color: var(--bad); background: rgba(229, 115, 92, .1); }

/* Bauleiste */
.dock { background: var(--panel); border-top: 1px solid var(--line); position: relative; z-index: 2; }
.dock-groups { display: flex; gap: 4px; padding: 6px var(--gutter-r) 0 var(--gutter-l); }
.dock-groups button { flex: 1 1 0; font-size: 12.5px; font-weight: 700; color: var(--muted); background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: 3px 8px; white-space: nowrap; }
.dock-groups button[aria-selected="true"] { color: var(--text); background: var(--panel-3); border-color: var(--accent); }
.dock-groups .dot { width: 7px; height: 7px; margin-left: 4px; vertical-align: 1px; }
@media (min-width: 900px) { .dock-groups button { flex: 0 0 auto; padding: 3px 14px; } }
.dock-inner { display: flex; gap: 8px; overflow-x: auto; padding: 8px var(--gutter-r) 8px var(--gutter-l); scrollbar-width: none; }
.dock-inner::-webkit-scrollbar { display: none; }
.bbtn { flex: 0 0 auto; width: 84px; display: flex; flex-direction: column; align-items: center; gap: 1px; background: var(--panel-2); border: 1.5px solid transparent; border-radius: 12px; padding: 5px 3px 6px; }
.bbtn canvas { width: 40px; height: 40px; }
.bbtn .n { font-size: 12.5px; font-weight: 700; line-height: 1.15; text-align: center; }
.bbtn .c { font-size: 11px; color: var(--muted); display: flex; gap: 5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bbtn .c span { display: inline-flex; align-items: center; gap: 2px; }
.bbtn .c svg { width: 10px; height: 10px; }
.bbtn[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.bbtn.poor .c { color: var(--bad); }
.bbtn.locked { opacity: .5; }
.bbtn.locked canvas { filter: grayscale(1); }

/* Reiter */
.tabs { display: grid; grid-template-columns: repeat(6, 1fr); background: var(--panel); border-top: 1px solid var(--line); padding: 0 var(--gutter-r) 0 var(--gutter-l); position: relative; z-index: 2; }
.tabs button { position: relative; border: 0; background: transparent; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 0 6px; font-size: 11px; font-weight: 700; min-width: 0; }
.tabs button span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.tabs svg { width: 21px; height: 21px; }
.tabs button[aria-current="page"] { color: var(--accent); }
.badge { position: absolute; top: 4px; left: calc(50% + 7px); min-width: 16px; height: 16px; border-radius: 8px; background: var(--bad); color: #fff; font-size: 10.5px; font-style: normal; font-weight: 800; display: grid; place-items: center; padding: 0 4px; }
.badge.dot { min-width: 9px; width: 9px; height: 9px; padding: 0; background: var(--accent); }

/* Kronen */
.top-actions { display: flex; gap: 8px; align-items: center; flex: 0 0 auto; }
.kronen-btn { position: relative; height: 38px; border-radius: 10px; border: 1px solid #6b5520; background: #2e2716; display: flex; align-items: center; gap: 6px; padding: 0 10px 0 8px; color: #f6dc95; font-weight: 800; }
.kronen-btn .crown, .crown-i { display: inline-block; width: 18px; height: 18px; background: no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M2 12.5 1.2 4.6l3.7 2.8L8 2.6l3.1 4.8 3.7-2.8-.8 7.9Z' fill='%23f0c24b' stroke='%23a07818' stroke-width='.8' stroke-linejoin='round'/%3E%3Crect x='2.3' y='12.2' width='11.4' height='1.8' rx='.6' fill='%23d9a52e'/%3E%3C/svg%3E"); }
.kronen-btn .badge { top: -4px; left: auto; right: -4px; }
.kv .crown-i { width: 16px; height: 16px; vertical-align: -3px; }
.big-balance { display: flex; align-items: center; gap: 10px; font-family: var(--f-display); font-size: 34px; font-weight: 700; color: #f6dc95; }
.big-balance .crown-i { width: 30px; height: 30px; }
.packs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.pack { background: var(--panel); border: 1px solid #6b5520; border-radius: 12px; padding: 12px; display: grid; gap: 6px; align-content: start; }
.pack .kr { display: flex; align-items: center; gap: 6px; font-size: 22px; font-weight: 800; color: #f6dc95; font-variant-numeric: tabular-nums; }
.pack .price { color: var(--muted); font-size: 14px; }
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--muted); }
.consent input { width: 18px; height: 18px; flex: 0 0 auto; margin-top: 2px; }
.kr-skip { margin-top: 12px; font-size: 13px; }
.small-print { font-size: 12.5px; color: var(--muted); }
.ledger td:last-child { color: var(--muted); }
.delta-plus { color: var(--good); }
.delta-minus { color: var(--bad); }

/* Bauwarteschlange über der Bauleiste */
.queue { display: flex; gap: 6px; overflow-x: auto; padding: 7px var(--gutter-r) 0 var(--gutter-l); scrollbar-width: none; font-size: 12.5px; }
.queue::-webkit-scrollbar { display: none; }
.qchip { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 3px 10px; background: var(--panel-2); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.qchip.busy { color: var(--text); border-color: #6b5520; }
.qchip b { font-variant-numeric: tabular-nums; color: var(--accent); font-weight: 800; }
.qchip.free { border-style: dashed; }
.qchip svg { width: 13px; height: 13px; }

.buildbox { margin-top: 12px; padding: 10px 12px; background: #2e2716; border: 1px solid #6b5520; border-radius: 10px; display: grid; gap: 8px; }
.buildbox .head { display: flex; justify-content: space-between; gap: 8px; font-weight: 700; }
.btn.kr { background: #3a2f14; border-color: #a07818; color: #f6dc95; display: inline-flex; align-items: center; gap: 6px; }
.btn.kr .crown-i { width: 15px; height: 15px; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; }

/* Lager und Anmeldeserie */
.res { cursor: pointer; }
.card h3 { font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; }
.card table td svg { width: 14px; height: 14px; vertical-align: -2px; }
.seg.wrap { grid-auto-flow: row; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); }
.streak { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin-top: 10px; }
.sday { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 5px 2px; border-radius: 8px; background: var(--panel-2); font-weight: 800; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.sday small { font-size: 10.5px; font-weight: 700; }
.sday .crown-i { width: 13px; height: 13px; }
.sday.done { background: rgba(157, 204, 114, .16); color: var(--good); }
.sday.today { outline: 2px solid var(--accent); color: #f6dc95; }

/* Panels */
.panel { position: absolute; inset: 0; overflow-y: auto; padding: 16px var(--gutter-r) 28px var(--gutter-l); -webkit-overflow-scrolling: touch; }
.panel-in { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
.panel h2 { font-family: var(--f-display); font-size: 26px; margin: 0; line-height: 1.1; text-wrap: balance; }
.panel h3 { font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; }
.lead { color: var(--muted); margin: 6px 0 0; max-width: 62ch; }
.box { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.list { display: flex; flex-direction: column; gap: 8px; }
.item { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px; display: grid; gap: 7px; min-width: 0; }
.item.done { opacity: .62; }
.item.ready { border-color: var(--accent); }
.item-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.item-top > div { min-width: 0; }
.item-title { font-weight: 800; font-size: 15.5px; }
.item-sub { color: var(--muted); font-size: 13.5px; }
.item-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 720px) { .grid3 { grid-template-columns: 1fr; } }
.kv { display: flex; gap: 14px; flex-wrap: wrap; font-size: 14px; color: var(--muted); }
.kv b { color: var(--text); font-variant-numeric: tabular-nums; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.inline-form input[type="number"] { width: 96px; flex: 0 0 auto; }
.inline-form select { width: auto; flex: 0 0 auto; }
.inline-form .grow { flex: 1 1 160px; }
.msgs { display: flex; flex-direction: column; gap: 6px; max-height: 320px; overflow-y: auto; padding-right: 4px; }
.msg { font-size: 14px; }
.msg b { color: var(--accent); }
.msg.sys { color: var(--muted); font-style: italic; }
.msg time { color: var(--muted); font-size: 12px; margin-right: 6px; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.me td { color: var(--accent); }
.empty { color: var(--muted); padding: 10px 0; }

/* Overlay */
.overlay { position: fixed; inset: 0; background: rgba(6, 10, 8, .66); display: grid; place-items: center; z-index: 20;
  padding: max(16px, env(safe-area-inset-top, 0px)) var(--gutter-r) max(16px, env(safe-area-inset-bottom, 0px)) var(--gutter-l); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 20px; width: 100%; max-width: 440px; max-height: 100%; overflow: auto; }
.card h2 { margin: 0 0 4px; font-family: var(--f-display); font-size: 26px; }
.card .sub { margin: 0 0 14px; color: var(--muted); }
.card ul { margin: 0; padding-left: 18px; display: grid; gap: 7px; }
.row { display: flex; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
.row .btn { flex: 1; min-width: 120px; }

/* Sturmflut */
.floodbar { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 3; display: flex; align-items: center; gap: 8px; max-width: calc(100% - 32px);
  border-radius: 999px; padding: 6px 14px; font-size: 14px; font-weight: 700; background: #18303f; border: 1px solid #6fa3c0; color: #d8ecf7; animation: pulse 2.4s ease-in-out infinite; }
.floodbar { border-radius: 14px; text-align: left; }
.floodbar span { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.floodbar b, .floodbar small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.floodbar small { font-size: 12.5px; font-weight: 600; color: #a9cfe4; }
.floodbar svg, .flood-box svg, .warn-text svg { width: 16px; height: 16px; flex: 0 0 auto; vertical-align: -3px; }
@keyframes pulse { 50% { border-color: #a9d3ea; box-shadow: 0 0 0 3px rgba(111, 163, 192, .2); } }
.flood-box { border-color: #4f7d96; background: #172630; }
.sheet p.warn-text, .warn-text { color: #9fd0ec; }

/* Hafen */
.goods { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px 16px; }
.trade-good { display: grid; grid-template-columns: 1fr auto 84px; align-items: center; gap: 8px; margin-top: 6px; font-size: 14px; }
.trade-good span { display: inline-flex; align-items: center; gap: 5px; min-width: 0; }
.trade-good small { color: var(--muted); display: inline-flex; align-items: center; gap: 3px; font-variant-numeric: tabular-nums; }
.trade-good svg { width: 13px; height: 13px; }
.trade-good input { padding: 7px 8px; text-align: right; }
.est { gap: 4px 14px; }
.qchip.ship { border-color: #4f7d96; }
.qchip.ship b { color: #9fd0ec; }
.item-title svg { width: 15px; height: 15px; vertical-align: -2px; }
.item-sub svg, .msg svg, .relic svg, .box svg { width: 14px; height: 14px; vertical-align: -2px; }
.seg button svg { width: 15px; height: 15px; vertical-align: -3px; }
.relics { display: flex; flex-wrap: wrap; gap: 6px; }
.relic { font-size: 13px; border-radius: 8px; padding: 4px 9px; background: var(--panel-2); color: var(--muted); border: 1px dashed var(--line); }
.relic.got { color: var(--text); border: 1px solid #6b5520; background: #2e2716; }
.relic b { color: var(--accent); }
.link { border: 0; background: none; color: var(--accent); font-weight: 700; padding: 0 0 0 4px; text-decoration: underline; font-size: 12.5px; }

.more { width: 32px; height: 32px; border-radius: 8px; border: 0; background: transparent; color: var(--muted); font-size: 16px; flex: 0 0 auto; }
.sheet > .cost { margin-top: 10px; }
.facts { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; font-size: 14px; }
.facts span { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.facts svg { width: 14px; height: 14px; }
.place-hint { color: var(--accent); }
.panel a { color: var(--accent); }
.legal-links { margin-top: 14px; font-size: 12.5px; color: var(--muted); text-align: center; line-height: 1.8; }
.legal-links a, .consent a { color: var(--muted); text-decoration: underline; }
.consent a { color: var(--text); }
.withdraw-link { display: inline-block; margin-top: 6px; border: 1.5px solid var(--accent); border-radius: 8px; padding: 4px 10px; color: var(--accent) !important; text-decoration: none !important; font-weight: 700; }
.menu-h { margin: 16px 0 8px; }
.card a.btn { text-decoration: none; color: inherit; display: inline-block; }
#modal input { margin-top: 6px; }

/* Rechtsseiten */
.legal-page { overflow: auto; height: auto; min-height: 100%; }
.legal-top { display: flex; justify-content: space-between; align-items: center; padding: 14px var(--gutter-r) 6px var(--gutter-l); max-width: 760px; margin: 0 auto; }
.legal-top .brand { font-family: var(--f-display); font-size: 26px; font-weight: 700; color: var(--text); text-decoration: none; }
.legal-top a, .legal-nav a, .legal-foot a, .legal a { color: var(--accent); }
.legal-nav { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 0 var(--gutter-r) 8px var(--gutter-l); max-width: 760px; margin: 0 auto; border-bottom: 1px solid var(--line); font-size: 14px; }
.legal-nav a { color: var(--muted); text-decoration: none; font-weight: 700; }
.legal-nav a[aria-current] { color: var(--accent); }
.legal { max-width: 760px; margin: 0 auto; padding: 12px var(--gutter-r) 24px var(--gutter-l); line-height: 1.55; }
.legal h1 { font-family: var(--f-display); font-size: 32px; margin: 8px 0 12px; }
.legal h2 { font-size: 17px; margin: 22px 0 6px; }
.legal p { margin: 0 0 10px; max-width: 68ch; }
.legal .lead { color: var(--muted); }
.legal .stand, .legal .note { color: var(--muted); font-size: 13px; }
.legal mark { background: #6b2a1d; color: #fff; padding: 0 4px; border-radius: 4px; }
.legal .formular { border: 1px dashed var(--line); border-radius: 10px; padding: 12px 14px; }
.legal .cta .btn { text-decoration: none; display: inline-block; }
.legal .btn.primary { color: #1d1708; }
.legal-form { max-width: 460px; }
.legal-form fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; margin: 8px 0 0; }
.legal-form legend { font-size: 13px; font-weight: 700; color: var(--muted); padding: 0 4px; }
.legal-form .radio { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; color: var(--text); font-size: 14.5px; margin: 6px 0; }
.legal-form .radio input { width: 18px; height: 18px; flex: 0 0 auto; margin-top: 2px; }
.receipt { background: var(--panel); border: 1px solid var(--good); border-radius: 12px; padding: 12px 16px; margin-bottom: 12px; }
.receipt dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 8px 0 0; }
.receipt dt { color: var(--muted); }
.receipt dd { margin: 0; }
.legal-foot { max-width: 760px; margin: 0 auto; padding: 8px var(--gutter-r) 32px var(--gutter-l); border-top: 1px solid var(--line); font-size: 14px; }

/* Menü oben rechts */
.icon-btn { position: relative; }
.icon-btn .badge { top: -3px; left: auto; right: -3px; }
.drop { position: fixed; z-index: 25; width: min(290px, calc(100vw - 16px)); background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 8px; box-shadow: 0 18px 40px rgba(0, 0, 0, .5); max-height: calc(100vh - 80px); overflow: auto; }
.drop-who { margin: 4px 8px 6px; font-size: 13px; color: var(--muted); }
.drop-item { display: flex; align-items: center; gap: 12px; width: 100%; border: 0; background: transparent; border-radius: 10px; padding: 10px; font-weight: 700; font-size: 15.5px; text-align: left; color: var(--text); }
.drop-item:hover, .drop-item:focus-visible { background: var(--panel-2); }
.drop-item svg { width: 20px; height: 20px; flex: 0 0 auto; color: var(--muted); }
.drop-item span { flex: 1; }
.drop-item .count { font-style: normal; min-width: 20px; height: 20px; border-radius: 10px; background: var(--bad); color: #fff; font-size: 12px; display: grid; place-items: center; padding: 0 6px; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); vertical-align: middle; }
.drop-sep { height: 1px; background: var(--line); margin: 6px 4px; }
.drop .langs { justify-content: flex-start; margin: 6px 10px; }
.drop-legal { padding: 2px 10px 4px; font-size: 13px; line-height: 1.9; color: var(--muted); }
.drop-legal a { color: var(--muted); }
.drop-legal .withdraw-link { margin-top: 4px; }
.drop-ver { margin: 2px 10px 4px; font-size: 12px; color: var(--muted); }

/* Chat und Nachrichten */
.suggest { display: flex; flex-wrap: wrap; gap: 6px; }
.suggest button { border: 1px solid var(--line); background: var(--panel-2); border-radius: 999px; padding: 4px 12px; font-size: 14px; font-weight: 700; }
.drop-item.warn span { color: var(--accent); }
.verify-box { border-color: var(--accent); }
.verify-box .small-print { margin: 6px 0 10px; }
.form-err.ok { color: var(--good); }
.chat-box { display: flex; flex-direction: column; gap: 10px; }
.chat-list { height: clamp(200px, calc(100vh - 590px), 560px); height: clamp(200px, calc(100dvh - 590px), 560px); max-height: none; }
.msg.mine b { color: var(--good); }
.msg .who { border: 0; background: none; padding: 0; color: var(--accent); font-weight: 700; font-size: inherit; cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
.seg button[disabled] { opacity: .5; }
.item.mail { padding: 0; gap: 0; overflow: hidden; }
.mail-head { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; border: 0; background: transparent; padding: 11px 13px; text-align: left; color: var(--text); }
.mail-sub { font-size: 15.5px; }
.item.mail.unread { border-color: var(--accent); }
.item.mail.unread .mail-sub { font-weight: 800; }
.item.mail.system .mail-sub::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #6fa3c0; margin-right: 8px; vertical-align: 2px; }
.mail-body { white-space: pre-wrap; padding: 0 13px; color: #d6ddd3; line-height: 1.5; overflow-wrap: anywhere; }
.item.mail .btns { padding: 10px 13px 12px; }
textarea { background: var(--ink); border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; width: 100%; font: inherit; color: inherit; resize: vertical; }
.help { margin: 0; padding-left: 20px; display: grid; gap: 10px; max-width: 64ch; line-height: 1.5; }

.ver { text-align: center; margin: 12px 0 0; }

@media (prefers-reduced-motion: reduce) { .toast, .floodbar { animation: none; } .bar i { transition: none; } }
.more-btn { display: block; margin: 2px auto 8px; }
.chat-keep { text-align: center; margin: 0 0 8px; }

.ally-desc { white-space: pre-line; overflow-wrap: anywhere; }
.ally-desc.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ally-flags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.role { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; color: var(--muted); }
.role.mayor { color: var(--accent); font-weight: 700; }
.role svg { width: 12px; height: 12px; }
.item.locked { opacity: .7; }
.warn-box { margin: 10px 0 0; padding: 8px 10px; border-radius: 10px; background: rgba(227, 168, 59, .14); border: 1px solid rgba(227, 168, 59, .5); font-size: 13.5px; line-height: 1.4; }
.warn-box b { display: block; color: var(--accent); margin-bottom: 2px; }
.warn-box svg { width: 13px; height: 13px; vertical-align: -2px; }
.rtree-wrap { overflow-x: auto; padding: 4px 2px 8px; -webkit-overflow-scrolling: touch; }
.rtree { position: relative; }
.rtree svg { position: absolute; inset: 0; overflow: visible; }
.rtree path { fill: none; stroke: var(--line); stroke-width: 2; }
.rtree path.ok { stroke: var(--good); opacity: .7; }
.rnode { position: absolute; display: flex; flex-direction: column; justify-content: center; gap: 2px; text-align: left; padding: 5px 9px; border-radius: 10px; background: var(--panel-2); border: 1.5px solid var(--line); color: var(--text); overflow: hidden; }
.rnode b { font-size: 12.5px; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rnode small { font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 3px; white-space: nowrap; }
.rnode small svg { width: 11px; height: 11px; }
.rnode.done { border-color: rgba(157, 204, 114, .55); background: rgba(157, 204, 114, .1); }
.rnode.done small { color: var(--good); }
.rnode.run { border-color: var(--accent); }
.rnode.run small { color: var(--accent); }
.rnode.locked { opacity: .55; }
.rnode.can { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.rnode.sel { outline: 2px solid var(--text); outline-offset: 1px; }
.rdetail { margin-top: 4px; }
.unlocks { color: var(--accent); margin-top: 3px; }
.mail-group { border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2); overflow: hidden; }
.mail-group.unread { border-color: var(--accent); }
.mail-group.system { background: linear-gradient(135deg, rgba(111, 163, 192, .16), var(--panel-2) 60%); border-color: rgba(111, 163, 192, .55); }
.mail-ghead { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; border: 0; background: transparent; padding: 11px 13px; text-align: left; color: var(--text); }
.mail-who { font-size: 15.5px; font-weight: 800; display: inline-flex; align-items: center; gap: 6px; }
.mail-who svg { width: 15px; height: 15px; }
.mail-who .badge { position: static; display: inline-grid; }
.mail-group > .list { padding: 0 8px 8px; gap: 6px; }
.mail-group > .btns { padding: 0 13px 12px; }
.mail-group .item.mail { background: var(--panel); }
.mail-group.system .item.mail .mail-body { color: var(--text); }
.mail-ghead { position: relative; padding-right: 36px; }
.mail-chev { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 14px; }
