/* Nestduel – het kaartspel van Egghunt. Donkere stijl zoals Egghunt/portaal; speelbord op een volledig speelveld. */
:root {
  --hand-card: clamp(78px, 11vw, 112px); --hand-h: calc(var(--hand-card) * 1.4 + 30px);
  --bg: #140f24; --panel: #1d1733; --panel2: #271f45; --line: #3a2f5e; --text: #f1eefb; --muted: #a7a3c2;
  --accent: #ffb300; --accent2: #ff6f00; --good: #4caf50; --bad: #ef5350; --blue: #42a5f5;
  --common: #9e9e9e; --rare: #42a5f5; --epic: #ab47bc; --mythic: #ffb300;
  --card-w: 112px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); }
body { padding-top: 54px; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px; cursor: pointer; transition: border-color .15s, transform .1s; }
button:hover { border-color: var(--accent); }
button:active { transform: translateY(1px); }
button:disabled { opacity: .45; cursor: not-allowed; transform: none; }
button.primary { background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #1b1430; border-color: transparent; font-weight: 800; }
button.ghost { background: #ffffff14; }
button.danger { border-color: var(--bad); color: #ffb4b0; }
button.icon { padding: 6px 9px; }
button.big { padding: 14px 26px; font-size: 18px; border-radius: 14px; }
input[type=text], input[type=email], input[type=password], select { font: inherit; color: inherit; background: #0b0814; border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; width: 100%; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
h1 { margin: 0 0 6px; font-size: clamp(28px, 4vw, 44px); line-height: 1.05; }
h2 { margin: 0 0 12px; font-size: 22px; }
h3 { margin: 14px 0 8px; font-size: 16px; color: var(--accent); }

/* kopbalk */
#top { position: fixed; top: 0; left: 0; right: 0; height: 54px; z-index: 20; display: flex; align-items: center; gap: 10px; padding: 0 14px; background: linear-gradient(#140f24f5, #140f24d8); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 900; color: var(--accent); letter-spacing: .4px; }
.orb { width: 16px; height: 16px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #ffe082, #ff8f00 60%, #6a1b9a); box-shadow: 0 0 12px #ffb30088; }
#nav { display: flex; gap: 6px; margin-left: 10px; }
#nav button { padding: 6px 11px; font-size: 13px; position: relative; }
#nav button.on { border-color: var(--accent); background: #ffb30022; }
#nav button .dot { position: absolute; top: -4px; right: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--bad); border: 2px solid var(--bg); }
#wallet { display: flex; gap: 10px; font-size: 14px; white-space: nowrap; }
#wallet span { background: #0008; border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; }
#acct { font-size: 13px; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
#acct img { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--accent); object-fit: cover; }
.langs { display: flex; gap: 3px; }
.langs button { padding: 4px 7px; font-size: 11px; font-weight: 700; border-radius: 7px; }
.langs button.on { background: var(--accent); color: #1b1430; border-color: var(--accent); }
@media (max-width: 900px) { .brand-name, #acct .who { display: none; } #nav button { padding: 5px 7px; font-size: 12px; } #nav { margin-left: 0; } }
@media (max-width: 620px) { #nav { display: none; } }

/* schermen */
#screen { padding: 22px clamp(14px, 4vw, 48px) 60px; max-width: 1280px; margin: 0 auto; }
.loading { padding: 60px; text-align: center; color: var(--muted); }
.hero { position: relative; display: grid; grid-template-columns: 1.1fr .9fr; gap: 24px; align-items: center; border-radius: 20px; overflow: hidden; padding: 28px; min-height: 300px; background: var(--panel) center / cover no-repeat; border: 1px solid var(--line); }
.hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, #140f24f2 0%, #140f24c0 45%, #140f2440 100%); }
.hero > * { position: relative; }
.hero .kicker { color: var(--accent); font-weight: 800; letter-spacing: 2px; text-transform: uppercase; font-size: 12px; }
.hero .lead { color: #e6e2f5; line-height: 1.5; max-width: 560px; }
.hero .art { justify-self: end; display: flex; gap: 6px; align-items: flex-end; }
.hero .art img { height: clamp(120px, 20vw, 220px); filter: drop-shadow(0 12px 24px #000a); }
.menu { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; margin-top: 22px; }
.menu button { padding: 18px 16px; font-size: 17px; font-weight: 700; text-align: left; display: flex; flex-direction: column; gap: 4px; border-radius: 16px; background: var(--panel); position: relative; }
.menu button small { font-weight: 400; color: var(--muted); font-size: 13px; }
.menu button .big-ico { font-size: 28px; }
.menu button .dot { position: absolute; top: 12px; right: 12px; width: 12px; height: 12px; border-radius: 50%; background: var(--bad); }
.notice { margin-top: 18px; padding: 12px 16px; border-radius: 12px; background: #ffb3001a; border: 1px solid #ffb30055; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.notice.info { background: #42a5f51a; border-color: #42a5f555; }
.setpick { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; margin-top: 18px; }
.setpick button { padding: 0; border-radius: 18px; overflow: hidden; text-align: left; background: var(--panel); display: block; }
.setpick .art { aspect-ratio: 16 / 9; background: center / cover no-repeat; }
.setpick .info { padding: 14px 16px 16px; }
.setpick .name { font-size: 20px; font-weight: 800; }
.setpick.compact button { display: flex; align-items: center; gap: 12px; }
.setpick.compact .art { width: 120px; aspect-ratio: 16/9; flex: none; }

/* kaarten */
.card { position: relative; width: var(--card-w); aspect-ratio: 5 / 7; border-radius: 10px; background: linear-gradient(170deg, #2a2347, #171229); border: 2px solid var(--r, var(--common)); box-shadow: 0 6px 14px #0008, inset 0 0 0 1px #ffffff12; display: flex; flex-direction: column; overflow: hidden; cursor: pointer; user-select: none; transition: transform .15s, box-shadow .15s; flex: none; }
.card:hover { transform: translateY(-4px); box-shadow: 0 10px 20px #000a, 0 0 0 2px var(--r); }
.card.sel { transform: translateY(-14px) scale(1.04); box-shadow: 0 14px 26px #000c, 0 0 0 3px var(--accent); }
.card.r-common { --r: var(--common); } .card.r-rare { --r: var(--rare); } .card.r-epic { --r: var(--epic); } .card.r-mythic { --r: var(--mythic); box-shadow: 0 6px 14px #0008, 0 0 18px #ffb30066; }
.card .cost { position: absolute; top: 4px; left: 4px; z-index: 2; width: 24px; height: 24px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ffd54a, #c77800); color: #221a00; font-weight: 900; font-size: 13px; display: grid; place-items: center; box-shadow: 0 2px 4px #000a; }
.card .art { flex: 1; min-height: 0; display: grid; place-items: center; background: radial-gradient(ellipse at 50% 70%, color-mix(in srgb, var(--el, #555) 45%, transparent), transparent 70%); padding: 6px 6px 0; }
.card .art img { max-width: 92%; max-height: 92%; object-fit: contain; filter: drop-shadow(0 4px 6px #0009); image-rendering: auto; }
.card .name { font-size: 11px; font-weight: 800; text-align: center; padding: 2px 4px 0; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .el { font-size: 9px; text-align: center; color: var(--muted); padding-bottom: 2px; }
.card .stats { display: flex; justify-content: space-between; padding: 0 6px 5px; font-size: 12px; font-weight: 800; }
.card .stats .atk { color: #ffab91; } .card .stats .hp { color: #a5d6a7; } .card .stats .hatch { color: #ffe082; font-weight: 600; }
.card .desc { font-size: 9px; color: var(--muted); padding: 0 6px 6px; text-align: center; line-height: 1.2; }
.card .cnt { position: absolute; top: 4px; right: 4px; z-index: 2; background: #000b; border: 1px solid #fff3; border-radius: 999px; padding: 1px 7px; font-size: 11px; font-weight: 700; }
.card .own { position: absolute; left: 4px; top: 32px; background: #4caf50dd; color: #fff; font-size: 9px; border-radius: 6px; padding: 1px 5px; font-weight: 700; max-width: 72%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-shadow: 0 1px 3px #0008; }
.card.dim { opacity: .4; filter: grayscale(.6); }
.card.dim:hover { transform: none; }
.card.back { background: repeating-linear-gradient(45deg, #2b2050 0 10px, #1e1740 10px 20px); border-color: #6a5aa0; }
.card.back::after { content: "🥚"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 34px; opacity: .55; }
.card.disabled { opacity: .55; }
.card.disabled:hover { transform: none; }
.card .tag { position: absolute; top: 32px; left: 4px; font-size: 10px; font-weight: 800; padding: 1px 6px; border-radius: 6px; background: var(--accent); color: #1b1430; }
.card .tag.dupe { background: #ffffff33; color: #fff; }
.cards { display: flex; flex-wrap: wrap; gap: 10px; }

/* collectie / deck */
.deckview { display: grid; grid-template-columns: 300px 1fr; gap: 22px; align-items: start; }
@media (max-width: 860px) { .deckview { grid-template-columns: 1fr; } }
.decklist { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px; position: sticky; top: 64px; }
.decklist .dl { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.decklist .dl:hover { background: #ffffff10; }
.decklist .dl img { width: 26px; height: 26px; object-fit: contain; }
.decklist .dl .c { width: 18px; height: 18px; border-radius: 50%; background: #c77800; color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center; }
.decklist .dl .n { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.filters button { padding: 5px 10px; font-size: 13px; }
.filters button.on { border-color: var(--accent); background: #ffb30022; }
.bar { height: 8px; background: #0008; border-radius: 4px; overflow: hidden; border: 1px solid var(--line); }
.bar .fill { height: 100%; background: var(--accent); width: 0; transition: width .3s; }

/* trainers */
.trainers { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.trainer { position: relative; border-radius: 16px; overflow: hidden; background: var(--panel); border: 1px solid var(--line); cursor: pointer; transition: transform .15s, box-shadow .15s; text-align: left; padding: 0; display: block; }
.trainer:hover:not(.locked) { transform: scale(1.03); box-shadow: 0 14px 30px #000a, 0 0 0 2px var(--accent); }
.trainer .field { aspect-ratio: 16 / 9; background: center / cover no-repeat; position: relative; }
.trainer .field img.av { position: absolute; left: 12px; bottom: -18px; width: 64px; height: 64px; border-radius: 50%; border: 3px solid var(--accent); object-fit: cover; background: #000; }
.trainer .field img.boss { position: absolute; right: 8px; bottom: 0; height: 85%; filter: drop-shadow(0 6px 10px #000c); }
.trainer .info { padding: 24px 14px 14px; }
.trainer .name { font-weight: 800; font-size: 16px; }
.trainer .lvl { color: var(--accent); font-size: 12px; letter-spacing: 1px; }
.trainer.locked { opacity: .55; cursor: not-allowed; }
.trainer.locked .field::after { content: "🔒"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 42px; background: #0008; }
.elpill { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--c, #555); color: #fff; font-weight: 700; }

/* winkel / missies */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 18px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.pack { display: flex; gap: 16px; align-items: center; }
.pack .pimg { width: 110px; aspect-ratio: 5/7; border-radius: 12px; background: linear-gradient(160deg, #6a3fb5, #2a1b55); border: 2px solid #b388ff; box-shadow: 0 10px 24px #0009; display: grid; place-items: center; font-size: 44px; flex: none; position: relative; overflow: hidden; }
.pack .pimg img { width: 78%; filter: drop-shadow(0 6px 10px #000c); }
.pack .pimg.space { background: linear-gradient(160deg, #1b6a8f, #10243f); border-color: #80deea; }
.mission { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.mission:last-child { border-bottom: 0; }
.mission .txt { flex: 1; }
.mission .bar { margin-top: 6px; }
.gempack { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); gap: 10px; }

/* toasts, modals, bevestiging */
#toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: #1d1733f0; border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 10px; padding: 10px 16px; box-shadow: 0 8px 24px #000a; max-width: min(520px, 92vw); font-size: 14px; animation: rise .25s ease-out; }
.toast.bad { border-left-color: var(--bad); } .toast.good { border-left-color: var(--good); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
#modal, #confirm-box { position: fixed; inset: 0; z-index: 50; background: #06040ccc; display: grid; place-items: center; padding: 16px; overflow: auto; }
#confirm-box { z-index: 70; }
.dlg { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 22px; width: min(640px, 100%); max-height: calc(100vh - 32px); overflow: auto; box-shadow: 0 24px 60px #000c; animation: rise .2s ease-out; }
.dlg.wide { width: min(900px, 100%); }
.dlg h2 { display: flex; align-items: center; gap: 10px; }
.dlg .foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
.dlg .rules p { line-height: 1.5; }
.form { display: grid; gap: 10px; }
.err { color: #ffb4b0; font-size: 13px; }
.result { text-align: center; }
.result .big { font-size: 42px; font-weight: 900; }
.result .win { color: var(--accent); text-shadow: 0 0 24px #ffb30088; } .result .lose { color: #ef9a9a; } .result .draw { color: var(--muted); }
.result .rew { font-size: 20px; margin: 10px 0; }
.packstage { position: relative; min-height: 300px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 10px 0; overflow: hidden; border-radius: 14px; }
.packstage.mythicflash { animation: bflash .7s ease-out; background: #fff; }
.packet { position: relative; width: 170px; height: 240px; border-radius: 14px; background: linear-gradient(160deg, #6a3fb5, #2a1b55 60%, #1a1040); border: 2px solid #b388ff; box-shadow: 0 18px 40px #000c, inset 0 0 30px #ffffff22; display: grid; place-items: center; cursor: pointer; overflow: hidden; transition: transform .2s; z-index: 2; }
.packet.space { background: linear-gradient(160deg, #1b6a8f, #10243f 60%, #0a1830); border-color: #80deea; }
.packet:hover { transform: scale(1.04) rotate(-1deg); }
.packet img { width: 72%; filter: drop-shadow(0 8px 12px #000c); }
.packet-label { position: absolute; top: 12px; left: 0; right: 0; text-align: center; font-weight: 900; letter-spacing: 2px; text-transform: uppercase; font-size: 13px; color: #ffe082; text-shadow: 0 2px 6px #000; }
.packet-count { position: absolute; bottom: 10px; right: 12px; background: #ffb300; color: #1b1430; font-weight: 900; border-radius: 999px; padding: 2px 9px; font-size: 13px; }
.packet-shine { position: absolute; inset: 0; background: linear-gradient(115deg, transparent 30%, #ffffff55 48%, #ffffff99 50%, #ffffff55 52%, transparent 70%); transform: translateX(-120%); animation: shine 2.6s ease-in-out infinite; pointer-events: none; }
@keyframes shine { 0%, 60% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }
.packet.tearing { animation: tear .65s ease-in-out; }
@keyframes tear { 0% { transform: rotate(0); } 15% { transform: rotate(-6deg) scale(1.03); } 30% { transform: rotate(6deg) scale(1.06); } 45% { transform: rotate(-8deg) scale(1.08); } 60% { transform: rotate(8deg) scale(1.1); } 100% { transform: rotate(0) scale(1.12); } }
.packet.open { animation: packpop .55s ease-in forwards; pointer-events: none; }
@keyframes packpop { 0% { transform: scale(1.12); opacity: 1; filter: brightness(1); } 50% { transform: scale(1.3); opacity: 1; filter: brightness(2.5); } 100% { transform: scale(0.2) translateY(-60px); opacity: 0; } }
.packglow { position: absolute; left: 50%; top: 45%; width: 10px; height: 10px; border-radius: 50%; background: radial-gradient(circle, #fff, #ffd54a 40%, transparent 70%); opacity: 0; transform: translate(-50%, -50%); pointer-events: none; z-index: 1; }
.packglow.on { animation: glowburst .9s ease-out forwards; }
@keyframes glowburst { 0% { opacity: 0; transform: translate(-50%, -50%) scale(1); } 20% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -50%) scale(60); } }
.packhint { margin-top: 10px; color: var(--muted); font-size: 13px; z-index: 2; }
.packsum { text-align: center; font-size: 18px; font-weight: 800; color: var(--accent); margin-top: 6px; }
.reveal { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin: 6px 0; min-height: 0; perspective: 1000px; z-index: 2; }
.reveal:not(:empty) { min-height: 190px; }
.packet.open ~ .reveal { margin-top: -120px; }
.cardflip { position: relative; width: var(--card-w); aspect-ratio: 5 / 7; animation: flyout .55s cubic-bezier(.2,.9,.3,1.2) both; cursor: pointer; }
@keyframes flyout { from { transform: translateY(-140px) scale(.3) rotate(calc(var(--i) * 20deg - 40deg)); opacity: 0; } to { transform: none; opacity: 1; } }
.cardflip .inner { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .5s cubic-bezier(.4,.2,.2,1); }
.cardflip.flipped .inner { transform: rotateY(180deg); }
.cardflip .face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.cardflip .face .card { width: 100%; height: 100%; }
.cardflip .face-front { transform: rotateY(180deg); }
.cardflip .face-back .card.back:hover { transform: translateY(-4px); }
.cardflip.burst .face-front .card { animation: raregl .9s ease-out; }
.cardflip.r-rare .face-front .card { box-shadow: 0 0 22px var(--rare); } .cardflip.r-epic .face-front .card { box-shadow: 0 0 28px var(--epic); } .cardflip.r-mythic .face-front .card { box-shadow: 0 0 40px var(--mythic), 0 0 80px #ffb30066; }
@keyframes raregl { 0% { transform: scale(1); filter: brightness(1); } 25% { transform: scale(1.14) rotate(-2deg); filter: brightness(1.8); } 60% { transform: scale(1.06) rotate(1deg); } 100% { transform: scale(1); filter: brightness(1); } }
.card .cnt.new { background: var(--accent); color: #1b1430; border-color: transparent; animation: pop .5s ease-out .3s both; }
.conf { position: absolute; left: 50%; top: 50%; width: 8px; height: 12px; background: var(--c, #ffb300); border-radius: 2px; pointer-events: none; z-index: 5; animation: confetti 1.4s ease-out forwards; }
@keyframes confetti { 0% { transform: translate(0, 0) rotate(0); opacity: 1; } 100% { transform: translate(var(--dx), calc(var(--dy) + 260px)) rotate(var(--r)); opacity: 0; } }
.inspect-card { display: grid; grid-template-columns: var(--card-w) 1fr; gap: 16px; align-items: start; }
.inspect-card .card { --card-w: 140px; cursor: default; } .inspect-card .card:hover { transform: none; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 14px; }
.kv b { color: var(--muted); font-weight: 600; }

/* ---------- speelbord ---------- */
#board { position: fixed; inset: 0; z-index: 30; background: #000 center / cover no-repeat; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr auto 1fr auto auto; grid-template-areas: "opp" "oppl" "mid" "mel" "me" "hand"; }
#board::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(to bottom, #000c 0, #0005 14%, #0002 50%, #0006 80%, #000d 100%); pointer-events: none; }
#board > * { position: relative; z-index: 2; }
#board > .bglayer { position: absolute; inset: 0; z-index: 0; background: #000 center / cover no-repeat; transition: opacity 1.2s ease; }
#board > .bglayer.clim { opacity: 0; }
#board > .bglayer.clim.on { opacity: 1; }
#board > .turnbanner, #board > .blog, #board > .dragghost, #board > .tut, #board > .boardflash { position: absolute; }   /* wint van de id-regel hierboven */
.pside { display: flex; align-items: center; gap: 12px; padding: 8px 14px; font-size: 14px; }
.pside.opp { grid-area: opp; padding-top: 8px; }
.pside.me { grid-area: me; }
.pside img.av { width: 42px; height: 42px; border-radius: 50%; border: 2px solid var(--accent); object-fit: cover; background: #000; }
.pside .pname { font-weight: 800; text-shadow: 0 2px 6px #000; }
.pside .stat { background: #000a; border: 1px solid #ffffff22; border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.pside .nest { min-width: 150px; }
.nestbar { height: 12px; border-radius: 6px; background: #0009; border: 1px solid #ffffff33; overflow: hidden; }
.nestbar .fill { height: 100%; background: linear-gradient(90deg, #ff7043, #ffb300); transition: width .35s; }
.nestbar.hitflash { animation: flashbar .4s; }
@keyframes flashbar { 0%, 100% { box-shadow: none; } 50% { box-shadow: 0 0 0 3px #ef5350, 0 0 22px #ef5350; } }
.pside.active .pname::after { content: " ●"; color: var(--good); }
.lanes { display: grid; grid-template-columns: 72px repeat(3, minmax(90px, 160px)); gap: clamp(8px, 2vw, 26px); justify-content: center; align-items: end; padding: 4px 10px; }
.env { display: flex; flex-direction: column; gap: 6px; align-items: center; justify-content: center; align-self: center; }
.envlabel { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; text-shadow: 0 1px 3px #000; }
.envtile { width: 56px; height: 56px; border-radius: 12px; border: 1px solid #26a69a88; background: #0a1f1dcc; display: grid; place-items: center; position: relative; box-shadow: 0 4px 10px #0008; }
.envtile img { width: 44px; height: 44px; object-fit: contain; filter: drop-shadow(0 3px 4px #000a); }
.envtile .n { position: absolute; right: -4px; bottom: -4px; background: #26a69a; color: #fff; font-size: 11px; font-weight: 800; border-radius: 999px; min-width: 18px; height: 18px; display: grid; place-items: center; padding: 0 4px; }
.envtile.empty { border-style: dashed; border-color: #ffffff22; background: #0003; color: #ffffff33; font-size: 20px; }
.lanes.opp { grid-area: oppl; align-items: center; }
.lanes.me { grid-area: mel; align-items: center; }
.lane { aspect-ratio: 1 / 1.05; border-radius: 16px; border: 2px dashed #ffffff33; background: #0003; display: grid; place-items: end center; position: relative; transition: border-color .15s, background .15s, box-shadow .15s; }
.lanes.opp .lane { place-items: start center; }
.lane.target { border-color: var(--accent); background: #ffb30022; cursor: pointer; box-shadow: 0 0 18px #ffb30055; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 26px #ffb300aa; } }
.lane.has { border-style: solid; border-color: #ffffff22; cursor: pointer; }
.lane.insp { box-shadow: 0 0 0 2px var(--blue); }
.mid { grid-area: mid; display: flex; justify-content: center; align-items: center; gap: 12px; padding: 2px; min-height: 30px; }
.mid .fieldtag { background: #000a; border: 1px solid #ffffff22; border-radius: 999px; padding: 3px 12px; font-size: 13px; }
.unit { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; position: relative; padding: 4px; transition: transform .18s ease, opacity .3s; }
.unit img.sprite { width: 86%; height: 72%; object-fit: contain; filter: drop-shadow(0 8px 10px #000c); transition: transform .2s; }
.unit.egg img.sprite { height: 62%; width: 60%; }
.unit.baby img.sprite { height: 60%; }
.lanes.opp .unit img.sprite { transform: scaleX(-1); }
.unit .badges { display: flex; gap: 4px; font-size: 12px; font-weight: 800; }
.unit .badges span { background: #000c; border: 1px solid #ffffff33; border-radius: 999px; padding: 1px 7px; }
.unit .badges .atk { color: #ffab91; } .unit .badges .hp { color: #a5d6a7; } .unit .badges .hatchn { color: #ffe082; } .unit .badges .shell { color: #e0e0e0; }
.unit .uname { font-size: 11px; font-weight: 700; text-shadow: 0 1px 3px #000, 0 0 6px #000; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.unit .st { position: absolute; top: 4px; right: 4px; display: flex; flex-direction: column; gap: 2px; font-size: 14px; filter: drop-shadow(0 1px 2px #000); }
.unit .fieldbonus { position: absolute; top: 4px; left: 6px; font-size: 12px; color: #ffe082; text-shadow: 0 0 6px #000; }
.unit .packbonus { position: absolute; top: 20px; left: 6px; font-size: 11px; color: #a5d6a7; text-shadow: 0 0 6px #000; }
.unit.frozen img.sprite { filter: drop-shadow(0 8px 10px #000c) saturate(.3) brightness(1.3) sepia(1) hue-rotate(160deg); }
.unit.shield::after { content: ""; position: absolute; inset: 6%; border-radius: 50%; border: 2px solid #80deea; box-shadow: 0 0 16px #80deea99, inset 0 0 16px #80deea55; pointer-events: none; }
.unit.pop { animation: pop .35s ease-out; }
@keyframes pop { 0% { transform: scale(.3); opacity: 0; } 70% { transform: scale(1.12); opacity: 1; } 100% { transform: none; } }
.unit.lunge-up { transform: translateY(-60px) scale(1.1); } .unit.lunge-down { transform: translateY(60px) scale(1.1); }
.unit.hit { animation: shake .4s; }
@keyframes shake { 0%, 100% { transform: none; } 20% { transform: translateX(-7px) rotate(-3deg); } 40% { transform: translateX(7px) rotate(3deg); } 60% { transform: translateX(-5px); } 80% { transform: translateX(5px); } }
.unit.die { opacity: 0; transform: scale(.5) rotate(12deg); }
.unit.crack img.sprite { animation: crack .45s ease-in; }
@keyframes crack { 0% { transform: none; } 30% { transform: rotate(-8deg) scale(1.05); } 60% { transform: rotate(8deg) scale(1.1); } 100% { transform: scale(1.3); opacity: 0; } }
.unit.glow img.sprite { animation: glow .6s ease-out; }
@keyframes glow { 0% { filter: brightness(2.5) drop-shadow(0 0 20px #fff); } 100% { filter: drop-shadow(0 8px 10px #000c); } }
.fxs { position: absolute; left: 50%; top: 45%; width: 100%; aspect-ratio: 1; transform: translate(-50%, -50%); pointer-events: none; object-fit: contain; z-index: 3; filter: drop-shadow(0 0 14px #fff8) drop-shadow(0 6px 10px #000a); transition: opacity .12s, transform .12s; }
.fxs.big { width: 135%; top: 40%; }
.fxs.out { opacity: 0; transform: translate(-50%, -55%) scale(1.15); }
.boardflash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; z-index: 9; }
.boardflash.on { animation: bflash .35s ease-out; }
@keyframes bflash { 0% { opacity: .55; } 100% { opacity: 0; } }
.lanes.opp .fxs { top: 50%; }
.dmg { position: absolute; left: 50%; top: 40%; transform: translateX(-50%); font-size: 26px; font-weight: 900; color: #fff; text-shadow: 0 0 6px #000, 0 2px 4px #000; animation: floatup 1s ease-out forwards; pointer-events: none; z-index: 4; }
.dmg.bad { color: #ff5252; } .dmg.good { color: #69f0ae; } .dmg.crit { font-size: 34px; color: #ffd740; } .dmg.weak { font-size: 20px; color: #cfd8dc; }
@keyframes floatup { 0% { opacity: 0; transform: translate(-50%, 10px) scale(.6); } 15% { opacity: 1; transform: translate(-50%, 0) scale(1.1); } 100% { opacity: 0; transform: translate(-50%, -60px); } }
.bottom { grid-area: hand; display: flex; align-items: flex-end; gap: 8px; height: var(--hand-h); padding: 0 8px calc(8px + env(safe-area-inset-bottom)) 8px; min-width: 0; }
.hand { flex: 1; display: flex; gap: 8px; justify-content: flex-start; align-items: flex-end; padding: 16px 4px 0; overflow-x: auto; overflow-y: visible; min-width: 0; height: 100%; }
.hand .card { --card-w: var(--hand-card); }
.hand > :first-child { margin-left: auto; } .hand > :last-child { margin-right: auto; }   /* gecentreerd, maar bij overloop scrollbaar vanaf links */
.hand .card.disabled { opacity: .6; }
.hand::-webkit-scrollbar { height: 6px; } .hand::-webkit-scrollbar-thumb { background: #ffffff33; border-radius: 3px; }
.bact { display: flex; flex-direction: column; gap: 8px; z-index: 5; align-items: stretch; flex: none; padding-bottom: 4px; }
.bact button { min-width: 150px; box-shadow: 0 6px 16px #000a; }
.bact button.end { font-size: 16px; padding: 12px 18px; }
.bact button.end.go { animation: pulse 1.4s ease-in-out infinite; }
.bmenu { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); z-index: 6; display: flex; gap: 6px; }
.bmenu button { background: #000a; padding: 6px 10px; font-size: 13px; }
.turnbanner { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); z-index: 8; background: #140f24ee; border: 1px solid var(--accent); border-radius: 16px; padding: 14px 34px; font-size: 26px; font-weight: 900; text-shadow: 0 2px 8px #000; pointer-events: none; animation: banner .9s ease-out both; }
.turnbanner.small { font-size: 18px; padding: 10px 22px; border-color: var(--line); }
@keyframes banner { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.7); } 20% { opacity: 1; transform: translate(-50%, -50%) scale(1.05); } 80% { opacity: 1; transform: translate(-50%, -50%); } 100% { opacity: 0; transform: translate(-50%, -60%); } }
.inspect { position: relative; flex: none; width: 330px; height: calc(100% - 6px); overflow: auto; z-index: 7; background: #140f24f2; border: 1px solid var(--line); border-radius: 14px; padding: 10px 10px 8px; box-shadow: 0 12px 30px #000c; display: grid; grid-template-columns: 56px 1fr; grid-template-rows: auto 1fr; gap: 6px 10px; font-size: 12.5px; animation: rise .15s ease-out; align-content: start; }
.inspect .ibody { line-height: 1.3; }
.inspect .ibody > div { margin-bottom: 2px; }
.inspect img { width: 56px; height: 56px; object-fit: contain; filter: drop-shadow(0 4px 6px #000a); }
.inspect .t { font-weight: 800; font-size: 15px; }
.inspect .acts { grid-column: 1 / -1; display: flex; gap: 6px; flex-wrap: wrap; }
.inspect .acts button { padding: 6px 10px; font-size: 13px; }
.inspect .x { position: absolute; top: 4px; right: 6px; background: none; border: 0; font-size: 16px; padding: 2px 6px; color: var(--muted); }
.blog { position: absolute; right: 12px; top: 60px; width: min(260px, 18vw); display: none; max-height: 28vh; overflow: auto; font-size: 12px; color: #e6e2f5; text-shadow: 0 1px 3px #000; pointer-events: none; flex-direction: column-reverse; gap: 2px; mask-image: linear-gradient(to top, #000 70%, transparent); z-index: 2; }
.blog div { background: #0007; border-radius: 6px; padding: 2px 8px; }
.scanpick { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin: 12px 0; }
@media (min-width: 1180px) { .blog { display: flex; } }
@media (max-width: 720px) {
  #board { grid-template-rows: auto 1fr auto 1fr auto auto; }
  .pside { padding: 6px 10px; font-size: 12px; gap: 8px; }
  .pside .nest { min-width: 100px; }
  .pside .stat.turn, .pside .stat.deckc { display: none; }
  .bmenu { position: static; transform: none; }
  .mid { justify-content: space-between; padding: 2px 10px; }
  .mid .fieldtag { font-size: 12px; padding: 3px 8px; }
  .pside img.av { width: 32px; height: 32px; }
  .lanes { grid-template-columns: 44px repeat(3, minmax(72px, 104px)); gap: 6px; }
  .envtile { width: 38px; height: 38px; border-radius: 9px; } .envtile img { width: 30px; height: 30px; } .envlabel { display: none; } .envtile .n { font-size: 9px; min-width: 15px; height: 15px; }
  .unit .badges { font-size: 10px; }
  .unit .badges span { padding: 0 5px; }
  .unit .uname { font-size: 9px; }
  .bact { gap: 6px; }
  .bact button { min-width: 0; padding: 8px 10px; font-size: 13px; }
  .bact button.end { font-size: 14px; padding: 10px 12px; }
  .inspect { position: absolute; left: 8px; right: 8px; bottom: calc(var(--hand-h) + 6px); width: auto; height: auto; max-height: 40vh; grid-template-columns: 44px 1fr; }
  .hero { grid-template-columns: 1fr; padding: 20px; }
  .hero .art { justify-self: start; }
  .hero .art img { height: 100px; }
}

/* v2: slepen, versnellen, klimaat, effecten, les */
.hand .card { touch-action: pan-x; }
.hand .card.dragging { opacity: .35; }
.dragghost { pointer-events: none; z-index: 40; transform: translate(-50%, -60%) rotate(-4deg) scale(1.05); opacity: .92; box-shadow: 0 20px 40px #000c, 0 0 0 3px var(--accent); }
.lane.over { background: #ffb30055; box-shadow: 0 0 30px #ffb300cc; }
.lane.enemy-target { border-color: var(--bad); }
.busyhint { font-size: 12px; color: var(--muted); background: #000a; border-radius: 999px; padding: 3px 10px; margin-left: 8px; }
.mid .clim { background: #ffb30033; border-radius: 999px; padding: 0 6px; margin-left: 4px; font-weight: 700; }
.pside .stat.fx { background: #26a69a33; border-color: #26a69a88; }
.pside .stat.food { position: relative; }
.tut { left: 12px; top: 58px; z-index: 45; width: min(400px, calc(100vw - 24px)); background: #140f24f5; border: 2px solid var(--accent); border-radius: 16px; padding: 12px 14px; box-shadow: 0 16px 40px #000c; animation: fadein .25s ease-out; }
@keyframes fadein { from { opacity: 0; } }
.tut-head { font-weight: 800; color: var(--accent); margin-bottom: 6px; display: flex; gap: 8px; align-items: baseline; }
.tut-text { line-height: 1.45; font-size: 14px; }
.tut-foot { display: flex; gap: 8px; justify-content: flex-end; align-items: center; margin-top: 10px; }
.tut-foot .small-btn { padding: 5px 9px; font-size: 12px; }
.tut-hl { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 14px; animation: tutpulse 1.2s ease-in-out infinite; }
@keyframes tutpulse { 50% { outline-color: #ffe082; box-shadow: 0 0 24px #ffb30099; } }
@media (max-width: 720px) { .tut { top: auto; bottom: calc(var(--hand-h) + 8px); font-size: 13px; padding: 10px; } .tut-text { font-size: 13px; } }
.card.climate .art, .card.nest .art { background: radial-gradient(ellipse at 50% 70%, color-mix(in srgb, var(--el, #555) 55%, transparent), transparent 70%); }
.card .desc { font-size: 8.5px; }
.discover { margin: 0 0 10px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.discover .bar { flex: 1; min-width: 120px; }
.card.unknown { background: repeating-linear-gradient(45deg, #221a40 0 10px, #1a1433 10px 20px); border-color: #ffffff22; cursor: default; display: grid; place-items: center; font-size: 32px; color: #ffffff33; }
.card.unknown:hover { transform: none; }
#mus.off { opacity: .45; text-decoration: line-through; }
