/* Schattenbörse – Handy-Controller */
html, body { height: 100%; overflow: hidden; overscroll-behavior: none; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
body { background: radial-gradient(ellipse at 50% -20%, #2b1f4a 0%, var(--ink) 60%) fixed; }
#app { position: fixed; inset: 0; display: flex; flex-direction: column; padding-top: env(safe-area-inset-top); }
.hidden { display: none !important; }

.timebar { position: absolute; top: 0; left: 0; right: 0; height: 4px; z-index: 20; }
.timebar i { display: block; height: 100%; width: 0; background: var(--gold); box-shadow: 0 0 10px var(--gold); transition: background .3s; }
.timebar.low i { background: var(--red); box-shadow: 0 0 10px var(--red); }

.hdr { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 10px; gap: 10px; }
.hdr-me { display: flex; align-items: center; gap: 10px; min-width: 0; }
.hdr-me .avatar { font-size: 20px; }
.hdr-name { font-weight: 700; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 42vw; }
.hdr-phase { font-size: 12px; color: var(--paper-faint); letter-spacing: .12em; text-transform: uppercase; }
.hdr-money { position: relative; display: flex; align-items: center; padding: 8px 14px; border-radius: 99px; background: rgba(242, 193, 78, .1); border: 1px solid rgba(242, 193, 78, .35); font-family: var(--mono); font-size: 20px; color: var(--gold-2); }
.money-fly { position: absolute; right: 10px; top: 0; font-family: var(--mono); font-weight: 700; font-size: 18px; animation: mfly 1.4s var(--ease) forwards; pointer-events: none; }
.money-fly.plus { color: var(--green); } .money-fly.minus { color: var(--red); }
@keyframes mfly { from { transform: translateY(0); opacity: 1; } to { transform: translateY(40px); opacity: 0; } }

main { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 6px 16px 18px; -webkit-overflow-scrolling: touch; }
.scr { animation: fadeUp .4s var(--ease) both; display: flex; flex-direction: column; gap: 14px; min-height: 100%; }
.center-col { align-items: center; justify-content: center; text-align: center; }
.h1 { font-family: var(--display); font-size: 40px; line-height: 1; letter-spacing: .02em; text-transform: uppercase; margin: 0; }
.h2 { font-family: var(--display); font-size: 26px; letter-spacing: .03em; text-transform: uppercase; margin: 0; }
.muted { color: var(--paper-dim); line-height: 1.45; }
.faint { color: var(--paper-faint); font-size: 14px; }
.kicker { font-size: 12px; letter-spacing: .3em; text-transform: uppercase; color: var(--gold); }
.card { background: linear-gradient(160deg, rgba(28, 25, 48, .92), rgba(19, 17, 31, .92)); border: 1px solid var(--line); border-radius: 18px; padding: 16px; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }
.grow { flex: 1; }

/* Join */
.join-logo { font-size: 64px; text-align: center; margin: 22px 0 4px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--paper-faint); }
.inp { width: 100%; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line-2); background: rgba(0, 0, 0, .35); font-size: 20px; outline: none; transition: border-color .2s; user-select: text; -webkit-user-select: text; }
.inp:focus { border-color: var(--gold); }
.inp.code { font-family: var(--display); font-size: 40px; letter-spacing: .3em; text-align: center; text-transform: uppercase; }
textarea.inp { min-height: 90px; resize: none; font-size: 17px; }
.av-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.av-grid button { aspect-ratio: 1; border-radius: 14px; font-size: 28px; background: rgba(255, 255, 255, .04); border: 2px solid transparent; transition: transform .15s; }
.av-grid button.sel { border-color: var(--gold); background: rgba(242, 193, 78, .15); transform: scale(1.06); }
.av-grid button.taken { opacity: .2; pointer-events: none; }
.err { color: var(--red); text-align: center; min-height: 1.2em; }

/* Lobby */
.me-big { font-size: 64px; }
.me-big .avatar { width: 2em; height: 2em; }
.color-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.color-row button { width: 34px; height: 34px; border-radius: 50%; background: var(--c); border: 3px solid transparent; }
.color-row button.sel { border-color: #fff; transform: scale(1.12); }
.color-row button.taken { opacity: .15; pointer-events: none; }
.seg { display: flex; background: rgba(0, 0, 0, .35); border-radius: 12px; padding: 4px; gap: 4px; }
.seg button { flex: 1; padding: 10px 4px; border-radius: 9px; font-size: 14px; color: var(--paper-dim); }
.seg button.sel { background: var(--gold); color: var(--ink); font-weight: 700; }
.mini-players { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.mini-players .avatar { font-size: 16px; }

/* Rolle */
.role-card { position: relative; width: min(300px, 80vw); aspect-ratio: 3 / 4.2; perspective: 1200px; margin: 0 auto; }
.role-in { position: absolute; inset: 0; transition: transform .6s var(--ease); transform-style: preserve-3d; }
.role-card.open .role-in { transform: rotateY(180deg); }
.role-f, .role-b { position: absolute; inset: 0; border-radius: 22px; backface-visibility: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 22px; }
.role-f { background: repeating-linear-gradient(45deg, #1c1930 0 14px, #221e3a 14px 28px); border: 2px solid var(--line-2); box-shadow: 0 20px 50px rgba(0, 0, 0, .6); }
.role-f .rf-i { font-size: 70px; opacity: .6; }
.role-f .rf-t { font-family: var(--display); font-size: 24px; letter-spacing: .05em; margin-top: 10px; }
.role-b { transform: rotateY(180deg); box-shadow: 0 20px 60px rgba(0, 0, 0, .6); }
.role-b.gruender { background: linear-gradient(170deg, #1d5fa3, #0a2747); }
.role-b.syndikat { background: linear-gradient(170deg, #a3203b, #3a0611); }
.role-b.neutral, .role-b.solo { background: linear-gradient(170deg, #5b3fb8, #1e1245); }
.role-b.saboteur { background: linear-gradient(170deg, #b85c1f, #3d1405); }
.role-b .rb-i { font-size: 72px; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .4)); }
.role-b .rb-f { font-size: 12px; letter-spacing: .3em; text-transform: uppercase; opacity: .8; margin-top: 8px; }
.role-b .rb-n { font-family: var(--display); font-size: 40px; line-height: 1; margin: 4px 0 10px; }
.role-b .rb-d { font-size: 14px; line-height: 1.4; opacity: .92; }
.role-b .rb-x { margin-top: 10px; font-size: 13px; background: rgba(0, 0, 0, .3); border-radius: 10px; padding: 8px 10px; }
.hold-hint { text-align: center; color: var(--paper-faint); font-size: 14px; }

/* Markt */
.dice-btn { width: 200px; height: 200px; margin: 10px auto; border-radius: 40px; background: linear-gradient(160deg, var(--paper), #d9c48f); color: var(--ink); font-family: var(--display); font-size: 30px; letter-spacing: .06em;
  box-shadow: 0 10px 0 #a28c55, 0 20px 60px rgba(242, 193, 78, .35); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; animation: pulse 1.6s infinite; }
.dice-btn:active { transform: translateY(8px); box-shadow: 0 2px 0 #a28c55; animation: none; }
.dice-btn .pips { font-size: 64px; line-height: 1; }
.tile-card { border-radius: 18px; overflow: hidden; background: #1a1630; border: 1px solid var(--line-2); box-shadow: 0 16px 40px rgba(0, 0, 0, .5); }
.tile-card .tb { height: 54px; background: var(--gc); display: flex; align-items: center; justify-content: center; font-family: var(--display); letter-spacing: .1em; font-size: 16px; text-transform: uppercase; color: rgba(0, 0, 0, .7); }
.tile-card .tc { padding: 16px; text-align: center; }
.tile-card .tn { font-family: var(--display); font-size: 34px; text-transform: uppercase; }
.tile-card .tr { display: flex; justify-content: space-between; margin-top: 10px; font-size: 15px; color: var(--paper-dim); }
.tile-card .tr b { color: var(--paper); font-family: var(--mono); }
.msg { padding: 14px 16px; border-radius: 14px; background: rgba(255, 255, 255, .05); border-left: 4px solid var(--gold); font-size: 16px; line-height: 1.4; }
.build-list { display: flex; flex-direction: column; gap: 8px; }
.build-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: rgba(255, 255, 255, .04); border: 1px solid var(--line); text-align: left; }
.build-item .sw { width: 12px; height: 36px; border-radius: 4px; background: var(--gc); flex: none; }
.build-item .bn { font-weight: 700; }
.build-item .bh { font-size: 13px; color: var(--paper-faint); }
.build-item .bc { margin-left: auto; font-family: var(--mono); color: var(--gold-2); }
.build-item[disabled] { opacity: .35; }
.wait-list { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.wait-list .avatar { font-size: 18px; }

/* Aufträge */
.task-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.task { position: relative; aspect-ratio: 1 / .9; border-radius: 18px; padding: 14px; text-align: left; display: flex; flex-direction: column; justify-content: space-between;
  background: linear-gradient(160deg, #26204a, #171330); border: 1px solid var(--line-2); box-shadow: 0 8px 20px rgba(0, 0, 0, .35); transition: transform .15s; }
.task:active { transform: scale(.96); }
.task .ti { font-size: 34px; }
.task .tt { font-weight: 700; font-size: 16px; }
.task .tg { font-size: 12px; color: var(--green); font-family: var(--mono); }
.task.special { background: linear-gradient(160deg, #4a3a12, #1f170a); border-color: rgba(242, 193, 78, .45); }
.task.special .tg { color: var(--gold-2); }
.task[disabled] { opacity: .3; pointer-events: none; }
.task.special::after { content: '★'; position: absolute; top: 10px; right: 14px; color: var(--gold); }
.progress-dots { display: flex; gap: 8px; justify-content: center; }
.progress-dots i { width: 14px; height: 14px; border-radius: 50%; background: rgba(255, 255, 255, .12); }
.progress-dots i.on { background: var(--green); box-shadow: 0 0 10px var(--green); }

.crisis-card { border-radius: 20px; padding: 18px; text-align: center; background: linear-gradient(160deg, #5a0c1d, #22050b); border: 2px solid var(--red); box-shadow: 0 0 40px rgba(255, 59, 92, .45); animation: shake .5s; }
.crisis-card .ci { font-size: 48px; }
.crisis-card .ct { font-family: var(--display); font-size: 32px; color: #ffb3c0; text-transform: uppercase; }
.hold-btn { position: relative; width: 190px; height: 190px; margin: 14px auto 6px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #ff8095, var(--red) 60%, #7a0f24); color: #fff;
  font-family: var(--display); font-size: 24px; letter-spacing: .05em; box-shadow: 0 8px 0 #5a0c1d, 0 0 40px rgba(255, 59, 92, .6); display: grid; place-items: center; touch-action: none; }
.hold-btn svg { position: absolute; inset: -8px; width: calc(100% + 16px); height: calc(100% + 16px); transform: rotate(-90deg); pointer-events: none; }
.hold-btn circle { fill: none; stroke: #fff; stroke-width: 6; stroke-dasharray: 603; stroke-dashoffset: 603; stroke-linecap: round; }
.hold-btn.holding { transform: scale(.95); }
.hold-btn.ok { background: radial-gradient(circle at 40% 35%, #a5ffd6, var(--green) 60%, #187a50); color: #032015; box-shadow: 0 8px 0 #0f5236, 0 0 40px rgba(75, 227, 160, .6); }

/* Rat */
.vote-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.vote-btn { aspect-ratio: 3 / 4; border-radius: 20px; font-family: var(--display); font-size: 46px; letter-spacing: .04em; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; transition: transform .15s; }
.vote-btn small { font-family: var(--body); font-size: 13px; letter-spacing: 0; opacity: .8; }
.vote-btn.ja { background: linear-gradient(160deg, #6ff0b6, #138a57); color: #03130b; box-shadow: 0 8px 0 #0a4a2e; }
.vote-btn.nein { background: linear-gradient(160deg, #ff8095, #8f1630); color: #fff; box-shadow: 0 8px 0 #4a0915; }
.vote-btn:active { transform: translateY(6px); box-shadow: none; }
.pick-list { display: flex; flex-direction: column; gap: 8px; }
.pick { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: rgba(255, 255, 255, .05); border: 1px solid var(--line); font-size: 18px; font-weight: 700; text-align: left; transition: transform .15s; }
.pick:active { transform: scale(.98); }
.pick .avatar { font-size: 20px; }
.pick.sel { border-color: var(--gold); background: rgba(242, 193, 78, .14); }
.pick .pr { margin-left: auto; font-size: 13px; font-weight: 400; color: var(--paper-faint); }
.hand-pick { display: flex; gap: 12px; justify-content: center; }
.hand-pick .law-card { font-size: 12px; transition: transform .25s var(--bounce), opacity .25s; animation: dealIn .5s var(--bounce) both; }
.hand-pick .law-card:nth-child(2) { animation-delay: .1s; } .hand-pick .law-card:nth-child(3) { animation-delay: .2s; }
.hand-pick .law-card.sel { transform: translateY(-16px) scale(1.06); box-shadow: 0 0 0 3px #fff, 0 20px 40px rgba(0, 0, 0, .6); }
.hand-pick .law-card.dim { opacity: .45; }
@keyframes dealIn { from { transform: translateY(-60px) rotate(-12deg); opacity: 0; } to { transform: none; opacity: 1; } }
.result-big { font-family: var(--display); font-size: 54px; text-transform: uppercase; }

/* Dock */
.dock { display: flex; gap: 8px; padding: 8px 12px calc(10px + env(safe-area-inset-bottom)); background: linear-gradient(0deg, rgba(5, 4, 9, .95), rgba(5, 4, 9, .6)); border-top: 1px solid var(--line); }
.dock-b { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0; border-radius: 12px; font-size: 12px; color: var(--paper-dim); }
.dock-b span { font-size: 22px; }
.dock-b:active { background: rgba(255, 255, 255, .06); }
.dock-b.badge { position: relative; }
.dock-b.badge::after { content: ''; position: absolute; top: 6px; right: 28%; width: 10px; height: 10px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 8px var(--gold); }

/* Peek */
.peek { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(5, 4, 9, .85); opacity: 0; pointer-events: none; transition: opacity .2s; }
.peek.show { opacity: 1; }
.peek .role-card { pointer-events: none; }

/* Sheet */
.sheet { position: fixed; inset: 0; z-index: 70; pointer-events: none; }
.sheet-bg { position: absolute; inset: 0; background: rgba(0, 0, 0, .6); opacity: 0; transition: opacity .3s; }
.sheet-card { position: absolute; left: 0; right: 0; bottom: 0; max-height: 88vh; overflow-y: auto; background: linear-gradient(180deg, #1f1a38, #120f22); border-radius: 24px 24px 0 0; border-top: 1px solid var(--line-2);
  padding: 8px 18px calc(22px + env(safe-area-inset-bottom)); transform: translateY(105%); transition: transform .35s var(--ease); }
.sheet.open { pointer-events: auto; }
.sheet.open .sheet-bg { opacity: 1; }
.sheet.open .sheet-card { transform: none; }
.sheet-grip { width: 44px; height: 5px; border-radius: 3px; background: var(--line-2); margin: 4px auto 14px; }
.sheet h3 { font-family: var(--display); font-weight: 400; font-size: 28px; letter-spacing: .03em; text-transform: uppercase; margin: 4px 0 12px; }
.act-list { display: flex; flex-direction: column; gap: 10px; }
.act { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 16px; background: rgba(255, 255, 255, .05); border: 1px solid var(--line); text-align: left; }
.act .ai { font-size: 28px; }
.act .at { font-weight: 700; }
.act .ad { font-size: 13px; color: var(--paper-faint); }
.act[disabled] { opacity: .35; }
.amounts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.amounts button { padding: 12px 0; border-radius: 12px; background: rgba(255, 255, 255, .06); font-family: var(--mono); font-size: 16px; }
.amounts button.sel { background: var(--gold); color: var(--ink); }
.log-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.rules p { line-height: 1.5; color: var(--paper-dim); margin: 0 0 10px; }
.rules b { color: var(--paper); }

/* Minispiele */
.mg { position: fixed; inset: 0; z-index: 80; background: radial-gradient(ellipse at 50% 0%, #2b2152, #0b0a14 70%); display: none; flex-direction: column; padding: calc(16px + env(safe-area-inset-top)) 18px calc(18px + env(safe-area-inset-bottom)); }
.mg.open { display: flex; animation: fadeUp .3s var(--ease); }
.mg-top { display: flex; justify-content: space-between; align-items: center; }
.mg-x { width: 44px; height: 44px; border-radius: 50%; background: rgba(255, 255, 255, .08); font-size: 20px; }
.mg-title { font-family: var(--display); font-size: 30px; text-transform: uppercase; letter-spacing: .03em; }
.mg-sub { color: var(--paper-dim); margin: 6px 0 16px; }
.mg-body { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 14px; }
.mg-done { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(5, 20, 12, .85); font-family: var(--display); font-size: 54px; color: var(--green); text-transform: uppercase; animation: pop .4s var(--bounce); }
.wires { position: relative; display: flex; justify-content: space-between; height: 360px; }
.wires svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.wires .col { display: flex; flex-direction: column; justify-content: space-around; z-index: 2; }
.plug { width: 64px; height: 56px; border-radius: 12px; background: var(--c); box-shadow: 0 0 0 3px rgba(0, 0, 0, .4) inset, 0 0 16px var(--c); }
.plug.sel { transform: scale(1.15); box-shadow: 0 0 0 4px #fff, 0 0 26px var(--c); }
.plug.done { opacity: .4; }
.cash-target { text-align: center; font-family: var(--mono); font-size: 18px; color: var(--paper-dim); }
.cash-target b { display: block; font-size: 52px; color: var(--gold-2); }
.cash-now { text-align: center; font-family: var(--mono); font-size: 40px; }
.coins { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.coins button { padding: 18px 0; border-radius: 16px; font-family: var(--mono); font-size: 26px; font-weight: 700; background: radial-gradient(circle at 40% 30%, var(--gold-2), var(--gold) 60%, #9a6c12); color: var(--ink); box-shadow: 0 6px 0 #6e4c0b; }
.coins button:active { transform: translateY(4px); box-shadow: 0 2px 0 #6e4c0b; }
.meter { position: relative; height: 64px; border-radius: 14px; background: rgba(255, 255, 255, .07); overflow: hidden; }
.meter .zone { position: absolute; top: 0; bottom: 0; background: rgba(75, 227, 160, .35); border-left: 2px solid var(--green); border-right: 2px solid var(--green); }
.meter .needle { position: absolute; top: -4px; bottom: -4px; width: 6px; margin-left: -3px; background: #fff; box-shadow: 0 0 12px #fff; border-radius: 3px; }
.code-show { font-family: var(--mono); font-size: 66px; letter-spacing: .25em; text-align: center; color: var(--gold-2); min-height: 80px; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.keypad button { padding: 16px 0; border-radius: 14px; background: rgba(255, 255, 255, .07); font-family: var(--mono); font-size: 26px; }
.keypad button:active { background: rgba(255, 255, 255, .18); }
.num-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.num-grid button { aspect-ratio: 1; border-radius: 18px; background: linear-gradient(160deg, #3a3170, #221c44); font-family: var(--display); font-size: 40px; box-shadow: 0 6px 0 #120f22; transition: transform .1s, opacity .2s; }
.num-grid button.ok { opacity: .15; transform: scale(.85); }

.dice-ov { position: fixed; inset: 0; z-index: 75; display: none; place-items: center; background: rgba(5, 4, 9, .75); }
.dice-ov.show { display: grid; }
.dice-ov .dpair { display: flex; gap: 24px; }
.dice-ov .d { width: 100px; height: 100px; border-radius: 22px; background: var(--paper); color: var(--ink); display: grid; place-items: center; font-family: var(--display); font-size: 60px; box-shadow: 0 10px 0 #a28c55, 0 20px 50px rgba(0, 0, 0, .6); animation: diceTumble .9s var(--ease) both; }
.dice-ov .d:nth-child(2) { animation-delay: .08s; }
@keyframes diceTumble { 0% { transform: translateY(-300px) rotate(-540deg) scale(.4); } 70% { transform: translateY(10px) rotate(10deg) scale(1.05); } 100% { transform: none; } }
.dice-ov .dsum { text-align: center; font-family: var(--display); font-size: 34px; margin-top: 20px; animation: fadeUp .4s .8s both; }

.toasts { position: fixed; left: 12px; right: 12px; top: calc(70px + env(safe-area-inset-top)); z-index: 90; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { padding: 12px 16px; border-radius: 14px; background: rgba(11, 10, 20, .96); border: 1px solid var(--line-2); font-size: 15px; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); animation: tIn 4s var(--ease) forwards; }
.toast.money { border-color: rgba(242, 193, 78, .5); }
.toast.good { border-color: rgba(75, 227, 160, .6); }
.toast.warn { border-color: rgba(255, 59, 92, .6); }
@keyframes tIn { 0% { transform: translateY(-20px); opacity: 0; } 8% { transform: none; opacity: 1; } 85% { opacity: 1; } 100% { opacity: 0; } }
.offline { position: fixed; top: 0; left: 0; right: 0; padding: 10px; text-align: center; background: var(--red); color: #fff; font-size: 14px; z-index: 100; transform: translateY(-100%); transition: transform .3s; }
.offline.show { transform: none; }
.ghost-banner { text-align: center; padding: 10px; border-radius: 12px; background: rgba(255, 255, 255, .06); color: var(--paper-dim); font-size: 14px; }
.win-big { font-family: var(--display); font-size: 64px; line-height: 1; text-transform: uppercase; }
