/* ============================================================
   RPG Network – Webshop im Block-/Pixel-Stil (eigene Gestaltung, keine Original-Texturen)
   ============================================================ */
:root {
  --bg: #1d1a17;
  --bg2: #000;
  --panel: #2d2b29;
  --panel2: #3b3835;
  --line: #0f0e0d;
  --bevel-hi: #67625c;
  --bevel-lo: #141210;
  --text: #f4f1ea;
  --muted: #bdb6aa;
  --brand: #ffd84a;
  --brand2: #6ad04a;
  --ok: #6dff6d;
  --warn: #ffe45c;
  --bad: #ff6464;
  --aqua: #6af3ff;
  --gui: #c6c6c6;
  --gui-text: #3c3c3c;
  --slot: #8b8b8b;
  --radius: 0px;
  --font: "Cascadia Mono", "Consolas", "Lucida Console", "Courier New", ui-monospace, monospace;
  --shadow: 0 0 0 3px #000, 0 10px 24px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font: 15px/1.6 var(--font);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(#6fb8ff 0, #9fd2ff 320px, #2a2420 320px) fixed;
}
/* Himmel mit ziehenden Pixelwolken (nur Hintergrund) */
.sky { position: fixed; inset: 0 0 auto 0; height: 340px; pointer-events: none; z-index: -1; overflow: hidden; }
.sky .clouds { position: absolute; left: 0; right: 0; background-repeat: repeat-x; image-rendering: pixelated; }
.sky .c1 { top: 30px; height: 60px; opacity: .95; animation: clouds 120s linear infinite;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='480' height='60' shape-rendering='crispEdges'%3E%3Cg fill='%23fff'%3E%3Crect x='20' y='20' width='120' height='20'/%3E%3Crect x='40' y='10' width='70' height='40'/%3E%3Crect x='260' y='30' width='150' height='20'/%3E%3Crect x='290' y='20' width='80' height='40'/%3E%3C/g%3E%3C/svg%3E"); }
.sky .c2 { top: 120px; height: 60px; opacity: .7; animation: clouds 200s linear infinite reverse;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='640' height='60' shape-rendering='crispEdges'%3E%3Cg fill='%23f1f5ff'%3E%3Crect x='80' y='20' width='90' height='20'/%3E%3Crect x='100' y='10' width='40' height='30'/%3E%3Crect x='420' y='26' width='130' height='18'/%3E%3C/g%3E%3C/svg%3E"); }
/* Grasrand zwischen Himmel und Erde */
.sky::after { content: ""; position: absolute; left: 0; right: 0; bottom: 20px; height: 24px; image-rendering: pixelated;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='24' shape-rendering='crispEdges'%3E%3Crect width='32' height='24' fill='%2365401f'/%3E%3Crect width='32' height='8' fill='%2359a83a'/%3E%3Crect y='8' width='32' height='3' fill='%233f7d26'/%3E%3Crect x='4' y='8' width='4' height='6' fill='%2359a83a'/%3E%3Crect x='20' y='8' width='4' height='4' fill='%2359a83a'/%3E%3Crect x='10' y='16' width='4' height='4' fill='%234d2f14'/%3E%3Crect x='26' y='18' width='3' height='3' fill='%23825325'/%3E%3C/svg%3E") repeat-x; background-size: 32px 24px; }
.sky::before { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 22px; background: #2a2420; }
@keyframes clouds { from { background-position-x: 0; } to { background-position-x: -1280px; } }

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .6em; letter-spacing: .02em; text-shadow: 3px 3px 0 rgba(0, 0, 0, .55); }
h1 { font-size: clamp(1.9rem, 4vw, 3rem); }
h2 { font-size: 1.35rem; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.grad { color: var(--brand); text-shadow: 3px 3px 0 #6b5300; }

/* Testmodus-Hinweis im Warnstreifen-Look */
.testbar {
  background: repeating-linear-gradient(45deg, #b38f00 0 16px, #2b2b2b 16px 32px);
  color: #fff; text-align: center; padding: 6px 12px; font-size: .85rem; position: sticky; top: 0; z-index: 30;
  text-shadow: 2px 2px 0 #000; border-bottom: 3px solid #000;
}

/* Kopfzeile als „Hotbar“ */
.topbar {
  display: flex; align-items: center; gap: 22px; padding: 10px clamp(14px, 4vw, 44px);
  background: rgba(20, 18, 16, .92); border-bottom: 4px solid #000; box-shadow: inset 0 -3px 0 var(--bevel-hi);
  position: sticky; top: 0; z-index: 20;
}
.testbar:not([hidden]) + .topbar { top: 35px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-size: 1.25rem; font-weight: 700; text-shadow: 2px 2px 0 #000; }
.brand img { image-rendering: pixelated; animation: bob 3s ease-in-out infinite; }
.brand:hover { text-decoration: none; }
.brand b { color: var(--brand); text-shadow: 2px 2px 0 #6b5300; }
.nav { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.nav a {
  color: var(--text); padding: 7px 12px; font-weight: 700; text-shadow: 2px 2px 0 #000;
  background: #4a4744; border: 3px solid #000; box-shadow: inset 2px 2px 0 #7a756f, inset -2px -2px 0 #2a2826;
}
.nav a:hover { text-decoration: none; background: #5f6fc4; box-shadow: inset 2px 2px 0 #a9b6ff, inset -2px -2px 0 #3c4a99; }
.nav a.active { outline: 3px solid #fff; outline-offset: -1px; background: #5c5853; }
.cart-link { display: inline-flex; align-items: center; gap: 8px; }
.badge { background: var(--bad); color: #fff; padding: 0 6px; font-size: .8rem; min-width: 22px; text-align: center; border: 2px solid #000; text-shadow: 1px 1px 0 #000; display: inline-block; }
.badge.pop { animation: pop .35s steps(4); }
.menu-toggle { display: none; margin-left: auto; background: #4a4744; border: 3px solid #000; color: var(--text); padding: 6px 12px; font: 700 1.1rem var(--font); }

.view { flex: 1; width: 100%; max-width: 1200px; margin: 0 auto; padding: 28px clamp(14px, 4vw, 30px) 64px; outline: none; }
.view.enter { animation: pageIn .35s ease-out; }
@keyframes pageIn { from { opacity: 0; transform: translateY(10px); } }

/* Fußzeile als Grasblock-Streifen */
.footer {
  position: relative; padding: 34px clamp(14px, 4vw, 44px) 18px; color: #e9dfcf; font-size: .82rem;
  display: flex; flex-wrap: wrap; gap: 10px 24px; justify-content: space-between; text-shadow: 2px 2px 0 #000;
  background: #5a3a1c url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' shape-rendering='crispEdges'%3E%3Crect width='16' height='16' fill='%235a3a1c'/%3E%3Crect x='2' y='3' width='2' height='2' fill='%23462c14'/%3E%3Crect x='10' y='6' width='2' height='2' fill='%23704a26'/%3E%3Crect x='6' y='11' width='2' height='2' fill='%23462c14'/%3E%3Crect x='13' y='13' width='2' height='2' fill='%23704a26'/%3E%3C/svg%3E");
  background-size: 32px 32px; image-rendering: pixelated; border-top: 4px solid #000;
}
.footer::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 14px; background: #5aa83a; box-shadow: inset 0 -4px 0 #3f7d26; }
.footer nav { display: flex; gap: 16px; }
.footer a { color: var(--brand); }

/* GUI-Bausteine mit Kantenschattierung */
.panel {
  background: var(--panel); border: 3px solid #000; padding: 22px;
  box-shadow: inset 3px 3px 0 var(--bevel-hi), inset -3px -3px 0 var(--bevel-lo), 6px 6px 0 rgba(0, 0, 0, .35);
}
.grid { display: grid; gap: 18px; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.section { margin-top: 44px; }

/* Knöpfe wie im Spiel */
.btn {
  white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
  padding: 10px 18px; font: 700 .95rem var(--font); color: #fff; text-shadow: 2px 2px 0 #1f1f1f;
  background: #4c9a2a; border: 3px solid #000; box-shadow: inset 3px 3px 0 #86e05b, inset -3px -3px 0 #2c5c17;
  transition: transform .08s steps(2), filter .1s;
}
.btn:hover { text-decoration: none; filter: brightness(1.12); transform: translateY(-2px); }
.btn:active { transform: translateY(1px); box-shadow: inset -3px -3px 0 #86e05b, inset 3px 3px 0 #2c5c17; }
.btn:disabled { filter: grayscale(1) brightness(.75); cursor: not-allowed; transform: none; }
.btn.ghost { background: #6f6f6f; box-shadow: inset 3px 3px 0 #a8a8a8, inset -3px -3px 0 #464646; }
.btn.ghost:hover { background: #6474c8; box-shadow: inset 3px 3px 0 #a9b6ff, inset -3px -3px 0 #3c4a99; }
.btn.ok { background: #3aa3a0; box-shadow: inset 3px 3px 0 #7ee6e2, inset -3px -3px 0 #1f625f; }
.btn.bad { background: #b02e26; box-shadow: inset 3px 3px 0 #ff6a5f, inset -3px -3px 0 #6b1712; }
.btn.small { padding: 6px 11px; font-size: .85rem; }

input[type=text], input[type=number], input[type=search], select {
  width: 100%; padding: 10px 12px; border: 3px solid #000; background: #000; color: #fff; font: inherit;
  box-shadow: inset 0 0 0 2px #a0a0a0;
}
input:focus-visible, .btn:focus-visible, a:focus-visible, select:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
label.field { display: block; margin-bottom: 14px; }
label.field span { display: block; margin-bottom: 6px; color: var(--muted); font-size: .9rem; }
.code-input { letter-spacing: .35em; text-transform: uppercase; font-size: 1.25rem !important; color: var(--ok) !important; }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 10px 0; color: var(--muted); font-size: .9rem; }
.check input { margin-top: 4px; accent-color: var(--brand2); width: 18px; height: 18px; flex: none; }

/* Startseite */
.hero { display: grid; grid-template-columns: 1.3fr 1fr; gap: 30px; align-items: center; }
.hero .titlebox { position: relative; display: inline-block; }
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); text-shadow: 4px 4px 0 #3a3a3a; color: #fff; }
.splash {
  position: absolute; right: -30px; bottom: -6px; color: #ffff55; font-size: .95rem; font-weight: 700; white-space: nowrap;
  text-shadow: 2px 2px 0 #3f3f00; transform: rotate(-16deg); animation: splash .9s ease-in-out infinite alternate; pointer-events: none;
}
@keyframes splash { from { transform: rotate(-16deg) scale(.92); } to { transform: rotate(-16deg) scale(1.08); } }
.hero p.lead { font-size: 1.05rem; color: #fff; max-width: 48ch; text-shadow: 2px 2px 0 rgba(0, 0, 0, .75); }
.ip-box { display: inline-flex; align-items: center; gap: 12px; background: #000; border: 3px solid #a0a0a0; padding: 6px 6px 6px 14px; box-shadow: 4px 4px 0 rgba(0, 0, 0, .4); }
.ip-box code { font-size: 1.1rem; color: var(--ok); }
.status-card .dot { width: 14px; height: 14px; background: var(--bad); border: 2px solid #000; flex: none; }
.status-card .dot.on { background: var(--ok); animation: blink 1.6s steps(2) infinite; }
@keyframes blink { 50% { filter: brightness(.55); } }
.status-card .big { font-size: 2.4rem; font-weight: 700; color: var(--ok); text-shadow: 3px 3px 0 #1b5e1b; }
/* Erfahrungsleiste */
.bar { height: 14px; background: #1a1a1a; border: 3px solid #000; margin: 10px 0; }
.bar > div { height: 100%; width: 0; transition: width 1s steps(20);
  background: repeating-linear-gradient(90deg, #80ff20 0 18px, #4fbf10 18px 20px); box-shadow: inset 0 2px 0 #c6ff8c; }
.stat { background: var(--panel); border: 3px solid #000; padding: 16px; box-shadow: inset 3px 3px 0 var(--bevel-hi), inset -3px -3px 0 var(--bevel-lo); }
.stat .v { font-size: 1.8rem; font-weight: 700; color: var(--brand); text-shadow: 3px 3px 0 #6b5300; }
.stat .l { color: var(--muted); font-size: .85rem; }
.feature { background: var(--panel); border: 3px solid #000; padding: 20px; box-shadow: inset 3px 3px 0 var(--bevel-hi), inset -3px -3px 0 var(--bevel-lo);
  transition: transform .15s steps(3); }
.feature:hover { transform: translateY(-4px); }
.feature .fi { width: 44px; height: 44px; margin-bottom: 8px; display: block; }
.feature:hover .fi { animation: bob 1s ease-in-out infinite; }
.feature h3 { margin-bottom: .4em; color: var(--brand); }
.promise { box-shadow: inset 3px 3px 0 #7be05a, inset -3px -3px 0 #2c5c17, 6px 6px 0 rgba(0, 0, 0, .35); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { background: #000; border: 2px solid #555; padding: 1px 8px; font-size: .82rem; color: var(--text); }

/* Shop */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.tab { background: #6f6f6f; border: 3px solid #000; color: #fff; padding: 8px 14px; cursor: pointer; font: 700 .92rem var(--font);
  text-shadow: 2px 2px 0 #1f1f1f; box-shadow: inset 3px 3px 0 #a8a8a8, inset -3px -3px 0 #464646; }
.tab:hover { background: #6474c8; box-shadow: inset 3px 3px 0 #a9b6ff, inset -3px -3px 0 #3c4a99; }
.tab.active { background: #4c9a2a; box-shadow: inset 3px 3px 0 #86e05b, inset -3px -3px 0 #2c5c17; transform: translateY(-3px); }
.catdesc { color: #fff; text-shadow: 2px 2px 0 rgba(0, 0, 0, .8); }

/* Produktkarte im Inventar-Stil */
.product {
  --accent: #8b5cf6; display: flex; flex-direction: column; background: var(--gui); color: var(--gui-text); position: relative;
  border: 3px solid #000; box-shadow: inset 3px 3px 0 #fff, inset -3px -3px 0 #555, 6px 6px 0 rgba(0, 0, 0, .35);
  transition: transform .15s steps(3); overflow: hidden; animation: pageIn .4s ease-out both;
}
.product:hover { transform: translateY(-5px); }
/* Verzauberungs-Schimmer beim Darüberfahren */
.product::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(200, 120, 255, .35) 45%, rgba(255, 255, 255, .25) 50%, transparent 65%);
  background-size: 250% 100%; }
.product:hover::after { opacity: 1; animation: glint 1.4s linear infinite; }
@keyframes glint { from { background-position: 150% 0; } to { background-position: -100% 0; } }
.product .art { height: 128px; display: grid; place-items: center; margin: 12px 12px 0; position: relative; perspective: 300px;
  background: radial-gradient(circle at 50% 70%, var(--accent) 0, transparent 62%), var(--slot);
  border: 3px solid; border-color: #373737 #fff #fff #373737; }
.product .art .float { animation: bob 2.8s ease-in-out infinite; }
.product .art svg { width: 68px; height: 68px; display: block; filter: drop-shadow(3px 4px 0 rgba(0, 0, 0, .45)); animation: spin 6s linear infinite; }
.product:hover .art svg { animation-duration: 2.2s; }
.product .tag { position: absolute; top: 6px; right: 6px; font-size: .72rem; padding: 1px 6px; background: #000; color: var(--warn); border: 2px solid var(--warn); }
.product .body { padding: 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.product h3 { margin: 0; color: #2a2a2a; text-shadow: 2px 2px 0 rgba(255, 255, 255, .6); }
.product .muted { color: #555; }
.product ul { margin: 0; padding-left: 18px; color: #444; font-size: .88rem; }
.product .foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: auto; padding-top: 10px; }
.price { font-size: 1.3rem; font-weight: 700; color: #1f6f1f; }
.price s { color: #777; font-size: .9rem; font-weight: 400; margin-right: 6px; }
.owned { color: #1f6f1f; font-size: .88rem; font-weight: 700; }
.panel .owned, .paybox .owned { color: var(--ok); }
/* Truhe öffnet sich beim Darüberfahren */
svg .lid { transition: transform .25s steps(3); transform-box: fill-box; transform-origin: 0 100%; }
.product:hover svg .lid, .feature:hover svg .lid { transform: translateY(-2px) rotate(-12deg); }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes spin { 0% { transform: rotateY(0); } 100% { transform: rotateY(360deg); } }

/* Partikel beim In-den-Warenkorb-Legen (Block-Abbau) */
.mc-particle { position: fixed; width: 8px; height: 8px; pointer-events: none; z-index: 60; border: 1px solid rgba(0, 0, 0, .5);
  animation: particle .7s cubic-bezier(.2, .6, .4, 1) forwards; }
@keyframes particle { to { transform: translate(var(--dx), var(--dy)) rotate(var(--rot)); opacity: 0; } }

/* Tabellen */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 2px solid #000; vertical-align: middle; }
th { color: var(--brand); font-weight: 700; font-size: .86rem; text-shadow: 2px 2px 0 #000; }
td.num, th.num { text-align: right; white-space: nowrap; }
.qty { display: inline-flex; align-items: center; gap: 6px; }
.qty button { width: 30px; height: 30px; border: 3px solid #000; background: #6f6f6f; color: #fff; cursor: pointer; font: 700 1rem var(--font);
  box-shadow: inset 2px 2px 0 #a8a8a8, inset -2px -2px 0 #464646; }
.total { font-size: 1.4rem; font-weight: 700; color: var(--ok); text-shadow: 2px 2px 0 #1b5e1b; }
.status { display: inline-block; padding: 1px 8px; font-size: .8rem; font-weight: 700; background: #000; border: 2px solid currentColor; }
.status.PAID { color: var(--ok); }
.status.PENDING { color: var(--warn); }
.status.FAILED, .status.CANCELLED, .status.REFUNDED { color: var(--bad); }
.notice { background: #3d3410; border: 3px solid #000; box-shadow: inset 0 0 0 2px var(--warn); padding: 12px 14px; color: #fff3b0; }
.notice.info { background: #182a3d; box-shadow: inset 0 0 0 2px var(--aqua); color: #d8f6ff; }
.error-text { color: var(--bad); min-height: 1.4em; text-shadow: 1px 1px 0 #000; }

/* Profil */
.avatar { width: 72px; height: 72px; display: grid; place-items: center; font-size: 2rem; font-weight: 800; color: #fff; flex: none;
  background: #4c9a2a; border: 3px solid #000; box-shadow: inset 3px 3px 0 #86e05b, inset -3px -3px 0 #2c5c17; text-shadow: 3px 3px 0 #1b3d0e; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 18px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 700; }

/* Rangliste */
.leader ol { list-style: none; padding: 0; margin: 0; }
.leader li { display: flex; gap: 14px; align-items: center; padding: 9px 6px; border-bottom: 2px solid #000; animation: pageIn .4s ease-out both; }
.leader .pos { width: 34px; height: 34px; display: grid; place-items: center; background: #555; border: 3px solid #000; font-weight: 700; }
.leader li:nth-child(1) .pos { background: #e6b800; color: #3f3200; }
.leader li:nth-child(2) .pos { background: #b9b9b9; color: #333; }
.leader li:nth-child(3) .pos { background: #b5651d; }

/* Testzahlung */
.paybox { max-width: 580px; margin: 0 auto; text-align: center; }
.paybox ul { list-style: none; padding: 0; }
.fake-provider { border: 3px dashed var(--warn); padding: 22px; margin: 20px 0; background: rgba(0, 0, 0, .35); }

/* Rechtliches */
.legal h2 { margin-top: 1.4em; font-size: 1.15rem; }
.legal .placeholder { background: #4a1414; border: 2px dashed var(--bad); padding: 1px 6px; color: #ffd0d0; }

/* Meldungen */
.toasts { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 50; }
.toast { background: #212121; border: 3px solid #000; box-shadow: inset 0 0 0 2px #6b6b6b, 4px 4px 0 rgba(0, 0, 0, .4);
  padding: 10px 14px; max-width: 360px; animation: toastIn .3s steps(4); text-shadow: 1px 1px 0 #000; }
.toast.ok { box-shadow: inset 0 0 0 2px var(--ok), 4px 4px 0 rgba(0, 0, 0, .4); }
.toast.bad { box-shadow: inset 0 0 0 2px var(--bad), 4px 4px 0 rgba(0, 0, 0, .4); }
@keyframes toastIn { from { transform: translateX(120%); } }
@keyframes pop { 50% { transform: scale(1.5); } }
.skeleton { color: var(--muted); padding: 40px; text-align: center; }
.skeleton::after { content: "▮"; animation: blink 1s steps(2) infinite; margin-left: 4px; }

/* Inhalt & Chancen (Cases) */
.chances summary { cursor: pointer; color: #2c3fa8; font-size: .9rem; font-weight: 700; }
.chances table { margin-top: 6px; font-size: .82rem; }
.chances td { padding: 3px 6px; border-bottom: 1px solid #9a9a9a; color: #333; }
.rarity { font-weight: 700; }
.rarity.COMMON { color: #555; }
.rarity.RARE { color: #1f7fa8; }
.rarity.EPIC { color: #9b30c8; }
.rarity.LEGENDARY { color: #b07800; }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
  .splash { right: 0; }
  .menu-toggle { display: block; }
  .nav { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch; background: #1b1916; border-bottom: 4px solid #000; padding: 10px; }
  .nav.open { display: flex; }
  .topbar { position: relative; }
  th.hide-sm, td.hide-sm { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
