/**
 * Create By zhixuan. © 2026 All right reserved.
 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Hiragino Maru Gothic Pro','Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f5e6d3 0%, #e8d4c4 50%, #d4c4b0 100%);
    color: #333;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

h1 {
    text-align: center;
    color: #5d4e37;
    margin-bottom: 30px;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.5);
    font-size: 2.5em;
}

.game-container {
    display: flex;
    gap: 30px;
    justify-content: center;
    flex-wrap: wrap;
}

.game-section, .camera-section {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.game-section {
    display: flex;
    flex-direction: column;
    align-items: center;
}

#gameCanvas {
    border: 3px solid #333;
    border-radius: 10px;
    background: #000;
    margin-bottom: 20px;
}

.game-info {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
    font-size: 1.2em;
    font-weight: bold;
}

button {
    background: #8b7355;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
    transition: background 0.2s, box-shadow 0.2s;
}

button:hover {
    background: #6d5a45;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

button:active {
    transform: translateY(0);
}

.camera-section {
    min-width: 300px;
}

.camera-section h2 {
    text-align: center;
    margin-bottom: 15px;
    color: #5d4e37;
}

#webcam-container {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    border-radius: 10px;
    overflow: hidden;
    background: #000;
}

#webcam-container canvas {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
}

#label-container {
    margin: 20px 0;
}

.prediction-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.label {
    font-weight: bold;
    min-width: 60px;
    color: #333;
}

.bar-container {
    flex: 1;
    height: 24px;
    background: #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.bar {
    height: 100%;
    background: #8b7355;
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 12px;
}

.percentage {
    min-width: 50px;
    text-align: right;
    font-weight: bold;
    color: #5d4e37;
}

#initCamera {
    width: 100%;
    margin-bottom: 10px;
}

#status {
    text-align: center;
    padding: 10px;
    background: #f0f0f0;
    border-radius: 8px;
    font-size: 0.9em;
    color: #666;
}

#status.active {
    background: #d4edda;
    color: #155724;
}

#status.error {
    background: #f8d7da;
    color: #721c24;
}

.loading-progress {
    margin: 15px 0;
}

.progress-bar-container {
    width: 100%;
    height: 30px;
    background: #e0e0e0;
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-bar {
    height: 100%;
    background: #8b7355;
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 15px;
}

.progress-text {
    text-align: center;
    color: #5d4e37;
    font-weight: bold;
    font-size: 0.9em;
}

.instructions {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin-top: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.instructions h3 {
    color: #5d4e37;
    margin-bottom: 15px;
}

.instructions ol {
    margin-left: 20px;
    line-height: 1.8;
}

.instructions p {
    margin-top: 15px;
    padding: 15px;
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    border-radius: 5px;
}

.instructions a {
    color: #8b7355;
    text-decoration: none;
    font-weight: bold;
}

.instructions a:hover {
    text-decoration: underline;
}

.footer {
    text-align: center;
    padding: 20px;
    margin-top: 30px;
    color: rgba(93, 78, 55, 0.7);
    font-size: 0.85em;
}

.footer p {
    margin: 0;
}

@media (max-width: 768px) {
    h1 {
        font-size: 1.8em;
    }
    
    .game-container {
        flex-direction: column;
        align-items: center;
    }
    
    #gameCanvas {
        width: 100%;
        max-width: 400px;
        height: auto;
    }
}
