/* Party kit — mobile-first, dark-leaning game shell on top of /assets/brand.css */
:root { --pk-good: #39d98a; --pk-bad: #ff5c7a; --pk-warn: #ffc53d; --pk-card: var(--bg-elevated); }
html, body { overflow-x: hidden; }
body { min-height: 100dvh; -webkit-tap-highlight-color: transparent; }
body.pk-ingame .nav { display: none; }
#pk { max-width: 560px; margin: 0 auto; padding: 12px 16px calc(24px + env(safe-area-inset-bottom)); }
#pk.pk-offline::before { content: "Verbindung wird wiederhergestellt …"; position: fixed; top: 0; left: 0; right: 0; z-index: 300; background: var(--pk-warn); color: #000; text-align: center; font-size: .8rem; font-weight: 700; padding: calc(4px + env(safe-area-inset-top)) 8px 4px; }
.pk-screen { animation: pkIn .25s ease; }
@keyframes pkIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.pk-hero { text-align: center; padding: 18px 0 12px; }
.pk-emoji { font-size: 3.2rem; line-height: 1; filter: drop-shadow(0 6px 18px rgba(109,91,255,.35)); animation: pkBob 3s ease-in-out infinite; }
@keyframes pkBob { 50% { transform: translateY(-6px) rotate(-4deg); } }
.pk-hero h1 { margin: 10px 0 4px; font-size: 1.9rem; letter-spacing: -.02em; }
.pk-tag { margin: 0; color: var(--text-muted); }
.pk-count { display: inline-block; margin-top: 10px; font-size: .8rem; font-weight: 700; padding: 4px 12px; border-radius: 999px; background: var(--border); color: var(--text-muted); }
.pk-card { background: var(--pk-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin: 12px 0; box-shadow: var(--shadow); }
.pk-card h2 { font-size: 1.05rem; margin: 0 0 10px; }
.pk-label { display: block; font-size: .8rem; font-weight: 700; color: var(--text-muted); margin-bottom: 6px; }
.pk-input { width: 100%; min-height: 48px; font: inherit; font-size: 1.05rem; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--bg); color: var(--text); outline: none; transition: border-color .15s; }
.pk-input:focus { border-color: var(--accent); }
.pk-code-in { text-transform: uppercase; letter-spacing: .3em; font-weight: 800; text-align: center; font-family: var(--mono); }
.pk-row { display: flex; gap: 8px; }
.pk-row > .pk-input { flex: 1; min-width: 0; }
.pk-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px; padding: 10px 18px; border-radius: 12px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font: inherit; font-weight: 700; font-size: 1rem; cursor: pointer; transition: transform .08s, background .15s, opacity .15s; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.pk-btn:active { transform: scale(.97); }
.pk-btn:disabled { opacity: .5; cursor: default; transform: none; }
.pk-primary { background: var(--accent-grad); border-color: transparent; color: #fff; box-shadow: 0 6px 20px rgba(109,91,255,.35); }
.pk-danger { color: var(--pk-bad); }
.pk-big { width: 100%; min-height: 56px; font-size: 1.1rem; }
.pk-card > .pk-btn, .pk-sheet-in > .pk-btn { width: 100%; margin-top: 10px; }
.pk-link { background: none; border: 0; color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; min-height: 44px; padding: 8px; display: block; margin: 4px auto 0; }
.pk-or { display: flex; align-items: center; gap: 10px; color: var(--text-muted); font-size: .8rem; margin: 14px 0 10px; }
.pk-or::before, .pk-or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.pk-rules summary { cursor: pointer; font-weight: 700; min-height: 28px; }
.pk-rules div { color: var(--text-muted); font-size: .92rem; line-height: 1.55; }
.pk-muted { color: var(--text-muted); }
.pk-small { font-size: .8rem; }
.pk-center { text-align: center; }
.pk-codebox { text-align: center; padding: 8px 0 4px; }
.pk-bigcode { font-family: var(--mono); font-size: 3rem; font-weight: 900; letter-spacing: .25em; margin: 2px 0 10px; padding-left: .25em; background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.pk-head { display: flex; align-items: center; justify-content: space-between; }
.pk-head .pk-link { margin: 0; }
.pk-plist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.pk-plist li { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 12px; background: var(--bg); animation: pkIn .25s ease; }
.pk-plist li.off { opacity: .5; }
.pk-pn { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.pk-pn em { color: var(--text-muted); font-style: normal; font-weight: 400; }
.pk-tagc { font-size: .7rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--border); color: var(--text-muted); white-space: nowrap; }
.pk-x { width: 36px; height: 36px; border-radius: 10px; border: 0; background: transparent; color: var(--text-muted); font-size: 1rem; cursor: pointer; }
.pk-av { font-style: normal; flex: none; width: 32px; height: 32px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--c); color: #111; font-weight: 900; font-size: .9rem; box-shadow: 0 0 0 2px rgba(255,255,255,.08); }
.pk-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; background: color-mix(in srgb, var(--c) 22%, transparent); color: var(--text); font-weight: 700; border: 1px solid color-mix(in srgb, var(--c) 55%, transparent); }
.pk-set { padding: 10px 0; border-top: 1px solid var(--border); }
.pk-set:first-child { border-top: 0; padding-top: 0; }
.pk-set.inline { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pk-setl { font-weight: 700; margin-bottom: 6px; }
.pk-set.inline .pk-setl { margin: 0; }
.pk-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pk-pill { min-height: 40px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg); color: var(--text-muted); font: inherit; font-size: .88rem; font-weight: 600; cursor: pointer; }
.pk-pill.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.pk-pill:disabled { cursor: default; }
.pk-toggle { flex: none; width: 54px; height: 32px; border-radius: 999px; border: 0; background: var(--border); position: relative; cursor: pointer; }
.pk-toggle span { position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; transition: transform .2s; }
.pk-toggle.on { background: var(--accent); }
.pk-toggle.on span { transform: translateX(22px); }
.pk-sticky { position: sticky; bottom: 0; padding: 12px 0 calc(8px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--bg) 30%); }
.pk-bar { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 8px; margin: -12px -16px 8px; padding: calc(6px + env(safe-area-inset-top)) 12px 6px; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.pk-barbtn { width: 44px; height: 44px; border-radius: 12px; border: 0; background: transparent; color: var(--text); font-size: 1.3rem; cursor: pointer; }
.pk-bartitle { flex: 1; font-weight: 800; font-family: var(--mono); letter-spacing: .1em; }
.pk-barright { font-size: .85rem; font-weight: 700; color: var(--text-muted); }
.pk-sheet { position: fixed; inset: 0; z-index: 250; background: rgba(5,5,10,.6); display: flex; align-items: flex-end; justify-content: center; animation: pkFade .2s; }
.pk-sheet[hidden] { display: none; }
@keyframes pkFade { from { opacity: 0; } }
.pk-sheet-in { width: 100%; max-width: 560px; max-height: 85dvh; overflow: auto; background: var(--bg-elevated); border-radius: 22px 22px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); animation: pkUp .25s ease; }
@keyframes pkUp { from { transform: translateY(40px); } }
.pk-sheet-in h2 { margin: 0 0 12px; font-size: 1.1rem; }
#pk-toasts { position: fixed; left: 0; right: 0; top: calc(60px + env(safe-area-inset-top)); z-index: 400; display: grid; justify-items: center; gap: 6px; pointer-events: none; padding: 0 16px; }
.pk-toast { background: #1f1f2b; color: #fff; padding: 10px 16px; border-radius: 12px; font-weight: 600; font-size: .92rem; box-shadow: 0 8px 30px rgba(0,0,0,.4); animation: pkIn .2s; transition: opacity .3s, transform .3s; max-width: 100%; }
.pk-toast.bad { background: #5a1624; }
.pk-toast.good { background: #114a31; }
.pk-toast.out { opacity: 0; transform: translateY(-6px); }
.pk-confetti { position: fixed; inset: 0; pointer-events: none; z-index: 500; }

/* building blocks used by the games */
.g-center { text-align: center; }
.g-title { font-size: 1.35rem; font-weight: 800; margin: 6px 0; line-height: 1.3; }
.g-sub { color: var(--text-muted); font-size: .9rem; }
.g-timer { height: 6px; border-radius: 99px; background: var(--border); overflow: hidden; margin: 8px 0 12px; }
.g-timer > i { display: block; height: 100%; background: var(--accent-grad); transform-origin: left; }
.g-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.g-opt { min-height: 64px; padding: 10px 12px; border-radius: 14px; border: 2px solid var(--border); background: var(--bg-elevated); color: var(--text); font: inherit; font-weight: 700; font-size: .98rem; line-height: 1.25; cursor: pointer; transition: transform .08s, border-color .15s, background .15s; touch-action: manipulation; }
.g-opt:active { transform: scale(.97); }
.g-opt.sel { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 18%, var(--bg-elevated)); }
.g-opt.right { border-color: var(--pk-good); background: color-mix(in srgb, var(--pk-good) 22%, var(--bg-elevated)); }
.g-opt.wrong { border-color: var(--pk-bad); background: color-mix(in srgb, var(--pk-bad) 18%, var(--bg-elevated)); }
.g-opt:disabled { cursor: default; }
.g-score { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.g-score li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: var(--bg-elevated); border: 1px solid var(--border); transition: transform .3s; }
.g-score li.me { border-color: var(--accent); }
.g-score .n { flex: 1; font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-score .v { font-weight: 900; font-variant-numeric: tabular-nums; }
.g-score .d { font-size: .8rem; font-weight: 800; }
.g-score .d.up { color: var(--pk-good); } .g-score .d.down { color: var(--pk-bad); }
.g-rank { width: 22px; text-align: center; font-weight: 900; color: var(--text-muted); }
.g-pop { animation: gPop .35s cubic-bezier(.2,1.6,.4,1); }
@keyframes gPop { from { transform: scale(.6); opacity: 0; } }
.g-shake { animation: gShake .4s; }
@keyframes gShake { 20%,60% { transform: translateX(-6px); } 40%,80% { transform: translateX(6px); } }
.g-podium { display: flex; align-items: flex-end; justify-content: center; gap: 8px; margin: 16px 0; }
.g-podium > div { flex: 1; max-width: 110px; text-align: center; }
.g-podium .blk { border-radius: 12px 12px 0 0; background: var(--accent-grad); color: #fff; font-weight: 900; font-size: 1.4rem; display: grid; place-items: center; animation: gRise .6s ease both; transform-origin: bottom; }
@keyframes gRise { from { transform: scaleY(0); } }
.g-podium .nm { font-weight: 800; font-size: .9rem; margin: 6px 0 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* keep the shared fullscreen button out of the game controls */
body.pk-ingame .game-fs-btn { top: calc(8px + env(safe-area-inset-top)) !important; bottom: auto !important; right: 10px !important; width: 40px !important; height: 40px !important; }
body.pk-ingame .pk-bar { padding-right: 60px; }
