/* Pennant Keeper: lilac dominant, charcoal and lemon accents. */
:root { --lil: #c8a2e8; --lil-d: #8e68c4; --lil-l: #e2d0f5; --lil-xl: #f3eafb; --ch: #2e2b33; --ch-l: #4e4956; --lem: #ffe94d; --lem-d: #e6c414; }
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body.pk-body { background: var(--lil); color: var(--ch); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; overflow-x: hidden; }
button { font: inherit; cursor: pointer; }
#pk-app {
  position: relative; display: flex; flex-direction: column; width: 100%; max-width: 620px; margin: 0 auto;
  height: 100vh; height: 100dvh; background: var(--lil);
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  overscroll-behavior: contain; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.pk-top { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; padding: 6px 8px; background: var(--ch); color: var(--lil-xl); }
.pk-brand { flex: 0 0 auto; color: var(--lem); font-weight: 900; text-decoration: none; letter-spacing: .04em; padding: 0 4px; line-height: 48px; }
.pk-chiphost { display: flex; flex: 0 1 auto; min-width: 0; overflow: hidden; }
.pk-chiphost:empty { display: none; }
.pk-top:has(.egmh-chip) .pk-round { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.pk-top:has(.egmh-chip) .pk-chiphost { flex: 1 1 auto; }
.pk-round { flex: 1 1 auto; min-width: 0; font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pk-ib { flex: 0 0 auto; min-width: 48px; height: 48px; padding: 0 8px; border: 2px solid var(--ch-l); border-radius: 12px; background: var(--ch-l); color: var(--lil-xl); font-weight: 700; font-size: 15px; }
.pk-ib[aria-pressed="true"] { background: var(--lem); color: var(--ch); border-color: var(--lem-d); }
.pk-ib:focus-visible, .pk-pad:focus-visible, .pk-kick:focus-visible, .pk-next:focus-visible, .pk-big:focus-visible, .pk-mid:focus-visible, .pk-diff:focus-visible { outline: 3px solid var(--lem); outline-offset: 2px; }
.pk-stagewrap { position: relative; flex: 1 1 auto; min-height: 0; touch-action: none; overscroll-behavior: contain; overflow: hidden; }
#pk-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; background: var(--lil-l); }
.pk-ov { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 14px; background: rgba(46, 43, 51, .55); text-align: center; overflow-y: auto; }
.pk-hide { display: none !important; }
#pk-menu { background: linear-gradient(rgba(200, 162, 232, .35), rgba(46, 43, 51, .62)); }
.pk-title { width: min(92%, 420px); height: auto; filter: drop-shadow(0 4px 0 rgba(46, 43, 51, .5)); }
.pk-lead { margin: 0; max-width: 340px; color: var(--lil-xl); font-weight: 700; text-shadow: 0 1px 2px var(--ch); }
.pk-diffs { display: flex; gap: 6px; }
.pk-diff { min-width: 84px; height: 48px; border-radius: 24px; border: 2px solid var(--ch); background: var(--lil-xl); color: var(--ch); font-weight: 800; }
.pk-diff.on { background: var(--ch); color: var(--lem); }
.pk-big { min-width: 200px; min-height: 56px; padding: 0 22px; border: 3px solid var(--ch); border-radius: 16px; background: var(--lem); color: var(--ch); font-weight: 900; font-size: 20px; box-shadow: 0 4px 0 var(--ch); }
.pk-big:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ch); }
.pk-mid { min-width: 180px; min-height: 48px; padding: 0 16px; border: 2px solid var(--ch); border-radius: 14px; background: var(--lil-xl); color: var(--ch); font-weight: 800; }
.pk-rec { margin: 0; color: var(--lil-xl); font-weight: 700; font-size: 14px; text-shadow: 0 1px 2px var(--ch); }
.pk-cardbox { width: min(100%, 360px); background: var(--lil-xl); border: 3px solid var(--ch); border-radius: 18px; padding: 14px 16px 16px; box-shadow: 0 6px 0 var(--ch); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.pk-cardbox h2 { margin: 0; font-size: 22px; line-height: 1.2; }
.pk-cardbox p { margin: 0; }
.pk-kicker { font-weight: 800; color: var(--lil-d); text-transform: uppercase; letter-spacing: .06em; font-size: 13px; }
.pk-skill { font-weight: 700; }
.pk-skill b { display: inline-block; min-width: 2.4em; padding: 0 6px; border-radius: 8px; background: var(--ch); color: var(--lem); }
.pk-cardrow { display: flex; gap: 10px; text-align: left; width: 100%; font-size: 14px; line-height: 1.35; }
.pk-tag { flex: 0 0 auto; align-self: flex-start; padding: 2px 8px; border-radius: 8px; background: var(--lil); font-weight: 800; font-size: 12px; text-transform: uppercase; }
.pk-controls { flex: 0 0 auto; display: flex; gap: 8px; align-items: stretch; padding: 8px; background: var(--ch); touch-action: none; }
.pk-pads { flex: 1 1 auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px 4px; justify-items: center; align-items: center; }
.pk-pad { width: 54px; height: 54px; min-height: 48px; min-width: 48px; border-radius: 50%; border: 3px solid var(--lil-d); box-shadow: 0 3px 0 rgba(0,0,0,.35); background: var(--lil); color: var(--ch); font-weight: 900; font-size: 18px; touch-action: none; }
.pk-pad.sel { background: var(--lem); border-color: var(--lem-d); }
.pk-pad:disabled { opacity: .45; }
.pk-acts { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 5px; width: 112px; }
.pk-next { width: 100%; min-height: 36px; font-size: 14px !important; border-radius: 20px; border: 2px solid var(--lil-l); background: var(--lil-xl); color: var(--ch); font-weight: 800; font-size: 15px; }
.pk-kick { flex: 0 0 auto; width: 92px; height: 92px; min-height: 64px; border-radius: 50%; border: 4px solid var(--ch); box-shadow: 0 4px 0 var(--lem-d), 0 0 0 3px var(--lem-d); background: var(--lem); color: var(--ch); font-weight: 900; font-size: 22px; touch-action: none; }
.pk-kick.held { background: var(--lem-d); transform: translateY(2px); }
.pk-next:disabled, .pk-kick:disabled { opacity: .4; }
.pk-help { max-width: 760px; margin: 0 auto; padding: 24px 18px 40px; background: var(--lil-xl); }
.pk-help h1 { font-size: 26px; line-height: 1.2; margin: 0 0 12px; }
.pk-help h2 { font-size: 20px; margin: 22px 0 6px; border-bottom: 3px solid var(--lem); display: inline-block; }
.pk-help a { color: var(--lil-d); font-weight: 700; }
.pk-foot { margin-top: 28px; }
@media (min-width: 700px) { body.pk-body { background: var(--lil-d); } #pk-app { box-shadow: 0 0 0 4px var(--ch); } }
@media (max-height: 640px) { .pk-pad { width: 50px; height: 50px; } .pk-kick { width: 80px; height: 80px; } }
@media (max-width: 360px) { .pk-pad { width: 50px; height: 50px; } .pk-acts { width: 100px; } }
@media (prefers-reduced-motion: reduce) { .pk-big:active, .pk-kick.held { transform: none; } }
