/**
 * Knock the Hands Down - Game Styles
 */

.knock-hands-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
    background: var(--color-bg, #f8f9fa);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100;
}

.knock-hands-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: white;
    border-bottom: 1px solid #e9ecef;
    gap: 1rem;
    flex-wrap: wrap;
}

.knock-hands-back {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-text-muted, #6c757d);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.knock-hands-back:hover {
    color: var(--color-primary, #1e3a5f);
}

.knock-hands-title {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.knock-hands-title h2 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--color-text, #212529);
}

.knock-hands-status {
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    background: #e9ecef;
    color: #6c757d;
}

.knock-hands-status.tracking {
    background: #d4edda;
    color: #155724;
}

.knock-hands-controls {
    display: flex;
    gap: 0.5rem;
}

.knock-hands-viewport {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    width: 100%;
}

.knock-hands-canvas {
    flex: 1;
    width: 100%;
    height: 100%;
}

.knock-hands-stats {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    background: var(--color-primary, #1e3a5f);
    color: white;
    padding: 1rem;
    border-radius: 0.5rem;
    font-size: 0.85rem;
    z-index: 10;
    min-width: 130px;
}

.knock-hands-stats .stat-item {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.knock-hands-stats .stat-label {
    opacity: 0.8;
}

.knock-hands-stats .stat-value {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* Instructions */
.knock-hands-instructions {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(248, 249, 250, 0.95);
    z-index: 20;
}

.knock-hands-instructions .instruction-card {
    background: white;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    max-width: 450px;
    text-align: center;
}

.knock-hands-instructions .instruction-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.knock-hands-instructions h3 {
    margin: 0 0 0.75rem;
    color: var(--color-primary, #1e3a5f);
}

.knock-hands-instructions p {
    color: #6c757d;
    margin: 0 0 1rem;
}

.knock-hands-instructions .instruction-list {
    text-align: left;
    padding-left: 1.5rem;
    margin: 0 0 1rem;
    color: #495057;
}

.knock-hands-instructions .instruction-list li {
    margin-bottom: 0.5rem;
}

.knock-hands-instructions .instruction-note {
    font-size: 0.9rem;
    color: #868e96;
    margin: 0;
}

/* Results */
.knock-hands-results {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(248, 249, 250, 0.95);
    z-index: 20;
}

.knock-hands-results .results-card {
    background: white;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    max-width: 400px;
    text-align: center;
}

.knock-hands-results h3 {
    margin: 0 0 1.5rem;
    color: var(--color-primary, #1e3a5f);
    font-size: 1.5rem;
}

.results-stats {
    display: grid;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.result-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 0.5rem;
}

.result-label {
    color: #6c757d;
}

.result-value {
    font-weight: 600;
    color: var(--color-primary, #1e3a5f);
    font-variant-numeric: tabular-nums;
}

.results-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

/* Loading */
.knock-hands-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(248, 249, 250, 0.95);
    z-index: 30;
}

.knock-hands-loading .loading-content {
    text-align: center;
}

.knock-hands-loading .spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e9ecef;
    border-top-color: var(--color-primary, #1e3a5f);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.knock-hands-loading h3 {
    margin: 0 0 0.5rem;
    color: var(--color-primary, #1e3a5f);
}

.knock-hands-loading p {
    margin: 0;
    color: #6c757d;
}

/* Debug Panel */
.knock-hands-debug {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: rgba(0, 0, 0, 0.9);
    color: #fff;
    padding: 1rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-family: 'Monaco', 'Consolas', monospace;
    z-index: 20;
    max-width: 280px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

.knock-hands-debug .debug-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #444;
}

.knock-hands-debug .btn-small {
    font-size: 0.65rem;
    padding: 0.25rem 0.5rem;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 0.25rem;
    cursor: pointer;
}

.knock-hands-debug .btn-small:hover {
    background: #45a049;
}

.knock-hands-debug .debug-section {
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #333;
}

.knock-hands-debug .debug-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.knock-hands-debug .debug-title {
    color: #888;
    font-size: 0.65rem;
    text-transform: uppercase;
    margin-bottom: 0.35rem;
}

.knock-hands-debug .debug-row {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.15rem 0;
}

.knock-hands-debug .debug-row span:first-child {
    color: #aaa;
}

.knock-hands-debug .debug-row.highlight {
    background: rgba(76, 175, 80, 0.2);
    padding: 0.25rem 0.35rem;
    margin: 0.1rem -0.35rem;
    border-radius: 0.25rem;
}

.knock-hands-debug .debug-row.highlight span:last-child {
    color: #4CAF50;
    font-weight: bold;
}

/* Utility */
.hidden {
    display: none !important;
}

/* Responsive */
@media (max-width: 768px) {
    .knock-hands-header {
        padding: 0.75rem 1rem;
    }

    .knock-hands-title h2 {
        font-size: 1.1rem;
    }

    .knock-hands-stats {
        font-size: 0.8rem;
        padding: 0.75rem;
        min-width: 110px;
    }

    .knock-hands-instructions .instruction-card,
    .knock-hands-results .results-card {
        margin: 1rem;
        padding: 1.5rem;
    }
}
