:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #101318;
  color: #edf2f7;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at top, #182231 0, #101318 42%, #0b0d11 100%); }
a { color: #9bd4ff; }
.shell { width: min(1180px, calc(100vw - 32px)); margin: 0 auto; padding: 32px 0; }
.shell.narrow { width: min(720px, calc(100vw - 32px)); min-height: 100vh; display: grid; place-items: center; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
h1, h2, p { margin-top: 0; }
h1 { font-size: clamp(2rem, 4vw, 4rem); line-height: 1; margin-bottom: 12px; }
h2 { font-size: 1.1rem; margin-bottom: 16px; }
.eyebrow { color: #89a6c8; text-transform: uppercase; letter-spacing: .13em; font-size: .75rem; margin-bottom: 8px; }
.muted { color: #a7b4c4; }
.small { font-size: .9rem; }
.card { background: rgba(18, 24, 32, .86); border: 1px solid rgba(164, 190, 220, .16); border-radius: 24px; padding: 24px; box-shadow: 0 24px 70px rgba(0,0,0,.28); backdrop-filter: blur(10px); }
.hero { text-align: center; }
.grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 18px; align-items: start; }
.result-card { grid-column: 1 / -1; }
.stack { display: flex; flex-direction: column; gap: 14px; }
label { display: flex; flex-direction: column; gap: 7px; color: #cbd7e6; font-size: .95rem; }
input { width: 100%; border: 1px solid rgba(164, 190, 220, .2); border-radius: 14px; background: #0c1016; color: #edf2f7; padding: 12px 14px; font: inherit; }
input[readonly] { color: #b8c9dd; }
button { border: 0; border-radius: 14px; padding: 12px 16px; font: inherit; font-weight: 700; cursor: pointer; }
button:disabled { opacity: .55; cursor: wait; }
.primary { background: linear-gradient(135deg, #4da3ff, #8e67ff); color: white; }
.secondary { background: #222b38; color: #edf2f7; border: 1px solid rgba(164, 190, 220, .14); }
.danger { color: #ffd5d5; }
.large { font-size: 1.15rem; padding: 15px 22px; }
.status { min-height: 1.2em; color: #a7e0ff; }

.session-tabs {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 0 0 18px;
  padding: 10px;
  border: 1px solid rgba(164, 190, 220, .14);
  border-radius: 20px;
  background: rgba(12, 16, 22, .9);
  backdrop-filter: blur(12px);
  box-shadow: 0 14px 40px rgba(0,0,0,.22);
}
.session-tab {
  flex: 0 1 auto;
  min-width: 116px;
  text-align: center;
  text-decoration: none;
  padding: 11px 16px;
  border-radius: 14px;
  color: #cbd7e6;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(164, 190, 220, .12);
  font-weight: 800;
}
.session-tab:hover { border-color: rgba(155, 212, 255, .45); color: #edf2f7; }
.session-tab.active {
  color: white;
  background: linear-gradient(135deg, #4da3ff, #8e67ff);
  border-color: rgba(255,255,255,.28);
}
@media (max-width: 640px) {
  .session-tabs { overflow-x: auto; }
  .session-tab { min-width: 104px; }
}

.pill { padding: 8px 12px; border: 1px solid rgba(164, 190, 220, .18); border-radius: 999px; color: #a7b4c4; background: rgba(255,255,255,.04); }
.linkbox { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; }
.linkbox span { grid-column: 1 / -1; color: #cbd7e6; }
.sides { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.side-card { background: rgba(255,255,255,.035); border: 1px solid rgba(164, 190, 220, .12); border-radius: 20px; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.preview, .big-result { background: #0c1016 center/cover no-repeat; border: 1px solid rgba(164, 190, 220, .16); display: grid; place-items: center; overflow: hidden; }
.preview { height: 180px; border-radius: 18px; }
.preview span, .big-result span { color: #89a6c8; font-weight: 800; font-size: 2.4rem; }
.big-result { min-height: 260px; border-radius: 22px; text-shadow: 0 4px 18px rgba(0,0,0,.75); }
.big-result strong { font-size: clamp(2rem, 8vw, 5rem); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
@media (max-width: 800px) { .grid, .sides { grid-template-columns: 1fr; } .topbar { align-items: flex-start; flex-direction: column; } }
.sides-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.edge-card { border-color: rgba(255, 220, 150, .22); }
.edge-preview span { font-size: 1.8rem; }
.quick-chances { display: flex; flex-wrap: wrap; gap: 8px; }
.mini { padding: 8px 10px; border-radius: 999px; font-size: .9rem; }
.probability-box, .simulation-result {
  background: rgba(255,255,255,.035);
  border: 1px solid rgba(164, 190, 220, .12);
  border-radius: 16px;
  padding: 12px 14px;
  line-height: 1.5;
}
.simulation-result strong { color: #edf2f7; }
@media (max-width: 1100px) { .sides-three { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 800px) { .sides-three { grid-template-columns: 1fr; } }
.shell.narrowish { width: min(920px, calc(100vw - 32px)); margin: 0 auto; padding: 32px 0; }
.form-grid { display: grid; gap: 12px; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.wide-card { grid-column: 1 / -1; }
.checkbox-row { flex-direction: row; align-items: center; gap: 10px; }
.checkbox-row input { width: auto; }
.history-card { margin-top: 18px; }
.history-list, .library-list { display: flex; flex-direction: column; gap: 10px; }
.history-item, .library-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  background: rgba(255,255,255,.035);
  border: 1px solid rgba(164, 190, 220, .12);
  border-radius: 16px;
  padding: 12px;
}
.history-item strong, .library-item strong { display: block; color: #edf2f7; margin-bottom: 4px; }
.history-item span, .library-item span { display: block; color: #a7b4c4; }
.history-actions, .library-actions, .share-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; }
.buttonlink {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  padding: 10px 14px;
  font-weight: 800;
  color: white;
  text-decoration: none;
  background: linear-gradient(135deg, #4da3ff, #8e67ff);
}
.secondary-link { background: #222b38; color: #edf2f7; border: 1px solid rgba(164, 190, 220, .14); }
.library-item { grid-template-columns: 72px 1fr auto; }
.library-thumb {
  width: 72px;
  height: 72px;
  border-radius: 14px;
  border: 1px solid rgba(164, 190, 220, .16);
  background: #0c1016 center/cover no-repeat;
}
.library-info { min-width: 0; }
.coin-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 800px) {
  .form-grid.two, .coin-strip { grid-template-columns: 1fr; }
  .history-item, .library-item { grid-template-columns: 1fr; }
  .history-actions, .library-actions, .share-actions { justify-content: flex-start; }
}
select {
  width: 100%;
  border: 1px solid rgba(164, 190, 220, .2);
  border-radius: 14px;
  background: #0c1016;
  color: #edf2f7;
  padding: 12px 14px;
  font: inherit;
}
.dice-sides {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
}
.dice-side-card { min-width: 0; }
.dice-preview span { font-size: 2rem; text-align: center; padding: 10px; }

/* Glücksrad */
.wheel-grid { grid-template-columns: 1.05fr 1fr; }
.wheel-items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 14px;
}
.wheel-item-card.inactive { opacity: .72; border-color: rgba(255, 180, 120, .25); }
.wheel-item-head { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.wheel-item-head span { color: #a7b4c4; font-size: .85rem; }
.style-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.style-grid.compact label { font-size: .85rem; }
.style-grid input[type="color"] { min-height: 44px; padding: 6px; }
.wheel-remove-row { align-self: end; min-height: 70px; justify-content: center; }
.wheel-field-preview {
  min-height: 90px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.24);
  display: grid;
  place-items: center;
  font-weight: 900;
  text-align: center;
  background-position: center;
  background-size: cover;
  text-shadow: 0 3px 12px rgba(0,0,0,.7);
}
.wheel-canvas {
  width: min(100%, 520px);
  aspect-ratio: 1;
  border-radius: 999px;
  background: rgba(255,255,255,.025);
  justify-self: center;
  align-self: center;
}
.wheel-preview-card { align-items: center; }
.wheel-result { border-width: 4px; }
.wheel-result-label {
  padding: 14px 24px;
  border-radius: 999px;
  background: rgba(0,0,0,.45);
  border: 4px solid currentColor;
}
@media (max-width: 900px) {
  .wheel-grid, .style-grid { grid-template-columns: 1fr; }
}

textarea {
  width: 100%;
  border: 1px solid rgba(164, 190, 220, .2);
  border-radius: 14px;
  background: #0c1016;
  color: #edf2f7;
  padding: 12px 14px;
  font: inherit;
  resize: vertical;
}
.bulk-field-tools,
.panel-style-box {
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(164, 190, 220, .12);
  border-radius: 18px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
button.copied {
  background: linear-gradient(135deg, #21c979, #4da3ff);
  color: white;
}
.status.error { color: #ffb8b8; }
.removeWheelItem { align-self: stretch; min-height: 46px; }
