/* Kovan oyunu: bal paleti sabit, zemin temanın paneliyle karışır (koyu temada koyu, beyazda açık) */

.game .icon { display: block; object-fit: contain; -webkit-user-drag: none; user-select: none; }

.game {
  --honey: #f6b73c;
  --honey-hi: #ffd56b;
  --honey-lo: #d98a12;
  --cocoa: #3b2208;
  --g-num: #f6b73c;
  --g-bg: color-mix(in oklab, var(--panel) 88%, #f6b73c);
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 12px;
  padding: 0 16px;
}
[data-theme="white"] .game { --g-num: #a35f00; }

/* Orta panel daralınca (1024 px ekran, mobil) alt alta */
.p-screen { container-type: inline-size; }
@container (max-width: 640px) {
  .game { grid-template-columns: 1fr; grid-template-rows: 300px auto; overflow-y: auto; }
  .shop { overflow: visible; }
}

/* ---------- Arena ---------- */

.arena {
  position: relative;
  min-height: 0;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--honey) 25%, var(--line));
  background:
    radial-gradient(circle at 50% 55%, color-mix(in srgb, var(--honey) 22%, transparent), transparent 55%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='100'%3E%3Cpath d='M28 66L0 50L0 16L28 0L56 16L56 50L28 66L28 100' fill='none' stroke='%23f6b73c' stroke-opacity='.13' stroke-width='2'/%3E%3Cpath d='M28 0L28 34L0 50L0 84L28 100L56 84L56 50L28 34' fill='none' stroke='%23f6b73c' stroke-opacity='.08' stroke-width='2'/%3E%3C/svg%3E"),
    var(--g-bg);
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  transition: box-shadow 0.4s;
}
/* çimen şeridi */
.arena::before {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 22%;
  background: linear-gradient(transparent, color-mix(in srgb, #6fbf73 26%, transparent));
  pointer-events: none;
}
.arena.frenzy { box-shadow: inset 0 0 70px rgb(255 140 0 / 0.4); }

.game-stats { position: absolute; left: 14px; top: 12px; z-index: 5; pointer-events: none; }
.honey { display: flex; align-items: center; gap: 8px; font-size: 28px; font-weight: 800; color: var(--g-num); line-height: 1.1; }
.honey .jar { width: 34px; height: 34px; animation: wobble 2.4s ease-in-out infinite; }
.rate { color: var(--muted); font-size: 12px; margin-top: 2px; }
.rate span { color: var(--fg); font-weight: 700; }
/* Geçici etkiler: "🌸 Bahar ×2 · 42 sn" */
.effects { display: grid; justify-items: start; gap: 4px; margin-top: 8px; }
.effect {
  padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap;
  background: linear-gradient(90deg, #ffb347, #ffd56b); color: #3b1600;
  box-shadow: 0 2px 8px rgb(255 160 40 / 0.3);
}
.effect.bad { background: linear-gradient(90deg, #8fa3b8, #b7c6d6); color: #14202c; box-shadow: none; }
.game-sound { position: absolute; right: 10px; top: 10px; z-index: 5; font-size: 16px; }

/* ---------- Kovan ---------- */

.hive {
  position: absolute; left: 50%; top: 54%; z-index: 2;
  translate: -50% -50%;
  width: min(56%, 250px);
  aspect-ratio: 220 / 210;
  padding: 0; border-radius: 40%;
  filter: drop-shadow(0 10px 18px rgb(120 60 0 / 0.25));
  -webkit-tap-highlight-color: transparent;
}
.hive svg { width: 100%; height: 100%; display: block; animation: breathe 3.2s ease-in-out infinite; transform-origin: 50% 100%; }
.hive:hover { filter: drop-shadow(0 10px 18px rgb(120 60 0 / 0.25)) drop-shadow(0 0 22px rgb(255 200 60 / 0.35)); }
.hive:focus-visible { outline-offset: 6px; }

.float-text {
  position: absolute; z-index: 6; pointer-events: none; white-space: nowrap;
  font-size: 18px; font-weight: 800; color: var(--honey-hi);
  text-shadow: 0 2px 0 var(--honey-lo), 0 0 12px rgb(255 190 60 / 0.5);
}
.float-text.bad { color: #ff6b6b; text-shadow: 0 2px 0 #7a1f1f; font-size: 15px; }
.float-text.hit { color: #fff; text-shadow: 0 2px 0 #333, 0 0 10px rgb(255 255 255 / 0.5); font-size: 14px; }
.drop {
  position: absolute; z-index: 5; width: 10px; height: 12px; pointer-events: none;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  background: radial-gradient(circle at 35% 35%, #ffe7a3, #f6b73c 55%, #c9790f);
}

/* ---------- Arılar ---------- */

.bees { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.fly { position: absolute; left: 50%; top: var(--top); animation: sway-x var(--d) ease-in-out var(--delay) infinite alternate; }
.fly-y { animation: sway-y var(--d) ease-in-out calc(var(--delay) - var(--d) / 2) infinite alternate; }
.face { display: block; animation: face calc(var(--d) * 2) steps(1) var(--delay) infinite; }
.fly .bee { width: var(--size); translate: -50% -50%; }
.arena.frenzy .fly, .arena.frenzy .fly-y { animation-duration: calc(var(--d) * 0.55); }

@keyframes sway-x { from { transform: translateX(calc(var(--rx) * -1)); } to { transform: translateX(var(--rx)); } }
@keyframes sway-y { from { transform: translateY(calc(var(--ry) * -1)); } to { transform: translateY(var(--ry)); } }
@keyframes face { 0% { transform: scaleX(1); } 50% { transform: scaleX(-1); } }

.bee { display: block; height: auto; overflow: visible; }
.bee .wing { fill: rgb(236 246 255 / 0.9); stroke: rgb(60 40 10 / 0.35); stroke-width: 1; transform-box: fill-box; transform-origin: 50% 100%; animation: flap 0.09s ease-in-out infinite alternate; }
.bee .w2 { animation-delay: -0.045s; }
.bee .body { fill: #ffc93c; }
.bee .stripe, .bee .sting, .bee .eye { fill: var(--cocoa); }
.bee .outline { fill: none; stroke: var(--cocoa); stroke-width: 1.6; }
.bee .shine { fill: #fff; }
.bee .blush { fill: #ff8fa3; opacity: 0.75; }
.bee .antenna { fill: none; stroke: var(--cocoa); stroke-width: 1.4; stroke-linecap: round; }
@keyframes flap { to { transform: scaleY(0.35); } }

/* Altın arı */
.golden-bee {
  position: absolute; left: 0; z-index: 7; width: 56px; padding: 8px; border-radius: 50%;
  filter: drop-shadow(0 0 6px #ffd700) drop-shadow(0 0 16px rgb(255 200 0 / 0.7));
  cursor: pointer;
}
.golden-bee .face { animation: bob 0.5s ease-in-out infinite alternate; }
.golden-bee .bee { width: 100%; }
.golden-bee.rtl .bee { transform: scaleX(-1); }
.golden-bee .bee .body { fill: #ffe14d; }
.golden-bee .bee .outline { stroke: #b8860b; }
@keyframes bob { from { transform: translateY(-5px) rotate(-4deg); } to { transform: translateY(5px) rotate(4deg); } }

/* ---------- Olaylar ---------- */

/* Ayı: kovanın yanına yürür, can çubuğu tıkladıkça azalır */
.bear {
  position: absolute; bottom: 30%; z-index: 6; padding: 0; display: grid; justify-items: center; gap: 4px;
  cursor: pointer; filter: drop-shadow(0 8px 10px rgb(60 30 0 / 0.35));
}
.bear.left { left: 6%; }
.bear.right { right: 6%; }
.bear-face { display: block; width: 76px; height: 76px; animation: munch 0.5s ease-in-out infinite alternate; }
.bear.right .bear-face { scale: -1 1; }
.bear .hp { width: 64px; height: 7px; border-radius: 4px; background: rgb(0 0 0 / 0.35); overflow: hidden; }
.bear .hp i { display: block; height: 100%; width: calc(var(--p, 1) * 100%); background: linear-gradient(90deg, #ff6b6b, #ffb347); transition: width 0.15s; }
@keyframes munch { to { transform: translateY(-4px) rotate(3deg); } }

/* Eşek arısı: kırmızı-siyah, sinirli */
.wasp { position: absolute; z-index: 6; width: 40px; padding: 4px; border-radius: 50%; cursor: crosshair; }
.wasp .bee { width: 100%; }
.wasp .bee .body { fill: #e8553a; }
.wasp .bee .blush { opacity: 0; }
.wasp .bee .wing { animation-duration: 0.05s; }

/* Seçimli olay kartı */
.event-card {
  position: absolute; left: 50%; top: 50%; z-index: 9; transform: translate(-50%, -50%);
  width: min(320px, calc(100% - 24px)); padding: 14px 16px; border-radius: 16px; text-align: center;
  background: color-mix(in srgb, var(--panel) 92%, #f6b73c); color: var(--fg);
  border: 1px solid color-mix(in srgb, var(--honey) 55%, var(--line));
  box-shadow: 0 12px 30px rgb(0 0 0 / 0.35);
}
.ev-icon { width: 44px; height: 44px; margin: 0 auto; }
.ev-title { display: block; margin-top: 2px; font-size: 14px; }
.ev-text { margin: 6px 0 12px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.event-card .actions { display: flex; gap: 8px; justify-content: center; }
.event-card button { height: 34px; padding: 0 16px; border-radius: 9px; font-weight: 700; }
.event-card .yes { background: var(--honey); color: var(--cocoa); }
.event-card .yes:hover { background: var(--honey-hi); }
.event-card .no { background: var(--raise); color: var(--muted); border: 1px solid var(--line); }

/* Hava: yağmur çizgileri, bahar yaprakları, güneş parıltısı */
.arena::after {
  content: ""; position: absolute; inset: 0; z-index: 4; pointer-events: none; opacity: 0; transition: opacity 0.6s;
}
.arena.rain::after {
  opacity: 1;
  background:
    repeating-linear-gradient(105deg, transparent 0 14px, rgb(170 200 230 / 0.35) 14px 15px, transparent 15px 34px),
    linear-gradient(rgb(40 60 90 / 0.28), rgb(40 60 90 / 0.18));
  background-size: 120px 120px, auto;
  animation: rain 0.45s linear infinite;
}
.arena.sunny::after {
  opacity: 1;
  background: radial-gradient(circle at 85% 8%, rgb(255 230 120 / 0.55), transparent 45%);
  animation: sun 3s ease-in-out infinite alternate;
}
.arena.bloom::after { opacity: 1; background: radial-gradient(circle at 50% 100%, rgb(255 170 200 / 0.25), transparent 60%); }
.petal { position: absolute; top: 0; z-index: 4; width: 20px; height: 20px; pointer-events: none; }
@keyframes rain { to { background-position: -32px 120px, 0 0; } }
@keyframes sun { to { opacity: 0.6; } }

/* Çiçekler */
.flowers { position: absolute; left: 0; right: 0; bottom: 8px; z-index: 1; display: flex; justify-content: center; gap: 12px; pointer-events: none; }
.flower { width: 30px; height: 30px; transform-origin: 50% 100%; animation: sway 2.6s ease-in-out var(--delay) infinite alternate; }

/* Bildirimler */
/* Bildirimler altta, çiçeklerin üstünde: sayaç ve etki rozetlerini kapatmasın */
.toasts {
  position: absolute; bottom: 52px; left: 50%; translate: -50% 0; z-index: 8;
  display: grid; justify-items: center; gap: 6px; width: max-content; max-width: 86%; pointer-events: none;
}
.toast {
  padding: 7px 14px; border-radius: 999px; font-size: 12px; text-align: center;
  background: color-mix(in srgb, var(--panel) 88%, #000); color: var(--fg);
  border: 1px solid color-mix(in srgb, var(--honey) 40%, transparent);
  box-shadow: 0 6px 18px rgb(0 0 0 / 0.25);
}
.toast.big { font-size: 13px; font-weight: 600; }
.toast.gold { background: linear-gradient(90deg, #ffe08a, #f6b73c); color: var(--cocoa); border-color: #e0a21f; }
.toast.bad { background: linear-gradient(90deg, #5b2a2a, #7a3434); color: #ffe3e3; border-color: #b04a4a; }

/* ---------- Dükkan ---------- */

.shop { min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding-bottom: 8px; }
.shop-head { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; color: var(--faint); font-size: 11px; letter-spacing: 0.06em; }
.shop-head b { color: var(--muted); font-weight: 500; }
.buy-mode { display: flex; gap: 2px; padding: 2px; border-radius: 8px; background: var(--raise); }
.buy-mode button { padding: 2px 8px; border-radius: 6px; color: var(--muted); font-size: 11px; }
.buy-mode button.on { background: var(--panel); color: var(--fg); }

.upgrades { display: flex; flex-wrap: wrap; gap: 6px; }
.upg {
  width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center;
  background: var(--raise); border: 1px solid var(--line);
  opacity: 0.5; filter: grayscale(0.5); transition: opacity 0.15s, filter 0.15s, transform 0.1s;
}
.upg .icon { width: 28px; height: 28px; }
.upg.can { opacity: 1; filter: none; border-color: var(--honey); animation: glow 1.6s ease-in-out infinite alternate; }
.upg:hover { transform: translateY(-2px); }
.hint { color: var(--faint); font-size: 11px; }

.gens { display: grid; gap: 6px; }
.gen {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 10px;
  padding: 9px 12px 11px; border-radius: 12px; text-align: left;
  background: var(--raise); border: 1px solid var(--line);
  opacity: 0.65; transition: opacity 0.15s, border-color 0.15s, transform 0.1s;
}
.gen.can { opacity: 1; border-color: color-mix(in srgb, var(--honey) 50%, var(--line)); }
.gen.can:hover { border-color: var(--honey); transform: translateY(-1px); }
.gen:active { transform: scale(0.98); }
.gen-icon { width: 36px; height: 36px; }
.gen.mystery .gen-icon { filter: brightness(0) opacity(0.28); }
.gen-main { min-width: 0; }
.gen-name { display: block; font-size: 13px; }
.gen-desc { display: block; overflow: hidden; color: var(--faint); font-size: 11px; white-space: nowrap; text-overflow: ellipsis; }
.gen-side { display: grid; justify-items: end; gap: 2px; }
.gen-owned { font-size: 20px; font-weight: 800; line-height: 1; }
.gen-cost { color: var(--muted); font-size: 11px; white-space: nowrap; }
.gen.can .gen-cost { color: var(--g-num); }
.gen-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; }
.gen-bar i { display: block; height: 100%; width: calc(var(--p, 0) * 100%); background: linear-gradient(90deg, var(--honey-lo), var(--honey-hi)); transition: width 0.2s; }

.league { list-style: none; display: grid; gap: 4px; }
.league li {
  display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; align-items: center; gap: 0 8px;
  padding: 6px 10px; border-radius: 10px; background: var(--raise); font-size: 12px;
}
.league li.me { box-shadow: inset 0 0 0 1px var(--honey); }
.league .rank { width: 22px; height: 22px; text-align: center; }
.league .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.league .score { font-weight: 700; }
.league .pace { grid-column: 2 / 4; color: var(--faint); font-size: 11px; }
.league li.hint { display: block; background: none; padding: 0; }
.league .badges { font-size: 11px; letter-spacing: -0.02em; }
.week-info { margin: -4px 0 0; line-height: 1.35; }

/* 5.72 kraliçe: oğul verme ve yetenekler; başarımlar */
.queen { display: grid; gap: 6px; }
.swarm {
  padding: 9px 12px; border-radius: 12px; text-align: left; font-weight: 700;
  background: var(--raise); border: 1px solid var(--line); color: var(--muted);
}
.swarm.can { color: var(--fg); border-color: var(--honey); animation: glow 1.6s ease-in-out infinite alternate; }
.swarm.can:hover { transform: translateY(-1px); }
.swarm:disabled { cursor: default; }
.queen-info { line-height: 1.35; }
.skills { display: flex; flex-wrap: wrap; gap: 6px; }
.skill {
  width: 46px; height: 46px; border-radius: 10px; display: grid; place-items: center; align-content: center; gap: 2px;
  background: var(--raise); border: 1px solid var(--line); opacity: 0.5; transition: opacity 0.15s, transform 0.1s;
}
.skill .icon { width: 24px; height: 24px; }
.skill-cost { color: var(--muted); font-size: 10px; line-height: 1; }
.skill.can { opacity: 1; border-color: var(--honey); }
.skill.on { opacity: 1; background: color-mix(in srgb, var(--honey) 20%, var(--raise)); border-color: color-mix(in srgb, var(--honey) 70%, var(--line)); }
.skill.on .skill-cost { color: var(--fg); }
.skill:hover { transform: translateY(-2px); }
.achs { display: flex; flex-wrap: wrap; gap: 4px; }
.ach {
  width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center;
  background: var(--raise); border: 1px solid var(--line); filter: grayscale(1); opacity: 0.35; transition: transform 0.1s;
}
.ach .icon { width: 20px; height: 20px; }
.ach.on { filter: none; opacity: 1; border-color: color-mix(in srgb, var(--honey) 55%, var(--line)); }
.ach:hover { transform: translateY(-2px); }

/* ---------- Animasyonlar ---------- */

@keyframes breathe { 50% { transform: scale(1.015, 0.985); } }
@keyframes wobble { 0%, 100% { rotate: -6deg; } 50% { rotate: 6deg; } }
@keyframes pulse { to { transform: scale(1.06); } }
@keyframes sway { from { rotate: -8deg; } to { rotate: 8deg; } }
@keyframes glow { to { box-shadow: 0 0 0 4px color-mix(in srgb, var(--honey) 25%, transparent); } }
