/* Кристална фабрика — допълва /igri/elementi/game.css: топчета-йони (като фиг. 6), тава, бутони за йони. */
.ball { display: inline-block; border-radius: 50%; vertical-align: middle; flex-shrink: 0; }
.ball.pos { width: 14px; height: 14px; background: radial-gradient(circle at 35% 30%, #d9b3ff, #7c3aed 60%, #3b0f8c); box-shadow: 0 0 8px rgba(168, 85, 247, .6); }
.ball.neg { width: 26px; height: 26px; background: radial-gradient(circle at 35% 30%, #e6ff9e, #7cc832 55%, #3d7a12); box-shadow: inset 0 -3px 6px rgba(0, 0, 0, .25); }

.crystal-hero { display: grid; grid-template-columns: repeat(12, 26px); gap: 2px; align-items: center; justify-items: center; margin: 4px 0 16px; animation: rise .5s .05s both; }
.crystal-hero .ball { animation: bob 3s ease-in-out infinite; }
.crystal-hero .ball:nth-child(3n) { animation-delay: -1s; }
.crystal-hero .ball:nth-child(3n+1) { animation-delay: -2s; }
.crystal-hero.big { grid-template-columns: repeat(6, 30px); justify-content: center; }
.diploma .crystal-hero { justify-content: center; }
.model { text-align: center; margin: 18px 0; color: var(--soft); }
.model p { display: flex; gap: 8px; align-items: center; justify-content: center; flex-wrap: wrap; }

.chip-f { font-family: var(--mono); font-weight: 800; padding: 3px 9px; border-radius: 8px; background: rgba(255, 255, 255, .08); }

.f-table { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.f-row { display: grid; grid-template-columns: 70px 1fr auto; gap: 8px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px; }
.f-row b { color: var(--marker); font-size: 1.1rem; }
.f-row small { color: var(--soft); font-family: var(--mono); }

.q-preview { font-family: var(--mono); color: var(--marker); font-size: 1.4rem; min-height: 1.6em; margin-top: 6px; }
.typer input.wide { width: 190px; font-size: 2rem; }

/* Фабрика */
.tray {
    display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: center; align-content: center;
    min-height: 92px; margin: 16px 0 12px; padding: 12px; border-radius: 18px;
    background: repeating-linear-gradient(45deg, rgba(255, 255, 255, .02) 0 8px, transparent 8px 16px), var(--bg-2);
    border: 2px dashed rgba(255, 255, 255, .14); transition: border-color .2s, box-shadow .2s;
}
.tray .ball { animation: drop-in .25s both; }
.tray.built { border-style: solid; border-color: var(--ok); box-shadow: 0 0 0 5px rgba(91, 227, 140, .2), 0 0 40px -8px rgba(91, 227, 140, .6); }
.tray-empty { color: var(--soft); font-size: .9rem; }
.ion-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.ion-btn {
    display: grid; justify-items: center; gap: 4px; min-width: 96px; padding: 12px 14px; border-radius: 16px;
    background: var(--panel-2); border: 2px solid var(--line); transition: transform .1s, border-color .15s;
}
.ion-btn.pos { border-color: rgba(168, 85, 247, .5); }
.ion-btn.neg { border-color: rgba(124, 200, 50, .5); }
.ion-btn:active:not(:disabled) { transform: scale(.94); }
.ion-btn b { font-size: 1.35rem; }
.ion-btn small { color: var(--soft); font-weight: 800; }
.ion-btn .ball { margin-bottom: 2px; }
.fac-actions { display: flex; gap: 10px; justify-content: center; margin-top: 14px; }
.fac-actions button:disabled, .ion-btn:disabled { opacity: .55; cursor: default; }

@keyframes bob { 50% { transform: translateY(-3px); } }
@keyframes drop-in { from { opacity: 0; transform: translateY(-14px) scale(.4); } }

@media (max-width: 520px) {
    .crystal-hero { grid-template-columns: repeat(8, 26px); }
    .crystal-hero .ball:nth-child(n+17) { display: none; }
    .crystal-hero.big .ball { display: inline-block; }
    .ion-btn { min-width: 84px; padding: 10px; }
}
