:root{
  --bg:#0b0d12;
  --panel:#111522;
  --panel2:#0f1320;
  --text:#f3f5ff;
  --muted:rgba(243,245,255,.72);
  --muted2:rgba(243,245,255,.55);
  --hair:rgba(243,245,255,.10);
  --hair2:rgba(243,245,255,.16);
  --shadow: 0 10px 30px rgba(0,0,0,.45);
  --radius:18px;
  --radius2:26px;
  --danger:#ff3b30;
  --danger2:rgba(255,59,48,.18);
  --ok:#35c759;
  --accent:#4c7dff;
  --accent2:rgba(76,125,255,.18);
  --warn:#ffcc00;
  --safePad: env(safe-area-inset-bottom, 0px);
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  background: radial-gradient(900px 600px at 10% -10%, rgba(76,125,255,.16), transparent 60%),
              radial-gradient(900px 600px at 110% 0%, rgba(255,204,0,.10), transparent 55%),
              radial-gradient(900px 600px at 60% 120%, rgba(53,199,89,.10), transparent 55%),
              var(--bg);
  color:var(--text);
  overflow:hidden;
  touch-action: manipulation;
}
body.timeout{
  background:
    radial-gradient(900px 600px at 50% 110%, rgba(255,59,48,.18), transparent 60%),
    radial-gradient(900px 600px at 10% -10%, rgba(255,59,48,.10), transparent 60%),
    var(--bg);
}
a{color:inherit}
button,input{font:inherit}
.app{height:100%; display:flex; flex-direction:column}
.topbar{
  padding: 14px 16px 10px;
  display:flex; align-items:center; justify-content:space-between;
  gap:12px;
}
.logo{
  height: 40px;
  width: auto;
  object-fit: contain;
}
.brand{
  display:flex; flex-direction:column; gap:2px;
  line-height:1.05;
}
.brand .title{
  font-weight:720;
  letter-spacing:.2px;
  font-size:18px;
}
.brand .sub{
  font-size:12px;
  color:var(--muted2);
}
.iconbtn{
  background:rgba(243,245,255,.06);
  border:1px solid rgba(243,245,255,.10);
  color:var(--text);
  padding:10px 12px;
  border-radius:14px;
  box-shadow: 0 10px 18px rgba(0,0,0,.22);
}
.iconbtn:active{transform: translateY(1px)}
main{
  flex:1;
  overflow:hidden;
  position:relative;
}
.screen{
  position:absolute; inset:0;
  overflow:hidden;
  display:none;
}
.screen.active{display:block}
.scroll{
  height:100%;
  overflow:auto;
  padding: 0 14px calc(20px + var(--safePad));
  -webkit-overflow-scrolling: touch;
  scroll-behavior:smooth;
}
.card{
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.035));
  border:1px solid rgba(243,245,255,.10);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px 12px;
  margin: 10px 0;
  overflow:hidden;
}
.card-head{
  display:flex; align-items:center; justify-content:space-between;
  gap:10px;
  margin-bottom:10px;
}
.card-head .h{
  font-weight:680;
  font-size:14px;
  letter-spacing:.2px;
  display:flex; align-items:center; gap:10px;
}
.pill{
  font-size:12px;
  color:var(--muted);
  padding:3px 10px;
  border:1px solid rgba(243,245,255,.10);
  background: rgba(243,245,255,.04);
  border-radius:999px;
}
.row{display:flex; align-items:center; justify-content:space-between; gap:12px; padding:8px 4px}
.row + .row{border-top:1px solid var(--hair)}
.small{font-size:12px; color:var(--muted2)}
.muted{color:var(--muted2)}
.btn{
  border:1px solid rgba(243,245,255,.12);
  background: rgba(243,245,255,.06);
  color:var(--text);
  padding: 11px 14px;
  border-radius: 14px;
  transition: transform .08s ease;
  user-select:none;
}
.btn:active{transform: translateY(1px)}
.btn.primary{
  background: linear-gradient(180deg, rgba(76,125,255,.95), rgba(76,125,255,.72));
  border-color: rgba(76,125,255,.55);
  box-shadow: 0 14px 32px rgba(76,125,255,.22);
}
.btn.danger{
  background: linear-gradient(180deg, rgba(255,59,48,.95), rgba(255,59,48,.72));
  border-color: rgba(255,59,48,.55);
  box-shadow: 0 14px 32px rgba(255,59,48,.22);
}
.btn.ghost{
  background: rgba(255,255,255,.04);
}
.btn.wide{width:100%}
.toggle{
  display:flex; align-items:center; justify-content:space-between;
  gap:12px; width:100%;
}
.toggle .label{display:flex; flex-direction:column; gap:2px}
.switch{
  width:46px; height:28px; border-radius:999px;
  background: rgba(243,245,255,.10);
  border:1px solid rgba(243,245,255,.16);
  position:relative;
  flex:0 0 auto;
}
.switch::after{
  content:"";
  width:22px; height:22px; border-radius:999px;
  position:absolute; top:50%; left:3px;
  transform: translateY(-50%);
  background: rgba(243,245,255,.82);
  box-shadow: 0 8px 16px rgba(0,0,0,.35);
  transition: left .16s ease, background .16s ease;
}
input[type="checkbox"].hidden{position:absolute; opacity:0; pointer-events:none}
input[type="checkbox"].hidden:checked + .switch{
  background: rgba(76,125,255,.22);
  border-color: rgba(76,125,255,.38);
}
input[type="checkbox"].hidden:checked + .switch::after{
  left: 21px;
  background: rgba(76,125,255,.95);
}
.inline{
  display:flex; align-items:center; gap:10px; flex-wrap:wrap;
}
.num{
  -moz-appearance: textfield;
}
.num::-webkit-outer-spin-button,
.num::-webkit-inner-spin-button{
  -webkit-appearance: none;
  margin: 0;
}
.num{
  width:88px;
  background: rgba(0,0,0,.18);
  border:1px solid rgba(243,245,255,.12);
  color:var(--text);
  border-radius: 12px;
  padding:10px 12px;
}
.divider{height:1px; background: var(--hair); margin:10px 0}

/* Player loop list */
.players-head-actions{display:flex; gap:8px; align-items:center}
.loop-wrap{
  height: 46vh;
  min-height: 240px;
  max-height: 420px;
  overflow:auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 16px;
  border:1px solid rgba(243,245,255,.10);
  background: rgba(0,0,0,.12);
  position:relative;
  overscroll-behavior: contain;
  touch-action: pan-y;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.loop-wrap::-webkit-scrollbar{
  display: none;
}
.loop-inner{padding: 14px 0}
.player-row{
  height: 86px;
  display:flex;
  align-items:center;
  justify-content:center;
  position:relative;
  user-select:none;
  touch-action: pan-y;
}
.player-row .swipe-bg{
  position:absolute; inset:0;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 0 22px;
  opacity:0;
  transition: opacity .12s ease;
  pointer-events:none;
  font-weight:650;
  letter-spacing:.2px;
  font-size:13px;
}
.player-row .swipe-bg .left{color:rgba(255,59,48,.85)}
.player-row .swipe-bg .right{color:rgba(76,125,255,.9)}
.player-row.swiping .swipe-bg{opacity:1}
.player-chip{
  width: 76px;
  height: 76px;
  border-radius: 999px;
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 10px;
  text-align:center;
  line-height:1.1;
  font-weight:700;
  letter-spacing:.1px;
  border: 3px solid rgba(243,245,255,.35);
  box-shadow: 0 14px 30px rgba(0,0,0,.30);
  background: rgba(255,255,255,.06);
  transform: translateX(var(--dx, 0px));
  transition: transform .16s ease;
  will-change: transform;
}
.player-row.swiping .player-chip{transition:none}
.player-chip .name{
  font-size: 13px;
  color: rgba(255,255,255,.93);
  text-shadow: 0 2px 10px rgba(0,0,0,.38);
  max-width:100%;
  overflow:hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  word-break: break-word;
}
.add-inline{
  display:flex; align-items:center; justify-content:center;
  height: 260px;
  padding: 12px;
}
.add-circle{
  width: 92px; height:92px; border-radius:999px;
  border:2px dashed rgba(243,245,255,.25);
  background: rgba(255,255,255,.04);
  display:flex; align-items:center; justify-content:center;
  color: rgba(243,245,255,.85);
  font-size: 34px;
  box-shadow: 0 14px 30px rgba(0,0,0,.28);
}

/* Reveal */
.reveal{
  height:100%;
  display:flex;
  flex-direction:column;
  padding-bottom: calc(16px + var(--safePad));
}
.reveal-top{
  padding: 14px 16px 10px;
  display:flex; align-items:center; justify-content:space-between;
  gap:12px;
}
.progress{
  display:flex; gap:6px; align-items:center;
}
.dot{
  width: 7px; height: 7px; border-radius: 999px;
  background: rgba(243,245,255,.18);
}
.dot.on{background: rgba(243,245,255,.72)}
.reveal-stage{
  flex:1;
  display:flex;
  flex-direction:column;
  overflow:hidden;
  position:relative;
  padding: 0;
}
.reveal-secret{
  position:absolute;
  top:50%;
  left:50%;
  transform: translate(-50%, -50%);
  width: min(90%, 500px);
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.04));
  border:1px solid rgba(243,245,255,.10);
  border-radius: var(--radius2);
  padding: 16px 16px 18px;
  box-shadow: 0 18px 50px rgba(0,0,0,.45);
  z-index: 1;
  pointer-events: none;
}
.reveal-background{
  position:absolute;
  top:0;
  left:0;
  right:0;
  height: calc(50% + 180px);
  transform: translateY(var(--revealY, 0px));
  background: var(--bg, #0b0d12);
  z-index: 2;
  pointer-events: none;
  transition: transform .22s ease;
  will-change: transform;
}
.reveal-background.dragging{transition:none}
.reveal-card{
  position:absolute;
  top:50%;
  left:50%;
  transform: translate(-50%, calc(-50% + var(--revealY, 0px)));
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap: 16px;
  transition: transform .22s ease;
  will-change: transform;
  touch-action: none;
  user-select:none;
  z-index: 3;
  pointer-events: auto;
}
.reveal-card.dragging{transition:none}
.pull-hint{
  color: var(--muted2);
  font-size: 13px;
  padding: 10px 14px;
  border-radius: 999px;
  border:1px solid rgba(243,245,255,.12);
  background: rgba(0,0,0,.16);
}
.circle{
  width: 230px;
  height: 230px;
  border-radius: 999px;
  display:flex; align-items:center; justify-content:center;
  padding: 18px;
  text-align:center;
  border: 4px solid;
  box-shadow: 0 18px 48px rgba(0,0,0,.46);
  position:relative;
  z-index: 4;
}
.circle .name{
  font-size: 26px;
  font-weight: 770;
  letter-spacing: .2px;
  line-height:1.05;
  text-shadow: 0 2px 16px rgba(0,0,0,.45);
  word-break: break-word;
}
.role{
  font-weight: 760;
  font-size: 16px;
  letter-spacing: .2px;
  margin-bottom: 10px;
}
.word{
  font-size: 30px;
  font-weight: 850;
  letter-spacing: .2px;
  margin-bottom: 8px;
}
.hint{
  font-size: 14px;
  color: var(--muted);
  line-height:1.35;
}
.bottom-btn{
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: calc(16px + var(--safePad));
  z-index: 10;
}

/* Prestart */
.center{
  height:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  flex-direction:column;
  gap: 18px;
  padding: 20px 16px calc(20px + var(--safePad));
  text-align:center;
}
.circle.huge{width: 250px; height: 250px}
.subtitle{
  font-size: 16px;
  color: var(--muted);
}

/* Play */
.play{
  height:100%;
  display:flex;
  flex-direction:column;
  padding: 14px 14px calc(16px + var(--safePad));
  gap: 12px;
}
.play-top{
  display:flex; align-items:center; justify-content:space-between; gap:10px;
}
.timer{
  flex: 0 0 auto;
  border-radius: var(--radius2);
  border:1px solid rgba(243,245,255,.12);
  background: rgba(255,255,255,.04);
  box-shadow: var(--shadow);
  padding: 18px 18px;
  text-align:center;
  user-select:none;
}
.timer.timeout{
  border-color: rgba(255,59,48,.45);
  background: rgba(255,59,48,.10);
}
.timerLabel{font-size: 12px; color: var(--muted2); letter-spacing:.2px}
.timerValue{font-size: 46px; font-weight: 860; letter-spacing:.6px; margin-top: 6px}
.vote{
  margin-top:auto;
  width:100%;
  padding: 24px 16px;
  border-radius: 18px;
  border:1px solid rgba(255,59,48,.55);
  background: linear-gradient(180deg, rgba(255,59,48,.92), rgba(255,59,48,.72));
  box-shadow: 0 22px 54px rgba(255,59,48,.22);
  font-weight: 820;
  letter-spacing:.3px;
  font-size: 20px;
}
.vote:active{transform: translateY(1px)}

/* Large action buttons - Start, Weiter, Beginnen, Abstimmen */
#btnStart,
#btnRevealNext,
#btnBegin,
#btnVote{
  padding: 24px 16px !important;
  font-size: 20px !important;
  font-weight: 820 !important;
  letter-spacing: .3px !important;
}
.hidden{display:none !important}

/* Modal / overlay */
.overlay{
  position:fixed; inset:0;
  background: rgba(0,0,0,.58);
  display:flex;
  align-items:flex-end;
  justify-content:center;
  padding: 10px 10px calc(10px + var(--safePad));
  z-index: 1000;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.overlay.centered{align-items:center}
.sheet{
  width:min(720px, 100%);
  background: linear-gradient(180deg, rgba(17,21,34,.98), rgba(13,16,27,.98));
  border: 1px solid rgba(243,245,255,.14);
  border-radius: 22px;
  box-shadow: 0 30px 80px rgba(0,0,0,.55);
  overflow:hidden;
  max-height: 88vh;
  display:flex;
  flex-direction:column;
}
.sheet-head{
  padding: 14px 14px 10px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  border-bottom: 1px solid var(--hair);
}
.sheet-head .t{font-weight: 760; letter-spacing:.2px}
.sheet-body{
  padding: 10px 14px 14px;
  overflow:auto;
  -webkit-overflow-scrolling: touch;
}
.sheet-foot{
  padding: 12px 14px 14px;
  border-top: 1px solid var(--hair);
  display:flex;
  gap:10px;
}
.sheet-foot .btn{flex:1}
.grid2{display:grid; grid-template-columns: 1fr 1fr; gap:10px}
.palette{display:flex; flex-wrap:wrap; gap:10px}
.swatch{
  width: 34px; height:34px; border-radius: 999px;
  border: 2px solid rgba(243,245,255,.18);
  background: #999;
  box-shadow: 0 10px 20px rgba(0,0,0,.28);
}
.swatch.sel{border-color: rgba(243,245,255,.85)}
.input{
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(243,245,255,.14);
  background: rgba(0,0,0,.18);
  color: var(--text);
  padding: 12px 12px;
  outline:none;
}
.input:focus{border-color: rgba(76,125,255,.55); box-shadow: 0 0 0 4px rgba(76,125,255,.15)}
.genre-list{display:flex; flex-direction:column; gap:8px}
.genre-item{
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  padding: 10px 10px;
  border: 1px solid rgba(243,245,255,.10);
  border-radius: 14px;
  background: rgba(255,255,255,.03);
}
.order-item{
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  padding: 10px 10px;
  border: 1px solid rgba(243,245,255,.10);
  border-radius: 14px;
  background: rgba(255,255,255,.03);
  cursor: grab;
  user-select: none;
  transition: transform 0.2s ease, opacity 0.2s ease, border-color 0.2s ease;
}
.order-item:active{
  cursor: grabbing;
}
.order-item.dragging{
  opacity: 0.5;
  transform: scale(0.95);
}
.order-item.drag-over-top{
  border-top: 2px solid rgba(243,245,255,.5);
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}
.order-item.drag-over-bottom{
  border-bottom: 2px solid rgba(243,245,255,.5);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}
.genre-item .g{font-weight: 650; font-size: 14px}
input[type="range"]{width: 100%}
.kv{display:flex; justify-content:space-between; align-items:center; gap:12px}
.kv .k{font-weight: 650}
.kv .v{color: var(--muted); font-variant-numeric: tabular-nums}
.imp-rows{display:flex; flex-direction:column; gap:10px}
.imp-row{
  border: 1px solid rgba(243,245,255,.10);
  background: rgba(255,255,255,.03);
  border-radius: 14px;
  padding: 10px 10px;
}

/* Hint strength toggles */
.hint-strength-toggles{
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.hint-strength-toggle{
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 2px solid rgba(243,245,255,.18);
  background: rgba(255,255,255,.04);
  color: var(--muted2);
  font-weight: 700;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all .16s ease;
  user-select: none;
  box-shadow: 0 8px 16px rgba(0,0,0,.22);
}
.hint-strength-toggle:hover{
  border-color: rgba(243,245,255,.35);
  background: rgba(255,255,255,.08);
}
.hint-strength-toggle.active{
  background: linear-gradient(180deg, rgba(76,125,255,.95), rgba(76,125,255,.72));
  border-color: rgba(76,125,255,.55);
  color: rgba(255,255,255,.95);
  box-shadow: 0 12px 24px rgba(76,125,255,.28);
}
.hint-strength-toggle:active{
  transform: translateY(1px);
}

/* Toast */
.toast{
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  top: calc(70px + var(--safePad));
  z-index: 2000;
  background: rgba(17,21,34,.96);
  border: 1px solid rgba(243,245,255,.14);
  box-shadow: 0 20px 60px rgba(0,0,0,.55);
  padding: 10px 12px;
  border-radius: 14px;
  min-width: min(520px, calc(100% - 24px));
  max-width: min(520px, calc(100% - 24px));
  display:none;
}
.toast.show{display:block; animation: toastIn .18s ease-out}
@keyframes toastIn{from{opacity:0; transform: translateX(-50%) translateY(-8px)} to{opacity:1; transform: translateX(-50%) translateY(0)}}
.toast .msg{font-size: 13px; color: rgba(243,245,255,.92); line-height:1.35}
.toast .msg strong{font-weight:760}
.toast.danger{border-color: rgba(255,59,48,.35)}
.toast.ok{border-color: rgba(53,199,89,.35)}
.toast.warn{border-color: rgba(255,204,0,.35)}

@media (prefers-reduced-motion: reduce){
  *{transition:none !important; animation:none !important; scroll-behavior:auto !important}
}

