/* Airsoft-App: dunkles Braun, Coyote/Tan als Akzent */
:root {
  --bg: #15110d;
  --card: #1f1a14;
  --card2: #282118;
  --line: #3a3126;
  --text: #efe6d6;
  --muted: #a8998a;
  --tan: #d4a35a;
  --olive: #8a9a5b;
  --red: #e8553a;
  --radius: 14px;
  --font-d: 'Oswald', 'Inter', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 'Inter', system-ui, -apple-system, Segoe UI, sans-serif;
  min-height: 100vh;
}
a { color: var(--tan); }
button { font: inherit; }

/* Ladebildschirm (ohne Leucht-Effekte, wegen iPhone) */
.splash { position: fixed; inset: 0; z-index: 1000; background: var(--bg); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px; transition: opacity .35s ease; }
.splash.out { opacity: 0; pointer-events: none; }
.splash img { width: 120px; height: 120px; }
.splash-name { font-family: var(--font-d); font-size: 42px; font-weight: 700; letter-spacing: .12em; }
.splash-tag { margin-top: -10px; font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.splash-bar { width: min(300px, 78vw); height: 4px; background: var(--line); border-radius: 99px; overflow: hidden; }
#splash-fill { height: 100%; width: 0; background: var(--tan); border-radius: inherit; }
.splash-pct { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Kopfzeile */
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: rgba(21, 17, 13, .94);
  border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 9px; color: var(--text); text-decoration: none;
  font-family: var(--font-d); font-weight: 700; font-size: 20px; letter-spacing: .12em; }
.tabs { display: flex; gap: 4px; margin-left: auto; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.tabs a { color: var(--muted); text-decoration: none; padding: 6px 14px; border-radius: 7px; font-weight: 600; font-size: 14px; }
.tabs a.on { background: var(--tan); color: #1a140d; }
.icon-btn { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--card); color: var(--text); cursor: pointer; }
.icon-btn:hover { border-color: var(--tan); }
.icon-btn.spin svg { animation: spin .6s linear; }
@keyframes spin { to { transform: rotate(360deg); } }

main { max-width: 980px; margin: 0 auto; padding: 18px 16px 60px; }

/* Startseite */
.hero { padding: 22px 20px; border-radius: var(--radius); border: 1px solid var(--line);
  background: linear-gradient(135deg, #2b2218, #191410 70%); }
.hero small { color: var(--tan); letter-spacing: .2em; text-transform: uppercase; font-size: 12px; font-weight: 600; }
.hero h1 { font-family: var(--font-d); font-size: clamp(28px, 7vw, 40px); margin: 4px 0 6px; letter-spacing: .03em; line-height: 1.15; }
.hero p { margin: 0; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border-radius: 99px; background: var(--card2);
  border: 1px solid var(--line); font-size: 13px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

h2 { font-family: var(--font-d); font-size: 22px; letter-spacing: .06em; text-transform: uppercase; margin: 30px 0 12px; }
h2 span { color: var(--muted); font-size: 14px; font-family: 'Inter', sans-serif; letter-spacing: 0; text-transform: none; font-weight: 500; }

/* Loadout-Karten wie in einem Spiel */
.loadout { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); }
.slot { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.slot-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; background: var(--card2);
  border-bottom: 1px solid var(--line); }
.slot-tag { font-family: var(--font-d); letter-spacing: .14em; font-size: 13px; color: var(--tan); text-transform: uppercase; }
.slot-key { font-family: var(--font-d); font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 1px 7px; }
.slot-body { padding: 14px; flex: 1; }
.slot-name { font-family: var(--font-d); font-size: 24px; line-height: 1.15; margin: 0; letter-spacing: .02em; }
.slot-sub { color: var(--muted); font-size: 13px; margin: 2px 0 12px; }
.stats { display: grid; gap: 7px; margin-bottom: 14px; }
.stat { display: grid; grid-template-columns: 82px 1fr 84px; align-items: center; gap: 8px; font-size: 12px; }
.stat b { color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; font-size: 11px; }
.bar { height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--tan); border-radius: inherit; }
.stat span { text-align: right; font-variant-numeric: tabular-nums; }
.gear { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.gear li { display: grid; grid-template-columns: 34px 1fr auto; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.gear .n { font-family: var(--font-d); color: var(--tan); font-size: 15px; text-align: center; }
.gear a { color: var(--text); text-decoration: none; font-size: 14px; }
.gear a:hover { color: var(--tan); text-decoration: underline; }
.gear small { display: block; color: var(--muted); font-size: 12px; }
.gear .p { color: var(--muted); font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.slot-foot { display: flex; justify-content: space-between; padding: 11px 14px; border-top: 1px solid var(--line); background: var(--card2); font-weight: 600; }
.slot-foot span:last-child { color: var(--tan); font-variant-numeric: tabular-nums; }

/* Shops & Preis */
.shops { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.shop { display: block; text-decoration: none; color: var(--text); background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px; }
.shop:hover { border-color: var(--tan); }
.shop .name { font-family: var(--font-d); font-size: 20px; letter-spacing: .03em; }
.shop .url { color: var(--tan); font-size: 13px; }
.shop .what { color: var(--muted); font-size: 13px; margin: 6px 0 10px; }
.shop .sum { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.total { margin-top: 12px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px;
  padding: 16px 18px; border-radius: var(--radius); background: var(--tan); color: #1a140d; }
.total .l { font-family: var(--font-d); font-size: 18px; letter-spacing: .08em; text-transform: uppercase; }
.total .v { font-family: var(--font-d); font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums; }
.note { color: var(--muted); font-size: 13px; margin-top: 10px; }

/* Legende */
.legend { margin: 0; display: grid; gap: 0 18px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 16px; }
.legend div { display: grid; grid-template-columns: 112px 1fr; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.legend dt { color: var(--tan); font-weight: 600; font-size: 13px; }
.legend dd { margin: 0; color: var(--muted); font-size: 13px; }

/* PDF */
.pdf-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.pdf-bar .info { margin-right: auto; color: var(--muted); font-size: 13px; }
.pdf-bar .info b { color: var(--text); font-size: 16px; display: block; }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--card); color: var(--text); text-decoration: none; font-weight: 600; font-size: 14px; cursor: pointer; }
.btn.main { background: var(--tan); color: #1a140d; border-color: var(--tan); }
.pages { display: grid; gap: 12px; }
.pages canvas { width: 100%; height: auto; border-radius: 8px; background: #fff; display: block; }
.loading { color: var(--muted); text-align: center; padding: 40px 0; }

/* Handy: Reiter unten wie in einer App, grössere Tippflächen, Platz für die iPhone-Leiste */
@media (max-width: 640px) {
  body { font-size: 15px; }
  .top { padding-left: calc(16px + env(safe-area-inset-left)); padding-right: calc(16px + env(safe-area-inset-right)); }
  .brand { font-size: 19px; }
  .brand img { width: 36px; height: 36px; }
  .icon-btn { margin-left: auto; width: 42px; height: 42px; }
  .tabs { position: fixed; z-index: 20; left: 0; right: 0; bottom: 0; margin: 0; border-radius: 0; border: 0;
    border-top: 1px solid var(--line); background: rgba(21, 17, 13, .97); padding: 6px 16px calc(6px + env(safe-area-inset-bottom));
    display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .tabs a { text-align: center; padding: 11px 0; font-size: 15px; border-radius: 10px; }
  main { padding: 14px 12px calc(90px + env(safe-area-inset-bottom)); }
  .hero { padding: 18px 16px; }
  h2 { margin-top: 24px; }
  .slot-name { font-size: 22px; }
  .stat { grid-template-columns: 74px 1fr 78px; }
  .gear li { padding: 10px 0; }
  .gear a { font-size: 15px; }
  .shop .sum { font-size: 20px; }
  .total { padding: 14px 16px; }
  .total .v { font-size: 26px; }
  .pdf-bar .info { width: 100%; }
  .pdf-bar .btn { flex: 1; justify-content: center; padding: 12px; }
  .pages { gap: 8px; }
}
