/* ── Tactics Trainer Styles ───────────────────────────────── */

body.tactics-mode .main-layout {
    grid-template-columns: minmax(340px, 560px) minmax(320px, 420px);
    justify-content: center;
    align-items: start;
}

body.tactics-mode #boardPanel {
    grid-column: 1;
    order: 0;
    position: sticky;
    top: 96px;
}

body.tactics-mode #tacticsPanel {
    grid-column: 2;
    order: 0;
    position: sticky;
    top: 96px;
    align-self: start;
    min-height: 0;
}

body.tactics-mode #boardPanel .board-controls,
body.tactics-mode #boardPanel .engine-toggle,
body.tactics-mode #boardPanel .difficulty-selector,
body.tactics-mode #boardPanel .adaptive-toggle,
body.tactics-mode #boardPanel .clock-toggle,
body.tactics-mode #boardPanel .clock-panel,
body.tactics-mode #boardPanel .eval-bar,
body.tactics-mode #boardPanel .calibration-banner,
body.tactics-mode #boardPanel .fen-display,
body.tactics-mode #boardPanel .opening-band {
    display: none !important;
}

body.tactics-mode #boardPanel .board-outer {
    margin-bottom: 0;
}

body.tactics-mode #tacticsTrainPanel {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tactics-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}

.tactics-meta {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tactics-streak {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--accent-amber);
}

.tactics-timer {
    font-size: 0.9rem;
    font-family: "SF Mono", monospace;
    color: var(--text-dim);
    background: var(--bg-light);
    padding: 4px 10px;
    border-radius: 6px;
}

.tactics-difficulty-badge {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tactics-difficulty-badge.diff-1 {
    background: #1a4d1a;
    color: #7ee787;
}
.tactics-difficulty-badge.diff-2 {
    background: #2d4a1e;
    color: #a5d96a;
}
.tactics-difficulty-badge.diff-3 {
    background: #4a3b1e;
    color: #f4a261;
}
.tactics-difficulty-badge.diff-4 {
    background: #4a1e1e;
    color: #ff7b72;
}
.tactics-difficulty-badge.diff-5 {
    background: #2a0a0a;
    color: #e94560;
}

.tactics-subtabs {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 4px;
}

.tactics-subtab {
    background: transparent;
    border: none;
    color: var(--text-dim);
    padding: 6px 12px;
    font-size: 0.85rem;
    cursor: pointer;
    border-radius: 6px 6px 0 0;
    border-bottom: 2px solid transparent;
}

.tactics-subtab.active {
    color: var(--text);
    border-bottom-color: var(--accent);
    font-weight: 600;
}

.tactics-subtab:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
}

.tactics-content {
    min-height: 200px;
}

.tactics-puzzle-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding: 8px 12px;
    background: var(--bg-light);
    border-radius: 8px;
    font-size: 0.85rem;
}

.tactics-pattern {
    font-weight: 600;
    color: var(--accent);
    text-transform: capitalize;
}

.tactics-counter {
    color: var(--text-dim);
}

.tactics-objective {
    text-align: center;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
    background: var(--bg-light);
    border-left: 3px solid var(--accent);
    border-radius: 6px;
    padding: 8px 14px;
    margin-bottom: 10px;
    letter-spacing: 0.01em;
}

.tactics-feedback {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 12px;
    font-weight: 700;
    font-size: 1rem;
    text-align: center;
    animation: fadeIn 0.3s ease;
}

.tactics-feedback.correct {
    background: rgba(0, 217, 165, 0.15);
    color: var(--accent-green);
    border: 1px solid rgba(0, 217, 165, 0.3);
}

.tactics-feedback.wrong {
    background: rgba(233, 69, 96, 0.15);
    color: var(--error);
    border: 1px solid rgba(233, 69, 96, 0.3);
    animation: shake 0.4s ease;
}

.tactics-explanation {
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 16px;
    animation: fadeIn 0.4s ease;
}

.tactics-explanation-title {
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 8px;
    color: var(--text);
}

.tactics-explanation-text {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-dim);
}

.tactics-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 12px;
}

body.tactics-mode .tactics-actions {
    justify-content: stretch;
}

body.tactics-mode .tactics-actions button {
    flex: 1;
}

@media (max-width: 760px) {
    body.tactics-mode .main-layout {
        grid-template-columns: 1fr;
        justify-content: stretch;
    }

    body.tactics-mode #boardPanel,
    body.tactics-mode #tacticsPanel {
        grid-column: 1;
        position: static;
    }

    body.tactics-mode #tacticsPanel {
        margin-top: 12px;
    }
}

.tactics-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-dim);
}

.tactics-empty-icon {
    font-size: 3rem;
    margin-bottom: 12px;
}

.tactics-empty-text {
    font-size: 1rem;
}

/* Calendar */
.tactics-calendar-title {
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 12px;
    color: var(--text);
}

.tactics-calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}

.tactics-calendar-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-light);
    border-radius: 8px;
    border: 1px solid var(--border);
    font-size: 0.75rem;
    transition: transform 0.15s ease;
}

.tactics-calendar-day:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
}

.tactics-calendar-day .day-label {
    color: var(--text-dim);
    font-size: 0.65rem;
    margin-bottom: 2px;
}

.tactics-calendar-day .day-count {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text);
}

.tactics-calendar-day.has-puzzles {
    background: rgba(0, 217, 165, 0.1);
    border-color: rgba(0, 217, 165, 0.3);
}

.tactics-calendar-day.has-puzzles .day-count {
    color: var(--accent-green);
}

.tactics-calendar-day.today {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent);
}

