/* DunceAI - Fraction Monkeys Styles */

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

:root {
    --primary-orange: #FF6B35;
    --primary-yellow: #FFD23F;
    --primary-blue: #3D5A80;
    --primary-teal: #35A7A7;
    --success-green: #4CAF50;
    --error-red: #E74C3C;
    --monkey-brown: #8B4513;
    --monkey-face: #DEB887;
    --bg-cream: #FFF8E7;
    --text-dark: #2C3E50;
    --shadow: 0 4px 15px rgba(0,0,0,0.1);
}

body {
    font-family: 'Segoe UI', 'Comic Sans MS', Tahoma, sans-serif;
    background: linear-gradient(135deg, var(--bg-cream) 0%, #FFE4C4 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.game-container {
    background: white;
    border-radius: 24px;
    box-shadow: var(--shadow), 0 0 0 4px var(--primary-orange);
    max-width: 850px;
    width: 100%;
    padding: 24px;
    position: relative;
    overflow: hidden;
}

/* Header */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
}

.logo-dunce {
    color: var(--primary-orange);
}

.logo-ai {
    color: var(--primary-blue);
}

.game-header h1 {
    color: var(--text-dark);
    font-size: 1.4rem;
}

/* Intro Screen */
.intro-screen {
    text-align: center;
    padding: 60px 20px;
}

.intro-content {
    max-width: 400px;
    margin: 0 auto;
}

.intro-monkey {
    animation: swing 2s ease-in-out infinite;
}

@keyframes swing {
    0%, 100% { transform: rotate(-5deg); }
    50% { transform: rotate(5deg); }
}

.intro-content h2 {
    color: var(--primary-blue);
    font-size: 1.4rem;
    margin: 20px 0 30px;
    line-height: 1.5;
}

/* Buttons */
.btn {
    padding: 14px 32px;
    font-size: 1.1rem;
    font-weight: bold;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-start {
    background: linear-gradient(135deg, var(--success-green) 0%, #45A049 100%);
    color: white;
    box-shadow: 0 4px 0 #2E7D32;
}

.btn-start:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #2E7D32;
}

.btn-next {
    background: linear-gradient(135deg, var(--primary-blue) 0%, #2C4A6E 100%);
    color: white;
    box-shadow: 0 4px 0 #1E3A5F;
    margin-top: 16px;
}

.btn-next:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #1E3A5F;
}

/* Game Screen */
.game-screen {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Score Panel */
.score-panel {
    display: flex;
    justify-content: center;
    gap: 30px;
    padding: 12px;
    background: linear-gradient(135deg, #E8F4FD 0%, #D0E8F8 100%);
    border-radius: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.score-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.score-label {
    font-size: 1rem;
    color: var(--text-dark);
}

.score-sublabel {
    font-size: 0.85rem;
    color: #666;
}

.score-value {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--primary-blue);
}

/* Game Area */
.game-area {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Number Line Area */
.number-line-area {
    background: #F0F8FF;
    border-radius: 12px;
    padding: 20px;
    position: relative;
    min-height: 200px;
}

.number-line {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.line-marker {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-blue);
    width: 30px;
    text-align: center;
}

.line-track {
    flex: 1;
    height: 6px;
    background: var(--primary-blue);
    border-radius: 3px;
    position: relative;
}

.hooks-container {
    display: flex;
    position: relative;
    height: 130px;
    margin-left: 40px;
    margin-right: 40px;
}

.hook {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    transform: translateX(-50%);
    cursor: default;
}

.hook-line {
    width: 3px;
    height: 30px;
    background: var(--primary-blue);
}

.hook-circle {
    width: 24px;
    height: 24px;
    border: 3px solid var(--primary-blue);
    border-radius: 50%;
    background: #FFFFCC;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hook-label {
    margin-top: 5px;
    text-align: center;
    font-size: 0.9rem;
    font-weight: bold;
    color: var(--primary-blue);
}

.hook-label .num {
    display: block;
    border-bottom: 2px solid var(--primary-blue);
    padding-bottom: 2px;
    margin-bottom: 2px;
}

.hook.occupied .hook-circle {
    background: var(--success-green);
    border-color: #2E7D32;
}

.placed-monkeys {
    position: absolute;
    top: 0;
    left: 40px;
    right: 40px;
    height: 100%;
    pointer-events: none;
}

.placed-monkey {
    position: absolute;
    width: 55px;
    height: 80px;
    transform: translateX(-50%);
    transition: top 0.3s ease;
}

.placed-monkey svg {
    width: 100%;
    height: 100%;
}

.placed-monkey.falling {
    animation: fall 0.8s ease-in forwards;
}

@keyframes fall {
    0% { transform: translateX(-50%) translateY(0) rotate(0); opacity: 1; }
    100% { transform: translateX(-50%) translateY(150px) rotate(45deg); opacity: 0; }
}

.placed-monkey.correct {
    animation: lockIn 0.5s ease;
}

@keyframes lockIn {
    0%, 100% { transform: translateX(-50%) scale(1); }
    50% { transform: translateX(-50%) scale(1.1); }
}

/* Monkey Zone */
.monkey-zone {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 15px;
    background: linear-gradient(135deg, #FFF5EE 0%, #FFE4D4 100%);
    border-radius: 12px;
}

.draggable-monkey {
    width: 80px;
    height: 115px;
    cursor: grab;
    transition: transform 0.1s ease;
    touch-action: none;
}

.draggable-monkey:active {
    cursor: grabbing;
}

.draggable-monkey.dragging {
    position: fixed;
    z-index: 1000;
    cursor: grabbing;
    transform: scale(1.1);
    pointer-events: none;
}

.draggable-monkey.hidden {
    visibility: hidden;
}

.monkey-svg {
    width: 100%;
    height: 100%;
}

.instruction {
    flex: 1;
    font-size: 1.1rem;
    color: var(--primary-blue);
    font-weight: 500;
}

/* Clue Area */
.clue-area {
    background: #FFF5EE;
    border: 2px solid var(--primary-orange);
    border-radius: 12px;
    padding: 15px;
    text-align: center;
}

.clue-area h4 {
    color: var(--primary-orange);
    margin-bottom: 10px;
}

.fraction-visual {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.visual-row {
    display: flex;
    gap: 4px;
}

.visual-square {
    width: 25px;
    height: 25px;
    border: 2px solid #333;
    border-radius: 3px;
}

.visual-square.filled {
    background: var(--success-green);
}

.visual-square.empty {
    background: white;
}

/* Dunce Panel */
.dunce-panel {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 10px;
}

.dunce-character {
    width: 70px;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.dunce-svg {
    width: 100%;
    height: auto;
}

.dunce-character.excited {
    animation: dunce-bounce 0.4s ease;
}

@keyframes dunce-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.dunce-character.smirk {
    transform: rotate(-5deg);
}

.speech-bubble {
    background: white;
    border: 2px solid var(--primary-orange);
    border-radius: 12px;
    padding: 12px 16px;
    position: relative;
    box-shadow: var(--shadow);
    flex: 1;
}

.speech-bubble::before {
    content: '';
    position: absolute;
    left: -10px;
    top: 15px;
    border: 8px solid transparent;
    border-right-color: var(--primary-orange);
}

.speech-bubble::after {
    content: '';
    position: absolute;
    left: -6px;
    top: 17px;
    border: 6px solid transparent;
    border-right-color: white;
}

.speech-bubble p {
    color: var(--text-dark);
    line-height: 1.4;
    margin: 0;
    font-size: 1rem;
}

/* Win Overlay */
.win-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    border-radius: 24px;
    z-index: 100;
}

.win-overlay.show {
    display: flex;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.win-content {
    background: white;
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    border: 4px solid var(--primary-yellow);
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    animation: popIn 0.4s ease;
}

@keyframes popIn {
    0% { transform: scale(0.5); opacity: 0; }
    70% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

.win-monkey {
    animation: celebrate 0.6s ease-in-out infinite alternate;
}

@keyframes celebrate {
    from { transform: rotate(-10deg); }
    to { transform: rotate(10deg); }
}

.win-content h2 {
    color: var(--primary-blue);
    margin: 16px 0 8px;
    font-size: 1.5rem;
}

.win-content p {
    color: var(--text-dark);
    margin-bottom: 20px;
    font-size: 1.1rem;
}

/* Responsive */
@media (max-width: 600px) {
    .game-container {
        padding: 16px;
    }

    .score-panel {
        gap: 15px;
    }

    .score-item {
        gap: 4px;
    }

    .monkey-zone {
        flex-direction: column;
        text-align: center;
    }

    .dunce-panel {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .speech-bubble::before,
    .speech-bubble::after {
        left: 50%;
        top: -10px;
        transform: translateX(-50%) rotate(90deg);
    }

    .speech-bubble::after {
        top: -6px;
    }

    .number-line-area {
        padding: 15px 10px;
    }

    .hooks-container {
        margin-left: 30px;
        margin-right: 30px;
    }

    .placed-monkeys {
        left: 30px;
        right: 30px;
    }
}
