/**
 * Gluecksrad Deluxe - Styles
 * Sven Gauditz - gauditz.com
 */

:root{
  --bg1:#0b1220;
  --bg2:#0e1a2f;
  --bg3:#0a0f1c;

  --card: rgba(255,255,255,.06);
  --card2: rgba(255,255,255,.04);
  --stroke: rgba(255,255,255,.12);

  --text: rgba(255,255,255,.92);
  --muted: rgba(255,255,255,.70);
  --muted2: rgba(255,255,255,.56);

  --accent: #79e2ff;
  --accent2:#6ef3b1;
  --warn:#ffd37a;
  --danger:#ff6b6b;

  --shadow: 0 30px 90px rgba(0,0,0,.45);
  --shadow2: 0 20px 60px rgba(0,0,0,.38);

  --radius: 22px;
  --radius2: 18px;

  --pad: 18px;
  --pad2: 14px;

  --max: 1240px;

  --focus: 0 0 0 4px rgba(121,226,255,.18);
}

html[data-theme="light"]{
  --bg1:#f2f7ff;
  --bg2:#eef3ff;
  --bg3:#ffffff;

  --card: rgba(0,0,0,.05);
  --card2: rgba(0,0,0,.03);
  --stroke: rgba(0,0,0,.10);

  --text: rgba(0,0,0,.88);
  --muted: rgba(0,0,0,.60);
  --muted2: rgba(0,0,0,.48);

  --shadow: 0 30px 90px rgba(0,0,0,.18);
  --shadow2: 0 20px 60px rgba(0,0,0,.14);

  --focus: 0 0 0 4px rgba(121,226,255,.24);
}

*{ box-sizing:border-box; }
html, body{ height:100%; }
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Apple Color Emoji","Segoe UI Emoji";
  color: var(--text);

  /* Wichtig: kein "Neustart" beim Scrollen -> fixed Background + cover */
  background:
    radial-gradient(1200px 800px at 20% 10%, rgba(121,226,255,.22), transparent 60%),
    radial-gradient(900px 700px at 85% 20%, rgba(110,243,177,.18), transparent 62%),
    radial-gradient(900px 700px at 60% 90%, rgba(255,211,122,.12), transparent 62%),
    linear-gradient(180deg, var(--bg1), var(--bg2) 55%, var(--bg3));
  background-attachment: fixed;
  background-size: cover;
  background-repeat: no-repeat;

  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x:hidden;
}

/* iOS safe areas */
.safeTop{ padding-top: env(safe-area-inset-top); }
.safeBottom{ padding-bottom: env(safe-area-inset-bottom); }

/* Confetti canvas overlay */
#confetti{
  position:fixed;
  inset:0;
  pointer-events:none;
  z-index: 9999;
}

.wrap{
  width: min(var(--max), calc(100% - 28px));
  margin: 18px auto 30px;
}

/* Topbar */
.topbar{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 16px;
  padding: 18px 18px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--stroke);
  background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.03));
  box-shadow: var(--shadow2);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.brand{
  display:flex;
  gap: 14px;
  align-items:flex-start;
  min-width: 0;
}
.logo{
  width: 48px;
  height: 48px;
  border-radius: 18px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size: 22px;
  border: 1px solid var(--stroke);
  background: rgba(0,0,0,.18);
  flex: 0 0 auto;
  box-shadow: 0 10px 26px rgba(0,0,0,.25);
}

.brand h1{
  margin:0;
  font-size: 20px;
  line-height: 1.15;
  letter-spacing: .2px;
  font-weight: 950;
}
.brand p{
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  max-width: 720px;
}

.topActions{
  display:flex;
  gap: 10px;
  align-items:center;
  flex-wrap:wrap;
  justify-content:flex-end;
}
.pill{
  display:flex;
  align-items:center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,.04);
  font-size: 12px;
  color: var(--muted);
  font-weight: 850;
}
.pill .dot{
  width:10px;
  height:10px;
  border-radius:999px;
  background: var(--accent2);
  box-shadow: 0 0 0 3px rgba(110,243,177,.18);
  flex:0 0 auto;
}

/* Grid */
.grid{
  margin-top: 16px;
  display:grid;
  grid-template-columns: 1.25fr .75fr;
  gap: 16px;
  align-items:start;
}

.card{
  border-radius: var(--radius);
  border: 1px solid var(--stroke);
  background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.03));
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  overflow:hidden;
}

.cardPad{
  padding: 16px 16px 10px;
  border-bottom: 1px solid var(--stroke);
  background: rgba(0,0,0,.12);
}
html[data-theme="light"] .cardPad{
  background: rgba(255,255,255,.55);
}

.cardTitle{
  margin:0;
  font-size: 15px;
  letter-spacing: .2px;
  font-weight: 950;
}
.cardSub{
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

/* Stage (wheel area) */
.stage{
  position:relative;
  padding: 16px;
}

.hud{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  flex-wrap:wrap;
  margin-bottom: 12px;
}
.hudLeft, .hudRight{
  display:flex;
  gap: 10px;
  flex-wrap:wrap;
}
.chip{
  padding: 9px 12px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,.04);
  font-size: 12px;
  font-weight: 900;
  color: var(--muted);
  display:flex;
  gap: 6px;
  align-items:center;
}
.chip b{
  color: var(--text);
  font-weight: 950;
}

.wheelWrap{
  position:relative;
  width: min(560px, 100%);
  margin: 0 auto;
  aspect-ratio: 1/1;
  display:grid;
  place-items:center;
}

#wheel{
  width: 100%;
  height: 100%;
  display:block;
  border-radius: 50%;
  filter: drop-shadow(0 30px 70px rgba(0,0,0,.55));
}

.pointer{
  position:absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 16px solid transparent;
  border-right: 16px solid transparent;
  border-bottom: 30px solid rgba(255,255,255,.92);
  filter: drop-shadow(0 12px 18px rgba(0,0,0,.35));
  z-index: 5;
}
html[data-theme="light"] .pointer{
  border-bottom-color: rgba(0,0,0,.82);
}

.cap{
  position:absolute;
  width: 84px;
  height: 84px;
  border-radius: 26px;
  display:grid;
  place-items:center;
  font-weight: 950;
  letter-spacing: .4px;
  border: 1px solid var(--stroke);
  background: linear-gradient(180deg, rgba(255,255,255,.12), rgba(255,255,255,.06));
  box-shadow: 0 25px 60px rgba(0,0,0,.35);
  user-select:none;
  cursor:pointer;
  z-index: 6;
}
.cap:active{ transform: scale(.98); }

/* Stage bar buttons */
.stageBar{
  padding: 14px 16px 16px;
  border-top: 1px solid var(--stroke);
  background: rgba(0,0,0,.10);
}
html[data-theme="light"] .stageBar{
  background: rgba(255,255,255,.60);
}

.btnRow{
  display:flex;
  gap: 10px;
  flex-wrap:wrap;
}
.btn{
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,.06);
  color: var(--text);
  border-radius: 16px;
  padding: 12px 14px;
  font-weight: 950;
  font-size: 13px;
  cursor:pointer;
  transition: .16s ease;
  min-height: 46px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap: 8px;
  user-select:none;
}
.btn:hover{
  transform: translateY(-1px);
  background: rgba(255,255,255,.10);
}
.btn:active{ transform: translateY(0); }
.btn:focus{ outline:none; box-shadow: var(--focus); }
.btn:focus-visible{ outline:none; box-shadow: var(--focus); }

.btnPrimary{
  border-color: rgba(121,226,255,.45);
  background: linear-gradient(180deg, rgba(121,226,255,.22), rgba(121,226,255,.10));
}
.btnDanger{
  border-color: rgba(255,107,107,.45);
  background: linear-gradient(180deg, rgba(255,107,107,.20), rgba(255,107,107,.10));
}
.btnGhost{
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 14px;
}

/* Right panel */
.panel{
  overflow: hidden;
}
.section{
  border-bottom: 1px solid var(--stroke);
}
.section:last-child{ border-bottom:0; }
.sectionHead{
  padding: 14px 16px 10px;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 12px;
  background: rgba(0,0,0,.08);
}
html[data-theme="light"] .sectionHead{
  background: rgba(255,255,255,.55);
}
.sectionHead h3{
  margin:0;
  font-size: 13px;
  font-weight: 950;
  letter-spacing: .2px;
}
.sectionHead p{
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.3;
}
.sectionBody{
  padding: 14px 16px 16px;
}

textarea{
  width:100%;
  min-height: 210px;
  resize: vertical;
  border-radius: 18px;
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,.05);
  color: var(--text);
  padding: 12px 12px;
  font-weight: 800;
  outline:none;
  line-height: 1.35;
}
textarea:focus{ box-shadow: var(--focus); }

.toggle{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  padding: 12px 12px;
  border-radius: 18px;
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,.04);
  margin-bottom: 10px;
}
.toggle b{
  display:block;
  font-size: 13px;
  font-weight: 950;
}
.toggle span{
  display:block;
  margin-top: 4px;
  color: var(--muted2);
  font-size: 12px;
  line-height: 1.2;
}

.switch{
  width: 56px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: rgba(0,0,0,.18);
  position:relative;
  cursor:pointer;
  flex: 0 0 auto;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.03);
}
html[data-theme="light"] .switch{
  background: rgba(0,0,0,.08);
}
.switch .knob{
  position:absolute;
  top: 4px;
  left: 4px;
  width: 26px;
  height: 26px;
  border-radius: 14px;
  background: rgba(255,255,255,.86);
  box-shadow: 0 12px 25px rgba(0,0,0,.25);
  transition: .18s ease;
}
.switch[data-on="true"]{
  background: linear-gradient(180deg, rgba(121,226,255,.28), rgba(110,243,177,.18));
  border-color: rgba(121,226,255,.40);
}
.switch[data-on="true"] .knob{
  left: calc(100% - 4px - 26px);
}

.tiles{
  display:grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 10px;
}
.tile{
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,.04);
  border-radius: 18px;
  padding: 12px;
  min-height: 72px;
  display:flex;
  flex-direction:column;
  justify-content:center;
  gap: 6px;
}
.tile small{
  color: var(--muted2);
  font-weight: 850;
  font-size: 12px;
}
.tile b{
  font-size: 15px;
  font-weight: 950;
  color: var(--text);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.history{
  display:flex;
  flex-direction:column;
  gap: 10px;
}
.hItem{
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,.04);
  border-radius: 18px;
  padding: 12px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
}
.hLeft{
  display:flex;
  align-items:center;
  gap: 10px;
  min-width:0;
}
.hBadge{
  width: 40px;
  height: 40px;
  border-radius: 16px;
  border: 1px solid var(--stroke);
  display:flex;
  align-items:center;
  justify-content:center;
  background: rgba(0,0,0,.16);
  flex: 0 0 auto;
}
.hText{
  min-width:0;
}
.hText b{
  display:block;
  font-weight: 950;
  font-size: 13px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  max-width: 360px;
}
.hText small{
  display:block;
  margin-top: 4px;
  color: var(--muted2);
  font-weight: 850;
  font-size: 12px;
}

.foot{
  margin-top: 14px;
  color: var(--muted2);
  font-size: 12px;
  text-align:center;
  padding: 10px 0 0;
}

/* Inputs for autoEvery / drawCount */
.row2{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 8px;
}
.field{
  border: 1px solid var(--stroke);
  border-radius: 18px;
  background: rgba(255,255,255,.04);
  padding: 10px 12px;
}
.labelRow{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.labelRow label{
  font-size: 12px;
  font-weight: 950;
  color: var(--text);
}
.labelRow .hint{
  font-size: 12px;
  font-weight: 850;
  color: var(--muted2);
}
input[type="number"]{
  width:100%;
  border: 1px solid var(--stroke);
  border-radius: 14px;
  background: rgba(255,255,255,.06);
  color: var(--text);
  padding: 10px 10px;
  font-weight: 900;
  outline:none;
}
input[type="number"]:focus{ box-shadow: var(--focus); }

/* ===== Toast ===== */
.toast{
  position:fixed;
  right:18px;
  bottom:18px;
  z-index:99999;
  width:min(420px, calc(100vw - 36px));
  padding:14px 14px 14px 12px;
  border-radius:18px;
  border:1px solid var(--stroke);
  background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.05));
  box-shadow: 0 20px 70px rgba(0,0,0,.35);
  display:flex;
  gap:12px;
  align-items:flex-start;
  transform: translateY(20px);
  opacity:0;
  pointer-events:none;
  transition: .28s ease;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.toast.show{
  transform: translateY(0);
  opacity:1;
  pointer-events:auto;
}
.toast .tIcon{
  width:44px;
  height:44px;
  border-radius:16px;
  border:1px solid var(--stroke);
  display:flex;
  align-items:center;
  justify-content:center;
  background: rgba(0,0,0,.18);
  font-size:20px;
  flex:0 0 auto;
}
.toast .tMsg{
  color: var(--muted);
  font-size:13px;
  line-height:1.35;
  min-width:0;
}
.toast .tMsg b{
  color: var(--text);
  font-weight:950;
}
.toast .tClose{
  margin-left:auto;
  border:none;
  background: rgba(255,255,255,.06);
  color: var(--text);
  border:1px solid var(--stroke);
  border-radius:14px;
  padding:10px 12px;
  font-weight:950;
  cursor:pointer;
  transition:.18s ease;
}
.toast .tClose:hover{
  transform: translateY(-1px);
  background: rgba(255,255,255,.10);
}

/* FAQ accordion */
.faqA{
  display: none;
  padding: 0 14px 14px;
  color: var(--muted);
  line-height: 1.5;
}
.faqItem.open .faqA{
  display: block;
}

/* Mobile */
@media (max-width: 980px){
  .grid{
    grid-template-columns: 1fr;
  }
  .brand p{ max-width: none; }
  .tiles{ grid-template-columns: 1fr 1fr; }
  .hText b{ max-width: 220px; }
}

@media (max-width: 520px){
  .wrap{ width: calc(100% - 18px); margin: 12px auto 22px; }
  .topbar{ padding: 14px; }
  .logo{ width:44px;height:44px;border-radius:16px; }
  .brand h1{ font-size: 18px; }
  .stage{ padding: 14px; }
  .cap{ width: 78px; height: 78px; border-radius: 24px; }
  .btn{ width: 100%; justify-content:center; }
  .btnRow{ flex-direction:column; }
  .row2{ grid-template-columns: 1fr; }
  .tiles{ grid-template-columns: 1fr; }
}
