:root{
  --bg0:#070A12;
  --bg1:#0A1022;
  --card:rgba(255,255,255,.08);
  --card2:rgba(255,255,255,.06);
  --stroke:rgba(255,255,255,.14);
  --text:rgba(255,255,255,.92);
  --muted:rgba(255,255,255,.68);
  --muted2:rgba(255,255,255,.55);
  --shadow: 0 18px 60px rgba(0,0,0,.35);
  --shadow2: 0 10px 30px rgba(0,0,0,.28);
  --radius: 18px;
  --radius2: 14px;
  --accent:#ef4444;
  --accent2:#fb923c;
  --danger:#fb7185;
  --ok:#34d399;
  --focus: 0 0 0 4px rgba(239,68,68,.25);
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color:var(--text);
  background:
              radial-gradient(1200px 700px at 15% 10%, rgba(255,255,255,.06), transparent 60%),
              radial-gradient(900px 600px at 85% 22%, rgba(0,0,0,.22), transparent 55%),
              linear-gradient(135deg, rgba(239,68,68,.55), rgba(251,146,60,.45)),
              linear-gradient(180deg, var(--bg0), var(--bg1));
  overflow-x:hidden;
}

body.noscroll{overflow:hidden}

.bg{
  position:fixed;
  inset:-2px;
  pointer-events:none;
  background:
    linear-gradient(135deg, rgba(239,68,68,.22), rgba(251,146,60,.18)),
    radial-gradient(800px 400px at 20% 20%, rgba(255,255,255,.07), transparent 65%),
    radial-gradient(850px 460px at 70% 90%, rgba(0,0,0,.18), transparent 65%);
  filter: blur(0.2px);
  opacity:.95;
}

.app{
  position:relative;
  max-width: 980px;
  margin:0 auto;
  padding: 18px 16px 28px;
}

.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding: 8px 6px 12px;
}

.brand{
  display:flex;
  align-items:center;
  gap:12px;
  min-width:0;
}

.logo{
  width:42px;
  height:42px;
  border-radius:14px;
  display:grid;
  place-items:center;
  background: linear-gradient(135deg, rgba(239,68,68,.22), rgba(251,146,60,.14));
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 10px 24px rgba(0,0,0,.22);
  color: rgba(255,255,255,.9);
}

.brandText{min-width:0}
.brandName{font-weight:750; letter-spacing:.2px; font-size: 18px; line-height:1.1}
.brandTag{color:var(--muted); font-size:12.5px; margin-top:2px}

.topActions{display:flex; gap:10px; align-items:center}

.view{margin-top:10px}
.hidden{display:none !important}

.grid{
  display:grid;
  gap:14px;
}

@media (min-width: 860px){
  .app{padding: 18px 18px 32px}
}

.card{
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  box-shadow: 0 16px 46px rgba(0,0,0,.28);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.cardSubtle{
  background: rgba(255,255,255,.05);
  box-shadow: 0 10px 30px rgba(0,0,0,.22);
}

.cardHeader h2{margin:0; font-size:18px}
.subtle{color:var(--muted)}

h2{margin: 0 0 8px 0; font-size:18px}
h3{margin: 0 0 10px 0; font-size:16px}

.form{
  display:grid;
  gap:14px;
  margin-top:12px;
}

.wizard{
  display:grid;
  gap:12px;
  margin-top:12px;
}

.wizardTop{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding: 2px 2px 6px;
}

.wizardTitle{
  font-weight: 900;
  letter-spacing: .2px;
  font-size: 14px;
  color: rgba(255,255,255,.82);
}

.wizardDots{
  display:flex;
  gap:7px;
  align-items:center;
  justify-content:flex-end;
}
.wizardDot{
  width:8px;
  height:8px;
  border-radius:999px;
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.14);
  transition: transform .18s ease, background .18s ease, border-color .18s ease, opacity .18s ease;
  opacity:.8;
}
.wizardDot.isActive{
  background: linear-gradient(135deg, rgba(239,68,68,.85), rgba(251,146,60,.45));
  border-color: rgba(239,68,68,.45);
  transform: scale(1.25);
  opacity:1;
}

.wizardStage{
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(0,0,0,.10);
  overflow:hidden;
}

.wizardTrack{
  display:flex;
  width: 400%;
  transform: translateX(var(--wizardX, 0%));
  transition: transform .34s cubic-bezier(.2,.8,.2,1);
}

.wizardStep{
  width: 25%;
  padding: 22px 20px 18px;
}

.stepCard{
  display:grid;
  gap: 14px;
  min-height: 280px;
}
.stepHeadline{
  font-size: clamp(24px, 5.2vw, 30px);
  font-weight: 950;
  letter-spacing:.2px;
}
.stepSubtle{
  color: rgba(255,255,255,.72);
  margin-top: -6px;
  font-size: clamp(14px, 3.6vw, 16px);
}

.wizardNav{
  display:flex;
  gap:10px;
  align-items:center;
  justify-content:space-between;
}
.wizardNav .btn{flex: 1}

.stepSummary{
  margin-top: 4px;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.04);
  color: rgba(255,255,255,.78);
  line-height: 1.45;
  font-size: 13px;
  white-space: pre-line;
}

.field label{
  display:block;
  font-size:12.5px;
  color: var(--muted);
  margin: 0 0 7px;
}

.label{
  font-size:12.5px;
  color:var(--muted);
  margin-bottom:3px;
}

.help{
  margin-top:8px;
  font-size:12.5px;
  color:var(--muted2);
  min-height: 16px;
}

.control{
  display:flex;
  align-items:stretch;
  gap:0;
  border-radius: 14px;
  overflow:hidden;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.18);
}

input, select, textarea{
  appearance:none;
  -webkit-appearance:none;
  border:0;
  outline:0;
  background:transparent;
  color:var(--text);
  padding: 12px 12px;
  font-size: 15px;
  width:100%;
}

textarea{
  resize: none;
  line-height: 1.35;
  min-height: 118px;
}

.wizard input, .wizard select, .wizard textarea{
  font-size: clamp(20px, 5vw, 22px);
  padding: 16px 14px;
}
.wizard .suffix{
  font-size: 14px;
  padding: 0 12px;
}
.wizard .field label{
  font-size: 14px;
  margin-bottom: 8px;
}
.wizard .help{
  font-size: 14px;
}

.wizard .btn{
  padding: 14px 14px;
  font-size: 16px;
}

select{
  cursor:pointer;
}

input::placeholder{color:rgba(255,255,255,.35)}

.suffix{
  display:flex;
  align-items:center;
  padding: 0 12px;
  border-left:1px solid rgba(255,255,255,.12);
  color: rgba(255,255,255,.55);
  font-size: 12.5px;
}

.actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top: 2px;
}

.btn{
  border: 1px solid rgba(255,255,255,.14);
  color: var(--text);
  background: rgba(255,255,255,.06);
  padding: 12px 14px;
  border-radius: 14px;
  font-weight: 700;
  letter-spacing: .2px;
  cursor:pointer;
  user-select:none;
  transition: transform .12s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease, opacity .15s ease;
}
.btn:active{transform: translateY(1px) scale(.99)}
.btn:focus-visible{box-shadow: var(--focus)}

.btn-primary{
  border-color: rgba(239,68,68,.55);
  background: linear-gradient(135deg, rgba(239,68,68,.88), rgba(251,146,60,.48));
  box-shadow: 0 16px 40px rgba(239,68,68,.22);
}
.btn-primary:hover{background: linear-gradient(135deg, rgba(239,68,68,.95), rgba(251,146,60,.55))}

.btn-ghost{
  background: rgba(255,255,255,.04);
}
.btn-ghost:hover{background: rgba(255,255,255,.07)}

.btn[disabled]{
  opacity:.55;
  cursor:not-allowed;
}

.rowBetween{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}

.rowBetweenWrap{
  flex-wrap:wrap;
  align-items:center;
}
.rowBetweenWrap > :first-child{
  flex: 1 1 220px;
  min-width: 0;
}

.srOnly{
  position:absolute;
  width:1px;
  height:1px;
  padding:0;
  margin:-1px;
  overflow:hidden;
  clip:rect(0,0,0,0);
  white-space:nowrap;
  border:0;
}

.segToggle{
  position:relative;
  display:flex;
  align-items:center;
  gap:6px;
  padding: 6px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.12);
  box-shadow: 0 10px 20px rgba(0,0,0,.18);
  flex: 0 0 auto;
}

.segOption{
  border: 1px solid transparent;
  background: transparent;
  color: rgba(255,255,255,.78);
  padding: 9px 12px;
  border-radius: 999px;
  font-weight: 850;
  letter-spacing: .1px;
  cursor: pointer;
  transition: transform .12s ease, background .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.segOption:active{transform: translateY(1px)}
.segOption:focus-visible{box-shadow: var(--focus)}

.segToggle[data-state="off"] .segOption[data-seg="off"],
.segToggle[data-state="on"] .segOption[data-seg="on"]{
  background: linear-gradient(135deg, rgba(239,68,68,.78), rgba(251,146,60,.40));
  border-color: rgba(239,68,68,.42);
  color: rgba(255,255,255,.92);
  box-shadow: 0 10px 18px rgba(239,68,68,.16);
}

.segToggle[data-state="off"] .segOption[data-seg="on"],
.segToggle[data-state="on"] .segOption[data-seg="off"]{
  background: rgba(255,255,255,.02);
}

.pill{
  font-size:12px;
  color: rgba(255,255,255,.78);
  border:1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.05);
  padding: 7px 10px;
  border-radius: 999px;
  white-space:nowrap;
}

.steps{
  margin: 0;
  padding-left: 18px;
  color: rgba(255,255,255,.76);
  line-height:1.55;
}
.steps li{margin: 6px 0}
.tip{
  margin-top:12px;
  padding: 10px 12px;
  border-radius: 14px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.05);
  color: rgba(255,255,255,.78);
}

.playerRow{
  display:flex;
  align-items:center;
  gap:12px;
  margin: 14px 0 12px;
  padding: 12px 12px;
  border-radius: 16px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.14);
}

.avatar{
  width:44px;
  height:44px;
  border-radius: 16px;
  display:grid;
  place-items:center;
  font-weight: 850;
  letter-spacing:.2px;
  background: linear-gradient(135deg, rgba(34,211,238,.20), rgba(124,58,237,.25));
  border:1px solid rgba(255,255,255,.14);
}

.playerName{
  font-size:16px;
  font-weight:800;
}

.turnName{
  margin: 18px 0 12px;
  padding: 16px 14px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.12);
  font-weight: 950;
  letter-spacing: .2px;
  font-size: clamp(26px, 7vw, 36px);
  text-align:center;
}

.doneSummary{
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.03);
  color: rgba(255,255,255,.78);
  line-height: 1.5;
  font-size: 14px;
  white-space: pre-line;
}

.btn-big{
  padding: 16px 16px;
  font-size: 18px;
}

.finalScreen{
  display:flex;
  flex-direction:column;
  min-height: calc(100vh - 240px);
}
@supports (height: 100svh){
  .finalScreen{min-height: calc(100svh - 240px)}
}

.finalCenter{
  flex: 1;
  display:grid;
  place-items:center;
  text-align:center;
  padding: 18px 8px;
}

.finalLabel{
  color: rgba(255,255,255,.70);
  font-weight: 900;
  letter-spacing: .22em;
  text-transform: uppercase;
  font-size: 14px;
  margin-bottom: 10px;
}

.finalName{
  font-weight: 980;
  letter-spacing: .2px;
  font-size: clamp(42px, 11vw, 66px);
  line-height: 1.03;
}

.finalBottom{
  padding-top: 12px;
  padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px));
}
.finalBottom .btn{
  width: 100%;
}

.overlay{
  position:fixed;
  inset:0;
  display:grid;
  place-items:center;
  padding: 16px;
  z-index: 20;
}
.overlayBackdrop{
  position:absolute;
  inset:0;
  background: radial-gradient(1200px 600px at 20% 10%, rgba(239,68,68,.34), rgba(0,0,0,.70)),
              radial-gradient(900px 500px at 85% 20%, rgba(251,146,60,.24), rgba(0,0,0,.74));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.overlayContent{
  position:relative;
  width: min(520px, 100%);
  display:grid;
  gap: 12px;
  animation: pop .18s ease-out;
}

@keyframes pop{
  from{transform: translateY(12px) scale(.985); opacity:0}
  to{transform: translateY(0) scale(1); opacity:1}
}

.secureCard, .roleCard{
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,.14);
  background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.06));
  box-shadow: var(--shadow);
  overflow:hidden;
}

.secureTop{
  padding: 18px 18px 16px;
}
.securePlayer{
  font-size:12.5px;
  color: rgba(255,255,255,.70);
}
.secureTitle{
  font-size: 22px;
  font-weight: 900;
  letter-spacing: .2px;
  margin-top: 6px;
}
.secureHint{
  margin-top: 6px;
  color: rgba(255,255,255,.74);
  font-size: 13px;
}

.holdBtn{
  position:relative;
  width:100%;
  padding: 14px 16px;
  border:0;
  color: var(--text);
  background: rgba(0,0,0,.18);
  border-top: 1px solid rgba(255,255,255,.10);
  display:flex;
  justify-content:center;
  align-items:center;
  gap:10px;
  font-weight: 850;
  cursor:pointer;
}
.holdBtn:focus-visible{box-shadow: var(--focus)}
.holdFill{
  position:absolute;
  inset:0;
  width: var(--hold, 0%);
  background: linear-gradient(90deg, rgba(239,68,68,.65), rgba(251,146,60,.38));
  opacity:.95;
  transition: width .06s linear;
}
.holdText{
  position:relative;
  z-index:1;
}

.roleCard{
  padding: 18px 18px 16px;
  animation: flip .24s ease-out;
}

.roleCard.isImpostor{
  border-color: rgba(251,113,133,.40);
  background:
    radial-gradient(900px 300px at 20% 20%, rgba(251,113,133,.20), transparent 60%),
    linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.06));
}
.roleCard.isNormal{
  border-color: rgba(52,211,153,.28);
  background:
    radial-gradient(900px 300px at 20% 20%, rgba(52,211,153,.14), transparent 60%),
    linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.06));
}

@keyframes flip{
  from{transform: rotateX(18deg) translateY(10px); opacity:0}
  to{transform: rotateX(0deg) translateY(0); opacity:1}
}

.roleBadge{
  display:inline-flex;
  align-items:center;
  gap:8px;
  font-size: 12px;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.16);
  color: rgba(255,255,255,.80);
}

.roleMain{
  margin-top: 10px;
  font-size: 30px;
  font-weight: 950;
  letter-spacing: .2px;
  line-height: 1.05;
}

.roleMeta{
  margin-top: 10px;
  color: rgba(255,255,255,.75);
  line-height: 1.45;
  font-size: 13px;
  white-space: pre-line;
}

.overlayActions{
  display:flex;
  gap:10px;
}
.overlayActions .btn{flex:1}
.overlayFoot{
  text-align:center;
  font-size: 12.5px;
}

.switch{
  position: relative;
  display:inline-flex;
  align-items:center;
  cursor:pointer;
  user-select:none;
  width: 54px;
  height: 32px;
  flex: 0 0 auto;
}
.switch input{
  position:absolute;
  inset:0;
  opacity:0;
  width:100%;
  height:100%;
  margin:0;
  cursor:pointer;
}
.switch .track{
  width: 100%;
  height: 100%;
  flex: 0 0 auto;
  border-radius: 999px;
  border:1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.18);
  position:relative;
  transition: background .15s ease, border-color .15s ease;
  box-shadow: 0 10px 22px rgba(0,0,0,.22);
}
.switch .track::after{
  content:"";
  position:absolute;
  top: 50%;
  left: 6px;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgba(255,255,255,.88);
  box-shadow: 0 10px 25px rgba(0,0,0,.35);
  transition: transform .18s ease, background .15s ease;
}
.switch input:checked + .track{
  background: rgba(239,68,68,.34);
  border-color: rgba(239,68,68,.52);
}
.switch input:checked + .track::after{
  transform: translate(22px, -50%);
  background: rgba(255,255,255,.92);
}

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