/* === ОСНОВНОЙ КОНТЕЙНЕР ПОКЕР-КАЛЬКУЛЯТОРА === */
.poker-container {
    max-width: 1400px;
    margin: 0 auto;
}

/* === ОСНОВНАЯ ОБЛАСТЬ С ДВУМЯ КОЛОНКАМИ === */
.main-area {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 30px;
    margin-bottom: 40px;
}

@media (max-width: 1100px) {
    .main-area { grid-template-columns: 1fr; }
}

/* === ПАНЕЛИ === */
.panel {
    border-radius: 15px;
    padding: 25px;
    border-width: 2px;
    border-style: solid;
}

.panel:first-child {
    display: flex;
    flex-direction: column;
}

/* === ЗАГОЛОВОК ПАНЕЛИ — крупнее подзаголовков, центрирован по высоте === */
.panel-title {
    font-size: 1.3rem;
    font-weight: bold;
    padding-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
    min-height: 2.2rem;
    letter-spacing: 0.04em;
}

/* === ПОДЗАГОЛОВКИ СЕКЦИЙ — заметно мельче панельного заголовка === */
.section-title {
    margin-bottom: 3px;
    font-size: 1.0rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    height: 28px;
    position: relative;
    letter-spacing: 0.03em;
}

/* === СЕКЦИИ РУКИ И БОРДА === */
.hand-section, .board-section {
    border-radius: 12px;
    padding: 15px 20px;
    margin-bottom: 15px;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    border-width: 2px;
    border-style: solid;
    position: relative;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.section-title::before {
    transition: opacity 0.3s, background-color 0.3s, box-shadow 0.3s;
}

.board-subtitle,
.hand-subtitle {
    font-size: 0.9rem;
    text-align: center;
    margin-bottom: 8px;
    height: 20px;
    flex-shrink: 0;
    line-height: 20px;
}

.section-content {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding-bottom: 28px;
}

/* === РЯД С КАРТАМИ === */
.cards-row {
    display: flex;
    gap: 15px;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    margin: 0;
    position: relative;
}

/* === СЛОТ ДЛЯ КАРТЫ === */
.card-slot {
    width: 80px;
    height: 115px;
    border-width: 2px;
    border-style: dashed;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    position: relative;
    transition: all 0.3s;
    cursor: pointer;
}

.card-slot.drag-over { transform: scale(1.05); }

/* === РЕАЛЬНАЯ КАРТА === */
.real-card {
    border-radius: 8px;
    overflow: hidden;
    border-width: 1px;
    border-style: solid;
    cursor: move;
    position: relative;
    transition: all 0.2s;
    width: 80px;
    height: 115px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.real-card:hover {
    transform: translateY(-3px) scale(1.03);
    z-index: 10;
}

.card-content {
    font-size: 2.5rem;
    font-weight: bold;
    text-align: center;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    line-height: 1.2;
}

/* === ПРЕДУПРЕЖДЕНИЯ === */
.warning {
    font-size: 0.9rem;
    text-align: center;
    display: none;
    position: absolute;
    bottom: 5px;
    left: 20px;
    right: 20px;
    height: 20px;
    line-height: 20px;
    z-index: 2;
}

/* === БЛОК ОППОНЕНТОВ === */
.opponents-control {
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    border-width: 2px;
    border-style: solid;
}

.opponents-label {
    font-weight: bold;
    margin-bottom: 10px;
    text-align: center;
    font-size: 1.0rem;
}

.opponent-pills {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.opponent-pill {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border-width: 2px;
    border-style: solid;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.opponent-pill:hover { transform: scale(1.1); }

/* === СЕТКА КОЛОДЫ === */
.deck-grid {
    display: grid;
    grid-template-columns: repeat(13, 1fr);
    gap: 6px;
    margin: 0 0 20px 0;
    padding: 15px 20px;
    border-radius: 12px;
    border-width: 2px;
    border-style: solid;
}

/* === КАРТА В КОЛОДЕ === */
.deck-card {
    aspect-ratio: 2/3;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    border-width: 1px;
    border-style: solid;
    font-weight: bold;
    position: relative;
    border-color: transparent;
}

.deck-card:hover {
    transform: scale(1.15);
    z-index: 10;
}

/* === ВЫБРАННАЯ КАРТА — затемняем === */
.deck-card.selected {
    cursor: default;
    opacity: 0.35;
    filter: grayscale(40%);
}

.deck-card.selected:hover { transform: none; }

.deck-card.selected .card-face { display: none; }

.deck-card.selected::after {
    content: "✕";
    font-size: 0.9rem;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* === ЛИЦЕВАЯ СТОРОНА КАРТЫ В КОЛОДЕ === */
.card-face {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    gap: 7%;
}

.card-value {
    font-size: 1.2rem;
    font-weight: bold;
    line-height: 1;
}

.card-suit-large {
    font-size: 1.3rem;
    line-height: 1;
}

/* === КНОПКИ === */
.controls {
    display: flex;
    gap: 15px;
    margin-top: 25px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 180px;
    position: relative;
    overflow: hidden;
}

.btn:hover { transform: translateY(-3px); }
.btn:active { transform: scale(0.95); }

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-primary:disabled:hover { transform: none; }

.btn.clicked { animation: button-pulse 0.3s ease-in-out; }

@keyframes button-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(0.95); }
    100% { transform: scale(1); }
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%, -50%);
    transform-origin: 50% 50%;
}

.btn:active::after { animation: ripple 0.6s ease-out; }

@keyframes ripple {
    0% { transform: scale(0, 0); opacity: 0.5; }
    100% { transform: scale(20, 20); opacity: 0; }
}

/* === ПАНЕЛЬ РЕЗУЛЬТАТОВ === */
.results-panel {
    margin-top: 30px;
    display: block !important;
    position: relative;
    border-radius: 15px;
    padding: 25px;
    border-width: 2px;
    border-style: solid;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 10px;
}

.result-card {
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    border-width: 2px;
    border-style: solid;
    min-height: 160px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}

.result-percent {
    font-size: 3.5rem;
    font-weight: bold;
    margin: 15px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-grow: 1;
    transition: color 0.1s ease-out;
}

.drop-hint {
    font-size: 0.9rem;
    text-align: center;
    margin-top: 5px;
}

.slot-empty { font-size: 2.5rem; }

/* === ИНДИКАТОР АКТИВНОГО БЛОКА === */
.section-title::before {
    content: "";
    position: absolute;
    right: -5px;
    top: -5px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    opacity: 0;
    transition: all 0.3s ease;
    border-width: 2px;
    border-style: solid;
    z-index: 5;
}

.hand-section.active .section-title::before,
.board-section.active .section-title::before {
    opacity: 1;
}

@keyframes quick-glow {
    0% { border-color: transparent; }
    50% { border-color: transparent; }
    100% { border-color: transparent; }
}

.results-panel.fresh-result { animation: quick-glow 0.25s ease-in-out; }

/* === АДАПТИВНОСТЬ 768px === */
@media (max-width: 768px) {
    .section-title::before { width: 12px; height: 12px; right: -4px; top: -4px; }
    .panel { padding: 20px 15px; }
    .hand-section, .board-section { min-height: 180px; padding: 12px; margin-bottom: 10px; }
    .card-slot { width: 70px; height: 100px; font-size: 2rem; }
    .real-card { width: 70px; height: 100px; }
    .card-content { font-size: 2rem; }
    .deck-grid { grid-template-columns: repeat(7, 1fr); gap: 4px; padding: 10px; }
    .deck-card { aspect-ratio: 3/4; }
    .card-value { font-size: 0.8rem; }
    .card-suit-large { font-size: 1rem; }
    .btn { min-width: 150px; padding: 10px 20px; font-size: 1rem; }
    .result-percent { font-size: 2.8rem; }
    .results-grid { grid-template-columns: 1fr; gap: 15px; }
    .result-card { min-height: 140px; padding: 15px; }
    .opponent-pill { width: 40px; height: 40px; font-size: 1.1rem; }
    .controls { gap: 10px; }
    .panel-title { font-size: 1.1rem; }
    .section-title { font-size: 0.9rem; }
}

/* === АДАПТИВНОСТЬ 480px === */
@media (max-width: 480px) {
    .section-title::before { width: 10px; height: 10px; right: -3px; top: -3px; }
    .panel { padding: 15px; }
    .hand-section, .board-section { min-height: 160px; padding: 10px; }
    .card-slot { width: 60px; height: 85px; font-size: 1.8rem; }
    .real-card { width: 60px; height: 85px; }
    .card-content { font-size: 1.8rem; }
    .btn { min-width: 130px; padding: 8px 15px; font-size: 0.9rem; }
    .result-percent { font-size: 2.5rem; }
    .result-card { min-height: 130px; }
    .deck-grid { grid-template-columns: repeat(4, 1fr); }
    .opponent-pills { gap: 5px; }
    .opponent-pill { width: 35px; height: 35px; font-size: 1rem; }
    .panel-title { font-size: 1rem; }
    .section-title { font-size: 0.85rem; }
}
