* {
    font-family: "Inter", sans-serif;
    font-optical-sizing: auto;
}

body {
    margin: 0;
    overflow: hidden;
}

canvas {
    display: block;
}

#controls {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    padding: 1.2rem;
    border-radius: 5px;
    font-family: Arial, sans-serif;
    z-index: 100;
}

button {
    background: #8B4513;
    /* Saddle brown - more rope-like color */
    border: none;
    color: white;
    padding: 5px 10px;
    margin: 5px 0;
    border-radius: 3px;
    cursor: pointer;
}

button:hover {
    background: #A0522D;
    /* Sienna - lighter brown on hover */
}

#video-container {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 320px;
    height: 240px;
    border: 2px solid #d2b48c;
    /* Tan border to match rope */
    border-radius: 5px;
    overflow: hidden;
    z-index: 10;
}

#handCanvas {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 320px;
    height: 240px;
    z-index: 20;
}

#videoElement {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#status {
    color: white;
    background: rgba(0, 0, 0, 0.5);
    padding: 5px;
    position: absolute;
    bottom: 250px;
    right: 10px;
    border-radius: 3px;
    width: 320px;
}

#timer-container {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: rgba(139, 69, 19, 0.7);
    /* Rope-themed background */
    color: white;
    padding: 10px;
    border-radius: 5px;
    z-index: 100;
    border: 2px solid #d2b48c;
    /* Tan border */
}

#score-container {
    position: absolute;
    top: 60px;
    right: 10px;
    background-color: rgba(139, 69, 19, 0.7);
    /* Rope-themed background */
    color: white;
    padding: 10px;
    border-radius: 5px;
    z-index: 100;
    border: 2px solid #d2b48c;
    /* Tan border */
}



#game-over-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(139, 69, 19, 0.9);
    /* Rope-themed background */
    color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    font-size: 24px;
    z-index: 200;
    display: none;
    flex-direction: column;
    gap: 1rem;
    border: 3px solid #d2b48c;
    /* Tan border */
    h2{
        font-size: 2.5rem;
    }
    * {
        margin:0;
        padding:0;
    }
}

#difficulty-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(139, 69, 19, 0.9);
    color: white;
    padding: 1.5rem 2rem;
    border-radius: 10px;
    text-align: center;
    font-size: 24px;
    z-index: 200;
    border: 3px solid #d2b48c;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.difficulty-button {
    padding: 15px 20px;
    font-size: 1.2em;
    cursor: pointer;
    background-color: #8B4513;
    color: white;
    border: 2px solid #d2b48c;
    border-radius: 5px;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.difficulty-button:hover {
    background-color: #A0522D;
    transform: scale(1.05);
}

.difficulty-time {
    font-size: 0.8em;
    margin-top: 5px;
    opacity: 0.8;
}

#easy-button {
    border-color: #90EE90;
    /* Light green */
}

#medium-button {
    border-color: #FFD700;
    /* Gold */
}

#hard-button {
    border-color: #FF6347;
    /* Tomato */
}

#game-prompt {
    color: white;
    background: rgba(139, 69, 19, 0.7);
    padding: 10px;
    position: absolute;
    bottom: 320px;
    right: 10px;
    border-radius: 5px;
    width: 320px;
    text-align: center;
    border: 2px solid #d2b48c;
    font-size: 1.1em;
    z-index: 15;
}

#game-prompt .highlight {
    color: #FFD700;
    font-weight: bold;
}

#voice-indicator {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(139, 69, 19, 0.7);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    border: 2px solid #d2b48c;
    font-size: 0.9em;
    z-index: 150;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

#voice-indicator:hover {
    transform: translateX(-50%) scale(1.05);
    background-color: rgba(139, 69, 19, 0.8);
    cursor: pointer;
}

#voice-indicator.listening {
    background-color: rgba(144, 238, 144, 0.7);
    /* Light green when active */
    border-color: #90EE90;
}

#voice-indicator-icon {
    width: 12px;
    height: 12px;
    background-color: #d2b48c;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

#voice-indicator.listening #voice-indicator-icon {
    background-color: #FF6347;
    /* Red dot when listening */
    animation: pulse 1.5s infinite;
}

#voice-indicator .command {
    font-weight: bold;
    color: #FFD700;
    /* Gold color for commands */
}

#voice-indicator.processing {
    background-color: rgba(255, 165, 0, 0.7); /* Orange background when processing */
    animation: processingPulse 1.5s infinite;
}

#voice-indicator .processing-dot {
    display: none;
}

@keyframes pulse {
    0% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.5;
    }
}

@keyframes processingPulse {
    0% { background-color: rgba(255, 165, 0, 0.4); }
    50% { background-color: rgba(255, 165, 0, 0.8); }
    100% { background-color: rgba(255, 165, 0, 0.4); }
}

/* Knot Measurement Styles */
#measureKnot {
    background-color: #8B4513;
    color: white;
    border: 2px solid #d2b48c;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
    margin-top: 5px;
}

#measureKnot:hover {
    background-color: #A0522D;
}

#knotRating {
    font-weight: bold;
    color: #FFD700;
}

/* Animation for measurement indicators */
@keyframes pulse-indicator {
    0% { opacity: 0.5; }
    50% { opacity: 1; }
    100% { opacity: 0.5; }
}

#voice-indicator.recognized {
    background-color: rgba(255, 215, 0, 0.8); /* Gold background when command recognized */
    border-color: #FFD700;
    transform: translateX(-50%) scale(1.1);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
}

#tangleMetrics {
    margin-top: 10px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 5px;
}

#knotMeasurement {
    margin-top: 10px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 5px;
}

#knotMeasurement p {
    margin: 5px 0;
}

#knotMeasurement span {
    font-weight: bold;
    color: #FFD700;
}

#measureKnot {
    background: #8B4513;
    color: white;
    padding: 5px 10px;
    margin: 5px 0;
    border-radius: 3px;
    cursor: pointer;
    border: 2px solid #d2b48c;
}

#measureKnot:hover {
    background: #A0522D;
}

#measureKnot:disabled {
    background: #666;
    cursor: not-allowed;
} 