:root {
  --bg: #0d0f1a; --bg2: #161a2e; --panel: #1c2140; --edge: #070812; --hi: #3a4378;
  --fg: #f4f2ff; --dim: #8a88b0; --orange: #f07a22; --teal: #18e8c8; --yellow: #ffe066;
  --red: #ff6060; --green: #70e060;
  --px: "Press Start 2P", ui-monospace, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  background-image:
    linear-gradient(45deg, var(--bg2) 25%, transparent 25%, transparent 75%, var(--bg2) 75%),
    linear-gradient(45deg, var(--bg2) 25%, transparent 25%, transparent 75%, var(--bg2) 75%);
  background-size: 32px 32px; background-position: 0 0, 16px 16px;
  color: var(--fg); font-family: var(--px); font-size: 10px; line-height: 1.7;
  min-height: 100vh;
}
a { color: var(--teal); text-decoration: none; }

/* ---- pixel-rand ---- */
.panel {
  background: var(--panel);
  box-shadow: 0 -4px 0 0 var(--edge), 0 4px 0 0 var(--edge), -4px 0 0 0 var(--edge), 4px 0 0 0 var(--edge),
    inset 4px 4px 0 0 var(--hi), inset -4px -4px 0 0 #12152a;
}

/* ---- kop ---- */
.top {
  display: flex; align-items: center; gap: 16px; padding: 12px 20px;
  background: #080a14; border-bottom: 4px solid var(--edge); box-shadow: 0 4px 0 0 #232848;
  position: sticky; top: 0; z-index: 5;
}
.logo { display: flex; gap: 10px; align-items: baseline; font-size: 18px; letter-spacing: 1px; }
.logo .l1 { color: var(--orange); text-shadow: 3px 3px 0 #000; }
.logo .l2 { color: var(--teal); text-shadow: 3px 3px 0 #000; font-size: 22px; }
.nav { margin-left: 16px; }
.nav a { color: var(--dim); }
.nav a:hover { color: var(--yellow); }
.account { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.account .nick { color: var(--yellow); }

.pbtn {
  font-family: var(--px); font-size: 10px; color: #1a0e00; background: var(--yellow); border: 0; cursor: pointer;
  padding: 10px 14px; box-shadow: inset -4px -4px 0 0 #c89a10, inset 4px 4px 0 0 #fff4b0, 0 0 0 4px var(--edge);
  margin: 4px;
}
.pbtn:hover { filter: brightness(1.08); }
.pbtn:active { box-shadow: inset 4px 4px 0 0 #c89a10, 0 0 0 4px var(--edge); }
.pbtn.ghost { background: #3a4060; color: var(--fg); box-shadow: inset -4px -4px 0 0 #262a44, inset 4px 4px 0 0 #565e88, 0 0 0 4px var(--edge); }
.pbtn.small { padding: 7px 10px; font-size: 8px; }
.pbtn:focus-visible, .tab:focus-visible, .lvl:focus-visible { outline: 3px solid var(--teal); outline-offset: 4px; }

/* ---- indeling ---- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 28px; max-width: 1240px; margin: 28px auto; padding: 0 20px; }
.stage { display: flex; flex-direction: column; align-items: center; gap: 12px; min-width: 0; }
.frame { width: 100%; max-width: 768px; padding: 8px; background: #000; box-shadow: 0 0 0 4px var(--edge), 0 0 0 8px #2a2f58, 0 12px 40px #0009; }
#screen { display: block; width: 100% !important; height: auto !important; image-rendering: pixelated; image-rendering: crisp-edges; background: #000; }
.runbar { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px 14px; width: 100%; max-width: 768px; padding: 10px 14px; background: #080a14; box-shadow: 0 0 0 4px var(--edge); }
.runbar .lbl { color: var(--dim); }
.runbar .val { color: var(--fg); min-width: 3ch; }
.runbar .big { color: var(--yellow); font-size: 14px; font-variant-numeric: tabular-nums; }
.runbar .note { margin-left: auto; color: var(--red); font-size: 8px; }
.help { max-width: 768px; text-align: center; color: var(--fg); font-size: 8px; margin: 0; }
.help b { color: var(--teal); font-weight: normal; }
.help.dim { color: var(--dim); }

/* ---- ranglijst ---- */
.board { padding: 18px 16px 16px; align-self: start; position: sticky; top: 84px; }
.board h2 { margin: 0 0 14px; font-size: 14px; color: var(--orange); text-shadow: 2px 2px 0 #000; text-align: center; }
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.lvl {
  font-family: var(--px); font-size: 8px; color: var(--fg); background: #2a3060; border: 0; cursor: pointer;
  padding: 6px 2px 5px; box-shadow: inset -3px -3px 0 0 #1a1e40, inset 3px 3px 0 0 #4a5290; line-height: 1.6;
}
.lvl small { display: block; color: var(--dim); font-size: 7px; }
.lvl.castle { background: #4a2a40; box-shadow: inset -3px -3px 0 0 #2a1424, inset 3px 3px 0 0 #6e4062; }
.lvl.active { background: var(--teal); color: #032; box-shadow: inset -3px -3px 0 0 #0c9a84, inset 3px 3px 0 0 #a8fff0; }
.lvl.active small { color: #064; }
.boardhead { margin: 18px 0 8px; text-align: center; }
.boardhead h3 { margin: 0; font-size: 12px; color: var(--yellow); }
.boardhead .sub { color: var(--dim); font-size: 8px; margin-top: 4px; }
.list { list-style: none; margin: 0; padding: 0; min-height: 120px; }
.list li { display: grid; grid-template-columns: 34px 1fr auto; gap: 8px; padding: 7px 8px; font-size: 9px; align-items: baseline; }
.list li:nth-child(odd) { background: #171b36; }
.list li .r { color: var(--dim); }
.list li.p1 .r { color: #ffd040; } .list li.p2 .r { color: #d0d0e0; } .list li.p3 .r { color: #e09050; }
.list li .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list li .t { color: var(--teal); font-variant-numeric: tabular-nums; }
.list li.me { background: #3a3060; box-shadow: inset 3px 0 0 var(--yellow); }
.list .empty { display: block; text-align: center; color: var(--dim); padding: 28px 8px; line-height: 2; }
.mybest { margin-top: 12px; text-align: center; color: var(--dim); font-size: 8px; }
.mybest b { color: var(--yellow); font-weight: normal; }

/* ---- inlogvenster ---- */
.dlg { border: 0; padding: 22px; width: min(92vw, 380px); color: var(--fg); }
.dlg::backdrop { background: rgba(4, 5, 12, 0.75); }
.tabs { display: flex; gap: 6px; margin-bottom: 18px; }
.tab { flex: 1; font-family: var(--px); font-size: 8px; padding: 10px 4px; border: 0; cursor: pointer; color: var(--dim); background: #12152a; }
.tab.active { color: #1a0e00; background: var(--orange); }
.dlg label { display: block; margin-bottom: 14px; color: var(--yellow); font-size: 8px; }
.dlg input {
  display: block; width: 100%; margin-top: 8px; padding: 10px; font-family: var(--px); font-size: 11px;
  color: var(--fg); background: #080a14; border: 0; box-shadow: 0 0 0 3px var(--edge), inset 3px 3px 0 #000;
}
.dlg input:focus { outline: 3px solid var(--teal); }
.hint { color: var(--dim); font-size: 8px; margin: 4px 0; }
.err { color: var(--red); font-size: 8px; min-height: 14px; margin: 6px 0; }
.row { display: flex; justify-content: space-between; margin-top: 8px; }

/* ---- melding ---- */
.toast {
  position: fixed; left: 50%; top: 86px; transform: translate(-50%, -20px); opacity: 0; pointer-events: none;
  background: #080a14; color: var(--yellow); padding: 12px 18px; font-size: 10px; text-align: center; max-width: 92vw;
  box-shadow: 0 0 0 4px var(--edge), 0 0 0 8px var(--orange); transition: opacity .2s, transform .2s; z-index: 20;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.foot { text-align: center; color: var(--dim); font-size: 8px; padding: 24px 0 40px; }

/* ---- aanraakbediening (zelfde knoppen als het spel) ---- */
#touch { display: none; position: fixed; inset: auto 0 0 0; height: 150px; pointer-events: none; z-index: 10; }
#touch .pad { position: absolute; bottom: 18px; display: flex; gap: 10px; pointer-events: auto; }
#touch .left { left: 16px; } #touch .right { right: 16px; }
#touch button { width: 64px; height: 64px; border-radius: 50%; border: 2px solid #fff6; background: #ffffff22;
  color: #fff; font-size: 20px; font-weight: 700; touch-action: none; user-select: none; -webkit-user-select: none; pointer-events: auto; }
#touch button.small { width: 52px; height: 36px; border-radius: 10px; font-size: 10px; position: fixed; top: auto; bottom: 170px; }
body.touch #touch { display: block; }
body.touch .help { display: none; }
body.touch .foot { padding-bottom: 200px; }

@media (max-width: 980px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .board { position: static; }
}
@media (max-width: 560px) {
  .top { padding: 10px 16px; gap: 10px; }
  .logo { font-size: 13px; } .logo .l2 { font-size: 16px; }
  .nav { display: none; }
  .layout { padding: 0 16px; margin-top: 18px; }
}

/* ---- spelersnamen klikbaar ---- */
.plink { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: left;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.plink:hover, .plink:focus-visible { color: var(--yellow); text-decoration: underline; text-underline-offset: 3px; outline: none; }
.account .plink { color: var(--yellow); }

/* ---- spelerskaart ---- */
.dlg.wide { width: min(94vw, 620px); max-height: 90vh; overflow-y: auto; }
.pc-head { display: flex; gap: 16px; align-items: center; margin-bottom: 18px; }
.pc-head canvas { width: 64px; height: 64px; image-rendering: pixelated; background: #080a14; box-shadow: 0 0 0 4px var(--edge); }
.pc-head h3 { margin: 0; font-size: 16px; color: var(--yellow); text-shadow: 2px 2px 0 #000; word-break: break-all; }
.pc-head .since { color: var(--dim); font-size: 8px; margin-top: 8px; }
.pc-head .crowns { color: #ffd040; font-size: 9px; margin-top: 6px; }
.pc-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 18px; }
.pc-tile { background: #12152a; padding: 12px 10px; box-shadow: 0 0 0 3px var(--edge); }
.pc-tile .n { font-size: 13px; color: var(--teal); }
.pc-tile .l { font-size: 7px; color: var(--dim); margin-top: 6px; }
.pc-sec { margin: 16px 0 8px; font-size: 10px; color: var(--orange); }
.pc-king li { display: flex; justify-content: space-between; padding: 7px 8px; font-size: 9px; }
.pc-king li:nth-child(odd) { background: #171b36; }
.pc-king { list-style: none; margin: 0; padding: 0; }
.pc-king .now { color: #ffd040; }
.pc-bests { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; }
.pc-bests div { background: #12152a; padding: 5px 2px; text-align: center; font-size: 7px; line-height: 1.7; color: var(--dim); }
.pc-bests div b { display: block; color: var(--fg); font-weight: normal; }
.pc-bests div.has b { color: var(--teal); }
.pc-bests div.gold { background: #4a3a08; box-shadow: inset 0 0 0 2px #ffd040; }
.pc-bests div.gold b { color: #ffd040; }
.pc-empty { color: var(--dim); font-size: 8px; padding: 8px; }
@media (max-width: 560px) { .pc-tiles { grid-template-columns: repeat(2, 1fr); } .pc-bests { grid-template-columns: repeat(4, 1fr); } }

/* ---- wereldrecord-feest ---- */
.party { position: fixed; inset: 0; z-index: 50; background: radial-gradient(ellipse at center, #2a1a5aee, #070812f5 70%);
  display: grid; place-items: center; cursor: pointer; animation: partyIn .35s steps(6) both; }
.party[hidden] { display: none; }
.party canvas { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; }
.party-text { position: relative; text-align: center; padding: 0 16px; pointer-events: none; }
.p-crown { font-size: 54px; color: #ffd040; text-shadow: 4px 4px 0 #a06010, 0 0 30px #ffd04088; animation: bob 0.6s steps(2) infinite; }
.p-title { font-size: clamp(22px, 6vw, 56px); line-height: 1.25; color: var(--yellow);
  text-shadow: 4px 4px 0 var(--orange), 8px 8px 0 #000; animation: rainbow 0.9s steps(6) infinite, zoom .7s steps(7) both; }
.p-level { margin-top: 22px; font-size: clamp(11px, 2vw, 16px); color: var(--teal); }
.p-time { margin-top: 14px; font-size: clamp(26px, 6vw, 52px); color: #fff; text-shadow: 4px 4px 0 #000; animation: pulse 0.5s steps(2) infinite; }
.p-prev { margin-top: 14px; font-size: clamp(8px, 1.4vw, 11px); color: var(--dim); }
.p-hint { margin-top: 30px; font-size: 8px; color: var(--dim); animation: blink 1s steps(2) infinite; }
@keyframes partyIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes bob { 50% { transform: translateY(-8px); } }
@keyframes rainbow { 0% { color: #ffe066; } 33% { color: #ff70e0; } 66% { color: #40e8ff; } }
@keyframes zoom { from { transform: scale(0.2); } to { transform: scale(1); } }
@keyframes pulse { 50% { transform: scale(1.08); } }
@keyframes blink { 50% { opacity: 0; } }
/* het spel zelf doet mee */
.frame.partying { animation: frameParty 0.25s steps(2) infinite; }
@keyframes frameParty { 0% { box-shadow: 0 0 0 4px var(--edge), 0 0 0 10px #ffd040, 0 0 60px #ffd040; transform: rotate(-0.6deg); }
  100% { box-shadow: 0 0 0 4px var(--edge), 0 0 0 10px #ff70e0, 0 0 60px #40e8ff; transform: rotate(0.6deg) scale(1.01); } }
@media (prefers-reduced-motion: reduce) { .party, .p-title, .p-time, .p-crown, .frame.partying { animation: none; } }

[hidden] { display: none !important; }

/* ---- bladeren in de ranglijst ---- */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; }
.pager .pginfo { font-size: 8px; color: var(--dim); text-align: center; }
.pbtn:disabled { opacity: 0.35; cursor: default; filter: none; }
.pgme { display: block; width: calc(100% - 8px); margin-top: 12px; }

/* ---- je eigen naam valt op ---- */
.list li.me { background: linear-gradient(90deg, #5a4a10, #3a3060); box-shadow: inset 4px 0 0 var(--yellow), 0 0 0 2px var(--yellow);
  animation: meGlow 1.2s steps(2) infinite; position: relative; z-index: 1; }
.list li.me .n .plink, .list li.me .r { color: var(--yellow); }
.list li.me .t { color: #fff; }
.list li .you { margin-left: 6px; font-size: 7px; color: #1a0e00; background: var(--yellow); padding: 2px 4px; vertical-align: 1px; }
.list li .n { display: flex; align-items: baseline; min-width: 0; }
@keyframes meGlow { 50% { box-shadow: inset 4px 0 0 var(--yellow), 0 0 0 2px var(--orange); } }
@media (prefers-reduced-motion: reduce) { .list li.me { animation: none; } }

.list li.filler { background: none !important; }
.board { overflow-anchor: none; }
.list li .you { line-height: 1; padding: 2px 4px 1px; }

/* ---- spelerskaart: foto ---- */
.pc-ava { flex: none; width: 64px; height: 64px; }
.pc-ava canvas, .pc-ava img { display: block; width: 64px; height: 64px; background: #080a14; box-shadow: 0 0 0 4px var(--edge); object-fit: cover; }
.pc-ava canvas { image-rendering: pixelated; }

/* ---- kaart-editor ---- */
.pc-edit { margin-top: 18px; }
.pbtn.wide2 { width: calc(100% - 8px); }
.pc-opts { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.pc-sw, .pc-bd { font-family: var(--px); font-size: 7px; color: #fff; border: 0; cursor: pointer; padding: 8px 2px; min-height: 44px;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; box-shadow: 0 0 0 3px var(--edge); }
.pc-sw span { text-shadow: 1px 1px 0 #000; }
.pc-bd { background: #12152a; }
.pc-sw.on, .pc-bd.on { outline: 3px solid var(--yellow); outline-offset: 3px; }
.pc-demo { display: block; width: 22px; height: 14px; background: #1c2140; box-shadow: 0 0 0 2px var(--edge); }
.pc-demo.pc-bd-0 { box-shadow: 0 0 0 2px var(--edge), 0 0 0 4px #3a4378; }
.pc-photo { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pc-photo label.pbtn { margin: 4px; }
@media (max-width: 560px) { .pc-opts { grid-template-columns: repeat(3, 1fr); } }
#touch button.tstart { left: calc(50% - 60px); }
#touch button.tmute { left: calc(50% + 8px); }
.dlg .pc-photo label.pbtn { display: inline-block; color: #1a0e00; font-size: 8px; margin: 4px; }

/* ===== spelerskaart: 20 achtergronden (0-4 gratis, 5-19 via achievements). Allemaal donker genoeg voor lichte tekst. ===== */
.dlg.pc-bg-0, .pc-sw.sw-0 { background: #1c2140; }
.dlg.pc-bg-1, .pc-sw.sw-1 { background: #1e5a2e; }
.dlg.pc-bg-2, .pc-sw.sw-2 { background: #7a1e34; }
.dlg.pc-bg-3, .pc-sw.sw-3 { background: #14507a; }
.dlg.pc-bg-4, .pc-sw.sw-4 { background: #3e1e6a; }
/* polderblokjes */
.dlg.pc-bg-5, .pc-sw.sw-5 { background: repeating-conic-gradient(#1e4a2a 0 25%, #275c36 0 50%) 0 0 / 32px 32px; }
/* tulpenveld: rijen rood, geel en groen */
.dlg.pc-bg-6, .pc-sw.sw-6 { background: repeating-linear-gradient(90deg, #5a1424 0 14px, #4a3a0a 14px 28px, #1a4220 28px 42px); }
/* kanaalwater */
.dlg.pc-bg-7, .pc-sw.sw-7 { background: #0e4a4a; }
/* zeegroen */
.dlg.pc-bg-8, .pc-sw.sw-8 { background: linear-gradient(160deg, #0a2a5a, #134a40); }
/* avondrood */
.dlg.pc-bg-9, .pc-sw.sw-9 { background: linear-gradient(180deg, #1a1040, #4a1a48 60%, #6a2a28); }
/* kasteelstenen */
.dlg.pc-bg-10, .pc-sw.sw-10 { background: repeating-linear-gradient(0deg, #1e1e26 0 2px, transparent 2px 16px), repeating-linear-gradient(90deg, #1e1e26 0 2px, transparent 2px 32px), #3a3a46; }
/* koningspaars met gouden gloed */
.dlg.pc-bg-11, .pc-sw.sw-11 { background: linear-gradient(135deg, #2a0e4a, #4a1a6a 55%, #5a3a0a); }
/* grafiet */
.dlg.pc-bg-12, .pc-sw.sw-12 { background: #2a2a30; }
/* amber */
.dlg.pc-bg-13, .pc-sw.sw-13 { background: #5a3a0a; }
/* schatkist: gouden muntjes */
.dlg.pc-bg-14, .pc-sw.sw-14 { background: radial-gradient(#ffd04070 2px, transparent 2.6px) 0 0 / 16px 16px, linear-gradient(160deg, #3a2a06, #5a4008); }
/* stroopwafel */
.dlg.pc-bg-15, .pc-sw.sw-15 { background: repeating-linear-gradient(45deg, #3a200a 0 3px, transparent 3px 14px), repeating-linear-gradient(-45deg, #3a200a 0 3px, transparent 3px 14px), #6a3e16; }
/* lava */
.dlg.pc-bg-16, .pc-sw.sw-16 { background: linear-gradient(160deg, #4a0a0a, #8a3a0a); }
/* magenta */
.dlg.pc-bg-17, .pc-sw.sw-17 { background: #5a1650; }
/* sterrenhemel */
.dlg.pc-bg-18, .pc-sw.sw-18 { background: radial-gradient(#ffffff40 1px, transparent 1.6px) 0 0 / 18px 18px, #0a0a28; }
/* dageraad */
.dlg.pc-bg-19, .pc-sw.sw-19 { background: linear-gradient(135deg, #4a2a78, #7a3820); }
/* leesbaarheid op gekleurde achtergronden: donkere vakjes en lichtere bijtekst */
.dlg[class*="pc-bg-"]:not(.pc-bg-0) .pc-tile,
.dlg[class*="pc-bg-"]:not(.pc-bg-0) .pc-bests div:not(.gold),
.dlg[class*="pc-bg-"]:not(.pc-bg-0) .pc-edit .pc-bd { background: #000a; }
.dlg[class*="pc-bg-"]:not(.pc-bg-0) .pc-king li:nth-child(odd) { background: #0006; }
.dlg[class*="pc-bg-"]:not(.pc-bg-0) .since,
.dlg[class*="pc-bg-"]:not(.pc-bg-0) .hint,
.dlg[class*="pc-bg-"]:not(.pc-bg-0) .pc-tile .l,
.dlg[class*="pc-bg-"]:not(.pc-bg-0) .pc-empty { color: #d8d4f0; }
.dlg[class*="pc-bg-"]:not(.pc-bg-0) .pc-sec { color: var(--yellow); text-shadow: 2px 2px 0 #000; }

/* ===== spelerskaart: 17 randen (0-1 gratis, 2-16 via achievements) ===== */
.pc-bd-0 { }
.pc-bd-1 { box-shadow: 0 0 0 4px var(--edge), 0 0 0 7px #b8f0ff, 0 0 18px 6px #80d8ff88 !important; }                 /* ijs */
.pc-bd-2 { animation: bdRainbow 1.2s steps(6) infinite; }                                                             /* regenboog */
.pc-bd-3 { animation: bdFire 0.3s steps(2) infinite; }                                                                /* vuur */
.pc-bd-4 { animation: bdRoyal 1s steps(2) infinite; }                                                                 /* koninklijk */
.pc-bd-5 { box-shadow: 0 0 0 4px var(--edge), 0 0 0 8px #ffd040, 0 0 0 10px #a06010 !important; }                   /* goud */
.pc-bd-6 { animation: bdStar 0.8s steps(3) infinite; }                                                                /* sterrenglans */
.pc-bd-7 { animation: bdJewels 1.6s steps(4) infinite; }                                                              /* kroonjuwelen */
.pc-bd-8 { box-shadow: 0 0 0 4px var(--edge), 0 0 0 7px #e8e8f8, 0 0 0 9px #707088, 0 0 0 11px #c0c0d8 !important; } /* zilver */
.pc-bd-9 { animation: bdBolt 1.4s steps(1) infinite; }                                                                /* bliksem */
.pc-bd-10 { animation: bdGoldRush 1.2s ease-in-out infinite; }                                                        /* goudkoorts */
.pc-bd-11 { animation: bdSlime 1.6s ease-in-out infinite; }                                                           /* slijm */
.pc-bd-12 { animation: bdGhost 2.4s ease-in-out infinite; }                                                           /* geest */
.pc-bd-13 { box-shadow: 0 0 0 3px #ffe066, 0 0 0 6px var(--edge), 0 0 0 9px #ff6060, 0 0 0 12px var(--edge) !important; } /* retro */
.pc-bd-14 { animation: bdPink 1.1s ease-in-out infinite; }                                                            /* roze neon */
.pc-bd-15 { animation: bdNeon 1.4s ease-in-out infinite; }                                                            /* neon */
.pc-bd-16 { animation: bdArcade 0.5s steps(2) infinite; }                                                             /* arcade */
@keyframes bdRainbow {
  0%   { box-shadow: 0 0 0 4px var(--edge), 0 0 0 9px #ff6060; }
  17%  { box-shadow: 0 0 0 4px var(--edge), 0 0 0 9px #ffa040; }
  33%  { box-shadow: 0 0 0 4px var(--edge), 0 0 0 9px #ffe066; }
  50%  { box-shadow: 0 0 0 4px var(--edge), 0 0 0 9px #70e060; }
  67%  { box-shadow: 0 0 0 4px var(--edge), 0 0 0 9px #40c8ff; }
  83%  { box-shadow: 0 0 0 4px var(--edge), 0 0 0 9px #c070ff; }
  100% { box-shadow: 0 0 0 4px var(--edge), 0 0 0 9px #ff6060; }
}
@keyframes bdFire {
  0%   { box-shadow: 0 0 0 4px var(--edge), 0 0 0 7px #f07a22, 0 -6px 0 7px #ff3020, 0 0 24px 8px #ff602088; }
  100% { box-shadow: 0 0 0 4px var(--edge), 0 0 0 7px #ffb020, 0 -9px 0 7px #f05010, 0 0 30px 10px #ffa02088; }
}
@keyframes bdRoyal {
  0%   { box-shadow: 0 0 0 4px var(--edge), 0 0 0 7px #9a50e0, 0 0 0 10px #ffd040, 0 0 24px 8px #9a50e066; }
  100% { box-shadow: 0 0 0 4px var(--edge), 0 0 0 7px #ffd040, 0 0 0 10px #9a50e0, 0 0 30px 10px #ffd04066; }
}
@keyframes bdStar {
  0%   { box-shadow: 0 0 0 4px var(--edge), 0 0 0 7px #ffd040, 0 0 0 9px #fff4b0, 0 0 20px 6px #ffd04066; }
  50%  { box-shadow: 0 0 0 4px var(--edge), 0 0 0 7px #fff4b0, 0 0 0 9px #ffd040, 0 0 26px 10px #ffffff66; }
  100% { box-shadow: 0 0 0 4px var(--edge), 0 0 0 7px #ffd040, 0 0 0 9px #c08010, 0 0 20px 6px #ffd04066; }
}
@keyframes bdJewels {
  0%   { box-shadow: 0 0 0 4px var(--edge), 0 0 0 8px #ffd040, 0 0 0 10px #a06010, 0 0 22px 8px #ff304088; }
  25%  { box-shadow: 0 0 0 4px var(--edge), 0 0 0 8px #ffd040, 0 0 0 10px #a06010, 0 0 22px 8px #3080ff88; }
  50%  { box-shadow: 0 0 0 4px var(--edge), 0 0 0 8px #ffd040, 0 0 0 10px #a06010, 0 0 22px 8px #30e07088; }
  75%  { box-shadow: 0 0 0 4px var(--edge), 0 0 0 8px #ffd040, 0 0 0 10px #a06010, 0 0 22px 8px #c050ff88; }
  100% { box-shadow: 0 0 0 4px var(--edge), 0 0 0 8px #ffd040, 0 0 0 10px #a06010, 0 0 22px 8px #ff304088; }
}
@keyframes bdBolt {
  0%   { box-shadow: 0 0 0 4px var(--edge), 0 0 0 7px #c8a020; }
  70%  { box-shadow: 0 0 0 4px var(--edge), 0 0 0 7px #ffffff, 0 0 40px 14px #fff4b0cc; }
  74%  { box-shadow: 0 0 0 4px var(--edge), 0 0 0 7px #c8a020; }
  80%  { box-shadow: 0 0 0 4px var(--edge), 0 0 0 7px #ffffff, 0 0 40px 14px #fff4b0cc; }
  84%  { box-shadow: 0 0 0 4px var(--edge), 0 0 0 7px #c8a020; }
}
@keyframes bdGoldRush {
  0%, 100% { box-shadow: 0 0 0 4px var(--edge), 0 0 0 9px #c08010, 0 0 10px 4px #ffd04044; }
  50%      { box-shadow: 0 0 0 4px var(--edge), 0 0 0 9px #fff0a0, 0 0 36px 14px #ffd040aa; }
}
@keyframes bdSlime {
  0%, 100% { box-shadow: 0 0 0 4px var(--edge), 0 0 0 7px #70e060, 0 5px 0 7px #3a9a30; }
  50%      { box-shadow: 0 0 0 4px var(--edge), 0 0 0 8px #a0ff80, 0 10px 0 8px #3a9a30; }
}
@keyframes bdGhost {
  0%, 100% { box-shadow: 0 0 0 4px var(--edge), 0 0 0 7px #ffffff22, 0 0 8px 4px #ffffff11; }
  50%      { box-shadow: 0 0 0 4px var(--edge), 0 0 0 7px #e8e8ffcc, 0 0 34px 12px #d0d0ff55; }
}
@keyframes bdPink {
  0%, 100% { box-shadow: 0 0 0 4px var(--edge), 0 0 0 7px #ff70e0, 0 0 12px 4px #ff70e055; }
  50%      { box-shadow: 0 0 0 4px var(--edge), 0 0 0 7px #ffc0f4, 0 0 28px 10px #ff70e099; }
}
@keyframes bdNeon {
  0%, 100% { box-shadow: 0 0 0 4px var(--edge), 0 0 0 7px #18e8c8, 0 0 14px 6px #18e8c855; }
  50%      { box-shadow: 0 0 0 4px var(--edge), 0 0 0 7px #a8fff0, 0 0 30px 12px #18e8c899; }
}
@keyframes bdArcade {
  0%   { box-shadow: 0 0 0 4px var(--edge), 0 0 0 7px #ffe066, 0 0 0 10px #101018, 0 0 0 13px #ffe066; }
  100% { box-shadow: 0 0 0 4px var(--edge), 0 0 0 7px #101018, 0 0 0 10px #ffe066, 0 0 0 13px #101018; }
}
@media (prefers-reduced-motion: reduce) { [class*="pc-bd-"] { animation: none !important; } }

/* slotjes op nog niet vrijgespeelde looks */
.pc-sw, .pc-bd { position: relative; }
.pc-sw.locked, .pc-bd.locked { cursor: help; filter: grayscale(0.85) brightness(0.55); }
.pc-sw.locked::after, .pc-bd.locked::after { content: "🔒︎"; position: absolute; inset: 0; display: grid; place-items: center;
  font-family: system-ui, sans-serif; font-size: 12px; color: #fff; text-shadow: 0 0 3px #000; filter: none; }
.pc-lockinfo { min-height: 28px; margin: 10px 0 0; line-height: 1.8; }
.pc-lockinfo b { color: var(--yellow); font-weight: normal; }
.ach-info .rw { color: var(--teal); }

/* keuzerasters in de editor (zonder namen) */
.pc-opts { grid-template-columns: repeat(8, 1fr); gap: 10px; }
.pc-sw, .pc-bd { min-height: 34px; padding: 0; }
.pc-demo { width: 24px; height: 16px; margin: auto; transform: scale(0.6); }
@media (max-width: 560px) { .pc-opts { grid-template-columns: repeat(4, 1fr); } }

/* ===== achievements op de kaart ===== */
.pc-ach { display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px; }
.ach { font-family: system-ui, sans-serif; font-size: 16px; line-height: 1; aspect-ratio: 1; border: 0; cursor: pointer; padding: 0;
  color: #5a5a78; background: #0d0f1e; box-shadow: inset 0 0 0 2px #2a2f50; font-variant-emoji: text; }
.ach.on.t1 { color: #ffd8b0; background: #7a4520; box-shadow: inset 0 0 0 2px #c07a40, inset -3px -3px 0 #4a2a10; }
.ach.on.t2 { color: #ffffff; background: #5a6078; box-shadow: inset 0 0 0 2px #c8d0e8, inset -3px -3px 0 #3a4058; }
.ach.on.t3 { color: #fff4b0; background: #8a6a10; box-shadow: inset 0 0 0 2px #ffd040, inset -3px -3px 0 #5a4008; }
.ach.sel { outline: 3px solid var(--teal); outline-offset: 2px; }
.ach-info { min-height: 32px; margin-top: 10px; line-height: 1.8; }
.ach-info b { color: var(--yellow); font-weight: normal; }
.ach-info .got { color: var(--green); }
.ach-info .lock { color: var(--dim); }
@media (max-width: 560px) { .pc-ach { grid-template-columns: repeat(6, 1fr); } }

/* ===== achievement-melding ===== */
.achpop { position: fixed; right: 20px; bottom: 24px; z-index: 40; display: flex; gap: 14px; align-items: center; max-width: min(92vw, 380px);
  padding: 14px 16px; background: #080a14; box-shadow: 0 0 0 4px var(--edge), 0 0 0 8px #c07a40, 0 10px 30px #000a;
  transform: translateY(140%); transition: transform .3s steps(5); }
.achpop.t2 { box-shadow: 0 0 0 4px var(--edge), 0 0 0 8px #c8d0e8, 0 10px 30px #000a; }
.achpop.t3 { box-shadow: 0 0 0 4px var(--edge), 0 0 0 8px #ffd040, 0 0 30px #ffd04066; }
.achpop.show { transform: translateY(0); }
.achpop .ach { width: 44px; height: 44px; font-size: 24px; flex: none; cursor: default; }
.achpop small { display: block; font-size: 7px; color: var(--teal); margin-bottom: 6px; }
.achpop b { display: block; font-size: 10px; color: var(--yellow); font-weight: normal; margin-bottom: 6px; }
.achpop i { display: block; font-size: 7px; color: var(--fg); font-style: normal; line-height: 1.6; }

/* ===== mededeling van de beheerder ===== */
.announce { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 10px 16px; text-align: center;
  background: var(--orange); color: #1a0e00; font-size: 9px; line-height: 1.7; box-shadow: 0 4px 0 #a04a10; }
.announce .megafoon { background: #1a0e00; color: var(--yellow); padding: 2px 7px; }
.achpop i.rw { color: var(--teal); margin-top: 6px; }

/* ===== feestdagenthema's (website, niet de game) ===== */
.holifx { position: fixed; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; pointer-events: none; z-index: 0; }
.top, .layout, .foot, .announce { position: relative; z-index: 1; }
.top { z-index: 5; }
.holi { font-size: 9px; color: #1a0e00; background: var(--yellow); padding: 6px 9px; box-shadow: 0 0 0 3px var(--edge); white-space: nowrap;
  animation: holiBob 1.6s steps(2) infinite; }
@keyframes holiBob { 50% { transform: translateY(-2px); } }
@media (max-width: 760px) { .holi { display: none; } }

body.theme-halloween   { --bg: #120a1a; --bg2: #1c0f26; --orange: #ff7a1a; --teal: #b070ff; --yellow: #ffb030; --hi: #4a2a68; --panel: #221535; }
body.theme-kerst       { --bg: #0a1a12; --bg2: #102418; --orange: #e83038; --teal: #6ad07a; --yellow: #ffe066; --hi: #2a5a3a; --panel: #142a1e; }
body.theme-sinterklaas { --bg: #1a0a0e; --bg2: #260f14; --orange: #d8283c; --teal: #ffd040; --yellow: #ffe7a0; --hi: #5a2a30; --panel: #2a1218; }
body.theme-oudnieuw    { --bg: #0a0a18; --bg2: #14142a; --orange: #ffd040; --teal: #c0a0ff; --yellow: #fff0b0; --hi: #3a3a68; }
body.theme-valentijn   { --bg: #1a0a16; --bg2: #260f20; --orange: #ff5a9a; --teal: #ff9ad0; --yellow: #ffd0e8; --hi: #5a2a4a; --panel: #2a1424; }
body.theme-carnaval    { --bg: #120e0a; --bg2: #1c160f; --orange: #e83030; --teal: #40c860; --yellow: #ffd820; --hi: #4a3a20; }
body.theme-pasen       { --bg: #10161a; --bg2: #182228; --orange: #ffb0d0; --teal: #a0e0b0; --yellow: #fff0a0; --hi: #3a4a58; --panel: #1c2a34; }
body.theme-koningsdag  { --bg: #1a0e04; --bg2: #26160a; --orange: #ff7a00; --teal: #ffa040; --yellow: #ffd090; --hi: #5a3a1a; --panel: #2a1a0c; }
body.theme-bevrijding  { --bg: #0a0e1a; --bg2: #121a2a; --orange: #e0303e; --teal: #7aa8f0; --yellow: #f4f2ff; --hi: #2a3a68; }
/* donkerrode accenten: witte tekst erop voor genoeg contrast */
body.theme-kerst .announce, body.theme-sinterklaas .announce, body.theme-bevrijding .announce,
body.theme-kerst .tab.active, body.theme-sinterklaas .tab.active, body.theme-bevrijding .tab.active,
body.theme-carnaval .announce, body.theme-carnaval .tab.active { color: #fff; }
body.theme-halloween .logo .l2 { text-shadow: 3px 3px 0 #000, 0 0 14px #b070ff88; }
body.theme-kerst .logo .l1 { text-shadow: 3px 3px 0 #000, 0 -3px 0 #ffffff; }

/* ===== uitgebreide feestdagen: decor, versieringen en verzameljacht ===== */
.frame { position: relative; }

/* kerstlampjes boven het spelscherm (kleuren wisselen via hue-rotate) */
body.theme-kerst.festive .frame::before {
  content: ""; position: absolute; left: -8px; right: -8px; top: -14px; height: 18px; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='18' shape-rendering='crispEdges'%3E%3Cpath d='M0 3 Q16 11 32 3' stroke='%23203a20' stroke-width='2' fill='none'/%3E%3Crect x='7' y='7' width='4' height='6' fill='%23ff3a3a'/%3E%3Crect x='8' y='5' width='2' height='2' fill='%23404040'/%3E%3Crect x='21' y='7' width='4' height='6' fill='%23ffd040'/%3E%3Crect x='22' y='5' width='2' height='2' fill='%23404040'/%3E%3C/svg%3E") repeat-x;
  animation: lights 1.2s steps(3) infinite; }
@keyframes lights { 0% { filter: hue-rotate(0deg) drop-shadow(0 0 4px #ffd04088); } 100% { filter: hue-rotate(360deg) drop-shadow(0 0 4px #ffd04088); } }

/* halloween: spinnenweb in de hoek en een bungelende spin */
body.theme-halloween.festive .frame::before {
  content: ""; position: absolute; left: 8px; top: 8px; width: 64px; height: 64px; pointer-events: none; z-index: 2;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' stroke='%23e8e0f0' stroke-width='1' fill='none' opacity='.7'%3E%3Cpath d='M0 0L64 8M0 0L56 40M0 0L32 60M0 0L8 64'/%3E%3Cpath d='M14 2Q12 10 10 14Q6 14 2 14M28 4Q24 20 20 28Q10 28 4 28M44 6Q38 30 30 44Q16 44 6 44'/%3E%3C/svg%3E"); }
body.theme-halloween.festive .frame::after {
  content: ""; position: absolute; right: 40px; top: -40px; width: 16px; height: 74px; pointer-events: none; z-index: 2;
  background: linear-gradient(#e8e0f0, #e8e0f0) 7px 0 / 1px 60px no-repeat,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='14' shape-rendering='crispEdges'%3E%3Cg fill='%23101018'%3E%3Crect x='6' y='4' width='4' height='6'/%3E%3Crect x='5' y='3' width='6' height='3'/%3E%3Crect x='1' y='4' width='4' height='1'/%3E%3Crect x='11' y='4' width='4' height='1'/%3E%3Crect x='0' y='7' width='5' height='1'/%3E%3Crect x='11' y='7' width='5' height='1'/%3E%3Crect x='1' y='10' width='4' height='1'/%3E%3Crect x='11' y='10' width='4' height='1'/%3E%3C/g%3E%3Crect x='6' y='5' width='1' height='1' fill='%23ff3030'/%3E%3Crect x='9' y='5' width='1' height='1' fill='%23ff3030'/%3E%3C/svg%3E") 0 60px / 16px 14px no-repeat;
  animation: spider 3s ease-in-out infinite; }
@keyframes spider { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(26px); } }
body.theme-halloween.festive .frame { box-shadow: 0 0 0 4px var(--edge), 0 0 0 8px #3a1a4a, 0 0 40px #ff7a1a55; }

/* sinterklaas: pakjes onder het spelscherm */
body.theme-sinterklaas.festive .frame::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -22px; height: 18px; pointer-events: none; z-index: 2;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='18' shape-rendering='crispEdges'%3E%3Crect x='2' y='4' width='18' height='14' fill='%23c02030'/%3E%3Crect x='10' y='4' width='2' height='14' fill='%23ffd040'/%3E%3Crect x='2' y='9' width='18' height='2' fill='%23ffd040'/%3E%3Crect x='26' y='8' width='14' height='10' fill='%232a5ac0'/%3E%3Crect x='32' y='8' width='2' height='10' fill='%23ffffff'/%3E%3Crect x='46' y='2' width='20' height='16' fill='%2330a050'/%3E%3Crect x='55' y='2' width='2' height='16' fill='%23ff4060'/%3E%3Crect x='46' y='8' width='20' height='2' fill='%23ff4060'/%3E%3C/svg%3E") repeat-x left bottom; }

/* pasen: gras met eitjes onder het spelscherm */
body.theme-pasen.festive .frame::after {
  content: ""; position: absolute; left: -8px; right: -8px; bottom: -14px; height: 18px; pointer-events: none; z-index: 2;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='18' shape-rendering='crispEdges'%3E%3Crect y='10' width='48' height='8' fill='%2358b838'/%3E%3Cpath d='M0 10l3-6 3 6 3-8 3 8 3-5 3 5 3-7 3 7 3-6 3 6 3-8 3 8 3-5 3 5 3-6 3 6z' fill='%238ce060'/%3E%3Crect x='8' y='6' width='6' height='9' fill='%23ffb0d0'/%3E%3Crect x='8' y='9' width='6' height='1' fill='%23ffffff'/%3E%3Crect x='30' y='7' width='6' height='8' fill='%23a8d0ff'/%3E%3Crect x='30' y='10' width='6' height='1' fill='%23fff0a0'/%3E%3C/svg%3E") repeat-x; }

/* vlaggetjeslijnen onder de kop */
body.festive.theme-koningsdag .top::after, body.festive.theme-carnaval .top::after, body.festive.theme-bevrijding .top::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -18px; height: 16px; pointer-events: none;
  background-repeat: repeat-x; animation: bunting 2s ease-in-out infinite; transform-origin: top; }
body.festive.theme-koningsdag .top::after { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='16'%3E%3Cpath d='M0 1H48' stroke='%23ffffff' stroke-width='1.5'/%3E%3Cpath d='M2 1h12l-6 12z' fill='%23ff7a00'/%3E%3Cpath d='M18 1h12l-6 12z' fill='%23ffffff'/%3E%3Cpath d='M34 1h12l-6 12z' fill='%23ff7a00'/%3E%3C/svg%3E"); }
body.festive.theme-carnaval .top::after { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='16'%3E%3Cpath d='M0 1H48' stroke='%23ffffff' stroke-width='1.5'/%3E%3Cpath d='M2 1h12l-6 12z' fill='%23e83030'/%3E%3Cpath d='M18 1h12l-6 12z' fill='%23ffd820'/%3E%3Cpath d='M34 1h12l-6 12z' fill='%2330b040'/%3E%3C/svg%3E"); }
body.festive.theme-bevrijding .top::after { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='16'%3E%3Cpath d='M0 1H48' stroke='%23ffffff' stroke-width='1.5'/%3E%3Cpath d='M2 1h12l-6 12z' fill='%23c8102e'/%3E%3Cpath d='M18 1h12l-6 12z' fill='%23ffffff'/%3E%3Cpath d='M34 1h12l-6 12z' fill='%2321468b'/%3E%3C/svg%3E"); }
@keyframes bunting { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(1.15); } }

/* valentijn: kloppend logo; oud & nieuw: gouden gloed om het spel */
body.festive.theme-valentijn .logo { animation: heartbeat 1.1s ease-in-out infinite; }
@keyframes heartbeat { 0%, 40%, 100% { transform: scale(1); } 15% { transform: scale(1.08); } 25% { transform: scale(0.98); } }
body.festive.theme-oudnieuw .frame { animation: goldglow 1.6s ease-in-out infinite; }
@keyframes goldglow { 0%, 100% { box-shadow: 0 0 0 4px var(--edge), 0 0 0 8px #2a2f58, 0 0 20px #ffd04033; } 50% { box-shadow: 0 0 0 4px var(--edge), 0 0 0 8px #ffd040, 0 0 50px #ffd04088; } }
body.festive.theme-oudnieuw .holi { font-variant-numeric: tabular-nums; }

/* ===== verzameljacht: het gouden voorwerp ===== */
.holifind { position: fixed; z-index: 30; width: 56px; height: 56px; padding: 4px; border: 0; cursor: pointer; background: #0d0f1acc;
  box-shadow: 0 0 0 3px var(--edge), 0 0 0 6px #ffd040, 0 0 24px 8px #ffd04099; animation: findbob 0.8s ease-in-out infinite; }
.holifind canvas { width: 100%; height: 100%; image-rendering: pixelated; display: block; }
.holifind.pop { animation: findpop .3s steps(4), findbob 0.8s ease-in-out .3s infinite; }
.holifind:focus-visible { outline: 3px solid var(--teal); outline-offset: 6px; }
@keyframes findbob { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-6px) rotate(4deg); } }
@keyframes findpop { from { transform: scale(0); } to { transform: scale(1); } }
.spark { position: fixed; z-index: 31; width: 5px; height: 5px; background: #ffd040; pointer-events: none; box-shadow: 0 0 6px #ffd040;
  animation: spark .8s ease-out forwards; }
@keyframes spark { to { transform: translate(var(--dx), var(--dy)); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .holifind, .holifind.pop, body.festive .frame, body.festive .logo, body.festive .top::after, body.festive .frame::before, body.festive .frame::after { animation: none !important; }
}

/* ===== 9 seizoensranden (pc-bd-17 t/m 25), alleen te verdienen tijdens het feest ===== */
.pc-bd-17 { animation: bdWeb 1.2s steps(2) infinite; }        /* spinnenweb */
.pc-bd-18 { animation: bdMitre 1.4s steps(2) infinite; }      /* mijtergoud */
.pc-bd-19 { animation: bdXmas 0.9s steps(3) infinite; }       /* kerstlampjes */
.pc-bd-20 { animation: bdFirework 1.2s steps(4) infinite; }   /* vuurwerk */
.pc-bd-21 { animation: bdHeart 1.1s ease-in-out infinite; }   /* hartenklop */
.pc-bd-22 { animation: bdTricolor 0.9s steps(3) infinite; }   /* drieklek carnaval */
.pc-bd-23 { animation: bdPastel 2.4s linear infinite; }       /* pastel */
.pc-bd-24 { animation: bdOranje 0.8s ease-in-out infinite; }  /* oranjekoorts */
.pc-bd-25 { box-shadow: 0 0 0 4px var(--edge), 0 0 0 7px #c8102e, 0 0 0 10px #ffffff, 0 0 0 13px #21468b, 0 0 20px 6px #ffffff44 !important; } /* vrijheid */
@keyframes bdWeb {
  0%   { box-shadow: 0 0 0 4px var(--edge), 0 0 0 7px #ff7a1a, 0 0 0 9px #2a0a3a, 0 0 26px 8px #ff7a1a66; }
  100% { box-shadow: 0 0 0 4px var(--edge), 0 0 0 7px #9a50e0, 0 0 0 9px #2a0a3a, 0 0 26px 8px #9a50e066; }
}
@keyframes bdMitre {
  0%   { box-shadow: 0 0 0 4px var(--edge), 0 0 0 7px #d8283c, 0 0 0 10px #ffd040, 0 0 18px 4px #ffd04055; }
  100% { box-shadow: 0 0 0 4px var(--edge), 0 0 0 7px #ffd040, 0 0 0 10px #d8283c, 0 0 26px 8px #ffd04088; }
}
@keyframes bdXmas {
  0%   { box-shadow: 0 0 0 4px var(--edge), 0 0 0 8px #e83038, 0 0 20px 6px #e8303866; }
  33%  { box-shadow: 0 0 0 4px var(--edge), 0 0 0 8px #30b040, 0 0 20px 6px #30b04066; }
  66%  { box-shadow: 0 0 0 4px var(--edge), 0 0 0 8px #ffd040, 0 0 20px 6px #ffd04066; }
  100% { box-shadow: 0 0 0 4px var(--edge), 0 0 0 8px #e83038, 0 0 20px 6px #e8303866; }
}
@keyframes bdFirework {
  0%   { box-shadow: 0 0 0 4px var(--edge), 0 0 0 7px #ffd040, 0 0 30px 10px #ffd04066; }
  25%  { box-shadow: 0 0 0 4px var(--edge), 0 0 0 7px #ff70b0, 0 0 40px 14px #ff70b066; }
  50%  { box-shadow: 0 0 0 4px var(--edge), 0 0 0 7px #40e8ff, 0 0 30px 10px #40e8ff66; }
  75%  { box-shadow: 0 0 0 4px var(--edge), 0 0 0 7px #c0a0ff, 0 0 46px 16px #c0a0ff66; }
  100% { box-shadow: 0 0 0 4px var(--edge), 0 0 0 7px #ffd040, 0 0 30px 10px #ffd04066; }
}
@keyframes bdHeart {
  0%, 45%, 100% { box-shadow: 0 0 0 4px var(--edge), 0 0 0 7px #ff4a8a, 0 0 12px 4px #ff4a8a55; }
  15%           { box-shadow: 0 0 0 4px var(--edge), 0 0 0 10px #ff8ab8, 0 0 34px 12px #ff4a8aaa; }
  28%           { box-shadow: 0 0 0 4px var(--edge), 0 0 0 8px #ff4a8a, 0 0 20px 6px #ff4a8a77; }
}
@keyframes bdTricolor {
  0%   { box-shadow: 0 0 0 4px var(--edge), 0 0 0 7px #e83030, 0 0 0 10px #ffd820, 0 0 0 13px #30b040; }
  33%  { box-shadow: 0 0 0 4px var(--edge), 0 0 0 7px #ffd820, 0 0 0 10px #30b040, 0 0 0 13px #e83030; }
  66%  { box-shadow: 0 0 0 4px var(--edge), 0 0 0 7px #30b040, 0 0 0 10px #e83030, 0 0 0 13px #ffd820; }
  100% { box-shadow: 0 0 0 4px var(--edge), 0 0 0 7px #e83030, 0 0 0 10px #ffd820, 0 0 0 13px #30b040; }
}
@keyframes bdPastel {
  0%, 100% { box-shadow: 0 0 0 4px var(--edge), 0 0 0 8px #ffb0d0, 0 0 18px 6px #ffb0d055; }
  25%      { box-shadow: 0 0 0 4px var(--edge), 0 0 0 8px #a0e0b0, 0 0 18px 6px #a0e0b055; }
  50%      { box-shadow: 0 0 0 4px var(--edge), 0 0 0 8px #a8d0ff, 0 0 18px 6px #a8d0ff55; }
  75%      { box-shadow: 0 0 0 4px var(--edge), 0 0 0 8px #fff0a0, 0 0 18px 6px #fff0a055; }
}
@keyframes bdOranje {
  0%, 100% { box-shadow: 0 0 0 4px var(--edge), 0 0 0 9px #ff7a00, 0 0 14px 4px #ff7a0055; }
  50%      { box-shadow: 0 0 0 4px var(--edge), 0 0 0 11px #ffa040, 0 0 36px 14px #ff7a00aa; }
}
.ach.seasonal { position: relative; }
.ach.seasonal::after { content: ""; position: absolute; right: 2px; top: 2px; width: 4px; height: 4px; background: var(--teal); }
body.festive .frame::before, body.festive .frame::after { z-index: 3; }

/* ===== duidelijke profielknop rechtsboven ===== */
.account .nickname { color: var(--dim); font-size: 8px; max-width: 18ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pbtn.profile { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px 5px 5px; position: relative; }
.pf-ava { flex: none; width: 24px; height: 24px; background: #080a14; box-shadow: 0 0 0 2px var(--edge); overflow: hidden; display: block; }
.pf-ava img, .pf-ava canvas { display: block; width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; }
.pf-new { position: absolute; top: -10px; right: -8px; background: var(--red); color: #200; font-size: 6px; padding: 3px 5px; line-height: 1;
  box-shadow: 0 0 0 2px var(--edge); animation: pfBlink 1s steps(2) infinite; }
@keyframes pfBlink { 50% { transform: translateY(-2px); } }
@media (max-width: 760px) { .account .nickname { display: none; } }
@media (max-width: 560px) { .pf-long { display: none; } }
@media (prefers-reduced-motion: reduce) { .pf-new { animation: none; } }

/* ===== eigen kaart: label en aanpas-knop bovenaan ===== */
.pc-you { display: inline-block; font-size: 7px; color: #1a0e00; background: var(--yellow); padding: 3px 6px; margin-bottom: 8px; box-shadow: 0 0 0 2px var(--edge); }
.pc-head + .pc-edit { margin: 0 0 18px; }
#pcEditToggle { font-size: 9px; padding: 12px 10px; }

/* ===== kop van de site: INLOGGEN, PROFIEL en UITLOGGEN zijn precies even groot ===== */
#account { gap: 8px; }
#account .pbtn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; box-sizing: border-box;
  height: 34px; margin: 0 4px; padding: 0 14px; font-size: 9px; line-height: 1; white-space: nowrap; }
#account .pbtn.profile { padding: 0 14px 0 5px; }
