@font-face {
  font-family: "Pixelify Sans";
  src: url("/fonts/pixelify-sans-latin-400.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Pixelify Sans";
  src: url("/fonts/pixelify-sans-latin-700.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}

@font-face {
  font-family: "Pixel Digits";
  src: url("/fonts/vt323-latin-400.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
  unicode-range: U+0030-0039;
  size-adjust: 130%;
}

:root {
  --font: "Pixel Digits", "Pixelify Sans", "Segoe UI", system-ui, sans-serif;
  --radius-sm: 0; --radius: 0; --radius-lg: 0;

  --bg: #1b1c1f;
  --surface: #232428;
  --surface-2: #2c2d32;
  --surface-3: #37393e;
  --border: #45474d;
  --border-strong: #5c5f66;
  --text: #f2f2f2;
  --text-muted: #b8b8b8;
  --text-faint: #8f8f8f;
  --gold: #ffaa00;
  --shadow: 4px 4px 0 rgba(0, 0, 0, 0.55);
  --shadow-lg: 6px 6px 0 rgba(0, 0, 0, 0.6);

  --gui: #c6c6c6;
  --gui-light: #ffffff;
  --gui-dark: #555555;
  --slot: #8b8b8b;
  --slot-dark: #373737;
  --gui-text: #262626;
  --gui-muted: #4a4a4a;

  --belt: #16171a;
  --belt-2: #2e3035;
  --highlight: #ffd75e;

  --bevel: inset 2px 2px 0 rgba(255, 255, 255, 0.35), inset -2px -2px 0 rgba(0, 0, 0, 0.45);
  --bevel-dark: inset 2px 2px 0 rgba(255, 255, 255, 0.08), inset -2px -2px 0 rgba(0, 0, 0, 0.5);
  --gui-bevel: inset 3px 3px 0 var(--gui-light), inset -3px -3px 0 var(--gui-dark);
  --slot-bevel: inset 3px 3px 0 var(--slot-dark), inset -3px -3px 0 var(--gui-light);
}

body {
  font-family: var(--font);
  letter-spacing: 0.01em;
  background-color: #222327;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 2px, transparent 2px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 2px, transparent 2px);
  background-size: 48px 48px;
  background-attachment: scroll;
}
h1, h2, h3, h4 { letter-spacing: 0.01em; }
a { color: var(--highlight); }
a:hover { color: #fff; }

:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--highlight); outline-offset: 2px; box-shadow: none;
}

.page { width: 100%; max-width: 1500px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .page { padding: 0 20px; } }

.btn {
  --btn-bg: #6f6f6f; --btn-fg: #fff;
  border-radius: 0; border: 2px solid #000;
  box-shadow: var(--bevel);
  font-weight: 700; text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.45);
  transition: none;
}
.btn:hover:not(:disabled) { transform: none; border-color: #fff; }
.btn:active:not(:disabled) { box-shadow: inset 2px 2px 0 rgba(0, 0, 0, 0.45), inset -2px -2px 0 rgba(255, 255, 255, 0.2); }
.btn-primary { --btn-bg: var(--accent); --btn-fg: var(--accent-contrast); box-shadow: var(--bevel); text-shadow: none; }
.btn-primary:hover:not(:disabled) { --btn-bg: var(--accent); border-color: #fff; }
.btn-danger { --btn-bg: #a83232; --btn-fg: #fff; }
.btn-ghost { --btn-bg: transparent; border-color: transparent; box-shadow: none; text-shadow: none; }
.btn-ghost:hover:not(:disabled) { --btn-bg: var(--surface-3); border-color: transparent; }
.btn-buy { --btn-bg: #e8b923; --btn-fg: #2a1d00; text-shadow: none; box-shadow: inset 2px 2px 0 #ffe27a, inset -2px -2px 0 #9c7a10; }
.btn-buy:hover:not(:disabled) { --btn-bg: #f2c935; }
.btn-sm, .btn-lg { border-radius: 0; }
.btn:disabled { opacity: 1; --btn-bg: #4a4a4a; --btn-fg: #a0a0a0; text-shadow: none; box-shadow: var(--bevel-dark); }
.icon-btn { border-radius: 0; border: 2px solid #000; background: #6f6f6f; box-shadow: var(--bevel); }
.icon-btn:hover { background: #6f6f6f; border-color: #fff; }
.link-btn { background: none; border: none; color: var(--highlight); font: inherit; font-size: 0.9rem; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; padding: 4px; }

input[type="text"], input[type="search"], input[type="password"], input[type="number"], input:not([type]), select, textarea {
  border-radius: 0; background: #000; border: 2px solid #a0a0a0; color: #fff;
}
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: #fff; border-radius: 0; }
input[type="checkbox"] { border-radius: 0; }
.form-error, .form-success { border-radius: 0; border-width: 2px; }

.site-header { position: sticky; top: 0; z-index: 50; }

.topbar { background: var(--belt); color: #fff; }
.topbar-inner {
  display: flex; align-items: center; gap: 6px 10px;
  max-width: 1500px; margin: 0 auto; padding: 8px 16px; min-height: 64px;
}
@media (min-width: 720px) { .topbar-inner { padding: 8px 20px; } }
.topbar-spacer { flex: 1; }

.brand {
  display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none;
  font-weight: 700; font-size: 1.35rem; min-width: 0; padding: 4px 6px; border: 2px solid transparent;
}
a.brand:hover { color: #fff; border-color: #fff; }
.brand-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-shadow: 2px 2px 0 #000; }
.brand-sub { display: block; font-size: 0.75rem; font-weight: 400; color: var(--highlight); text-shadow: none; }
.brand-mark {
  display: block; width: 32px; height: 32px; flex-shrink: 0; border: 2px solid #000; border-radius: 0;
  background:
    linear-gradient(#000 0 0) 25% 70% / 4px 4px no-repeat,
    linear-gradient(#5a3e29 0 0) 70% 85% / 4px 4px no-repeat,
    linear-gradient(#6aad3d 0 0) 30% 38% / 4px 4px no-repeat,
    linear-gradient(#7bbf48 0 0) 0 0 / 100% 30% no-repeat,
    linear-gradient(90deg, #5d9b3a 0 25%, #7bbf48 25% 50%, #5d9b3a 50% 75%, #4f8a30 75%) 0 30% / 100% 12% no-repeat,
    #866043;
  box-shadow: inset -3px -3px 0 rgba(0, 0, 0, 0.25);
}

:root[data-logo="tdm"] .brand-mark {
  width: 40px; height: 40px; border: none; box-shadow: none;
  background: url("/img/tdm-logo-192.png") center / contain no-repeat;
}
:root[data-logo="tdm"] .footer-bottom .brand-mark { width: 28px; height: 28px; }
:root[data-logo-theme] .brand-mark { border: none; box-shadow: none; image-rendering: pixelated; background: url("/img/logo-halloween.svg") center / contain no-repeat; }
:root[data-logo-theme="christmas"] .brand-mark { background-image: url("/img/logo-weihnachten.svg"); }

.nav-link {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 8px; min-height: 48px; border: 2px solid transparent;
  background: none; color: #fff; font: inherit; text-decoration: none; cursor: pointer; text-align: left;
  flex-shrink: 0;
}
.nav-link:hover { border-color: #fff; color: #fff; }
.nav-stack { flex-direction: column; align-items: flex-start; justify-content: center; gap: 0; }
.nav-small { display: block; font-size: 0.75rem; color: #cfcfcf; line-height: 1.2; }
.nav-big { display: block; font-size: 0.95rem; font-weight: 700; line-height: 1.2; }

.subnav { background: var(--belt-2); color: #fff; }
.subnav::after {
  content: ""; display: block; height: 8px;
  background:
    repeating-linear-gradient(90deg, #6aad3d 0 6px, #559230 6px 12px, #7bbf48 12px 16px, #4f8a30 16px 20px) top / 100% 4px no-repeat,
    repeating-linear-gradient(90deg, #866043 0 8px, #6e4d34 8px 14px, #93694a 14px 22px, #5a3e29 22px 26px) bottom / 100% 4px no-repeat;
}
.subnav-inner {
  display: flex; align-items: center; gap: 12px;
  max-width: 1500px; margin: 0 auto; padding: 4px 16px; min-height: 44px;
}
@media (min-width: 720px) { .subnav-inner { padding: 4px 20px; } }
.subnav-plain .subnav-inner { min-height: 0; }

.chip, .subnav-link {
  flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px;
  background: none; border: 2px solid transparent; color: #fff; text-decoration: none;
  font: inherit; font-size: 0.92rem; cursor: pointer; white-space: nowrap;
}
.chip:hover, .subnav-link:hover { border-color: #fff; color: #fff; }
.chip[aria-pressed="true"], .subnav-link[aria-current="page"] {
  color: var(--highlight); font-weight: 700; background: rgba(0, 0, 0, 0.25); border-color: transparent;
  box-shadow: inset 0 -3px 0 var(--highlight);
}
.scroll-row { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; }
.scroll-row::-webkit-scrollbar { display: none; }

.banner { border-width: 2px; box-shadow: var(--bevel-dark); }
.tag, .status-badge, .status-badge::before, .badge { border-radius: 0; }
.tag-sale { background: #b3261e; color: #fff; border-color: #000; }
.tag-bundle { background: rgba(95, 180, 255, 0.15); color: #8ccaff; border-color: rgba(95, 180, 255, 0.5); }
.tag-wait { background: rgba(255, 215, 94, 0.12); color: var(--highlight); border-color: rgba(255, 215, 94, 0.45); }
.tag-duty { background: rgba(93, 155, 58, 0.18); color: #7ddf55; border-color: #5d9b3a; }
.stars { color: var(--gold); letter-spacing: 0.05em; white-space: nowrap; }
.empty-state { border: 2px dashed var(--border-strong); background: rgba(22, 23, 26, 0.8); }
.skeleton { background: linear-gradient(90deg, #3a3b40 0%, #4a4c52 50%, #3a3b40 100%); background-size: 200% 100%; }
.avatar { border-radius: 0; }

.table-wrap { border: 2px solid #000; box-shadow: var(--bevel-dark), var(--shadow); }
th { background: var(--belt); color: #d6d6d6; letter-spacing: 0.06em; }
th, td { border-bottom: 2px solid var(--border); }
tbody tr:hover td { background: rgba(255, 255, 255, 0.03); }

:root {
  --page: #dfe1e1; --page-grid: rgba(0, 0, 0, 0.035);
  --box: #ffffff; --box-2: #eceeee; --box-3: #f6f6f6;
  --ink: #111111; --ink-2: #333333; --ink-3: #555555;
  --line: #dcdcdc; --line-2: #b5b5b5;
  --link: #0a5a99; --link-hover: #c45500;
  --price-ink: #3d2800; --ok-ink: #2d7a12; --bad-ink: #a3211a; --warn-ink: #9a5800; --info-ink: #0b4f8a;
  --field-bg: #ffffff; --field-ink: #111111; --field-inset: #c8c8c8;
  --panel-shadow: 4px 4px 0 rgba(0, 0, 0, 0.22);
}
:root[data-theme="dark"] {
  --page: #1a1b1e; --page-grid: rgba(255, 255, 255, 0.025);
  --box: #232428; --box-2: #2c2d32; --box-3: #37393e;
  --ink: #f2f2f2; --ink-2: #d4d4d4; --ink-3: #ababab;
  --line: #45474d; --line-2: #5c5f66;
  --link: #8ccaff; --link-hover: #ffb347;
  --price-ink: #ffcf4d; --ok-ink: #7ddf55; --bad-ink: #ff7b6e; --warn-ink: #ffb547; --info-ink: #8ccaff;
  --field-bg: #000000; --field-ink: #ffffff; --field-inset: #2a2a2a;
  --panel-shadow: inset 2px 2px 0 rgba(255, 255, 255, 0.08), inset -2px -2px 0 rgba(0, 0, 0, 0.5), 4px 4px 0 rgba(0, 0, 0, 0.55);
}
body.light-page, .light-shell {
  background-color: var(--page);
  background-image:
    linear-gradient(var(--page-grid) 2px, transparent 2px),
    linear-gradient(90deg, var(--page-grid) 2px, transparent 2px);
}
.light-area {
  --text: var(--ink); --text-muted: var(--ink-3); --text-faint: var(--ink-3);
  --surface: var(--box); --surface-2: var(--box-2); --surface-3: var(--box-3);
  --border: var(--line); --border-strong: var(--line-2);
  --highlight: #8a5a00; --gold: #9a6400; --warning: var(--warn-ink); --danger: var(--bad-ink); --info: var(--info-ink); --custom: #5b2aa8;
  color: var(--text);
  color-scheme: light;
}
:root[data-theme="dark"] .light-area { --highlight: #ffd75e; --gold: #ffaa00; --custom: #c9a6ff; color-scheme: dark; }
.light-area a:not(.btn) { color: var(--link); }
.light-area a:not(.btn):hover { color: var(--link-hover); }
.light-area .link-btn { color: var(--link); }
.light-area .link-btn:hover { color: var(--link-hover); }
.light-area :is(input[type="text"], input[type="search"], input[type="password"], input[type="number"], input:not([type]), textarea) {
  background: var(--field-bg); color: var(--field-ink); border: 2px solid #000; box-shadow: inset 2px 2px 0 var(--field-inset);
}
.light-area select { background: var(--box-2); color: var(--ink); border: 2px solid #000; box-shadow: inset 2px 2px 0 rgba(255, 255, 255, 0.5), inset -2px -2px 0 rgba(0, 0, 0, 0.3); }
.light-area .banner { box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.18); }
.light-area .banner-warning { background: #fff3cd; border-color: #a86f00; color: #3d2a00; }
.light-area .banner-info { background: #e3f0ff; border-color: #2f6db5; color: #0d2b52; }
.light-area .form-error { background: #fdecea; color: #7a1712; border-color: #b3261e; }
.light-area .form-success { background: #e8f5e9; color: #1b5e20; border-color: #2e7d32; }
.light-area .empty-state { background: var(--box); border-color: var(--border-strong); }
.light-area .skeleton { background: linear-gradient(90deg, var(--box-2) 0%, var(--box-3) 50%, var(--box-2) 100%); background-size: 200% 100%; }
.light-area .table-wrap { background: var(--box); box-shadow: var(--panel-shadow); }
.light-area th { background: var(--box-2); color: var(--ink-2); }
.light-area th, .light-area td { border-bottom-color: var(--line); }
.light-area tbody tr:hover td { background: var(--box-3); }
.light-area .tag-bundle { background: #d6e9fb; color: #164a7a; border-color: #164a7a; }
.light-area .tag-custom { background: #efe5fc; color: #4b1f8f; border-color: #4b1f8f; }
.light-area .tag-duty { background: #e3f3da; color: #2d5a12; border-color: #5d9b3a; }
.light-area :is(.tag-wait, .tag-test) { background: #fff3cd; color: #7a4a00; border-color: #a86f00; }
.light-area .status-open { background: #e3f0ff; color: #0d47a1; border-color: #1d5fb5; }
.light-area .status-completed { background: #e3f3da; color: #1e5c12; border-color: #3f8a2a; }
.light-area .status-rejected { background: #fdecea; color: #8e1b14; border-color: #b3261e; }
.white-box { background: var(--box); border: 2px solid #000; box-shadow: var(--panel-shadow); }

:root[data-theme="dark"] .light-area .banner-warning { background: rgba(255, 181, 71, 0.13); border-color: #a86f00; color: #ffe2b5; }
:root[data-theme="dark"] .light-area .banner-info { background: rgba(95, 180, 255, 0.13); border-color: #2f6db5; color: #d3e9ff; }
:root[data-theme="dark"] .light-area .form-error { background: rgba(255, 107, 120, 0.14); color: #ffd3d7; border-color: #a83232; }
:root[data-theme="dark"] .light-area .form-success { background: rgba(93, 155, 58, 0.18); color: #c9f7dc; border-color: #5d9b3a; }
:root[data-theme="dark"] .light-area .tag-bundle { background: rgba(95, 180, 255, 0.15); color: #8ccaff; border-color: rgba(95, 180, 255, 0.5); }
:root[data-theme="dark"] .light-area .tag-custom { background: rgba(185, 140, 255, 0.15); color: #c9a6ff; border-color: rgba(185, 140, 255, 0.45); }
:root[data-theme="dark"] .light-area .tag-duty { background: rgba(93, 155, 58, 0.18); color: #7ddf55; border-color: #5d9b3a; }
:root[data-theme="dark"] .light-area :is(.tag-wait, .tag-test) { background: rgba(255, 215, 94, 0.12); color: #ffd75e; border-color: rgba(255, 215, 94, 0.45); }
:root[data-theme="dark"] .light-area .status-open { background: rgba(95, 180, 255, 0.13); color: #8ccaff; border-color: rgba(95, 180, 255, 0.4); }
:root[data-theme="dark"] .light-area .status-completed { background: rgba(93, 155, 58, 0.18); color: #7ddf55; border-color: #5d9b3a; }
:root[data-theme="dark"] .light-area .status-rejected { background: rgba(255, 107, 120, 0.14); color: #ff8a80; border-color: #a83232; }

:root[data-theme="dark"] .light-area :is(h1, h2, h3) { text-shadow: 2px 2px 0 #000; }
:root[data-theme="dark"] .light-area th { background: #16171a; color: #d6d6d6; }

.theme-toggle {
  position: fixed; right: 16px; bottom: 16px; z-index: 1500; width: 48px; height: 48px;
  display: grid; place-items: center; padding: 0; cursor: pointer;
  background: #6f6f6f; border: 2px solid #000; box-shadow: var(--bevel), 3px 3px 0 rgba(0, 0, 0, 0.45);
}
.theme-toggle:hover { border-color: #fff; }
.theme-toggle:active { box-shadow: inset 2px 2px 0 rgba(0, 0, 0, 0.45), inset -2px -2px 0 rgba(255, 255, 255, 0.2); }
.theme-icon { display: block; width: 24px; height: 24px; background: #e9e4c8; border: 2px solid #000; box-shadow: inset -6px -6px 0 #6f6f6f; }
:root[data-theme="dark"] .theme-icon { background: #ffd23f; box-shadow: inset -3px -3px 0 #e0a800, 0 0 0 3px #6f6f6f, 0 0 0 5px #ffd23f; width: 18px; height: 18px; }
.toasts { bottom: 76px; }

dialog { border: 2px solid #000; box-shadow: inset 2px 2px 0 rgba(255, 255, 255, 0.08), var(--shadow-lg); }
dialog::backdrop { background: rgba(0, 0, 0, 0.7); backdrop-filter: none; }
dialog[open] { animation: dialog-in 0.16s steps(3); }
.dialog-header h2 { text-shadow: 2px 2px 0 #000; }

.toast { border-radius: 0; border: 2px solid #000; border-left: 6px solid var(--accent); box-shadow: var(--shadow); }
.toast-error { border-left-color: var(--danger); }
.toast-warning { border-left-color: var(--warning); }
.toast-info { border-left-color: var(--info); }

.footer { background: var(--belt); border-top: 2px solid #000; padding: 22px 0; margin-top: 24px; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center; justify-content: space-between; }
.footer p { margin: 0; }
.footer-notes { display: grid; gap: 4px; text-align: right; }
@media (max-width: 720px) { .footer-notes { text-align: left; } }
.footer-big { padding: 0; margin-top: 32px; border-top: none; }
.footer-top {
  display: block; padding: 14px 16px; text-align: center; font-size: 0.9rem; text-decoration: none;
  background: #37393e; color: #fff; border-top: 2px solid #000; box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.08);
}
.footer-top:hover { background: #45474d; color: #fff; }
.footer-main { padding: 28px 0 24px; border-top: 2px solid #000; }
.footer-cols { display: grid; gap: 20px 40px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.footer-col h2 { margin: 0 0 8px; font-size: 1rem; color: #fff; text-shadow: 2px 2px 0 #000; }
.footer-col ul, .footer-col ol { display: grid; gap: 4px; margin: 0; padding: 0; font-size: 0.9rem; color: #cfcfcf; }
.footer-col ul { list-style: none; }
.footer-col ol { padding-left: 1.3em; }
.footer-col a { color: #d6d6d6; text-decoration: none; }
.footer-col a:hover { color: #fff; text-decoration: underline; }
.footer-big .footer-notes { text-align: left; align-content: start; }
.footer-bottom {
  display: flex; align-items: center; justify-content: center; gap: 10px; padding: 14px 16px;
  background: #0f1012; border-top: 2px solid #000; color: #fff; font-weight: 700; text-shadow: 2px 2px 0 #000;
}
.footer-bottom .brand-mark { width: 24px; height: 24px; }
.ai-note { display: inline-flex; align-items: center; gap: 6px; }
.ai-note::before { content: ""; width: 8px; height: 8px; background: var(--highlight); flex-shrink: 0; }
