/* Bee Haven — habillage cozy : papier kraft, bois poli, pastels miel / lavande / prairie. */
:root {
  --honey: #F6C453;
  --honey-d: #C98A1E;
  --lav: #B9A5E3;
  --meadow: #A8D58A;
  --cream: #FFF8EA;
  --kraft: #F3E3C7;
  --kraft-line: #E2C9A2;
  --kraft-shadow: #D9BC93;
  --ink: #5A3A22;
  --ink-soft: #8A6A50;
  --accent: #B0702A;
  font-family: 'Baloo 2', 'Trebuchet MS', system-ui, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; color: var(--ink); overscroll-behavior: none; }
body {
  display: flex; justify-content: center; align-items: center;
  background: #E9D8BA radial-gradient(rgba(176,122,74,.12) 2px, transparent 2.5px) 0 0 / 26px 26px;
  user-select: none; -webkit-user-select: none;
}
button { font: inherit; color: inherit; }
.hidden { display: none !important; }

/* ---------- Cadre portrait ---------- */
#app {
  position: relative; width: 100%; max-width: 430px; height: 100dvh;
  display: flex; flex-direction: column; overflow: hidden; background: var(--kraft);
}
@media (min-width: 500px) {
  #app {
    height: min(calc(100dvh - 40px), 900px); border-radius: 36px;
    box-shadow: 0 0 0 10px #FFF6E3, 0 0 0 13px var(--kraft-line), 0 24px 60px rgba(90,58,34,.28);
  }
}

.icon { display: inline-flex; width: 28px; height: 28px; flex: none; }
.icon svg { width: 100%; height: 100%; display: block; overflow: visible; }
.icon.sm { width: 20px; height: 20px; }
.icon.xs { width: 16px; height: 16px; }
.icon.lg { width: 44px; height: 44px; }

/* ---------- Barre du haut ---------- */
#topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 14px; min-height: 62px; z-index: 10;
  background: linear-gradient(#FFF3D3, #FBE3AE); border-bottom: 3px solid #E2C08A;
}
.money { display: flex; align-items: center; gap: 8px; }
.money > .icon { width: 36px; height: 36px; }
.money-text { display: flex; flex-direction: column; line-height: 1; }
#coins { font-size: 27px; font-weight: 800; letter-spacing: -.5px; }
#income { font-size: 13px; font-weight: 700; color: var(--ink-soft); margin-top: 2px; }
.side-money { display: flex; align-items: center; gap: 8px; }
.pill {
  display: flex; align-items: center; gap: 4px; padding: 2px 10px 2px 6px; font-weight: 800;
  background: var(--cream); border: 2.5px solid var(--kraft-line); border-radius: 999px;
}
.round-btn {
  width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--cream); border: 2.5px solid var(--kraft-line); box-shadow: 0 3px 0 var(--kraft-shadow); cursor: pointer;
}
.round-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--kraft-shadow); }

/* ---------- Le pré ---------- */
#scene {
  --sky1: #CDEBFF; --sky2: #FFF3D6; --grass: #A8D58A; --hill: #C6E5A4;
  position: relative; flex: 1 1 auto; min-height: 270px; overflow: hidden;
  background:
    radial-gradient(circle, rgba(255,255,255,.22) 0 2.5px, transparent 3px) 0 0 / 46px 38px,
    radial-gradient(circle, rgba(80,130,50,.13) 0 3px, transparent 3.5px) 20px 14px / 58px 44px,
    var(--grass);
}
.sky { position: absolute; left: 0; right: 0; top: 0; height: 24%; background: linear-gradient(var(--sky1), var(--sky2)); transition: filter 1s; }
.sun {
  position: absolute; right: 9%; top: 14%; width: 40px; height: 40px; border-radius: 50%;
  background: radial-gradient(#FFF6C8, #FFE07A 60%, #FFD45C);
  box-shadow: 0 0 0 8px rgba(255,224,122,.25), 0 0 0 18px rgba(255,224,122,.12);
}
.cloud { position: absolute; width: 70px; height: 22px; background: #fff; border-radius: 99px; opacity: .9; animation: drift 70s linear infinite; }
.cloud::before, .cloud::after { content: ''; position: absolute; background: #fff; border-radius: 50%; }
.cloud::before { left: 12px; top: -13px; width: 30px; height: 30px; }
.cloud::after { left: 34px; top: -8px; width: 24px; height: 24px; }
.cloud.c1 { top: 16%; animation-delay: -12s; }
.cloud.c2 { top: 42%; animation-delay: -48s; transform: scale(.75); }
@keyframes drift { from { left: -25%; } to { left: 110%; } }
.hills { position: absolute; left: 0; right: 0; bottom: 0; height: 50%; }
.hills::before, .hills::after { content: ''; position: absolute; border-radius: 50%; background: var(--hill); }
.hills::before { left: -20%; width: 85%; bottom: -70%; height: 170%; }
.hills::after { right: -25%; width: 90%; bottom: -80%; height: 165%; filter: brightness(.96); }

#grid {
  position: absolute; left: 2%; right: 2%; top: 17%; height: 60%;
  display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(2, 1fr); z-index: 2;
}
.slot { position: relative; container-type: size; }
.slot .patch {
  position: absolute; left: 4%; right: 4%; top: 52%; height: 38%; border-radius: 50%;
  background: radial-gradient(ellipse, rgba(110,165,72,.45), rgba(110,165,72,0) 70%);
}
.slot .fl {
  position: absolute; width: min(17cqw, 30cqh); transform-origin: 50% 100%;
  transform: translate(-50%, -100%); animation: sway 3.4s ease-in-out infinite; animation-delay: var(--d);
}
.slot .fl svg { width: 100%; display: block; overflow: visible; transition: filter .6s; }
@keyframes sway {
  0%, 100% { transform: translate(-50%, -100%) rotate(-4deg); }
  50% { transform: translate(-50%, -100%) rotate(4deg); }
}
#scene.raining .fl svg { filter: saturate(1.3) brightness(1.05); }
#scene.raining .fl { animation-duration: 1.8s; }
#scene.raining .sky { filter: saturate(.55) brightness(.9); }

.hive-wrap {
  position: absolute; left: 50%; top: 42%; width: min(56cqw, 74cqh); aspect-ratio: 1;
  transform: translate(-50%, -50%); background: none; border: none; padding: 0; cursor: pointer;
}
.hive { width: 100%; height: 100%; transform-origin: 50% 92%; }
.hive svg { width: 100%; height: 100%; display: block; overflow: visible; }
.slot.selected .hive-wrap::before {
  content: ''; position: absolute; left: 2%; right: 2%; bottom: -4%; height: 26%; border-radius: 50%; z-index: -1;
  background: radial-gradient(ellipse, rgba(255,255,255,.85), rgba(255,255,255,0) 70%);
}
.hive-svg .ec, .bee-svg .ec, .bear-svg .ec { display: none; }
.slot.full .hive-svg .eo { display: none; }
.slot.full .hive-svg .ec { display: inline; }

.gauge {
  position: absolute; left: 16%; right: 16%; bottom: -8%; height: 10px; overflow: hidden;
  background: var(--cream); border: 2px solid #6B4426; border-radius: 99px;
}
.gauge .fill {
  height: 100%; width: 100%; transform-origin: left center; transform: scaleX(0);
  background: repeating-linear-gradient(-45deg, #F6C453 0 6px, #FFDB73 6px 12px);
  animation: honeyflow 1.2s linear infinite;
}
@keyframes honeyflow { to { background-position: 17px 0; } }
.slot.full .gauge { border-color: var(--honey-d); animation: glow 1.1s ease-in-out infinite; }
.slot.full .hive-wrap::after {
  content: ''; position: absolute; right: 24%; bottom: -17%; width: 8px; height: 10px;
  background: var(--honey); border: 2px solid #6B4426; border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%;
  animation: drip 1.5s ease-in infinite;
}
@keyframes glow { 50% { box-shadow: 0 0 0 3px rgba(246,196,83,.55); } }
@keyframes drip {
  0% { transform: translateY(-6px) scale(.4); opacity: 0; }
  30% { transform: translateY(0) scale(1); opacity: 1; }
  100% { transform: translateY(12px) scale(.9); opacity: 0; }
}
.lvl {
  position: absolute; top: 0; right: -8%; padding: 0 7px; line-height: 19px; font-size: 11.5px; font-weight: 800;
  background: var(--cream); border: 2px solid #6B4426; border-radius: 99px; box-shadow: 0 2px 0 rgba(107,68,38,.25); white-space: nowrap;
}

.plot {
  position: absolute; inset: 14% 9% 12%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  border: 3px dashed rgba(107,68,38,.42); border-radius: 22px; background: rgba(255,248,234,.5); cursor: pointer; padding: 0;
}
.plot.buyable { animation: breathe 2.4s ease-in-out infinite; }
.plot .plus { font-size: 30px; font-weight: 800; line-height: .9; }
.plot-label { font-size: 12px; font-weight: 700; }
.plot-cost { display: flex; align-items: center; gap: 3px; font-size: 13px; font-weight: 800; }
.plot.dim { border-color: rgba(107,68,38,.12); background: transparent; cursor: default; animation: none; }
@keyframes breathe { 50% { transform: scale(1.04); } }

#stand-area { position: absolute; left: 0; right: 0; bottom: 0; height: 25%; z-index: 3; }
.stand { position: absolute; left: 50%; bottom: 5%; height: 92%; aspect-ratio: 140 / 112; transform: translateX(-50%); cursor: pointer; }
.stand svg { width: 100%; height: 100%; display: block; transform-origin: 50% 95%; }
.vendor { position: absolute; left: calc(50% + 16%); bottom: 46%; width: 36px; height: 36px; animation: hover 1.8s ease-in-out infinite; }
.vendor svg { width: 100%; height: 100%; display: block; }
@keyframes hover { 50% { transform: translateY(-6px) rotate(4deg); } }

/* ---------- Abeilles ---------- */
#bees { position: absolute; inset: 0; pointer-events: none; z-index: 5; }
.bee { position: absolute; left: 0; top: 0; will-change: transform; transition: opacity .15s; }
.bee svg { width: 100%; height: 100%; display: block; overflow: visible; }
.bee.inside { opacity: 0; }
.bee-svg { overflow: visible; }
.bee-svg .wings { transform-box: view-box; transform-origin: 24px 20px; animation: flap .09s linear infinite alternate; }
@keyframes flap { from { transform: scaleY(1); } to { transform: scaleY(.5); } }
.bee.sleeping .wings, .mini-bee .wings, .card-icon .wings, .dex-bee .wings { animation: none; }
.bee.sleeping .eo { display: none; }
.bee.sleeping .ec { display: inline; }

/* ---------- Événements ---------- */
#events-layer { position: absolute; inset: 0; pointer-events: none; z-index: 6; }
.bear { position: absolute; bottom: 3%; width: 24%; max-width: 110px; transform: translateX(-50%); pointer-events: auto; cursor: pointer; }
.bear svg { width: 100%; display: block; transform-origin: 50% 95%; }
.bear.walking svg { animation: waddle .45s ease-in-out infinite alternate; }
@keyframes waddle { from { transform: rotate(-5deg); } to { transform: rotate(5deg) translateY(-3px); } }
.bear.happy .eo { display: none; }
.bear.happy .ec { display: inline; }
.bear-bubble {
  position: absolute; bottom: 96%; left: 50%; transform: translateX(-50%); display: none; flex-direction: column; align-items: center; gap: 4px;
  padding: 6px 8px; background: var(--cream); border: 2.5px solid #6B4426; border-radius: 16px; font-size: 12px; font-weight: 700; white-space: nowrap;
}
.bear-bubble::after {
  content: ''; position: absolute; left: 50%; bottom: -8px; width: 12px; height: 12px; transform: translateX(-50%) rotate(45deg);
  background: var(--cream); border-right: 2.5px solid #6B4426; border-bottom: 2.5px solid #6B4426;
}
.bear.waiting .bear-bubble { display: flex; animation: popin .3s; }
.rainbow {
  position: absolute; left: 50%; top: 3%; width: 72%; transform: translateX(-50%); background: none; border: none; padding: 0;
  pointer-events: auto; cursor: pointer; opacity: .92; animation: fadein .8s, shimmer 1.6s ease-in-out infinite alternate; transition: opacity .6s;
}
.rainbow svg { width: 100%; display: block; }
.rainbow.fading { opacity: 0; }
@keyframes shimmer { to { filter: brightness(1.12) saturate(1.2); } }

#rain { position: absolute; inset: 0; pointer-events: none; z-index: 4; background: rgba(110,140,185,.13); transition: opacity .9s; overflow: hidden; }
#rain.fading { opacity: 0; }
.rain .cloud-svg { position: absolute; width: 36%; top: 1%; animation: cloudin 1.2s ease-out, bob 4s ease-in-out infinite alternate; }
.rain .rc1 { left: 2%; }
.rain .rc2 { left: 34%; top: -2%; animation-delay: 0s, -1.3s; }
.rain .rc3 { left: 64%; animation-delay: 0s, -2.4s; }
@keyframes cloudin { from { transform: translateY(-60px); opacity: 0; } }
@keyframes bob { to { transform: translateY(5px); } }
.drops {
  position: absolute; inset: -20%; transform: rotate(12deg);
  background-image: radial-gradient(1.2px 7px at 50% 50%, rgba(105,165,235,.8) 98%, transparent 100%);
  background-size: 22px 38px; animation: rainfall .42s linear infinite;
}
.drops.d2 { background-size: 31px 47px; background-position: 11px 9px; opacity: .65; animation: rainfall2 .58s linear infinite; }
@keyframes rainfall { to { background-position: 0 38px; } }
@keyframes rainfall2 { to { background-position: 11px 56px; } }

/* ---------- Tutoriel et toasts ---------- */
.tuto {
  position: absolute; left: 10px; right: 10px; top: 8px; z-index: 8; display: flex; align-items: center; gap: 8px;
  padding: 6px 10px; background: var(--cream); border: 3px solid var(--kraft-line); border-radius: 18px;
  box-shadow: 0 4px 0 var(--kraft-shadow); animation: popin .35s cubic-bezier(.3,1.4,.6,1);
  pointer-events: none; /* les taps traversent la bulle jusqu'aux ruches */
}
.tuto .tuto-ok { pointer-events: auto; }
.tuto-avatar { width: 46px; height: 46px; flex: none; }
.tuto-avatar svg { width: 100%; height: 100%; }
.tuto-text { display: flex; flex-direction: column; font-size: 13.5px; line-height: 1.25; font-weight: 600; }
.tuto-text b { font-size: 12px; color: var(--accent); }
.tuto-ok {
  margin-left: auto; padding: 4px 14px; border-radius: 12px; font-weight: 800; cursor: pointer;
  background: linear-gradient(#FFD978, #F2B33D); border: 2.5px solid var(--honey-d); box-shadow: 0 3px 0 #B87A16;
}
.toast {
  position: absolute; left: 50%; bottom: 27%; transform: translate(-50%, 16px); z-index: 9; max-width: 88%; width: max-content;
  padding: 8px 14px; border-radius: 16px; background: rgba(90,58,34,.93); color: #FFF6E3; font-size: 13.5px; font-weight: 600;
  text-align: center; line-height: 1.3; opacity: 0; transition: opacity .3s, transform .3s; pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Bande des boosts ---------- */
#strip {
  display: flex; align-items: center; gap: 8px; padding: 6px 10px; min-height: 50px;
  background: linear-gradient(#EFD9B4, var(--kraft)); border-top: 3px solid var(--kraft-shadow);
}
.pill-btn {
  display: flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; cursor: pointer; white-space: nowrap;
  background: linear-gradient(#EEF8FF, #CDE8FB); border: 2.5px solid #7FB0D3; box-shadow: 0 3px 0 #6A9CC0;
  font-weight: 800; font-size: 13px; color: #2F5A78;
}
.pill-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #6A9CC0; }
.pill-btn.disabled { opacity: .55; }
.ad-tag { font-size: 10px; background: #2F5A78; color: #fff; border-radius: 6px; padding: 0 5px; line-height: 16px; }
#chips { display: flex; gap: 6px; overflow-x: auto; flex: 1; scrollbar-width: none; }
.chip-boost {
  display: flex; align-items: center; gap: 4px; padding: 2px 8px; white-space: nowrap; font-size: 12px; font-weight: 700;
  background: var(--cream); border: 2px solid var(--kraft-line); border-radius: 99px;
}

/* ---------- Panneau d'achat ---------- */
#panel {
  flex: 0 0 auto; height: 35%; min-height: 220px; overflow-y: auto; padding: 10px 10px 14px;
  background-color: var(--kraft);
  background-image: radial-gradient(rgba(160,120,70,.09) 1px, transparent 1px), radial-gradient(rgba(160,120,70,.06) 1px, transparent 1px);
  background-size: 7px 7px, 11px 11px; background-position: 0 0, 3px 5px;
}
.kraft { background: var(--cream); border: 3px solid var(--kraft-line); border-radius: 18px; box-shadow: 0 3px 0 var(--kraft-shadow); }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-bottom: 8px; }
.chips { display: flex; gap: 4px; flex-wrap: wrap; }
.chip {
  min-width: 32px; height: 30px; padding: 0 8px; border-radius: 99px; cursor: pointer; font-weight: 800; font-size: 13px;
  background: var(--cream); border: 2.5px solid var(--kraft-line);
}
.chip.active { background: var(--honey); border-color: var(--honey-d); box-shadow: 0 2px 0 #B87A16; }
.hive-sum { padding: 8px 12px; margin-bottom: 8px; }
.hive-sum-title { font-weight: 800; font-size: 16px; line-height: 1.2; }
.hive-sum-sub { font-size: 12.5px; color: var(--ink-soft); font-weight: 600; }
.bee-row { display: flex; flex-wrap: wrap; gap: 2px; margin-top: 4px; }
.mini-bee { width: 24px; height: 24px; display: inline-block; }
.mini-bee svg { width: 100%; height: 100%; }

.card {
  display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 10px; margin-bottom: 8px;
  background: var(--cream); border: 3px solid var(--kraft-line); border-radius: 18px; box-shadow: 0 3px 0 var(--kraft-shadow);
}
.card.locked { opacity: .7; }
.card-icon { width: 40px; height: 40px; flex: none; display: flex; align-items: center; justify-content: center; }
.card-icon > svg, .card-icon .mini-hive svg { width: 40px; height: 40px; }
.card-icon .mini-flower svg { height: 40px; width: auto; }
.mini-hive, .mini-flower { display: flex; justify-content: center; }
.card-main { flex: 1; min-width: 0; }
.card-title { font-weight: 800; font-size: 14.5px; line-height: 1.2; }
.card-desc { font-size: 12px; color: var(--ink-soft); line-height: 1.25; font-weight: 600; }

.buy {
  flex: none; min-width: 94px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 4px 10px; border-radius: 16px; cursor: pointer; color: var(--ink);
  background: linear-gradient(#FFD978, #F2B33D); border: 3px solid var(--honey-d);
  box-shadow: 0 4px 0 #B87A16, inset 0 2px 0 rgba(255,255,255,.55); transition: transform .06s, box-shadow .06s;
}
.buy:active:not(.disabled) { transform: translateY(3px); box-shadow: 0 1px 0 #B87A16, inset 0 2px 0 rgba(255,255,255,.55); }
.buy .cost { display: flex; align-items: center; gap: 3px; font-weight: 800; font-size: 15px; line-height: 1.15; }
.buy-label { font-size: 11px; font-weight: 700; opacity: .8; line-height: 1.1; }
.buy.disabled { background: linear-gradient(#EFE3CC, #E2D2B5); border-color: #CDB894; box-shadow: 0 4px 0 #BBA57E; color: #9A8466; cursor: default; }
.buy.maxed, .buy.maxed.disabled { background: linear-gradient(#E3F3DC, #C4E6B7); border-color: #86B874; box-shadow: 0 4px 0 #6FA35E; color: #3E6B33; }
.buy.small { min-width: 0; padding: 2px 10px; border-radius: 12px; box-shadow: 0 3px 0 #B87A16; }
.buy.small .cost { font-size: 13px; }
.buy.big { width: 100%; padding: 10px; }
.buy.big .cost { font-size: 19px; }
.buy.danger { background: linear-gradient(#FFC2B6, #F08C7B); border-color: #C95F4E; box-shadow: 0 4px 0 #B04F3F; }
.buy.ad-btn { background: linear-gradient(#EEF8FF, #BFE0F7); border-color: #7FB0D3; box-shadow: 0 4px 0 #6A9CC0; color: #2F5A78; }

.section-title { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px; margin: 2px 2px 8px; font-weight: 800; font-size: 16px; }
.muted { color: var(--ink-soft); font-weight: 600; }
.small { font-size: 12px; }
.info-line { margin: 4px 4px 0; line-height: 1.3; }

.dex { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dex-cell { padding: 8px; text-align: center; background: var(--cream); border: 3px solid var(--kraft-line); border-radius: 16px; box-shadow: 0 3px 0 var(--kraft-shadow); }
.dex-bee { width: 52px; height: 52px; margin: 0 auto; }
.dex-bee svg { width: 100%; height: 100%; }
.dex-cell.unknown .dex-bee { filter: brightness(0) opacity(.22); }
.dex-name { font-weight: 800; font-size: 13px; line-height: 1.2; }
.dex-rarity { font-size: 11px; font-weight: 700; color: var(--accent); }
.dex-desc { font-size: 11.5px; line-height: 1.2; color: var(--ink-soft); font-weight: 600; }

.locked-tab { padding: 12px; text-align: center; }
.lock-big { width: 56px; height: 56px; margin: 0 auto 4px; }
.lock-big svg { width: 100%; height: 100%; }
.recipe { display: flex; flex-direction: column; margin-top: 6px; padding: 6px; border-radius: 12px; background: #FFF1D6; font-size: 12.5px; line-height: 1.25; }

.swarm { padding: 12px; }
.swarm-top { display: flex; align-items: center; gap: 10px; }
.swarm-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0; }
.swarm-stats > div { display: flex; flex-direction: column; padding: 6px 10px; border-radius: 12px; background: #FFF1D6; }
.swarm-stats b { font-size: 22px; line-height: 1.15; }
.swarm p { line-height: 1.35; }

/* ---------- Onglets en bois poli ---------- */
#tabs {
  display: flex; justify-content: space-around; padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  background: linear-gradient(#CF9762, #B07A4A); border-top: 3px solid #8A5A2B; box-shadow: inset 0 2px 0 rgba(255,255,255,.25);
}
#tabs button {
  position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; padding: 4px 0;
  background: none; border: none; border-radius: 14px; cursor: pointer; font-size: 11px; font-weight: 700; color: #FFF1D6;
}
#tabs button.active { background: rgba(255,246,227,.24); color: #fff; }
#tabs .icon { width: 26px; height: 26px; }
#tabs .icon .wings { animation: none; }
#tabs button.notify::after {
  content: ''; position: absolute; top: 3px; right: 24%; width: 11px; height: 11px; border-radius: 50%;
  background: #F7A8C4; border: 2px solid #fff; animation: breathe 1.4s infinite;
}

/* ---------- Fenêtres ---------- */
#modal.modal-open {
  position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 20px;
  background: rgba(70,45,25,.45); animation: fadein .2s;
}
.modal-card { width: 100%; max-width: 360px; padding: 16px; text-align: center; animation: popin .3s cubic-bezier(.3,1.4,.6,1); }
.modal-title { font-weight: 800; font-size: 20px; line-height: 1.2; margin-bottom: 6px; }
.modal-body p { margin: 6px 0; font-size: 14px; line-height: 1.35; }
.modal-actions { display: flex; justify-content: center; gap: 10px; margin-top: 12px; }
.modal-actions .buy { min-width: 120px; padding: 8px 14px; }
.hatch-bee { width: 110px; height: 110px; margin: 4px auto; animation: hover 2s ease-in-out infinite; }
.hatch-bee svg { width: 100%; height: 100%; }
.hatch-bee.sleepy .eo { display: none; }
.hatch-bee.sleepy .ec { display: inline; }
.hatch-bee.sleepy .wings { animation: none; }
.hatch-name { font-weight: 800; font-size: 20px; }
.hatch-rarity { font-weight: 700; font-size: 13px; color: var(--accent); }
.offline-gain { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 30px; font-weight: 800; }
.offline-gain .icon { width: 36px; height: 36px; }
.ad-bee { width: 80px; height: 80px; margin: 0 auto; }
.ad-bee svg { width: 100%; height: 100%; }
.ad-count { font-size: 40px; font-weight: 800; color: #2F5A78; }
.toggle-row {
  width: 100%; display: flex; align-items: center; gap: 10px; margin-bottom: 8px; padding: 10px 12px; cursor: pointer;
  background: #FFF1D6; border: none; border-radius: 14px; font-weight: 700; font-size: 15px;
}
.toggle-row span:nth-child(2) { flex: 1; text-align: left; }
.switch { position: relative; width: 44px; height: 26px; border-radius: 99px; background: #D9C6A6; transition: background .2s; }
.switch::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: left .2s;
}
.switch.on { background: #8CC66B; }
.switch.on::after { left: 21px; }

/* ---------- Particules ---------- */
#fx { position: fixed; inset: 0; z-index: 60; pointer-events: none; overflow: hidden; }
.fx { position: absolute; left: 0; top: 0; will-change: transform, opacity; }
.fx svg { width: 100%; height: 100%; display: block; }
.fx.star { width: 18px; height: 18px; }
.fx.coin { width: 22px; height: 22px; }
.fx.petal { width: 12px; height: 12px; }
.float-text { font-weight: 800; font-size: 19px; white-space: nowrap; color: #FFE07A;
  text-shadow: 0 2px 0 #8A5A1C, 2px 0 0 #8A5A1C, -2px 0 0 #8A5A1C, 0 -2px 0 #8A5A1C, 0 3px 6px rgba(90,58,34,.4); }
.float-text.small { font-size: 14px; }
.zzz { font-weight: 800; color: #8E77C9; text-shadow: 0 0 3px #fff, 0 0 2px #fff, 0 0 1px #fff; }

@keyframes popin { from { transform: scale(.85); opacity: 0; } }
@keyframes fadein { from { opacity: 0; } }

body.reduced .slot .fl, body.reduced .plot.buyable, body.reduced .cloud, body.reduced .dc svg, body.reduced .plant svg { animation: none; }

/* ---------- Prairies : décor, panneau et flèches ---------- */
#decor { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.dc { position: absolute; transform: translate(-50%, -100%); }
.dc svg { width: 100%; display: block; overflow: visible; }
.dc.sway svg { transform-origin: 50% 100%; animation: sway2 3.8s ease-in-out infinite; }
.dc.nest svg { transform-origin: 50% 0; animation: swing 3.2s ease-in-out infinite; }
@keyframes sway2 { 0%, 100% { transform: rotate(-5deg); } 50% { transform: rotate(5deg); } }
@keyframes swing { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg); } }

#prairie-nav { position: absolute; inset: 0; z-index: 7; pointer-events: none; }
.prairie-sign {
  position: absolute; left: 8px; top: 6px; display: flex; align-items: center; gap: 6px; max-width: 70%;
  padding: 1px 10px; border-radius: 10px; font-size: 12px; font-weight: 800; color: #FFF6E3; white-space: nowrap;
  background: linear-gradient(#D9A877, #B98552); border: 2.5px solid #8A5A2B; box-shadow: 0 3px 0 rgba(90,58,34,.3);
}
.prairie-sign b { overflow: hidden; text-overflow: ellipsis; }
.prairie-sign .pm { font-size: 10.5px; padding: 0 6px; border-radius: 99px; background: rgba(255,246,227,.25); }
.prairie-sign .dots { display: flex; gap: 3px; }
.prairie-sign .dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,246,227,.55); }
.prairie-sign .dots i.on { background: #FFE07A; box-shadow: 0 0 0 1.5px #8A5A2B; }
.prairie-sign .dots i.off { background: transparent; box-shadow: inset 0 0 0 1.5px rgba(255,246,227,.55); }
.nav-arrow {
  position: absolute; top: 47%; transform: translateY(-50%); width: 30px; height: 44px; padding: 0; pointer-events: auto; cursor: pointer;
  display: flex; align-items: center; justify-content: center; border-radius: 14px; color: #8A5A2B;
  background: rgba(255,248,234,.88); border: 2.5px solid #B98552; box-shadow: 0 3px 0 rgba(90,58,34,.25);
}
.nav-arrow:active { transform: translateY(calc(-50% + 2px)); box-shadow: 0 1px 0 rgba(90,58,34,.25); }
.nav-arrow .chev { font-size: 30px; font-weight: 800; line-height: 1; margin-top: -4px; }
.nav-arrow.left { left: 3px; }
.nav-arrow.right { right: 3px; }
.nav-arrow.locked { background: rgba(243,227,199,.88); }
.nav-arrow.alert::after {
  content: '!'; position: absolute; top: -9px; right: -7px; width: 18px; height: 18px; border-radius: 50%; border: 2px solid #fff;
  display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; color: #fff; background: #E5604D;
  animation: breathe 1s infinite;
}

/* ---------- Ruches attaquées, infestées, protégées ---------- */
.hive-wrap .grill { display: none; position: absolute; left: 50%; bottom: 13%; width: 30%; transform: translateX(-50%); pointer-events: none; }
.hive-wrap .grill svg { width: 100%; display: block; }
#scene.has-grill .hive-wrap .grill { display: block; }
.hive-wrap .pest { display: none; position: absolute; left: -6%; top: 0; width: 38%; aspect-ratio: 1; pointer-events: none; animation: wiggle 1.3s ease-in-out infinite; }
.hive-wrap .pest svg { width: 100%; height: 100%; display: block; overflow: visible; }
.slot.pest .hive-wrap .pest { display: block; }
.slot.pest .hive svg { filter: saturate(.5) brightness(.96); }
.slot.pest .gauge .fill { filter: grayscale(.7); }
@keyframes wiggle { 0%, 100% { transform: rotate(-8deg); } 50% { transform: rotate(8deg) translateY(-2px); } }
.hive-wrap .alert {
  display: none; position: absolute; left: 50%; top: -10%; width: 22px; height: 22px; margin-left: -11px; pointer-events: none;
  align-items: center; justify-content: center; border-radius: 50%; border: 2px solid #fff; background: #E5604D;
  color: #fff; font-weight: 800; font-size: 15px; line-height: 1; box-shadow: 0 2px 0 rgba(90,58,34,.3);
}
.slot.attacked .hive-wrap .alert { display: flex; animation: breathe .8s infinite; }

/* ---------- Combats ---------- */
#battle { position: absolute; inset: 0; z-index: 6; pointer-events: none; }
#battle.frozen .foe, #battle.frozen .dart { display: none; }
.foe { position: absolute; left: 0; top: 0; z-index: 2; pointer-events: auto; cursor: pointer; will-change: transform; }
.foe::before { content: ''; position: absolute; inset: -12px; }
.foe-body { width: 100%; height: 100%; }
.foe-svg { width: 100%; height: 100%; display: block; overflow: visible; }
.foe-svg .wings { transform-box: fill-box; transform-origin: 50% 80%; animation: flap .08s linear infinite alternate; }
.f-moth .foe-svg .wings, .f-sphinx .foe-svg .wings { animation-duration: .2s; }
.f-ant .foe-svg .legs { transform-box: fill-box; transform-origin: 50% 0; animation: legs .22s steps(2) infinite; }
@keyframes legs { from { transform: skewX(14deg); } to { transform: skewX(-14deg); } }
.foe-svg .loot { display: none; }
.foe.loaded .foe-svg .loot { display: inline; }
.foe .hp { position: absolute; left: 14%; right: 14%; top: -7px; height: 5px; border-radius: 3px; overflow: hidden; opacity: 0; background: rgba(90,58,34,.35); transition: opacity .2s; }
.foe .hp i { display: block; height: 100%; width: 100%; background: #8CC66B; transition: width .1s; }
.foe.hurt .hp { opacity: 1; }
.f-queen .hp { height: 7px; }
.f-queen .hp i { background: #E5604D; }
.foe.cooking .foe-svg { filter: drop-shadow(0 0 4px rgba(255,120,40,.95)) saturate(1.3); }
.foe.fleeing { opacity: .8; }
.foe.dazed { pointer-events: none; }
.foe.dazed .foe-svg { animation: dazed .9s ease-out forwards; }
.foe.dazed .hp { opacity: 0; }
@keyframes dazed { to { transform: rotate(540deg) scale(.35); opacity: 0; } }
.foe.slip { pointer-events: none; }
.foe.slip .foe-svg { animation: slip .55s ease-in forwards; }
@keyframes slip { to { transform: scale(.1) translateY(30%); opacity: 0; } }
.defender { position: absolute; left: 0; top: 0; z-index: 3; pointer-events: none; will-change: transform; }
.def-body { width: 100%; height: 100%; }
.def-body svg { width: 100%; height: 100%; display: block; overflow: visible; }
.d-heat .glow { transform-box: fill-box; transform-origin: center; animation: heatglow .7s ease-in-out infinite alternate; }
@keyframes heatglow { to { transform: scale(1.15); opacity: .6; } }
.dart { position: absolute; left: 0; top: 0; z-index: 3; width: 18px; height: 6px; pointer-events: none; }
.dart svg { width: 100%; height: 100%; display: block; }
.plant { position: absolute; z-index: 1; width: 11%; min-width: 34px; max-width: 56px; transform: translate(-50%, -100%); pointer-events: none; }
.plant svg { width: 100%; display: block; overflow: visible; transform-origin: 50% 100%; animation: sway2 3.2s ease-in-out infinite; }
.plant .jaw-up { transform-box: view-box; transform-origin: 24px 28px; transform: translateY(-5px) rotate(-7deg); transition: transform .14s ease-out; }
.plant.snap .jaw-up { transform: translateY(2px); transition-duration: .05s; }
.raid-banner {
  position: absolute; left: 50%; top: 40px; transform: translateX(-50%); z-index: 8; display: flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 99px; white-space: nowrap; font-size: 12.5px; font-weight: 800; color: #8A3A2B;
  background: #FFF1D6; border: 2.5px solid #E58C7B; box-shadow: 0 3px 0 rgba(176,79,63,.35); animation: popin .3s;
}
.raid-banner.grand { background: #F3E6FF; border-color: #8E6BBE; color: #5A3A82; }
.raid-banner .buy.small { padding: 0 8px; }
#tuto.tuto ~ .raid-banner { top: 88px; }

/* ---------- Panneaux Défense et Labo ---------- */
.def-head { padding: 10px 12px; margin-bottom: 8px; }
.def-top { display: flex; align-items: center; gap: 10px; }
.def-txt { flex: 1; min-width: 0; }
.res-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.res-row .pill { gap: 4px; font-size: 12.5px; }
.res-row .pill span { font-weight: 700; color: var(--ink-soft); }
.buy.alarm { min-width: 74px; background: linear-gradient(#FFC2B6, #F08C7B); border-color: #C95F4E; box-shadow: 0 3px 0 #B04F3F; }
.buy.alarm.disabled { background: linear-gradient(#EFE3CC, #E2D2B5); border-color: #CDB894; box-shadow: 0 3px 0 #BBA57E; color: #9A8466; }
.hive-warn { font-size: 12px; font-weight: 800; color: #B04F3F; line-height: 1.25; }
.hive-warn:empty { display: none; }
.card-desc b { color: var(--ink); }
.card-prog { margin-top: 4px; height: 9px; border-radius: 99px; overflow: hidden; background: #EFE3CC; border: 2px solid var(--kraft-line); }
.card-prog i { display: block; height: 100%; width: 0; background: repeating-linear-gradient(-45deg, #B9A5E3 0 6px, #CDBDF0 6px 12px); transition: width .25s linear; }
.mats { display: inline-flex; gap: 6px; margin-left: 6px; vertical-align: middle; }
.mat { display: inline-flex; align-items: center; gap: 2px; font-weight: 800; color: var(--ink); }
.mat .icon.xs { width: 14px; height: 14px; }
.mat.lack { color: #C95F4E; }
.mini-plant svg { width: 34px; height: 42px; display: block; }
.mini-prairie svg { width: 40px; height: 40px; display: block; }
.foe-icon svg { width: 100%; height: 100%; }
.hatch-bee.prairie-big { width: 96px; height: 96px; animation: none; }

/* ---------- Effets ---------- */
.fx.loot { width: 20px; height: 20px; }
.float-text.hitnum { font-size: 15px; color: #fff; text-shadow: 0 2px 0 #B04F3F, 2px 0 0 #B04F3F, -2px 0 0 #B04F3F, 0 -2px 0 #B04F3F; }
.float-text.loot-text { color: #FFE7C2; text-shadow: 0 2px 0 #8A4A20, 2px 0 0 #8A4A20, -2px 0 0 #8A4A20, 0 -2px 0 #8A4A20; }
.raid-banner { pointer-events: none; }
.raid-banner .buy { pointer-events: auto; }
