:root{
  --bg0:#07090d;
  --bg1:#0a1018;
  --card: rgba(255,255,255,.06);
  --card2: rgba(255,255,255,.04);
  --stroke: rgba(255,255,255,.10);
  --stroke2: rgba(255,255,255,.14);
  --text: rgba(255,255,255,.92);
  --muted: rgba(255,255,255,.68);
  --muted2: rgba(255,255,255,.55);
  --accent: #79e2ff;
  --accent2:#ffdf7a;
  --shadow: 0 18px 70px rgba(0,0,0,.55);
  --r: 22px;
  --blur: 10px;
  --font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;

  /* Mobile sizing */
  --stageH: 520px;
  --canvasMax: 340px;
  --gap: 14px;

  /* iOS safe area */
  --safeTop: env(safe-area-inset-top, 0px);
  --safeRight: env(safe-area-inset-right, 0px);
  --safeBottom: env(safe-area-inset-bottom, 0px);
  --safeLeft: env(safe-area-inset-left, 0px);
}
[data-theme="light"]{
  --bg0:#f6f7fb;
  --bg1:#eef2ff;
  --card: rgba(0,0,0,.05);
  --card2: rgba(0,0,0,.03);
  --stroke: rgba(0,0,0,.10);
  --stroke2: rgba(0,0,0,.14);
  --text: rgba(0,0,0,.88);
  --muted: rgba(0,0,0,.62);
  --muted2: rgba(0,0,0,.52);
  --shadow: 0 18px 60px rgba(0,0,0,.18);
}

*{ box-sizing:border-box; }
html, body{ height:100%; }
body{
  margin:0;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1000px 600px at 20% 10%, rgba(121,226,255,.14), transparent 60%),
    radial-gradient(1000px 600px at 80% 15%, rgba(255,223,122,.12), transparent 60%),
    radial-gradient(900px 700px at 50% 95%, rgba(255,255,255,.08), transparent 60%),
    linear-gradient(180deg, var(--bg1), var(--bg0));
  background-attachment: fixed;
  background-repeat: no-repeat;
  background-size: cover;

  /* MOBILE FIX: no center, allow scroll */
  display:block;
  overflow-x:hidden;

  padding:
    calc(14px + var(--safeTop))
    calc(14px + var(--safeRight))
    calc(14px + var(--safeBottom))
    calc(14px + var(--safeLeft));
}

/* Layout */
.app{
  width: min(1100px, 100%);
  margin: 0 auto;
  display:grid;
  grid-template-columns: 1.35fr .95fr;
  gap: var(--gap);
  align-items:start;
}

/* Elemente die über beide Spalten gehen sollen */
.app > hr,
.app > .seoBlock,
.app > .faqCard{
  grid-column: 1 / -1;
}

/* MOBILE: one column + better stage sizing */
@media (max-width: 980px){
  :root{
    --gap: 12px;
    --stageH: 520px;
    --canvasMax: 320px;
  }
  .app{ grid-template-columns: 1fr; }
}

/* Very small phones */
@media (max-width: 420px){
  :root{
    --stageH: 500px;
    --canvasMax: 290px;
  }
}

/* Landscape phones: reduce height, avoid huge empty */
@media (max-height: 520px) and (max-width: 980px){
  :root{
    --stageH: 420px;
    --canvasMax: 260px;
  }
}

.card{
  background: linear-gradient(180deg, var(--card), var(--card2));
  border:1px solid var(--stroke);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  overflow:hidden;
  position:relative;
  min-width: 0; /* important for grid on mobile */
}

.header{
  padding:16px 16px 12px 16px;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap; /* mobile: wrap pills */
}
.titleWrap{ min-width:0; flex: 1 1 260px; }
.title{
  margin:0;
  font-size:18px;
  font-weight:1000;
  letter-spacing:.2px;
  line-height:1.1;
}
.sub{
  margin:8px 0 0 0;
  font-size:13px;
  color: var(--muted);
  line-height:1.35;
}

.pillRow{
  display:flex;
  gap:8px;
  align-items:center;
  flex-wrap:wrap;
  justify-content:flex-end;
  flex: 0 1 auto;
}
.pill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 10px;
  border-radius:999px;
  border:1px solid var(--stroke);
  background: rgba(0,0,0,.08);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  font-size:12px;
  color: var(--muted);
  user-select:none;
  white-space:nowrap;
}
[data-theme="light"] .pill{ background: rgba(255,255,255,.55); }
.dot{
  width:9px; height:9px; border-radius:50%;
  background: var(--accent);
  box-shadow: 0 0 14px rgba(121,226,255,.55);
}

/* Stage */
.stage{
  height: var(--stageH);
  position:relative;
  border-top:1px solid var(--stroke);
  overflow:hidden;
  background:
    radial-gradient(900px 480px at 50% 85%, rgba(255,255,255,.12), transparent 62%),
    radial-gradient(600px 380px at 20% 20%, rgba(121,226,255,.10), transparent 60%),
    radial-gradient(600px 380px at 80% 25%, rgba(255,223,122,.08), transparent 60%),
    linear-gradient(180deg, rgba(0,0,0,.10), rgba(0,0,0,.02));
}
[data-theme="light"] .stage{
  background:
    radial-gradient(900px 480px at 50% 85%, rgba(0,0,0,.08), transparent 62%),
    radial-gradient(600px 380px at 20% 20%, rgba(121,226,255,.16), transparent 60%),
    radial-gradient(600px 380px at 80% 25%, rgba(255,223,122,.14), transparent 60%),
    linear-gradient(180deg, rgba(255,255,255,.40), rgba(255,255,255,.18));
}

.grid{
  position:absolute; inset:0;
  background:
    linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 44px 44px;
  opacity:.28;
  mask-image: radial-gradient(circle at 50% 70%, rgba(0,0,0,.85), transparent 70%);
  pointer-events:none;
}
[data-theme="light"] .grid{ opacity:.22; }

.hud{
  position:absolute;
  left:14px;
  top:14px;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  pointer-events:none;
  z-index:4;
}
.hud .tag{
  border:1px solid var(--stroke);
  background: rgba(0,0,0,.18);
  border-radius: 999px;
  padding:8px 10px;
  font-size:12px;
  color: var(--muted);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
}
[data-theme="light"] .hud .tag{ background: rgba(255,255,255,.55); }

/* Canvas center */
.coinCanvasWrap{
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;

  /* MOBILE FIX: ensure room for hint + footer, no overlap */
  padding: 46px 14px 110px 14px;
  z-index:2;
}

#coinCanvas{
  width: min(var(--canvasMax), 92vw);
  height: auto;
  aspect-ratio: 1 / 1;
  border-radius: 26px;
  background: rgba(0,0,0,.08);
  border:1px solid rgba(255,255,255,.06);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
  display:block;
}
[data-theme="light"] #coinCanvas{
  background: rgba(255,255,255,.55);
  border-color: rgba(0,0,0,.06);
}

/* Hint bar */
.hint{
  position:absolute;
  left:12px;
  right:12px;
  bottom:12px;
  border:1px solid var(--stroke);
  background: rgba(0,0,0,.18);
  border-radius: 14px;
  padding:10px 12px;
  font-size:12px;
  color: var(--muted);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  display:flex;
  gap:10px;
  align-items:center;
  z-index:4;
  flex-wrap:wrap;

  /* MOBILE FIX: never cover safe-area */
  margin-bottom: var(--safeBottom);
}
[data-theme="light"] .hint{ background: rgba(255,255,255,.55); }
.kbd{
  border:1px solid var(--stroke2);
  border-bottom-color: rgba(0,0,0,.25);
  padding:4px 8px;
  border-radius:10px;
  font-weight:900;
  color: var(--text);
  background: rgba(255,255,255,.07);
  white-space:nowrap;
}
[data-theme="light"] .kbd{
  background: rgba(0,0,0,.05);
  border-bottom-color: rgba(0,0,0,.18);
}

/* Footer */
.footer{
  border-top:1px solid var(--stroke);
  padding:14px;
  display:grid;
  gap:12px;
}

.row{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
  justify-content:space-between;
}
.btnRow{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
  width:100%;
}
.btnRow:last-child{ width:auto; }

button{
  appearance:none;
  border:1px solid var(--stroke2);
  background: rgba(255,255,255,.06);
  color: var(--text);
  padding:12px 14px;
  border-radius: 16px;
  cursor:pointer;
  font-weight:1000;
  letter-spacing:.2px;
  transition: transform .06s ease, background .18s ease, border-color .18s ease;
  display:inline-flex;
  gap:10px;
  align-items:center;
  user-select:none;
  flex: 1 1 auto;
  justify-content:center;
  min-height: 44px; /* mobile tap target */
}
button:hover{
  background: rgba(255,255,255,.10);
  border-color: rgba(255,255,255,.25);
}
button:active{ transform: scale(.985); }
button:disabled{ opacity:.55; cursor:not-allowed; }

/* MOBILE FIX: 2 buttons per row, then full width for copy */
@media (max-width: 520px){
  button{ flex: 1 1 calc(50% - 10px); }
  #btnCopy{ flex: 1 1 100%; }
  #btnReset{ flex: 1 1 100%; }
}

.primary{
  background:
    radial-gradient(circle at 20% 20%, rgba(121,226,255,.22), transparent 42%),
    linear-gradient(180deg, rgba(121,226,255,.18), rgba(255,255,255,.06));
  border-color: rgba(121,226,255,.38);
}
.primary:hover{
  border-color: rgba(121,226,255,.55);
  background:
    radial-gradient(circle at 20% 20%, rgba(121,226,255,.28), transparent 42%),
    linear-gradient(180deg, rgba(121,226,255,.22), rgba(255,255,255,.08));
}
.danger{ border-color: rgba(255,107,107,.40); }

.resultBar{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:flex-start;
  justify-content:space-between;
  border:1px solid var(--stroke);
  background: rgba(0,0,0,.16);
  border-radius: 18px;
  padding:12px;
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
}
[data-theme="light"] .resultBar{ background: rgba(255,255,255,.55); }
.resultText{
  font-weight:1000;
  letter-spacing:.2px;
  font-size:16px;
  display:flex;
  gap:10px;
  align-items:center;
  min-width: 220px;
  flex: 1 1 220px;
}
.miniLine{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  align-items:center;
  color: var(--muted);
  font-size:12px;
  flex: 1 1 220px;
  justify-content:flex-end;
}
@media (max-width: 520px){
  .miniLine{ justify-content:flex-start; }
}

.badge{
  border:1px solid var(--stroke);
  background: rgba(255,255,255,.05);
  padding:6px 10px;
  border-radius:999px;
  font-size:12px;
  color: var(--muted);
  white-space:nowrap;
}
.spark{
  color: var(--accent2);
  filter: drop-shadow(0 0 12px rgba(255,223,122,.25));
}

/* Right panel */
.panel{
  padding:16px;
  display:flex;
  flex-direction:column;
  gap:12px;
}
.section{
  border:1px solid var(--stroke);
  background: rgba(0,0,0,.10);
  border-radius: 18px;
  padding:12px;
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
}
[data-theme="light"] .section{ background: rgba(255,255,255,.55); }
.panel h2{
  margin:0;
  font-size:14px;
  font-weight:1000;
  letter-spacing:.2px;
}
.panel p{
  margin:6px 0 0 0;
  font-size:12px;
  color: var(--muted);
  line-height:1.4;
}

.grid2{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:10px;
  margin-top:10px;
}
@media (max-width: 520px){
  .grid2{ grid-template-columns: 1fr; }
}

.stat{
  border:1px solid var(--stroke);
  background: rgba(255,255,255,.05);
  border-radius:16px;
  padding:12px;
}
.stat .k{ font-size:12px; color: var(--muted); margin-bottom:6px; }
.stat .v{ font-size:18px; font-weight:1000; }

.controlsGrid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:10px;
  margin-top:10px;
}
@media (max-width: 520px){
  .controlsGrid{ grid-template-columns: 1fr; }
}

label{
  display:flex;
  flex-direction:column;
  gap:8px;
  font-size:12px;
  color: var(--muted);
}
select, input[type="range"], input[type="number"]{ width:100%; }
select, input[type="number"]{
  appearance:none;
  border:1px solid var(--stroke);
  background: rgba(255,255,255,.06);
  color: var(--text);
  border-radius: 14px;
  padding:10px 12px;
  outline:none;
  font-family: var(--font);
  min-height: 44px;
}
[data-theme="light"] select, [data-theme="light"] input[type="number"]{
  background: rgba(0,0,0,.04);
}
input[type="range"]{ accent-color: var(--accent); }

.toggle{
  display:flex;
  gap:10px;
  align-items:center;
  justify-content:space-between;
  border:1px solid var(--stroke);
  background: rgba(255,255,255,.05);
  padding:10px 12px;
  border-radius: 16px;
  margin-top:10px;
}
.toggle .tText{ display:flex; flex-direction:column; gap:2px; min-width:0; }
.toggle .tText b{ color: var(--text); font-size:12px; font-weight:1000; }
.toggle .tText span{ font-size:12px; color: var(--muted2); line-height:1.2; }

.switch{
  width:46px; height:28px;
  border-radius:999px;
  border:1px solid var(--stroke);
  background: rgba(0,0,0,.18);
  position:relative;
  cursor:pointer;
  flex:0 0 auto;
}
[data-theme="light"] .switch{ background: rgba(255,255,255,.55); }
.knob{
  position:absolute;
  left:4px; top:4px;
  width:20px; height:20px;
  border-radius:50%;
  background: rgba(255,255,255,.85);
  box-shadow: 0 8px 20px rgba(0,0,0,.30);
  transition: transform .18s ease;
}
.switch[data-on="true"] .knob{
  transform: translateX(18px);
  background: rgba(121,226,255,.95);
  box-shadow: 0 0 16px rgba(121,226,255,.45);
}

.history{
  max-height: 210px;
  overflow:auto;
  padding-right:6px;
  margin-top:10px;
}
.history::-webkit-scrollbar{ width:8px; }
.history::-webkit-scrollbar-thumb{
  background: rgba(255,255,255,.12);
  border-radius:999px;
}
[data-theme="light"] .history::-webkit-scrollbar-thumb{
  background: rgba(0,0,0,.14);
}

.hItem{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:10px 10px;
  border:1px solid var(--stroke);
  border-radius:14px;
  background: rgba(255,255,255,.04);
  margin-top:8px;
}
.hLeft{ display:flex; gap:10px; align-items:center; min-width:0; }
.hIcon{
  width:34px; height:34px;
  border-radius:12px;
  display:flex;
  align-items:center;
  justify-content:center;
  border:1px solid var(--stroke);
  background: rgba(0,0,0,.14);
  flex:0 0 auto;
}
[data-theme="light"] .hIcon{ background: rgba(255,255,255,.55); }
.hText{ min-width:0; display:flex; flex-direction:column; gap:2px; }
.hText b{
  font-size:12px;
  font-weight:1000;
  color: var(--text);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.hText span{
  font-size:12px;
  color: var(--muted2);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.hRight{
  font-size:12px;
  color: var(--muted2);
  white-space:nowrap;
  flex:0 0 auto;
}

.toast{
  position:fixed;
  left:50%;
  bottom: calc(18px + var(--safeBottom));
  transform: translateX(-50%);
  border:1px solid var(--stroke);
  background: rgba(0,0,0,.22);
  color: var(--text);
  padding:10px 12px;
  border-radius: 16px;
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  box-shadow: 0 14px 45px rgba(0,0,0,.35);
  opacity:0;
  pointer-events:none;
  transition: opacity .18s ease, transform .18s ease;
  max-width:min(760px, calc(100% - 24px));
  font-size:12px;
  text-align:center;
  z-index:999;
}
[data-theme="light"] .toast{ background: rgba(255,255,255,.70); }
.toast.show{
  opacity:1;
  transform: translateX(-50%) translateY(-4px);
}

/* iOS Safari: prevent double-tap zoom on controls + smoother */
button, .switch, input, select { touch-action: manipulation; }

/* Reduce motion accessibility */
@media (prefers-reduced-motion: reduce){
  *{ scroll-behavior:auto !important; }
  button{ transition:none !important; }
  .toast{ transition:none !important; }
  .knob{ transition:none !important; }
}

.seoBlock{
  margin-top: 32px;
  padding: 18px;
  border:1px solid var(--stroke);
  border-radius:18px;
  background: rgba(255,255,255,.04);
}

.seoBlock h2{
  margin:0 0 10px 0;
  font-size:16px;
  font-weight:1000;
}

.seoBlock p,
.seoBlock li{
  font-size:13px;
  line-height:1.6;
  color: var(--muted);
}

.seoFooter{
  margin-top:40px;
  font-size:11px;
  color: var(--muted2);
  text-align:center;
}

/* FAQ Card Styles */
.faqCard{
  border:1px solid var(--stroke);
  background: linear-gradient(180deg, var(--card), var(--card2));
  border-radius: var(--r);
  box-shadow: var(--shadow);
  overflow:hidden;
  margin-top: 32px;
}
.faqHead{
  padding:16px;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  border-bottom:1px solid var(--stroke);
}
.faqTitleWrap{ min-width:0; }
.faqTitle{
  margin:0;
  font-size:14px;
  font-weight:1000;
  letter-spacing:.2px;
  color: var(--text);
}
.faqSub{
  margin:6px 0 0 0;
  font-size:12px;
  line-height:1.4;
  color: var(--muted);
}
.faqTools{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
  justify-content:flex-end;
  flex:0 0 auto;
}
.faqPill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 10px;
  border-radius:999px;
  border:1px solid var(--stroke);
  background: rgba(0,0,0,.08);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  font-size:12px;
  color: var(--muted);
  user-select:none;
  white-space:nowrap;
}
[data-theme="light"] .faqPill{ background: rgba(255,255,255,.55); }

.faqBody{ padding:12px; }

.faqSearch{
  display:flex;
  gap:10px;
  align-items:center;
  border:1px solid var(--stroke);
  background: rgba(255,255,255,.05);
  border-radius:16px;
  padding:10px 12px;
  margin-bottom:12px;
}
.faqSearch span{
  font-size:12px;
  color: var(--muted2);
  white-space:nowrap;
}
.faqSearch input{
  width:100%;
  appearance:none;
  border:0;
  outline:none;
  background: transparent;
  color: var(--text);
  font-family: var(--font);
  font-size:13px;
}
.faqSearch input::placeholder{ color: var(--muted2); }

.faqList{ display:grid; gap:10px; }

.faqItem{
  border:1px solid var(--stroke);
  background: rgba(255,255,255,.05);
  border-radius:18px;
  overflow:hidden;
}
.faqBtn{
  width:100%;
  border:0;
  background: transparent;
  color: var(--text);
  padding:12px 12px;
  cursor:pointer;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  text-align:left;
  font-family: var(--font);
}
.faqQ{
  display:flex;
  gap:10px;
  align-items:flex-start;
  min-width:0;
}
.faqIcon{
  width:32px; height:32px;
  border-radius:12px;
  display:flex;
  align-items:center;
  justify-content:center;
  border:1px solid var(--stroke);
  background: rgba(0,0,0,.14);
  flex:0 0 auto;
  margin-top:1px;
}
[data-theme="light"] .faqIcon{ background: rgba(255,255,255,.55); }

.faqQText{
  display:flex;
  flex-direction:column;
  gap:3px;
  min-width:0;
}
.faqQText b{
  font-size:13px;
  font-weight:1000;
  letter-spacing:.2px;
  line-height:1.25;
}
.faqQText small{
  font-size:12px;
  color: var(--muted2);
  line-height:1.25;
}

.faqChevron{
  width:38px; height:38px;
  border-radius:14px;
  border:1px solid var(--stroke);
  background: rgba(0,0,0,.12);
  display:flex;
  align-items:center;
  justify-content:center;
  flex:0 0 auto;
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
}
[data-theme="light"] .faqChevron{ background: rgba(255,255,255,.55); }

.faqBtn:hover .faqChevron{
  border-color: rgba(255,255,255,.22);
  background: rgba(255,255,255,.08);
}
[data-theme="light"] .faqBtn:hover .faqChevron{
  border-color: rgba(0,0,0,.18);
  background: rgba(0,0,0,.03);
}

.faqA{
  max-height: 0;
  overflow:hidden;
  transition: max-height .22s ease;
}
.faqAInner{
  padding:0 12px 12px 12px;
  color: var(--muted);
  font-size:12px;
  line-height:1.55;
}
.faqAInner p{ margin:10px 0 0 0; }
.faqAInner ul{ margin:8px 0 0 18px; padding:0; }
.faqAInner li{ margin:6px 0; }

.faqItem[data-open="true"] .faqChevron{
  transform: rotate(180deg);
  border-color: rgba(121,226,255,.35);
  background:
    radial-gradient(circle at 30% 30%, rgba(121,226,255,.22), transparent 55%),
    rgba(255,255,255,.06);
}
.faqItem[data-open="true"] .faqA{ max-height: 520px; } /* reicht für normale Antworten */
@media (prefers-reduced-motion: reduce){
  .faqA{ transition:none; }
  .faqChevron{ transition:none; }
}

/* Highlight + "keine Treffer" */
.faqMark{
  padding:0 2px;
  border-radius:6px;
  background: rgba(255,223,122,.22);
  color: var(--text);
}
.faqEmpty{
  border:1px dashed var(--stroke);
  border-radius:18px;
  padding:14px 12px;
  color: var(--muted);
  font-size:12px;
  text-align:center;
}

/* JSON-LD output tiny area (optional) */
.faqMetaRow{
  display:flex;
  gap:10px;
  align-items:center;
  justify-content:space-between;
  flex-wrap:wrap;
  margin-top:12px;
}
.faqMiniBtn{
  appearance:none;
  border:1px solid var(--stroke2);
  background: rgba(255,255,255,.06);
  color: var(--text);
  padding:10px 12px;
  border-radius:14px;
  cursor:pointer;
  font-weight:900;
  letter-spacing:.2px;
  display:inline-flex;
  gap:10px;
  align-items:center;
  user-select:none;
  min-height: 44px;
}
.faqMiniBtn:hover{
  background: rgba(255,255,255,.10);
  border-color: rgba(255,255,255,.25);
}

