/* -- play.css -- Verdict Alpha -- */

.move-history {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: var(--bg);
    border-radius: 8px;
    font-size: 0.85rem;
}
.history-label {
    color: var(--text-dim);
}

/* Position Analysis */
.position-analysis {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.analysis-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.move-label {
    font-size: 0.9rem;
    font-weight: 600;
}
.eval-badge {
    font-size: 0.85rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 6px;
    background: var(--bg-lighter);
}
.eval-badge.blunder {
    background: var(--error);
    color: white;
}
.eval-badge.mistake {
    background: #d62828;
    color: white;
}
.eval-badge.inaccuracy {
    background: var(--accent-amber);
    color: #1a1a28;
}
.eval-badge.good {
    background: #4d908e;
    color: white;
}
.eval-badge.best {
    background: var(--accent-green);
    color: #1a1a28;
}

.loading-inline {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px;
    color: var(--text-dim);
}
.spinner-small {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.waiting-state {
    text-align: center;
    padding: 24px;
    color: var(--text-dim);
}
.waiting-state .hint {
    font-size: 0.85rem;
    margin-top: 8px;
    color: var(--text-dark);
}

/* Your Move Box */
.your-move-box {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--bg);
    border-radius: 8px;
}
.your-move-box .label {
    color: var(--text-dim);
    font-size: 0.85rem;
}
.your-move-box .move-san {
    font-weight: 700;
    font-size: 1.1rem;
    font-family: "SF Mono", monospace;
}
.your-move-box .eval-tag {
    margin-left: auto;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    background: var(--bg-lighter);
}

/* Alternatives Table */
.alt-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.alt-table th {
    text-align: left;
    padding: 6px 8px;
    color: var(--text-dim);
    font-weight: 600;
    font-size: 0.8rem;
    border-bottom: 1px solid var(--border);
}
.alt-table td {
    padding: 8px;
    border-bottom: 1px solid var(--border);
}
.alt-table tr:last-child td {
    border-bottom: none;
}
.alt-table .move-cell {
    font-family: "SF Mono", monospace;
    font-weight: 600;
    cursor: pointer;
}
.alt-table .move-cell:hover {
    color: var(--accent);
}
.alt-table .eval-cell {
    font-weight: 700;
    text-align: right;
}

/* Hint Box */
.hint-box {
    display: none;
}
.hint-sub {
    font-size: 0.75rem;
    color: var(--text-dark);
    font-weight: 400;
}
.hint-explanation {
    margin-top: 8px;
    padding: 10px 14px;
    background: var(--bg);
    border-radius: 8px;
    border-left: 3px solid var(--accent-amber);
}
.hint-explanation-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--accent-amber);
    margin-bottom: 4px;
}

/* Explanation */
.explanation-box {
    padding: 14px;
    background: var(--bg);
    border-radius: 8px;
    border-left: 3px solid var(--accent-green);
}
.explanation-text {
    line-height: 1.6;
    font-size: 0.95rem;
}

/* Show The Math */
.show-the-math {
    margin-top: 4px;
}
.stm-toggle {
    width: 100%;
    text-align: left;
    background: var(--bg-lighter);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 10px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.stm-toggle .arrow {
    transition: transform 0.2s;
}
.stm-toggle.open .arrow {
    transform: rotate(180deg);
}
.stm-content {
    padding: 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 8px 8px;
    font-size: 0.85rem;
    line-height: 1.6;
}
.stm-content pre {
    background: #0a0a14;
    padding: 10px;
    border-radius: 6px;
    overflow-x: auto;
    font-size: 0.8rem;
    margin: 8px 0;
}
.stm-content .stm-label {
    font-weight: 700;
    color: var(--accent-amber);
    margin-top: 8px;
}

/* Validator */
.validator-box {
    padding: 12px;
    background: var(--bg);
    border-radius: 8px;
}
.validator-status {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-top: 8px;
}
.v-layer {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    border-radius: 6px;
    font-size: 0.8rem;
    background: var(--bg-lighter);
}
.v-layer .v-icon {
    font-size: 0.9rem;
}
.v-layer .v-name {
    flex: 1;
    font-weight: 600;
}
.v-layer .v-status {
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
}
.v-layer .v-status.waiting {
    background: var(--bg);
    color: var(--text-dark);
}
.v-layer .v-status.pass {
    background: var(--accent-green);
    color: #1a1a28;
}
.v-layer .v-status.fail {
    background: var(--error);
    color: white;
}

/* Feedback */
.feedback {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-dim);
}

/* Section Title */
.section-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}

/* Adaptive AI Toggle */
.adaptive-toggle {
    margin-top: 6px;
}
.adaptive-hint {
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-left: 44px;
    margin-top: 2px;
}

/* Practice Puzzle Board */
.pz-wrapper {
    background: var(--panel-bg);
    border-radius: 8px;
    padding: 12px;
}
.pz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    font-size: 0.85rem;
}
.pz-label {
    color: var(--text-main);
}
.pz-rating {
    color: var(--text-dim);
    font-size: 0.78rem;
}
.pz-side-hint {
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-bottom: 6px;
}
.pz-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    width: 100%;
    aspect-ratio: 1;
    border: 1px solid var(--border);
    border-radius: 4px;
    overflow: hidden;
}
.pz-sq {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
}
.pz-sq.light {
    background: #f0d9b5;
}
.pz-sq.dark {
    background: #b58863;
}
.pz-sq.selected {
    outline: 3px solid #f6f669;
    outline-offset: -3px;
}
.pz-sq.move-dest::after {
    content: "";
    position: absolute;
    width: 30%;
    height: 30%;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 50%;
}
.pz-feedback {
    min-height: 20px;
    margin-top: 8px;
    font-size: 0.85rem;
    text-align: center;
}
.pz-correct {
    color: var(--accent-green, #4caf50);
    font-weight: bold;
}
.pz-wrong {
    color: #f44336;
}
.pz-solution {
    color: var(--accent-blue, #2196f3);
}
.pz-reveal-btn {
    margin-top: 8px;
    width: 100%;
    padding: 6px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-dim);
    cursor: pointer;
    font-size: 0.8rem;
}
.pz-reveal-btn:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* Calibration active banner */
.calibration-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-top: 10px;
    color: var(--text);
}
.calib-progress-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}
.calib-stats {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    font-weight: 700;
}
.calib-guide {
    font-size: 0.85rem;
    color: var(--accent-amber);
    font-style: italic;
    background: rgba(255, 159, 67, 0.1);
    padding: 6px 12px;
    border-radius: 6px;
    border-left: 3px solid var(--accent-amber);
}
