/* Garden War — UI styles. The whole game lives in a 1600x900 #stage scaled to fit the window. */
:root {
  --ink: #2a1a0e;
  --wood: #6d4c41;
  --wood-d: #3e2723;
  --gold: #ffd54f;
  --cream: #fff8e1;
  --leaf: #7cb342;
  --leaf-d: #33691e;
  --panel: linear-gradient(180deg, #4a3222 0%, #2e1f14 100%);
  --font-h: 'Rubik', 'Segoe UI', system-ui, sans-serif;
  --font-b: 'Nunito', 'Segoe UI', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; width: 100%; height: 100%; overflow: hidden;
  background: radial-gradient(circle at 50% 40%, #2b3a1c, #0e140a 80%);
  font-family: var(--font-b); color: var(--cream);
  -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none;
}
#stage {
  position: absolute; left: 0; top: 0; width: 1600px; height: 900px;
  transform-origin: 0 0; overflow: hidden; background: #5e9e33;
  box-shadow: 0 0 60px rgba(0,0,0,.6);
}
#game { position: absolute; left: 0; top: 0; width: 1600px; height: 900px; display: block; touch-action: none; }
#boot {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; flex-direction: column;
  background: #0e140a; color: var(--gold); font: 800 28px var(--font-h); z-index: 999;
}
.hidden { display: none !important; }

/* ------------------------------------------------------------ buttons */
.btn {
  font: 800 20px var(--font-h); color: #fff; letter-spacing: .5px;
  padding: 12px 26px; border-radius: 16px; border: 4px solid #1b3d0f;
  background: linear-gradient(180deg, #9ccc65 0%, #689f38 55%, #558b2f 100%);
  box-shadow: 0 6px 0 #1b3d0f, 0 12px 22px rgba(0,0,0,.35), inset 0 3px 0 rgba(255,255,255,.35);
  text-shadow: 0 2px 0 rgba(0,0,0,.35); cursor: pointer; position: relative;
  transition: transform .09s ease, filter .15s;
}
.btn:hover { transform: translateY(-2px) scale(1.03); filter: brightness(1.08); }
.btn:active { transform: translateY(4px); box-shadow: 0 2px 0 #1b3d0f, 0 4px 10px rgba(0,0,0,.35), inset 0 3px 0 rgba(255,255,255,.35); }
.btn:disabled { filter: grayscale(.8) brightness(.7); cursor: default; transform: none; }
.btn.gold { background: linear-gradient(180deg, #ffe57f 0%, #ffc107 55%, #ff8f00 100%); border-color: #6d3c00; box-shadow: 0 6px 0 #6d3c00, 0 12px 22px rgba(0,0,0,.35), inset 0 3px 0 rgba(255,255,255,.5); color: #4e2600; text-shadow: 0 1px 0 rgba(255,255,255,.5); }
.btn.blue { background: linear-gradient(180deg, #81d4fa 0%, #29b6f6 55%, #0288d1 100%); border-color: #01375e; box-shadow: 0 6px 0 #01375e, 0 12px 22px rgba(0,0,0,.35), inset 0 3px 0 rgba(255,255,255,.4); }
.btn.red { background: linear-gradient(180deg, #ff8a80 0%, #f44336 55%, #c62828 100%); border-color: #5f0f0f; box-shadow: 0 6px 0 #5f0f0f, 0 12px 22px rgba(0,0,0,.35), inset 0 3px 0 rgba(255,255,255,.35); }
.btn.wood { background: linear-gradient(180deg, #a1887f 0%, #795548 60%, #5d4037 100%); border-color: #2a1a0e; box-shadow: 0 6px 0 #2a1a0e, 0 12px 22px rgba(0,0,0,.35), inset 0 3px 0 rgba(255,255,255,.25); }
.btn.small { font-size: 16px; padding: 8px 16px; border-width: 3px; border-radius: 12px; }
.btn.round { width: 54px; height: 54px; padding: 0; border-radius: 50%; font-size: 24px; display: flex; align-items: center; justify-content: center; }
.btn.big { font-size: 30px; padding: 18px 40px; border-radius: 20px; }

/* ------------------------------------------------------------ HUD */
#hud { position: absolute; inset: 0; pointer-events: none; z-index: 20; }
#hud > * { pointer-events: auto; }
#res { position: absolute; left: 22px; top: 14px; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.pill {
  display: inline-flex; align-items: center; gap: 10px; min-width: 150px;
  background: linear-gradient(180deg, rgba(62,39,35,.92), rgba(40,25,15,.92));
  border: 3px solid var(--gold); border-radius: 30px; padding: 4px 18px 4px 8px;
  font: 800 26px var(--font-h); color: #fff59d; box-shadow: 0 5px 12px rgba(0,0,0,.4);
}
.pill i { font-style: normal; font-size: 26px; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: rgba(255,255,255,.12); }
.pill.gene { border-color: #69f0ae; color: #b9f6ca; }
.pill.crown { border-color: #ffab40; color: #ffe0b2; font-size: 20px; min-width: 110px; }
.pill.crown i { font-size: 20px; width: 30px; height: 30px; }
.pill.bump { animation: bump .25s ease; }
@keyframes bump { 50% { transform: scale(1.12); } }

#wavebox { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); width: 440px; text-align: center; pointer-events: none; }
#waveLabel { font: 900 28px var(--font-h); color: #fff; text-shadow: 0 3px 0 #1b3d0f, 0 0 12px rgba(0,0,0,.6); letter-spacing: 2px; }
#waveSub { font: 700 15px var(--font-b); color: #fff8e1; text-shadow: 0 2px 3px #000; min-height: 18px; }
#waveBar { position: relative; height: 16px; margin-top: 4px; border-radius: 10px; background: rgba(0,0,0,.55); border: 3px solid #3e2723; overflow: visible; }
#waveFill { height: 100%; width: 0%; border-radius: 8px; background: linear-gradient(90deg, #aed581, #ffeb3b); transition: width .3s; }
#waveFlag { position: absolute; right: -14px; top: -14px; font-size: 26px; filter: drop-shadow(0 2px 2px #000); }

#topRight { position: absolute; right: 22px; top: 16px; display: flex; gap: 10px; }
#sideBtns { position: absolute; right: 38px; top: 104px; width: 300px; display: flex; flex-direction: column; gap: 18px; }
.side-btn { width: 100%; display: flex; align-items: center; gap: 14px; text-align: left; padding: 10px 16px; }
.side-btn .ic { font-size: 40px; filter: drop-shadow(0 3px 2px rgba(0,0,0,.4)); }
.side-btn .lbl { display: flex; flex-direction: column; line-height: 1.1; }
.side-btn .lbl small { font: 800 17px var(--font-h); opacity: .95; }
/* attention: a soft golden ring around the button (no filters, so colours stay clean) */
.side-btn.pulse::after { content: ''; position: absolute; inset: -7px; border-radius: 20px; pointer-events: none;
  border: 3px solid rgba(255,241,118,.9); box-shadow: 0 0 16px rgba(255,235,59,.6); animation: ringPulse 1.3s ease-in-out infinite; }
@keyframes ringPulse { 0%, 100% { opacity: .25; transform: scale(.98); } 50% { opacity: 1; transform: scale(1.02); } }
@keyframes glowPulse { 50% { box-shadow: 0 0 0 3px rgba(255,241,118,.8), 0 0 20px rgba(255,235,59,.6); } }
/* seed-pack buttons: little foil packs with a price tag */
.pack-btns { display: flex; gap: 12px; }
.pack-btn { flex: 1; flex-direction: column; justify-content: flex-start; gap: 2px; padding: 10px 8px 12px; text-align: center; min-height: 128px; overflow: visible; }
.pack-btn::before { content: ''; position: absolute; inset: 4px; border-radius: 11px; pointer-events: none;
  background: repeating-linear-gradient(135deg, rgba(255,255,255,.1) 0 3px, transparent 3px 12px); }
.pack-btn .ic { font-size: 38px; line-height: 1.1; margin-top: 2px; }
.pack-btn .pk-name { font: 900 14px/1.1 var(--font-h); letter-spacing: .5px; text-shadow: 0 2px 0 rgba(0,0,0,.35); }
.pack-btn .pk-price { margin-top: auto; align-self: stretch; margin-left: 6px; margin-right: 6px; padding: 4px 6px; border-radius: 10px;
  background: rgba(20,12,4,.55); border: 2px solid rgba(255,255,255,.35); font: 900 16px var(--font-h); color: #fff59d; text-shadow: none; white-space: nowrap; }
.pack-btn .pk-count { position: absolute; right: -8px; top: -10px; min-width: 34px; height: 26px; padding: 0 6px; border-radius: 13px;
  background: #fff8e1; border: 3px solid #4e342e; color: #4e342e; font: 900 14px/20px var(--font-h); text-shadow: none; }
.pack-btn.free .pk-price { background: linear-gradient(#fff59d, #ffc107); border-color: #6d3c00; color: #4e2600; }
.pack-btn.poor .pk-price { color: #ff8a80; }
.pack-btn.poor .ic, .pack-btn.poor .pk-name { opacity: .7; }
.pack-btn-seed { background: linear-gradient(180deg, #aed581 0%, #7cb342 55%, #558b2f 100%); border-color: #1b3d0f; box-shadow: 0 6px 0 #1b3d0f, 0 12px 22px rgba(0,0,0,.35), inset 0 3px 0 rgba(255,255,255,.4); }
.pack-btn-mutant { background: linear-gradient(180deg, #b39ddb 0%, #7e57c2 55%, #512da8 100%); border-color: #1a0f4d; box-shadow: 0 6px 0 #1a0f4d, 0 12px 22px rgba(0,0,0,.35), inset 0 3px 0 rgba(255,255,255,.4); }

#bossBar { position: absolute; left: 50%; top: 96px; transform: translateX(-50%); width: 520px; text-align: center; pointer-events: none; }
#bossBar .name { font: 900 20px var(--font-h); color: #ffcdd2; text-shadow: 0 2px 0 #000; }
#bossBar .bar { height: 18px; border-radius: 10px; background: rgba(0,0,0,.6); border: 3px solid #b71c1c; overflow: hidden; margin-top: 3px; }
#bossBar .fill { height: 100%; background: linear-gradient(90deg, #ff1744, #ff9100); width: 100%; transition: width .15s; }

#banner { position: absolute; left: 0; right: 0; top: 250px; text-align: center; pointer-events: none; z-index: 30; }
#banner .b { display: inline-block; font: 900 64px var(--font-h); color: #fff59d; letter-spacing: 3px;
  text-shadow: 0 5px 0 #6d3c00, 0 0 30px rgba(0,0,0,.7); -webkit-text-stroke: 2px #6d3c00;
  animation: bannerIn 2.2s cubic-bezier(.2,.9,.3,1.2) forwards; }
#banner .b.boss { color: #ff8a80; text-shadow: 0 5px 0 #5f0f0f, 0 0 30px rgba(0,0,0,.7); -webkit-text-stroke: 2px #5f0f0f; }
#banner .b small { display: block; font: 800 24px var(--font-h); letter-spacing: 1px; -webkit-text-stroke: 0; color: #fff; text-shadow: 0 2px 4px #000; }
@keyframes bannerIn {
  0% { transform: translateX(-400px) scale(.6); opacity: 0; }
  18% { transform: translateX(0) scale(1.08); opacity: 1; }
  28% { transform: scale(1); }
  80% { transform: scale(1); opacity: 1; }
  100% { transform: translateX(400px) scale(.8); opacity: 0; }
}
#hurt { position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 160px 40px rgba(255,0,0,.55); opacity: 0; z-index: 25; }
#hurt.on { animation: hurt .8s ease-out; }
@keyframes hurt { 0% { opacity: 1; } 100% { opacity: 0; } }

#toasts { position: absolute; left: 50%; top: 150px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; z-index: 40; }
.toast { background: rgba(40,20,10,.92); border: 3px solid #ff8a65; color: #fff; font: 800 19px var(--font-h); padding: 8px 20px; border-radius: 14px; animation: toast 2.2s ease forwards; box-shadow: 0 6px 14px rgba(0,0,0,.4); }
.toast.good { border-color: #69f0ae; }
@keyframes toast { 0% { transform: translateY(10px); opacity: 0; } 10% { transform: none; opacity: 1; } 80% { opacity: 1; } 100% { opacity: 0; transform: translateY(-10px); } }

/* ------------------------------------------------------------ cards */
#hand { position: absolute; left: 0; top: 0; width: 0; height: 0; z-index: 30; }
.card { position: absolute; left: 0; top: 0; width: 132px; height: 184px; cursor: grab; touch-action: none; will-change: transform; }
.card.dragging { cursor: grabbing; }
.card-tilt { width: 100%; height: 100%; transition: transform .12s ease-out; transform-style: preserve-3d; }
.card-face {
  position: relative; width: 100%; height: 100%; border-radius: 16px; overflow: hidden;
  background: linear-gradient(180deg, #fffdf3 0%, #f3e3bd 100%);
  border: 4px solid #4e342e; box-shadow: 0 10px 20px rgba(0,0,0,.45), inset 0 0 0 3px #fff8e1, inset 0 -18px 30px rgba(160,110,50,.18);
  --mx: 50%; --my: 50%;
}
.card-art { position: absolute; left: 9px; top: 26px; width: 106px; height: 88px; border-radius: 12px; border: 3px solid rgba(50,30,10,.55);
  background: radial-gradient(circle at 50% 70%, #dcedc8 0%, #9ccc65 65%, #689f38 100%); }
.card-tomato .card-art { background: radial-gradient(circle at 50% 70%, #ffe0e0, #ef9a9a 60%, #c62828); }
.card-garlic .card-art { background: radial-gradient(circle at 50% 70%, #fff, #e1bee7 60%, #7b1fa2); }
.card-pineapple .card-art { background: radial-gradient(circle at 50% 70%, #fffde7, #ffe082 60%, #f9a825); }
.card-root .card-art { background: radial-gradient(circle at 50% 70%, #efebe9, #bcaaa4 60%, #5d4037); }
.card-magnet .card-art { background: radial-gradient(circle at 50% 70%, #e3f2fd, #90caf9 60%, #1565c0); }
.card-saguaro .card-art { background: radial-gradient(circle at 50% 70%, #fff3e0, #ffcc80 60%, #e65100); }
.card-opuntia .card-art { background: radial-gradient(circle at 50% 70%, #fce4ec, #f48fb1 60%, #ad1457); }
.card-cost { position: absolute; left: -2px; top: -2px; min-width: 60px; height: 34px; padding: 0 10px 0 6px; display: flex; align-items: center; gap: 3px;
  background: linear-gradient(#fff59d, #ffc107); border: 3px solid #6d3c00; border-radius: 0 0 14px 0; font: 900 18px var(--font-h); color: #4e2600; }
.card-cost span { font-size: 15px; }
.card-key { position: absolute; right: 6px; top: 4px; width: 22px; height: 22px; border-radius: 6px; background: rgba(62,39,35,.8); color: #fff8e1; font: 800 13px var(--font-h); display: flex; align-items: center; justify-content: center; }
.card-name { position: absolute; left: 6px; right: 6px; top: 118px; height: 38px; display: flex; align-items: center; justify-content: center; text-align: center;
  font: 800 15px/1.05 var(--font-h); color: #3e2723; }
.card-stars { position: absolute; left: 0; right: 0; bottom: 6px; text-align: center; font-size: 12px; color: #ff8f00; letter-spacing: 1px; text-shadow: 0 1px 0 #6d3c00; }
.card-shine { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .15s;
  background: radial-gradient(circle at var(--mx) var(--my), rgba(255,255,255,.55), rgba(255,255,255,0) 55%); mix-blend-mode: overlay; }
.card:hover .card-shine { opacity: 1; }
.card.poor .card-face { filter: grayscale(.6) brightness(.82); }
.card.poor .card-cost { background: linear-gradient(#e0e0e0, #9e9e9e); color: #b71c1c; }

/* ------------------------------------------------------------ tooltip */
#tooltip {
  position: absolute; left: 0; top: 0; width: 380px; z-index: 300; pointer-events: none; opacity: 0;
  padding: 16px 20px 14px; border-radius: 18px; color: var(--cream);
  background: linear-gradient(180deg, rgba(58,38,24,.97), rgba(30,19,11,.97));
  border: 3px solid #d7b074; box-shadow: 0 16px 34px rgba(0,0,0,.55), inset 0 2px 0 rgba(255,255,255,.12);
  transition: opacity .12s; font: 600 17px/1.35 var(--font-b);
}
#tooltip.show { opacity: 1; }
.tt-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.tt-name { font: 900 24px/1.1 var(--font-h); color: #fff59d; }
.tt-cost { font: 900 20px var(--font-h); color: #ffd54f; white-space: nowrap; }
.tt-cost.bad { color: #ff8a80; }
.tt-tag { font: italic 700 15px var(--font-b); color: #bcaaa4; margin: 2px 0 8px; }
.tt-desc { margin-bottom: 8px; }
.tt-warn { color: #ffab40; font-weight: 800; margin-bottom: 8px; }
.tt-stats { display: grid; grid-template-columns: 1fr auto; gap: 3px 14px; padding: 8px 12px; background: rgba(0,0,0,.28); border-radius: 12px; font-size: 16px; margin-bottom: 8px; }
.tt-stats b { color: #fff; font-family: var(--font-h); text-align: right; }
.tt-sub { font: 800 14px var(--font-h); color: #d7b074; text-transform: uppercase; letter-spacing: 1px; margin: 4px 0 3px; }
.tt-evo div { font-size: 15px; padding: 1px 0; }
.tt-evo .off { color: #8d7b6f; }
.tt-evo .on { color: #b9f6ca; }
.tt-foot { font-size: 14px; color: #bcaaa4; margin-top: 6px; }
.tt-req { color: #ff8a80; font-weight: 800; margin-top: 6px; }
.tt-now { display: flex; justify-content: space-between; gap: 10px; font-size: 16px; }
.tt-now b { color: #fff; font-family: var(--font-h); }

/* ------------------------------------------------------------ screens */
#screens { position: absolute; inset: 0; z-index: 100; pointer-events: none; }
.screen { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: auto;
  background: rgba(12,20,6,.62); backdrop-filter: blur(2px); animation: fadeIn .2s ease; }
.screen.clear { background: transparent; backdrop-filter: none; }
@keyframes fadeIn { from { opacity: 0; } }
.panel { background: var(--panel); border: 5px solid #d7b074; border-radius: 26px; padding: 28px 34px; color: var(--cream);
  box-shadow: 0 24px 60px rgba(0,0,0,.6), inset 0 2px 0 rgba(255,255,255,.12); animation: popIn .28s cubic-bezier(.2,.9,.3,1.3); }
@keyframes popIn { from { transform: scale(.85); opacity: 0; } }
.panel h1, .panel h2 { font-family: var(--font-h); margin: 0 0 10px; color: #fff59d; text-shadow: 0 3px 0 rgba(0,0,0,.4); }
.panel h1 { font-size: 44px; font-weight: 900; }
.panel h2 { font-size: 28px; font-weight: 800; }
.panel p { font-size: 19px; line-height: 1.45; margin: 0 0 16px; }
.row { display: flex; gap: 16px; align-items: center; }
.col { display: flex; flex-direction: column; gap: 14px; }
.x-close { position: absolute; right: 18px; top: 16px; }

/* main menu */
.menu { position: absolute; inset: 0; display: flex; align-items: center; }
.menu .art { position: absolute; left: 90px; top: 70px; width: 760px; height: 760px; border-radius: 34px; overflow: hidden;
  border: 7px solid #fff8e1; box-shadow: 0 30px 60px rgba(0,0,0,.55); transform: rotate(-2deg); animation: artFloat 6s ease-in-out infinite; }
.menu .art img { width: 100%; height: 100%; display: block; }
@keyframes artFloat { 50% { transform: rotate(-1deg) translateY(-8px); } }
.menu .side { position: absolute; left: 930px; top: 150px; width: 560px; display: flex; flex-direction: column; gap: 22px; }
.menu .side .btn { width: 100%; font-size: 30px; padding: 18px; }
.menu .meta { display: flex; gap: 14px; justify-content: center; margin-top: 6px; }
.menu .foot { position: absolute; right: 30px; bottom: 18px; font: 600 15px var(--font-b); color: rgba(255,255,255,.75); text-shadow: 0 1px 2px #000; }

/* language */
.lang .panel { display: flex; gap: 26px; padding: 40px; }
.lang .btn { width: 280px; font-size: 32px; padding: 26px; }

/* level select */
.levels .panel { width: 1180px; }
.lvl-cards { display: flex; gap: 30px; justify-content: center; margin: 12px 0 18px; }
.lvl-card { width: 520px; border-radius: 20px; overflow: hidden; border: 5px solid #d7b074; background: #2a1b10; cursor: pointer; transition: transform .15s, box-shadow .15s; position: relative; }
.lvl-card:hover { transform: translateY(-6px) rotate(-.5deg); box-shadow: 0 18px 30px rgba(0,0,0,.5); }
.lvl-card.sel { border-color: #76ff03; box-shadow: 0 0 0 4px rgba(118,255,3,.35), 0 18px 30px rgba(0,0,0,.5); }
.lvl-card canvas { width: 100%; height: 250px; display: block; }
.lvl-card .info { padding: 14px 18px; }
.lvl-card .info h3 { font: 900 30px var(--font-h); margin: 0 0 4px; color: #fff59d; }
.lvl-card .info p { font-size: 17px; margin: 0 0 6px; }
.lvl-card .best { font: 800 17px var(--font-h); color: #b9f6ca; }
.lvl-card.locked { cursor: not-allowed; }
.lvl-card.locked canvas { filter: grayscale(1) brightness(.45); }
.lvl-card .lock { position: absolute; left: 0; right: 0; top: 70px; text-align: center; font: 900 22px var(--font-h); padding: 0 30px; text-shadow: 0 2px 4px #000; }
.lvl-card .lock span { font-size: 60px; display: block; }
.checkpoints { display: flex; gap: 10px; align-items: center; justify-content: center; margin-bottom: 18px; font: 800 20px var(--font-h); }
.checkpoints .btn.sel { outline: 4px solid #76ff03; }

/* mutation tree */
.tree .panel { position: absolute; inset: 26px; padding: 18px 24px; display: flex; flex-direction: column; }
.tree-head { display: flex; align-items: center; gap: 18px; }
.tree-head h1 { margin: 0; font-size: 38px; }
.tabs { display: flex; gap: 10px; margin-left: 20px; }
.tabs .btn.on { outline: 4px solid #fff59d; }
.tree-res { margin-left: auto; margin-right: 70px; display: flex; gap: 12px; }
.tree-sub { font-size: 16px; color: #d7ccc8; margin: 6px 0 8px; }
.tree-view { position: relative; flex: 1; border-radius: 18px; overflow: hidden; cursor: grab; border: 3px solid rgba(215,176,116,.5);
  background: radial-gradient(circle at 50% 50%, #2f4a1f 0%, #16240e 70%, #0d1608 100%); }
.tree-view.grabbing { cursor: grabbing; }
.tree-layer { position: absolute; left: 0; top: 0; width: 0; height: 0; }
.tree-layer svg { position: absolute; left: -1200px; top: -800px; width: 2400px; height: 1600px; overflow: visible; pointer-events: none; }
.node { position: absolute; width: 88px; height: 88px; margin: -44px 0 0 -44px; border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: 38px;
  background: radial-gradient(circle at 35% 30%, #5d4a3a, #2a1b10 75%); border: 5px solid var(--c);
  box-shadow: 0 6px 14px rgba(0,0,0,.55), inset 0 3px 0 rgba(255,255,255,.18); transition: transform .12s; }
.node:hover { transform: scale(1.12); }
.node.locked { filter: grayscale(1) brightness(.55); cursor: default; }
.node.can { animation: nodeGlow 1.4s ease-in-out infinite; }
.node.max { background: radial-gradient(circle at 35% 30%, #fff59d, #ff8f00 80%); border-color: #fff8e1; }
@keyframes nodeGlow { 50% { box-shadow: 0 0 22px 6px var(--c), inset 0 3px 0 rgba(255,255,255,.18); } }
.node .lv { position: absolute; bottom: -12px; left: 50%; transform: translateX(-50%); background: #1b130c; border: 2px solid var(--c); border-radius: 10px;
  font: 800 13px var(--font-h); color: #fff; padding: 1px 8px; white-space: nowrap; }
.node .nm { position: absolute; top: 96px; left: 50%; transform: translateX(-50%); width: 150px; text-align: center; font: 800 14px/1.1 var(--font-h); color: #fff8e1; text-shadow: 0 2px 3px #000; pointer-events: none; }
.node.core { width: 120px; height: 120px; margin: -60px 0 0 -60px; font-size: 56px; cursor: default; background: radial-gradient(circle at 35% 30%, #b9f6ca, #1b5e20 80%); border-color: #69f0ae; }
.node.bought { animation: bought .45s ease; }
@keyframes bought { 40% { transform: scale(1.35) rotate(8deg); } }
.evo-grid { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; padding: 6px; }
.evo-row { display: flex; gap: 14px; align-items: center; background: rgba(0,0,0,.28); border-radius: 16px; padding: 10px 14px; border: 2px solid rgba(215,176,116,.35); }
.evo-row canvas { width: 90px; height: 75px; border-radius: 12px; background: rgba(255,255,255,.08); }
.evo-row .nm { font: 900 20px var(--font-h); color: #fff59d; width: 170px; }
.evo-row .opts { display: flex; gap: 10px; flex: 1; }
.evo-opt { flex: 1; border-radius: 12px; padding: 8px 10px; background: rgba(255,255,255,.06); border: 2px solid rgba(255,255,255,.12); font-size: 14px; line-height: 1.25; }
.evo-opt .btn { margin-top: 6px; width: 100%; }
.evo-opt.owned { border-color: #69f0ae; background: rgba(105,240,174,.12); }
.evo-row.locked { opacity: .45; }

/* reward / boons */
.reward { flex-direction: column; }
.reward h1 { font: 900 56px var(--font-h); color: #fff59d; text-shadow: 0 5px 0 #6d3c00; margin: 0; }
.reward .sub { font: 800 22px var(--font-h); margin: 6px 0 26px; text-shadow: 0 2px 4px #000; }
.boons { display: flex; gap: 34px; perspective: 1200px; }
.boon { width: 250px; height: 340px; border-radius: 22px; cursor: pointer; position: relative; transform-style: preserve-3d;
  animation: flipIn .6s cubic-bezier(.2,.9,.3,1.1) backwards; transition: transform .15s; }
.boon:hover { transform: translateY(-14px) scale(1.05); }
.boon .front { position: absolute; inset: 0; border-radius: 22px; padding: 22px 18px; display: flex; flex-direction: column; align-items: center; text-align: center;
  background: linear-gradient(180deg, #fffdf3, #efd9a8); border: 5px solid #6d4c41; color: #3e2723; box-shadow: 0 16px 30px rgba(0,0,0,.5); backface-visibility: hidden; }
.boon.rare .front { border-color: #1e88e5; background: linear-gradient(180deg, #f3f9ff, #bbdefb); }
.boon.epic .front { border-color: #8e24aa; background: linear-gradient(180deg, #fdf3ff, #e1bee7); }
.boon .ic { font-size: 74px; margin: 6px 0 10px; filter: drop-shadow(0 5px 3px rgba(0,0,0,.3)); }
.boon .nm { font: 900 25px/1.1 var(--font-h); margin-bottom: 10px; }
.boon .ds { font: 700 18px/1.35 var(--font-b); }
.boon .rar { margin-top: auto; font: 800 14px var(--font-h); text-transform: uppercase; letter-spacing: 2px; opacity: .7; }
.boon.chosen { animation: chosen .6s ease forwards; }
.boon.gone { animation: gone .4s ease forwards; }
@keyframes flipIn { from { transform: rotateY(180deg) translateY(120px) scale(.6); opacity: 0; } }
@keyframes chosen { 40% { transform: scale(1.15) translateY(-20px); } 100% { transform: scale(1.3) translateY(-60px); opacity: 0; } }
@keyframes gone { to { transform: translateY(160px) rotate(10deg); opacity: 0; } }

/* pack opening (capsule screen) */
.capsule-wrap { position: relative; width: 420px; height: 480px; display: flex; align-items: center; justify-content: center; flex-direction: column; }

.pack { width: 240px; height: 320px; border-radius: 20px; position: relative; cursor: default; perspective: 800px;
  border: 5px solid rgba(255,255,255,.55); box-shadow: 0 24px 50px rgba(0,0,0,.55), inset 0 3px 0 rgba(255,255,255,.4), inset 0 -24px 40px rgba(0,0,0,.25);
  display: flex; flex-direction: column; align-items: center; justify-content: center; overflow: hidden; }
.pack::before { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(135deg, rgba(255,255,255,.12) 0 3px, transparent 3px 14px); pointer-events: none; }
.pack::after { content: ''; position: absolute; left: 10%; right: 10%; top: 0; height: 22px; border-bottom: 3px dashed rgba(255,255,255,.65); }
.pack-icon { font-size: 92px; filter: drop-shadow(0 6px 6px rgba(0,0,0,.4)); }
.pack-label { font: 900 20px var(--font-h); color: #fff; text-shadow: 0 3px 0 rgba(0,0,0,.4); letter-spacing: 1px; margin-top: 10px; text-align: center; padding: 0 10px; }
.pack-seed { background: linear-gradient(160deg, #aeea00 0%, #689f38 45%, #33691e 100%); }
.pack-mutant { background: linear-gradient(160deg, #d1b3ff 0%, #7c4dff 45%, #311b92 100%); }
.pack-shine { position: absolute; top: -40%; left: -60%; width: 60%; height: 180%; background: linear-gradient(115deg, transparent 0%, rgba(255,255,255,.55) 45%, transparent 90%);
  transform: rotate(12deg); animation: packShine 2.6s ease-in-out infinite; }
@keyframes packShine { 0%, 20% { left: -60%; } 60%, 100% { left: 120%; } }

.pack.wobble { animation: packWobble 1s ease-in-out infinite; }
@keyframes packWobble { 0%,100% { transform: rotate(0) translateY(0); } 25% { transform: rotate(-3deg) translateY(-4px); } 50% { transform: rotate(0) translateY(0); } 75% { transform: rotate(3deg) translateY(-4px); } }
.pack.tear { animation: packTear .95s cubic-bezier(.3,.1,.3,1) forwards; }
@keyframes packTear {
  0% { transform: scale(1) rotate(0); }
  15% { transform: scale(1.06) rotate(-4deg); }
  30% { transform: scale(1.06) rotate(4deg); }
  45% { transform: scale(1.1) rotate(-5deg); }
  60% { transform: scale(1.15) rotate(0); filter: brightness(1.4); }
  75% { transform: scale(1.5) rotate(0); opacity: .6; filter: brightness(2.2); }
  100% { transform: scale(2.1) rotate(0); opacity: 0; filter: brightness(3); }
}

.burst { position: absolute; left: 50%; top: 50%; width: 60px; height: 60px; margin: -30px 0 0 -30px; border-radius: 50%;
  background: radial-gradient(circle, #fff 0%, #fff59d 35%, transparent 70%); pointer-events: none;
  animation: burstOut .5s ease-out forwards; }
@keyframes burstOut { from { transform: scale(0); opacity: 1; } to { transform: scale(9); opacity: 0; } }

.reveal { width: 300px; border-radius: 22px; padding: 18px; text-align: center; background: linear-gradient(180deg, #fffdf3, #f3e3bd); border: 5px solid #4e342e; color: #3e2723;
  box-shadow: 0 20px 40px rgba(0,0,0,.5); position: relative; }
.reveal.card-fly { animation: cardFly .6s cubic-bezier(.2,.7,.25,1.15) backwards; }
@keyframes cardFly { 0% { transform: translateY(90px) scale(.3) rotateY(180deg); opacity: 0; } 60% { opacity: 1; } 100% { transform: translateY(0) scale(1) rotateY(0); opacity: 1; } }
.reveal.rare { border-color: #ff8f00; background: linear-gradient(180deg, #fffdf3, #ffe082); box-shadow: 0 20px 40px rgba(0,0,0,.5), 0 0 0 4px rgba(255,193,7,.35), 0 0 50px rgba(255,193,7,.55); animation: cardFly .6s cubic-bezier(.2,.7,.25,1.15) backwards, rareGlow 1.6s ease-in-out .6s infinite; }
.reveal.common { box-shadow: 0 20px 40px rgba(0,0,0,.5), 0 0 0 4px rgba(105,240,174,.3), 0 0 40px rgba(105,240,174,.4); animation: cardFly .6s cubic-bezier(.2,.7,.25,1.15) backwards, commonGlow 1.6s ease-in-out .6s infinite; }
@keyframes rareGlow { 0%,100% { box-shadow: 0 20px 40px rgba(0,0,0,.5), 0 0 0 4px rgba(255,193,7,.35), 0 0 50px rgba(255,193,7,.55); } 50% { box-shadow: 0 20px 40px rgba(0,0,0,.5), 0 0 0 6px rgba(255,193,7,.55), 0 0 80px rgba(255,193,7,.85); } }
@keyframes commonGlow { 0%,100% { box-shadow: 0 20px 40px rgba(0,0,0,.5), 0 0 0 4px rgba(105,240,174,.3), 0 0 40px rgba(105,240,174,.4); } 50% { box-shadow: 0 20px 40px rgba(0,0,0,.5), 0 0 0 5px rgba(105,240,174,.5), 0 0 60px rgba(105,240,174,.65); } }
.reveal .hd { font: 900 26px var(--font-h); color: #e65100; margin-bottom: 6px; }
.reveal canvas { width: 220px; height: 180px; border-radius: 16px; background: radial-gradient(circle at 50% 70%, #fffde7, #aed581); border: 3px solid #33691e; position: relative; overflow: hidden; }
.reveal.rare canvas { background: radial-gradient(circle at 50% 70%, #fffde7, #ffca28); border-color: #ff8f00; }
.reveal .nm { font: 900 24px var(--font-h); margin: 8px 0 4px; }
.reveal .ds { font: 700 16px/1.35 var(--font-b); }
.rays { position: absolute; width: 700px; height: 700px; left: 50%; top: 50%; margin: -350px 0 0 -350px; pointer-events: none;
  background: repeating-conic-gradient(rgba(255,241,118,.28) 0 10deg, transparent 10deg 20deg); border-radius: 50%;
  mask: radial-gradient(circle, #000 20%, transparent 70%); -webkit-mask: radial-gradient(circle, #000 20%, transparent 70%); animation: spin 12s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* intro (new enemy / plant) */
.intro .panel { width: 820px; display: flex; gap: 26px; align-items: center; }
.intro canvas { width: 250px; height: 250px; border-radius: 20px; background: radial-gradient(circle at 50% 60%, #aed581, #33691e); border: 4px solid #d7b074; flex: none; }
.intro .kicker { font: 900 18px var(--font-h); color: #ffab40; text-transform: uppercase; letter-spacing: 2px; }
.intro h2 { font-size: 36px; margin: 2px 0 10px; }
.intro .counter { background: rgba(105,240,174,.12); border: 2px solid rgba(105,240,174,.5); border-radius: 12px; padding: 10px 14px; font-size: 18px; margin: 0 0 16px; }
.intro .counter b { color: #b9f6ca; font-family: var(--font-h); }

/* game over / pause / settings */
.over .panel { width: 700px; text-align: center; }
.over h1 { color: #ff8a80; }
.stats { display: grid; grid-template-columns: 1fr auto; gap: 6px 30px; text-align: left; font-size: 20px; background: rgba(0,0,0,.25); border-radius: 16px; padding: 14px 22px; margin: 0 auto 20px; width: 440px; }
.stats b { font-family: var(--font-h); color: #fff59d; text-align: right; }
.btn-row { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.settings .panel { width: 640px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,.08); font: 700 19px var(--font-b); }
.set-row input[type=range] { width: 260px; accent-color: #9ccc65; height: 24px; }
.pause .panel { width: 440px; text-align: center; }
.pause .col .btn { width: 100%; }

/* almanac */
.almanac .panel { position: absolute; inset: 26px; display: flex; flex-direction: column; padding: 18px 24px; }
.alm-body { flex: 1; display: flex; gap: 20px; min-height: 0; margin-top: 12px; }
.alm-grid { width: 620px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; align-content: start; overflow-y: auto; padding: 4px; }
.alm-item { border-radius: 14px; background: rgba(0,0,0,.28); border: 3px solid rgba(215,176,116,.4); cursor: pointer; text-align: center; padding: 6px; transition: transform .1s; }
.alm-item:hover { transform: scale(1.05); }
.alm-item.sel { border-color: #fff59d; }
.alm-item canvas { width: 120px; height: 100px; }
.alm-item div { font: 800 14px var(--font-h); }
.alm-item.unseen canvas { filter: brightness(0) opacity(.5); }
.alm-detail { flex: 1; background: rgba(0,0,0,.25); border-radius: 18px; padding: 20px 26px; overflow-y: auto; font-size: 19px; line-height: 1.45; }
.alm-detail canvas { float: right; width: 220px; height: 190px; margin: 0 0 10px 16px; border-radius: 16px; background: radial-gradient(circle at 50% 60%, #aed581, #33691e); }
.alm-detail h2 { font-size: 34px; }

/* tutorial */
#tutorial { position: absolute; inset: 0; z-index: 150; pointer-events: none; }
.dim { position: absolute; background: rgba(0,0,0,.45); pointer-events: none; animation: fadeIn .3s ease; }
.spot { position: absolute; border-radius: 18px; border: 4px solid #fff59d; animation: spotPulse 1.3s ease-in-out infinite; }
@keyframes spotPulse { 50% { border-color: #ffffff; box-shadow: 0 0 30px 8px rgba(255,245,157,.8); } }
.bubble { position: absolute; width: 440px; pointer-events: auto; padding: 18px 22px 16px 22px; border-radius: 20px;
  background: linear-gradient(180deg, #fffdf3, #f3e3bd); color: #3e2723; border: 4px solid #4e342e;
  font: 700 19px/1.4 var(--font-b); box-shadow: 0 18px 36px rgba(0,0,0,.5); animation: popIn .3s cubic-bezier(.2,.9,.3,1.3); }
.bubble .who { position: absolute; left: -38px; top: -38px; width: 74px; height: 74px; border-radius: 50%; background: #fff8e1; border: 4px solid #4e342e; overflow: hidden; }
.bubble .who canvas { width: 74px; height: 74px; }
.bubble .acts { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; gap: 10px; }
.bubble .skip { font: 700 14px var(--font-b); color: #8d6e63; cursor: pointer; text-decoration: underline; background: none; border: 0; }
.bubble .hint { font: 800 14px var(--font-h); color: #8d6e63; }
.arrow { position: absolute; font-size: 54px; filter: drop-shadow(0 4px 3px rgba(0,0,0,.5)); animation: bob .8s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(12px); } }

/* =================================================================== v2.1: seeds, packs, lanes */

/* ---------- seed cards in the hand */
.card-potato .card-art { background: radial-gradient(circle at 50% 70%, #fff8e1, #ffe0b2 60%, #a1662f); }
.card-iceberry .card-art { background: radial-gradient(circle at 50% 70%, #e8eaf6, #9fa8da 60%, #283593); }
.card-lily .card-art { background: radial-gradient(circle at 50% 70%, #e0f7fa, #80deea 60%, #00838f); }
.card-count { position: absolute; left: -2px; top: -2px; min-width: 50px; height: 34px; padding: 0 10px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(#e8f5e9, #a5d6a7); border: 3px solid #1b5e20; border-radius: 0 0 14px 0; font: 900 19px var(--font-h); color: #1b5e20; }
.card-count.full { background: linear-gradient(#fff59d, #ffc107); border-color: #6d3c00; color: #4e2600; }
.card-rar { position: absolute; left: 0; right: 0; bottom: 0; height: 22px; display: flex; align-items: center; justify-content: center;
  font: 900 11px var(--font-h); letter-spacing: 1.5px; text-transform: uppercase; color: #fff; background: #689f38; text-shadow: 0 1px 0 rgba(0,0,0,.4); }
.card-face.rar-rare { border-color: #01579b; }
.card-face.rar-rare .card-rar { background: linear-gradient(90deg, #0288d1, #29b6f6, #0288d1); }
.card-face.rar-epic { border-color: #4a148c; box-shadow: 0 10px 20px rgba(0,0,0,.45), inset 0 0 0 3px #f3e5f5, 0 0 16px rgba(186,104,200,.55); }
.card-face.rar-epic .card-rar { background: linear-gradient(90deg, #7b1fa2, #ba68c8, #7b1fa2); }
.card-face.rar-legendary { border-color: #e65100; background: linear-gradient(180deg, #fffde7 0%, #ffe082 100%);
  box-shadow: 0 10px 20px rgba(0,0,0,.45), inset 0 0 0 3px #fff8e1, 0 0 22px rgba(255,179,0,.75); }
.card-face.rar-legendary .card-rar { background: linear-gradient(90deg, #ff8f00, #ffd54f, #ff8f00); color: #4e2600; text-shadow: none; }
.card-face.golden::after { content: ''; position: absolute; inset: 0; pointer-events: none; mix-blend-mode: overlay;
  background: linear-gradient(115deg, transparent 20%, rgba(255,255,255,.75) 45%, transparent 60%); background-size: 250% 100%; animation: goldSweep 2.4s linear infinite; }
@keyframes goldSweep { from { background-position: 150% 0; } to { background-position: -100% 0; } }
.card.gain .card-count { animation: countPop .5s ease; }
@keyframes countPop { 40% { transform: scale(1.45); filter: brightness(1.3); } }
.card-name { top: 116px; }
.hand-empty { position: absolute; left: 800px; top: 838px; transform: translateX(-50%); white-space: nowrap; padding: 10px 22px; border-radius: 16px;
  background: rgba(40,20,10,.85); border: 3px solid #aed581; font: 800 20px var(--font-h); color: #fff8e1; box-shadow: 0 8px 18px rgba(0,0,0,.4);
  pointer-events: none; }


/* ---------- tooltips */
.tt-rar { font: 900 13px var(--font-h); letter-spacing: 1.5px; text-transform: uppercase; padding: 4px 10px; border-radius: 10px; white-space: nowrap;
  color: #fff; background: var(--rc); box-shadow: 0 0 12px var(--rc); text-shadow: 0 1px 0 rgba(0,0,0,.45); }
.rdot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-right: 8px; vertical-align: 0; }

/* ---------- almanac / tutorial */
.alm-plant { position: relative; border-color: var(--rc); }
.alm-m { position: absolute; right: 8px; top: 6px; font: 900 14px var(--font-h); color: #ffd54f; text-shadow: 0 1px 2px #000; }
.bubble .step { position: absolute; right: 14px; top: -14px; padding: 2px 10px; border-radius: 10px; background: #4e342e; color: #fff59d; font: 900 13px var(--font-h); }

/* ---------- pack opening show */
.pack-show { flex-direction: column; background: radial-gradient(circle at 50% 45%, rgba(40,30,10,.72), rgba(8,10,4,.9)); }
.pack-stage { position: relative; width: 1600px; height: 900px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.pack-stage .rays { opacity: 0; transition: opacity .5s; width: 1100px; height: 1100px; margin: -550px 0 0 -550px;
  background: repeating-conic-gradient(color-mix(in srgb, var(--rc) 32%, transparent) 0 9deg, transparent 9deg 18deg); }
.pack-stage.rays-on .rays { opacity: 1; }
.pack-stage .burst { background: radial-gradient(circle, #fff 0%, var(--rc) 40%, transparent 70%); z-index: 3; }
.pack-stage.flash-gold::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle, rgba(255,241,118,.8), rgba(255,179,0,0) 70%); animation: burstFlash .9s ease-out forwards; }
@keyframes burstFlash { from { opacity: 1; } to { opacity: 0; } }

.pack-show .pack { position: absolute; left: 50%; top: 50%; margin: -160px 0 0 -120px; cursor: pointer; }
.pack-count { font: 800 15px var(--font-h); color: rgba(255,255,255,.9); margin-top: 4px; }
.pack-tap { position: absolute; bottom: 14px; left: 0; right: 0; text-align: center; font: 800 13px var(--font-h); color: #fff; opacity: .85; }
.pack-top { position: absolute; left: 0; right: 0; top: 0; height: 26px; z-index: 2;
  background: linear-gradient(180deg, rgba(255,255,255,.45), rgba(255,255,255,.12)); border-bottom: 3px dashed rgba(255,255,255,.75); }
/* the shake is a tease: faster, stronger and glowing in the best rarity's colour */
.pack.pack-in { animation: packPop .45s cubic-bezier(.2,.8,.3,1.35) both, packShake var(--spd, .9s) ease-in-out .45s infinite; filter: drop-shadow(0 0 var(--gl, 0px) var(--rc)); }
.pack.shake-common { --amp: 2.5; --spd: 1s; --gl: 0px; }
.pack.shake-rare { --amp: 4; --spd: .6s; --gl: 16px; }
.pack.shake-epic { --amp: 6; --spd: .38s; --gl: 26px; }
.pack.shake-legendary { --amp: 8; --spd: .22s; --gl: 40px; }
@keyframes packPop { from { transform: scale(.2) rotate(-12deg); opacity: 0; } }
@keyframes packShake {
  0%, 100% { transform: rotate(0) translateY(0); }
  25% { transform: rotate(calc(var(--amp) * -1deg)) translateY(-4px) scale(1.02); }
  75% { transform: rotate(calc(var(--amp) * 1deg)) translateY(-4px) scale(1.02); }
}
.pack.tear .pack-top { animation: topOff .45s cubic-bezier(.3,.1,.4,1) forwards; }
@keyframes topOff { to { transform: translate(-70px, -190px) rotate(-38deg); opacity: 0; } }
.pack-show .pack.tear { animation: packBurst .45s ease-in forwards; }
@keyframes packBurst { 40% { transform: scale(1.12); filter: brightness(1.6); } 100% { transform: scale(1.5); opacity: 0; filter: brightness(3); } }

.pack-cards { position: relative; z-index: 4; display: flex; gap: 20px; perspective: 1400px; margin-top: 10px; }
.pcard { position: relative; width: 210px; height: 310px; cursor: pointer; opacity: 0; perspective: 1100px;
  transform: translateX(var(--fx)) translateY(30px) scale(.22) rotate(-24deg);
  transition: transform .6s cubic-bezier(.2,.8,.3,1.25), opacity .3s; }
.pcard.out { opacity: 1; transform: none; }
.pcard.out:not(.flipped):hover { transform: translateY(-10px) scale(1.03); }
.pcard.collect { transform: translateY(560px) scale(.3) rotate(10deg) !important; opacity: 0; transition: transform .5s ease-in, opacity .5s ease-in; }
.pcard-inner { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform .65s cubic-bezier(.3,1.35,.5,1); }
.pcard.flipped .pcard-inner { transform: rotateY(180deg); }
.pcard-back, .pcard-front { position: absolute; inset: 0; border-radius: 20px; backface-visibility: hidden; -webkit-backface-visibility: hidden; overflow: hidden; }
.pcard-back { display: flex; align-items: center; justify-content: center; border: 5px solid #fff8e1;
  background: repeating-linear-gradient(45deg, rgba(255,255,255,.08) 0 10px, transparent 10px 20px), radial-gradient(circle, #6d4c41, #2e1b10);
  box-shadow: 0 16px 30px rgba(0,0,0,.55); }
.pcard-back span { font-size: 70px; filter: drop-shadow(0 4px 4px rgba(0,0,0,.5)); }
/* the back already glows in the rarity colour: a teaser before the flip */
.pcard.rar-rare .pcard-back { box-shadow: 0 16px 30px rgba(0,0,0,.55), inset 0 0 26px #29b6f6; border-color: #b3e5fc; }
.pcard.rar-epic .pcard-back { box-shadow: 0 16px 30px rgba(0,0,0,.55), inset 0 0 34px #ba68c8; border-color: #e1bee7; animation: backPulse 1s ease-in-out infinite; }
.pcard.rar-legendary .pcard-back { box-shadow: 0 16px 30px rgba(0,0,0,.55), inset 0 0 44px #ffb300; border-color: #ffe082; animation: backPulse .6s ease-in-out infinite; }
@keyframes backPulse { 50% { filter: brightness(1.35); } }
.pcard-front { transform: rotateY(180deg); display: flex; flex-direction: column; align-items: center; padding: 34px 12px 10px;
  background: linear-gradient(180deg, #fffdf3, #f3e3bd); border: 5px solid #689f38; color: #3e2723; box-shadow: 0 16px 30px rgba(0,0,0,.55); }
.pcard.rar-rare .pcard-front { border-color: #0288d1; background: linear-gradient(180deg, #f3faff, #b3e5fc); }
.pcard.rar-epic .pcard-front { border-color: #8e24aa; background: linear-gradient(180deg, #fdf3ff, #e1bee7); }
.pcard.rar-legendary .pcard-front { border-color: #ff8f00; background: linear-gradient(180deg, #fffde7, #ffd54f); }
.pc-rar { position: absolute; left: 0; right: 0; top: 0; height: 28px; display: flex; align-items: center; justify-content: center; font: 900 14px var(--font-h);
  letter-spacing: 2px; text-transform: uppercase; color: #fff; background: #689f38; text-shadow: 0 1px 0 rgba(0,0,0,.4); }
.pcard.rar-rare .pc-rar { background: #0288d1; }
.pcard.rar-epic .pc-rar { background: #8e24aa; }
.pcard.rar-legendary .pc-rar { background: linear-gradient(90deg, #ff8f00, #ffd54f, #ff8f00); color: #4e2600; text-shadow: none; }
.pcard-front canvas { width: 176px; height: 146px; border-radius: 14px; background: radial-gradient(circle at 50% 70%, #fffde7, #aed581); border: 3px solid rgba(62,39,35,.45); flex: none; }
.pcard.rar-rare .pcard-front canvas { background: radial-gradient(circle at 50% 70%, #ffffff, #81d4fa); }
.pcard.rar-epic .pcard-front canvas { background: radial-gradient(circle at 50% 70%, #ffffff, #ce93d8); }
.pcard.rar-legendary .pcard-front canvas { background: radial-gradient(circle at 50% 70%, #fffde7, #ffb300); }
.pc-new { position: absolute; right: -34px; top: 38px; transform: rotate(35deg); background: #e53935; color: #fff; font: 900 14px var(--font-h); letter-spacing: 1px;
  padding: 3px 40px; box-shadow: 0 3px 6px rgba(0,0,0,.35); z-index: 2; }
.pcard.flipped .pc-new { animation: newPop .5s .45s cubic-bezier(.2,.8,.3,1.5) backwards; }
@keyframes newPop { from { transform: rotate(35deg) scale(0); } }
.pc-name { font: 900 20px/1.1 var(--font-h); margin: 8px 0 2px; text-align: center; }
.pc-gold { font: 800 12px/1.2 var(--font-b); color: #bf360c; text-align: center; }
.pc-mast { width: 100%; margin-top: auto; font: 800 13px var(--font-h); color: #5d4037; }
.pc-mast .bar { height: 8px; border-radius: 5px; background: rgba(0,0,0,.18); overflow: hidden; margin-top: 3px; }
.pc-mast .bar i { display: block; height: 100%; background: linear-gradient(90deg, #ffd54f, #ff8f00); }
.pc-mast.up span { color: #e65100; display: inline-block; }
.pcard.flipped .pc-mast.up span { animation: countPop .6s ease .6s backwards; }
.pc-foot { width: 100%; margin-top: 6px; padding: 4px 8px; border-radius: 10px; background: rgba(27,94,32,.12); font: 800 13px var(--font-h); color: #1b5e20; text-align: center; }
.pc-foot.compost { background: rgba(105,240,174,.25); color: #004d40; }
/* rarity effects on flip */
/* (glow via box-shadow: a CSS filter on the 3D card would flatten it and break the flip) */
.pcard.fx-rare .pcard-front { box-shadow: 0 16px 30px rgba(0,0,0,.55), 0 0 26px #29b6f6; }
.pcard.fx-epic .pcard-front { box-shadow: 0 16px 30px rgba(0,0,0,.55), 0 0 34px #ba68c8, 0 0 70px rgba(186,104,200,.5); }
.pcard.fx-legendary .pcard-front { box-shadow: 0 16px 30px rgba(0,0,0,.55), 0 0 44px #ffb300, 0 0 90px rgba(255,179,0,.55); }
.pcard.fx-epic::before, .pcard.fx-legendary::before { content: ''; position: absolute; left: 50%; top: 50%; width: 520px; height: 520px; margin: -260px 0 0 -260px; z-index: -1; border-radius: 50%;
  background: repeating-conic-gradient(rgba(206,147,216,.4) 0 8deg, transparent 8deg 16deg); animation: spin 8s linear infinite;
  mask: radial-gradient(circle, #000 18%, transparent 68%); -webkit-mask: radial-gradient(circle, #000 18%, transparent 68%); pointer-events: none; }
.pcard.fx-legendary::before { background: repeating-conic-gradient(rgba(255,213,79,.55) 0 8deg, transparent 8deg 16deg); animation: spin 5s linear infinite; }
.pcard.fx-legendary .pcard-front::after { content: ''; position: absolute; inset: 0; pointer-events: none; mix-blend-mode: overlay;
  background: linear-gradient(115deg, transparent 20%, rgba(255,255,255,.85) 45%, transparent 60%); background-size: 250% 100%; animation: goldSweep 1.8s linear infinite; }
.pack-actions { position: relative; z-index: 5; margin-top: 30px; min-height: 60px; display: flex; gap: 14px; }
/* belt and braces for the flip: swap the faces half-way through the turn, so the
   reveal works even where backface-visibility is ignored (software rendering) */
.pcard-back { visibility: visible; transition: visibility 0s linear .18s; }
.pcard.flipped .pcard-back { visibility: hidden; }
.pcard-front { visibility: hidden; transition: visibility 0s linear .18s; }
.pcard.flipped .pcard-front { visibility: visible; }
.alm-own { position: absolute; left: 8px; top: 6px; font: 900 14px var(--font-h); color: #b9f6ca; text-shadow: 0 1px 2px #000; }
.pill.seedcol { border-color: #aed581; color: #dcedc8; }
