/* Jass-Stube – Schweizer Rot/Weiss */
:root { --red: #d52b1e; --red2: #9b1d14; --ink: #22252e; --mut: #6a6f7c; --bg: #f6f2ec; --card: #fff; --gold: #f4c20d;
  --hw: 19vw; --tw: 18.5vw; --md: 19vw; --safe-t: 0px; --safe-b: 0px; }
@supports (padding-top: env(safe-area-inset-top)) { :root { --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px); } }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; overflow: hidden; }
body { -webkit-user-select: none; user-select: none; }
button { font: inherit; color: inherit; cursor: pointer; }
#app { position: fixed; top: 0; left: 0; right: 0; bottom: 0; }
.screen { position: absolute; top: 0; left: 0; right: 0; bottom: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; display: none; padding-bottom: calc(20px + var(--safe-b)); }
.screen.on { display: block; }
.wrap { max-width: 560px; margin: 0 auto; padding: 12px 14px; }
.c { text-align: center; }
.muted { color: var(--mut); font-size: 14px; }
small { font-size: 13px; }
h1, h2, h3 { margin: 0; }

/* ---------- Kopf ---------- */
.hero { position: relative; background: var(--red); color: #fff; padding: calc(18px + var(--safe-t)) 16px 26px; display: flex; gap: 14px; align-items: center; overflow: hidden; }
.hero::after { content: ''; position: absolute; right: -40px; bottom: -60px; width: 200px; height: 200px; background:
  linear-gradient(#fff, #fff) center/30% 100% no-repeat, linear-gradient(#fff, #fff) center/100% 30% no-repeat; opacity: .09; transform: rotate(-12deg); }
.hlogo svg { display: block; filter: drop-shadow(0 3px 6px #0004); }
.hero .hlogo svg > rect:first-child { fill: #b32015; }
.gr { font-size: 14px; opacity: .9; font-weight: 600; }
.hero h1 { font-size: 34px; letter-spacing: -.5px; font-weight: 900; line-height: 1.05; }
.sub { font-size: 14px; opacity: .92; margin-top: 2px; }
.hbtns { position: absolute; right: 10px; top: calc(10px + var(--safe-t)); display: flex; gap: 6px; z-index: 1; }
.bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 8px; background: var(--red); color: #fff; padding: calc(8px + var(--safe-t)) 10px 8px; box-shadow: 0 2px 8px #0002; }
.bar h2 { font-size: 20px; flex: 1; text-align: center; font-weight: 900; }
.bar .sp { width: 42px; }
.ib { width: 42px; height: 42px; border: 0; border-radius: 12px; background: #0000001f; color: inherit; font-size: 22px; font-weight: 900; display: inline-flex; align-items: center; justify-content: center; }
.ib.w { background: #ffffff2a; color: #fff; }

/* ---------- Kacheln & Boxen ---------- */
.tile { border: 0; background: var(--card); border-radius: 18px; padding: 14px; box-shadow: 0 3px 0 #0001, 0 2px 10px #0000000d; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; text-align: left; position: relative; }
.tile .ic { font-size: 28px; line-height: 1; margin-bottom: 4px; }
.tile b { font-size: 17px; } .tile small { color: var(--mut); }
.tile.big { flex-direction: row; align-items: center; width: 100%; gap: 14px; padding: 18px 16px; margin-top: -14px; border: 3px solid var(--red); box-shadow: 0 5px 0 var(--red2); }
.tile.big b { font-size: 24px; display: block; } .tile.big small { display: block; }
.tile.big .ic { margin: 0; width: 48px; height: 48px; background: #fff2f0; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 30px; }
.tile.big .go { margin-left: auto; width: 44px; height: 44px; border-radius: 50%; background: var(--red); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 18px; }
.tile:active, .btn:active, .lesson:active { transform: translateY(2px); }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0; }
.free { background: #fff6d6; border-radius: 12px; padding: 9px 12px; font-size: 14px; margin: 10px 0 0; text-align: center; }
.free a { color: var(--red); font-weight: 800; }
.box { background: var(--card); border-radius: 18px; padding: 14px; margin: 12px 0; box-shadow: 0 2px 10px #0000000d; }
.box > b { display: block; margin-bottom: 8px; font-size: 16px; }
.bh { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.bh b { font-size: 16px; } .bh span { color: var(--mut); font-weight: 700; font-size: 14px; }
.goal { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid #eee; font-size: 15px; }
.goal small { color: var(--mut); } .goal .rw { color: #1d8a4e; font-weight: 800; }
.goal.done span { color: #1d6b3e; }
.mini { border: 0; background: #1d8a4e; color: #fff; border-radius: 10px; padding: 6px 10px; font-weight: 900; box-shadow: 0 3px 0 #136237; }
.pbar { height: 10px; background: #eee6dc; border-radius: 99px; overflow: hidden; margin: 6px 0; }
.pbar i { display: block; height: 100%; background: linear-gradient(90deg, var(--red), #ef5b4f); border-radius: 99px; }
.rank small { color: var(--mut); }
.foot { text-align: center; color: var(--mut); font-size: 13px; margin: 18px 0 6px; }
.btn { display: block; width: 100%; border: 0; border-radius: 14px; padding: 14px; margin: 10px 0 0; background: var(--red); color: #fff; font-weight: 900; font-size: 17px; box-shadow: 0 4px 0 var(--red2); }
.btn small { display: block; font-weight: 600; opacity: .85; font-size: 13px; }
.btn.sec { background: #ece7e0; color: var(--ink); box-shadow: 0 3px 0 #d3ccc2; }
.btn.warn { background: #ffe1dd; color: var(--red2); box-shadow: 0 3px 0 #f1bcb5; }
.btn.ad { background: #22252e; box-shadow: 0 4px 0 #000; }
.row { display: flex; gap: 8px; } .row .btn { flex: 1; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 8px; }
.chip { border: 2px solid #e3ddd4; background: #fff; border-radius: 99px; padding: 9px 14px; font-weight: 800; font-size: 15px; }
.chip.on { border-color: var(--red); background: var(--red); color: #fff; }
.chip.lock { opacity: .75; }
.lead { font-size: 16px; line-height: 1.45; }

/* ---------- Spieltisch ---------- */
#s-game { overflow: hidden; padding: 0; }
.tbl { position: absolute; top: 0; left: 0; right: 0; bottom: 0; overflow: hidden; color: #fff; }
.tbl::before { content: ''; position: absolute; left: 50%; top: 45%; width: 74vmin; height: 46vmin; transform: translate(-50%, -50%); border-radius: 50%; border: 2px solid #ffffff1a; pointer-events: none; }
.gtop { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 8px; padding: calc(8px + var(--safe-t)) 8px 8px; background: #0000002e; z-index: 4; }
.sc { flex: 1; display: flex; gap: 12px; align-items: flex-end; justify-content: center; }
.sc div { text-align: center; line-height: 1.05; }
.sc small { display: block; font-size: 11px; opacity: .8; text-transform: uppercase; letter-spacing: .5px; }
.sc b { font-size: 21px; font-weight: 900; }
.sc .tg { font-size: 13px; opacity: .85; border-left: 1px solid #fff5; padding-left: 10px; }
.tr { display: flex; align-items: center; gap: 5px; background: #fff; color: var(--ink); border-radius: 12px; padding: 4px 9px; min-height: 36px; font-size: 14px; }
.tr small { font-size: 11px; color: var(--mut); } .tr em { font-style: normal; background: var(--red); color: #fff; border-radius: 6px; padding: 1px 5px; font-weight: 900; font-size: 12px; }
.seat { position: absolute; display: flex; flex-direction: column; align-items: center; gap: 3px; z-index: 2; transition: transform .2s; }
.seat .av { width: 46px; height: 46px; border-radius: 50%; border: 3px solid #fff; display: flex; align-items: center; justify-content: center; font-size: 26px; box-shadow: 0 3px 10px #0004; }
.seat .nm { font-size: 13px; font-weight: 800; background: #00000040; padding: 1px 8px; border-radius: 99px; }
.seat.turn .av { box-shadow: 0 0 0 4px var(--gold), 0 3px 10px #0004; }
.seat.won { transform: scale(1.12); }
.st2 { top: calc(62px + var(--safe-t)); left: 50%; transform: translateX(-50%); }
.st2.won { transform: translateX(-50%) scale(1.12); }
.st1 { right: 6px; top: 34%; } .st3 { left: 6px; top: 34%; }
.st0 { left: 50%; bottom: calc(var(--hw) * 1.5 + 22px + var(--safe-b)); transform: translateX(-50%); display: none; }
.mini-h { display: flex; height: 16px; }
.mini-h i { width: 9px; height: 14px; border-radius: 2px; background: #fff; border: 1px solid #d52b1e; margin-left: -4px; box-shadow: 0 1px 2px #0004; }
.mini-h i:first-child { margin-left: 0; }
#trick { position: absolute; left: 50%; top: 45%; width: calc(var(--tw) * 3); height: calc(var(--tw) * 3.25); transform: translate(-50%, -50%); }
.sl { position: absolute; width: var(--tw); height: calc(var(--tw) * 1.5); }
.sl0 { left: 50%; bottom: 0; margin-left: calc(var(--tw) * -0.5); }
.sl2 { left: 50%; top: 0; margin-left: calc(var(--tw) * -0.5); }
.sl1 { right: 0; top: 50%; margin-top: calc(var(--tw) * -0.75); }
.sl3 { left: 0; top: 50%; margin-top: calc(var(--tw) * -0.75); }
.sl .card { width: 100%; height: 100%; transition: transform .28s ease-out, opacity .3s; }
.card { position: relative; border-radius: 8%; background: #fffdf6; box-shadow: 0 2px 6px #0005; }
.card svg { display: block; width: 100%; height: 100%; }
#hand { position: absolute; left: 0; right: 0; bottom: calc(16px + var(--safe-b)); height: calc(var(--hw) * 1.5 + 16px); }
#hand .card { position: absolute; bottom: 0; width: var(--hw); height: calc(var(--hw) * 1.5); transform: translateY(var(--y, 0)) rotate(var(--r, 0)); transform-origin: 50% 120%; transition: transform .18s, filter .18s; }
#hand .card.ok { transform: translateY(calc(var(--y, 0px) - 12px)) rotate(var(--r, 0)); }
#hand .card.no { filter: brightness(.62) saturate(.6); }
#hand .card.tip { box-shadow: 0 0 0 4px var(--gold), 0 0 22px var(--gold); }
#hand .card.dl { animation: dealIn .4s backwards; }
@keyframes dealIn { from { transform: translateY(-40vh) scale(.5); opacity: 0; } }
.ginfo { position: absolute; left: 50%; bottom: calc(var(--hw) * 1.5 + 34px + var(--safe-b)); transform: translateX(-50%); background: #000000a0; color: #fff; border-radius: 12px; padding: 6px 12px; font-size: 14px; max-width: 92%; text-align: center; opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 3; }
.ginfo.on { opacity: 1; }
#gtip { position: absolute; right: 8px; bottom: calc(var(--hw) * 1.5 + 70px + var(--safe-b)); z-index: 3; }
.tipb { border: 0; background: var(--gold); color: #3a2a00; border-radius: 99px; padding: 8px 12px; font-weight: 900; font-size: 14px; box-shadow: 0 3px 0 #b38c00; }
.bub { position: absolute; z-index: 6; background: #fff; color: var(--ink); border-radius: 14px; padding: 6px 11px; font-weight: 900; font-size: 15px; box-shadow: 0 4px 14px #0005; opacity: 0; transform: scale(.7); transition: opacity .2s, transform .2s; pointer-events: none; white-space: nowrap; display: flex; align-items: center; gap: 4px; }
.bub.on { opacity: 1; transform: scale(1); }
.bb2 { top: calc(128px + var(--safe-t)); left: 50%; margin-left: -50px; }
.bb1 { right: 10px; top: calc(34% + 72px); } .bb3 { left: 10px; top: calc(34% + 72px); }
.bb0 { left: 50%; margin-left: -50px; bottom: calc(var(--hw) * 1.5 + 70px + var(--safe-b)); }
.si { vertical-align: middle; flex: none; }

/* ---------- Overlays ---------- */
#ov { position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 50; display: none; align-items: center; justify-content: center; padding: 16px; background: #1a1c24b0; }
#ov.on { display: flex; }
#ov .ob { background: #fff; color: var(--ink); border-radius: 22px; width: 100%; max-width: 440px; max-height: 100%; overflow-y: auto; padding: 18px; box-shadow: 0 12px 40px #0006; text-align: center; animation: pop .22s; }
@keyframes pop { from { transform: scale(.9); opacity: 0; } }
#ov h3 { font-size: 21px; margin: 2px 0 10px; display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; }
#ov p { margin: 8px 0; line-height: 1.4; }
#ov .big { font-size: 56px; line-height: 1.1; }
#ov.tpick { background: transparent; align-items: flex-start; padding-top: calc(92px + var(--safe-t)); pointer-events: none; }
#ov.tpick .ob { pointer-events: auto; max-width: 400px; background: #fffffff4; }
.tpg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tpb { border: 2px solid #e8e1d6; background: #fff; border-radius: 14px; padding: 10px 4px; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 14px; position: relative; }
.tpb em { font-style: normal; font-size: 12px; font-weight: 900; color: var(--red); }
.tpb:disabled { opacity: .4; }
.tpb:active { border-color: var(--red); }
#ov input[type=number] { font: inherit; font-size: 26px; width: 160px; text-align: center; border: 3px solid #ddd; border-radius: 14px; padding: 6px; }
#ov input[type=range] { width: 100%; accent-color: var(--red); }
.pred { display: flex; align-items: center; justify-content: center; gap: 18px; } .pred b { font-size: 40px; min-width: 70px; } .pred .ib { background: #eee; }
table.st { width: 100%; border-collapse: collapse; margin: 8px 0; font-size: 15px; }
table.st th { font-size: 12px; color: var(--mut); text-transform: uppercase; padding: 4px; }
table.st td { padding: 6px 4px; border-top: 1px solid #eee; }
table.st td:first-child { text-align: left; }
table.st tr.tot td { font-weight: 900; border-top: 2px solid #ccc; }
table.st tr.tot2 td { font-weight: 900; color: var(--red); font-size: 17px; }
table.st tr.me td { background: #fff3f1; font-weight: 800; }
table.coif td small { color: var(--mut); }
.match { background: var(--gold); color: #3a2a00; border-radius: 12px; padding: 8px; font-weight: 900; margin: 6px 0; }
.wrow { border: 2px solid #f0e9df; border-radius: 14px; padding: 8px; margin: 8px 0; }
.wh { font-size: 15px; margin-bottom: 6px; } .wh em { font-style: normal; color: var(--red); font-weight: 900; }
.wcards { display: flex; justify-content: center; }
.wcards .card { width: 46px; height: 69px; margin-left: -12px; } .wcards .card:first-child { margin-left: 0; }
.wsum { font-size: 22px; font-weight: 900; color: var(--red); margin-top: 6px; }
.xp { font-weight: 900; color: #1d8a4e; margin: 8px 0; }
.tafel { width: 100%; height: auto; display: block; margin: 4px 0; }
.tafel .ch { fill: #f4f6ef; font-family: "Segoe Print", "Bradley Hand", "Comic Sans MS", cursive; font-size: 18px; }
.tafel .ch.big { font-size: 30px; font-weight: 700; } .tafel .ch.sm { font-size: 15px; }
.tlog { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 6px 0; font-size: 13px; }
.tlog span { background: #f3eee6; border-radius: 99px; padding: 3px 8px; display: inline-flex; align-items: center; gap: 3px; }
ul.rl { text-align: left; padding-left: 18px; line-height: 1.45; font-size: 15px; }
#toast { position: fixed; left: 50%; top: calc(14px + var(--safe-t)); transform: translate(-50%, -120px); z-index: 80; background: #22252e; color: #fff; padding: 10px 16px; border-radius: 16px; font-weight: 700; transition: transform .3s; max-width: 92%; text-align: center; box-shadow: 0 6px 20px #0005; font-size: 15px; }
#toast.on { transform: translate(-50%, 0); }
#fx { position: fixed; top: 0; left: 0; right: 0; bottom: 0; pointer-events: none; z-index: 60; overflow: hidden; }
#fx i { position: absolute; top: -20px; width: 9px; height: 14px; border-radius: 2px; animation: fall 2s linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }

/* ---------- Schule ---------- */
.lesson { display: flex; align-items: center; gap: 12px; width: 100%; border: 0; background: #fff; border-radius: 16px; padding: 12px 14px; margin: 8px 0; text-align: left; box-shadow: 0 2px 10px #0000000d; }
.lesson .ic { font-size: 28px; width: 40px; text-align: center; } .lesson b { display: block; font-size: 16px; } .lesson small { color: var(--mut); }
.lesson .ck { margin-left: auto; font-size: 18px; color: var(--red); }
.lesson.done { background: #f1fbf4; }
.step { background: #fff; border-radius: 18px; padding: 16px; margin-top: 10px; box-shadow: 0 2px 10px #0000000d; }
.step p { font-size: 17px; line-height: 1.5; margin: 4px 0 12px; }
.step .q { font-weight: 700; }
.lcards { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.card.md { width: var(--md); height: calc(var(--md) * 1.5); }
.card.sm { width: 48px; height: 72px; display: inline-block; }
.card.pickable { cursor: pointer; transition: transform .15s; }
.card.pickable:active { transform: translateY(-6px); }
.card.right { box-shadow: 0 0 0 4px #1d8a4e; } .card.wrong { box-shadow: 0 0 0 4px var(--red); animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.trickx .tw { display: flex; flex-direction: column; align-items: center; gap: 3px; } .trickx small { color: var(--mut); font-size: 11px; }
.lab { font-size: 13px; color: var(--mut); font-weight: 700; text-transform: uppercase; margin-top: 8px; }
.tinfo { display: inline-flex; align-items: center; gap: 6px; background: #fff2f0; color: var(--red2); font-weight: 900; padding: 5px 12px; border-radius: 99px; margin-bottom: 4px; }
.opts .btn { margin-top: 8px; } .opt.right { background: #1d8a4e; color: #fff; box-shadow: 0 3px 0 #136237; } .opt.wrong { background: #ffe1dd; }
.fb { margin-top: 10px; font-weight: 700; font-size: 16px; line-height: 1.4; } .fb.ok { color: #1d6b3e; } .fb.no { color: var(--red2); }

/* ---------- Tages-Challenge, Statistik, Erfolge ---------- */
.dch { display: flex; gap: 12px; align-items: flex-start; } .dch .dlg { font-size: 44px; } .dch p { margin: 6px 0 0; line-height: 1.45; }
.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.dd { background: #f3eee6; border-radius: 10px; padding: 6px 2px; text-align: center; } .dd small { display: block; color: var(--mut); font-size: 11px; } .dd b { font-size: 13px; }
.dd.on { background: #ffe1dd; } .dd.td { outline: 2px solid var(--red); }
.sgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0; }
.stt { background: #fff; border-radius: 14px; padding: 10px 6px; text-align: center; box-shadow: 0 2px 8px #0000000d; } .stt b { display: block; font-size: 22px; color: var(--red); } .stt small { color: var(--mut); font-size: 12px; }
.lockwrap { position: relative; } .lockwrap.locked > :not(.lockov) { filter: blur(5px); opacity: .55; pointer-events: none; }
.lockov { position: absolute; top: 30px; left: 6%; right: 6%; background: #fff; border-radius: 18px; padding: 16px; text-align: center; box-shadow: 0 10px 30px #0003; }
.lockov p { margin: 6px 0; }
.tb { display: grid; grid-template-columns: 120px 1fr 34px; align-items: center; gap: 8px; font-size: 14px; } .tb span { display: flex; align-items: center; gap: 4px; } .tb small { text-align: right; }
.achs { display: grid; gap: 8px; }
.ach { display: flex; gap: 10px; align-items: center; background: #fff; border-radius: 14px; padding: 10px 12px; box-shadow: 0 2px 8px #0000000d; opacity: .7; }
.ach.got { opacity: 1; background: #fffbe9; } .ach .ai { font-size: 28px; width: 38px; text-align: center; } .ach b { display: block; } .ach small { color: var(--mut); }
.promo { border: 3px solid var(--red); } .var p { line-height: 1.45; margin: 0; }
.rulesp p { line-height: 1.5; margin: 0; }

/* ---------- Einstellungen ---------- */
.set { display: flex; justify-content: space-between; align-items: center; width: 100%; border: 0; background: #fff; border-radius: 16px; padding: 13px 14px; margin: 8px 0; text-align: left; box-shadow: 0 2px 10px #0000000d; gap: 10px; }
.set b { display: block; font-size: 16px; } .set small { color: var(--mut); } .set.warn b { color: var(--red2); }
.sw { width: 50px; height: 30px; border-radius: 99px; background: #d7d1c8; position: relative; flex: none; transition: background .2s; }
.sw i { position: absolute; left: 3px; top: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: left .2s; box-shadow: 0 1px 3px #0003; }
.sw.on { background: #1d8a4e; } .sw.on i { left: 23px; }
.decks { display: flex; gap: 8px; }
.deck { flex: 1; border: 3px solid #eee6dc; background: #fff; border-radius: 16px; padding: 10px 6px; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; }
.deck span { width: 100%; text-align: center; font-weight: 800; font-size: 14px; margin-top: 4px; } .deck.on { border-color: var(--red); }
.backs, .tables { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.bk, .tbx { border: 3px solid transparent; background: none; border-radius: 12px; padding: 4px; display: flex; flex-direction: column; align-items: center; gap: 4px; flex: none; width: 76px; }
.bk small, .tbx small { font-size: 11px; text-align: center; line-height: 1.2; }
.bk.on, .tbx.on { border-color: var(--red); } .bk.lock, .tbx.lock { opacity: .55; }
.tbx i { width: 60px; height: 44px; border-radius: 10px; display: block; box-shadow: inset 0 0 0 2px #0002; }

@media (min-width: 484px) { :root { --hw: 92px; --tw: 80px; --md: 80px; } }
