/* css/styles.css */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Comic Sans MS', 'Chalkboard', sans-serif;
    background: url('../assets/images/space-bg.jpg') no-repeat center center fixed;
    background-size: cover;
    min-height: 100vh;
    overflow: hidden;
    position: relative;
}

#game-container {
    width: 100vw;
    height: 100vh;
    position: relative;
    z-index: 1;
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
    pointer-events: none;
}

.screen.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Timer */
.timer-bar-container {
    width: 80%;
    max-width: 400px;
    height: 20px;
    background: rgba(255,255,255,0.5);
    border-radius: 10px;
    overflow: hidden;
    border: 3px solid white;
}

.timer-bar {
    height: 100%;
    border-radius: 7px;
    transition: width 0.05s linear, background-color 0.3s;
}

.timer-bar.green {
    background: linear-gradient(90deg, #4ECDC4, #44CF6C);
}

.timer-bar.yellow {
    background: linear-gradient(90deg, #FFE66D, #F0B429);
}

.timer-bar.orange {
    background: linear-gradient(90deg, #FF9F43, #FF6B6B);
}

/* Menu Screen */
.menu-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.game-title {
    font-size: 4rem;
    color: #FF6B6B;
    text-shadow: 4px 4px 0 #FFE66D;
    letter-spacing: 0.1em;
}

.menu-buttons {
    display: flex;
    gap: 2rem;
}

.menu-buttons button {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 6px solid #fff;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-buttons button:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

.btn-play {
    background: linear-gradient(135deg, #4ECDC4 0%, #44A08D 100%);
}

.btn-collection {
    background: linear-gradient(135deg, #FFE66D 0%, #F0B429 100%);
}

.btn-icon {
    font-size: 3rem;
}

/* Robot Buddy Base Styles */
.robot-buddy {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.robot-image {
    display: block;
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.15));
}

.menu-robot {
    animation: bounce 2s ease-in-out infinite;
}

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

/* Letter Display */
.letter-display {
    width: 250px;
    height: 250px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.4);
    position: relative;
}

/* Border Timer SVG */
.border-timer {
    position: absolute;
    top: -5px;
    left: -5px;
    width: 260px;
    height: 260px;
    transform: rotate(-90deg);
    pointer-events: none;
    z-index: 1;
}

.border-timer-track {
    fill: none;
    stroke: rgba(255, 255, 255, 0.3);
    stroke-width: 8;
}

.border-timer-progress {
    fill: none;
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke 0.3s ease;
}

.border-timer-progress.green {
    stroke: #44CF6C;
}

.border-timer-progress.yellow {
    stroke: #FFE66D;
}

.border-timer-progress.orange {
    stroke: #FF6B6B;
}

.border-timer-progress.correct {
    stroke: #44CF6C;
}

.letter {
    font-size: 10rem;
    font-weight: bold;
    position: relative;
    z-index: 10;
    color: white;
    text-shadow: 4px 4px 0 rgba(0,0,0,0.2);
    opacity: 0;
    transform: scale(0.5);
    transition: opacity 0.3s, transform 0.3s;
}

.letter.visible {
    opacity: 1;
    transform: scale(1);
}

.letter.correct {
    animation: correctPulse 0.5s ease-out;
    color: #44CF6C;
}

.letter.wrong {
    animation: wrongShake 0.3s ease-out;
}

@keyframes correctPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

@keyframes wrongShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* Confetti */
.confetti-piece {
    position: fixed;
    width: 12px;
    height: 12px;
    z-index: 1000;
    pointer-events: none;
}

/* Robot Animations */
.robot-buddy.celebrating {
    animation: celebrate 0.5s ease-out 2;
}

@keyframes celebrate {
    0%, 100% { transform: translateY(0) rotate(0); }
    25% { transform: translateY(-30px) rotate(-10deg); }
    75% { transform: translateY(-30px) rotate(10deg); }
}

.robot-buddy.encouraging {
    animation: nod 0.25s ease-out 2;
}

@keyframes nod {
    0%, 100% { transform: rotate(0); }
    50% { transform: rotate(10deg); }
}

.robot-buddy.idle {
    animation: idleBounce 3s ease-in-out infinite;
}

@keyframes idleBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.robot-buddy.waving {
    animation: wave 0.3s ease-in-out 3;
}

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

/* Collection Screen */
.collection-content {
    width: 100%;
    height: 100%;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.collection-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.btn-back {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 4px solid white;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-back:hover {
    transform: scale(1.1);
}

.btn-back .btn-icon {
    font-size: 1.5rem;
    color: white;
}

.collection-count {
    font-size: 2rem;
    font-weight: bold;
    color: #333;
    background: rgba(255,255,255,0.9);
    padding: 0.5rem 1.5rem;
    border-radius: 20px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.robots-grid {
    display: grid;
    grid-template-columns: repeat(10, 100px);
    gap: 1.5rem;
    padding: 1rem;
    justify-content: center;
}

.collection-footer {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.btn-continue-playing {
    background: linear-gradient(135deg, #4ECDC4 0%, #44A08D 100%);
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
    font-family: 'Comic Sans MS', 'Chalkboard', sans-serif;
    padding: 1rem 3rem;
    border: 4px solid white;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(78, 205, 196, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-continue-playing:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(78, 205, 196, 0.5);
}

.robot-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.collection-robot {
    width: 80px;
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: transform 0.2s;
}

.robot-svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 5px 10px rgba(0,0,0,0.3));
}

.robot-card.collected .collection-robot:hover {
    transform: scale(1.1);
}

.collection-robot.mystery {
    background: linear-gradient(135deg, #ccc 0%, #999 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.collection-robot.mystery span {
    font-size: 2.5rem;
    color: #666;
}

.robot-mini-eye {
    position: absolute;
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    top: 20px;
}

.robot-mini-eye.left { left: 15px; }
.robot-mini-eye.right { right: 15px; }

.robot-mini-eye::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    background: #333;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.robot-name {
    font-size: 0.9rem;
    font-weight: bold;
    color: white;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
}

.collection-robot.wiggle {
    animation: robotWiggle 0.5s ease-in-out;
}

@keyframes robotWiggle {
    0%, 100% { transform: rotate(0) scale(1.1); }
    25% { transform: rotate(-10deg) scale(1.1); }
    75% { transform: rotate(10deg) scale(1.1); }
}

/* New Robot Reveal Animation */
.reveal-container {
    position: relative;
}

.mystery-box {
    width: 80px;
    height: 90px;
    background: linear-gradient(135deg, #ccc 0%, #999 100%);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 10;
}

.mystery-box span {
    font-size: 2.5rem;
    color: #666;
}

.mystery-box.exploding {
    animation: explode 0.5s ease-out forwards;
}

@keyframes explode {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.8; }
    100% { transform: scale(0); opacity: 0; }
}

.new-robot-hidden {
    opacity: 0;
    transform: scale(0);
}

.new-robot-reveal {
    animation: robotAppear 0.6s ease-out forwards;
}

@keyframes robotAppear {
    0% { opacity: 0; transform: scale(0) rotate(-180deg); }
    60% { transform: scale(1.2) rotate(10deg); }
    100% { opacity: 1; transform: scale(1) rotate(0); }
}

/* Explosion Particles */
.explosion-particle {
    position: fixed;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 1000;
}

/* Game Screen */
.game-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 2rem;
}

/* Countdown */
.countdown-overlay {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.countdown-number {
    font-size: 15rem;
    font-weight: bold;
    color: white;
    text-shadow: 0 0 30px rgba(78, 205, 196, 0.8), 4px 4px 0 rgba(0,0,0,0.3);
}

.countdown-animate {
    animation: countdownPop 0.8s ease-out;
}

@keyframes countdownPop {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.3); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

.game-header {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    position: relative;
}

/* Pause Button */
.btn-pause {
    position: absolute;
    right: 1rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 3px solid white;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-pause:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(1.1);
}

/* Pause Overlay */
.pause-overlay {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    align-items: center;
    justify-content: center;
    z-index: 200;
}

.pause-menu {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 3rem;
    border-radius: 20px;
    border: 4px solid white;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.pause-menu h2 {
    color: white;
    font-size: 3rem;
    margin-bottom: 2rem;
    text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.3);
}

.pause-menu button {
    display: block;
    width: 200px;
    padding: 1rem;
    margin: 1rem auto;
    border-radius: 15px;
    border: 3px solid white;
    font-size: 1.5rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-resume {
    background: linear-gradient(135deg, #44CF6C 0%, #2ecc71 100%);
    color: white;
}

.btn-resume:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(68, 207, 108, 0.5);
}

.btn-exit {
    background: linear-gradient(135deg, #FF6B6B 0%, #ee5a5a 100%);
    color: white;
}

.btn-exit:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(255, 107, 107, 0.5);
}

.progress-dots {
    display: flex;
    gap: 0.5rem;
}

.progress-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    border: 3px solid white;
    transition: all 0.3s;
}

.progress-dot.current {
    background: #4A90D9;
    transform: scale(1.2);
}

.progress-dot.correct {
    background: #44CF6C;
}

.progress-dot.wrong {
    background: #FF6B6B;
}

.game-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.game-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
}

.robot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
}

/* Score Screen */
.score-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.score-display {
    text-align: center;
}

.score-number {
    font-size: 8rem;
    font-weight: bold;
    color: #4ECDC4;
    text-shadow: 4px 4px 0 #2C7873;
    line-height: 1;
}

.score-label {
    font-size: 2rem;
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.stars-container {
    display: flex;
    gap: 0.5rem;
}

.star {
    font-size: 3rem;
    color: #ddd;
    transition: all 0.3s;
}

.star.filled {
    color: #FFD700;
    text-shadow: 2px 2px 0 #B8860B;
    animation: starPop 0.5s ease-out backwards;
}

.star:nth-child(1) { animation-delay: 0.2s; }
.star:nth-child(2) { animation-delay: 0.4s; }
.star:nth-child(3) { animation-delay: 0.6s; }

@keyframes starPop {
    0% { transform: scale(0); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* Robot Earned */
.robot-earned {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    animation: robotFlyIn 1s ease-out 1.5s backwards;
}

@keyframes robotFlyIn {
    0% {
        opacity: 0;
        transform: translateY(-100px) scale(0);
    }
    60% {
        transform: translateY(20px) scale(1.2);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.mini-robot {
    width: 60px;
    height: 70px;
    border-radius: 20px 20px 25px 25px;
    border: 3px solid white;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    position: relative;
}

.mini-robot::before,
.mini-robot::after {
    content: '';
    position: absolute;
    width: 15px;
    height: 15px;
    background: white;
    border-radius: 50%;
    top: 15px;
}

.mini-robot::before { left: 10px; }
.mini-robot::after { right: 10px; }

.robot-earned-name {
    font-size: 1.2rem;
    font-weight: bold;
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.earned-robot-svg {
    width: 80px;
    height: 90px;
    filter: drop-shadow(0 5px 15px rgba(0,0,0,0.3));
    animation: robotBounce 0.5s ease-out infinite alternate;
}

@keyframes robotBounce {
    0% { transform: translateY(0); }
    100% { transform: translateY(-10px); }
}

/* Score Buttons */
.score-buttons {
    display: flex;
    gap: 1.5rem;
    margin-top: 1rem;
}

.score-buttons button {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 4px solid white;
    cursor: pointer;
    transition: transform 0.2s;
}

.score-buttons button:hover {
    transform: scale(1.1);
}

.btn-play-again {
    background: linear-gradient(135deg, #4ECDC4 0%, #44A08D 100%);
}

.btn-home {
    background: linear-gradient(135deg, #FF6B6B 0%, #C44569 100%);
}

.btn-see-robots {
    background: linear-gradient(135deg, #FFE66D 0%, #F0B429 100%);
}

.score-buttons .btn-icon {
    font-size: 2rem;
}

/* New Letter Suggestion */
.new-letter-suggestion {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 1.5rem 2rem;
    border-radius: 20px;
    text-align: center;
    color: white;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
    animation: slideUp 0.5s ease-out 2s backwards;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.suggestion-text {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.suggestion-letter {
    font-size: 4rem;
    font-weight: bold;
    text-shadow: 3px 3px 0 rgba(0,0,0,0.2);
}

.suggestion-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
}

.suggestion-buttons button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px solid white;
    font-size: 1.5rem;
    cursor: pointer;
    transition: transform 0.2s;
}

.suggestion-buttons button:hover {
    transform: scale(1.1);
}

.btn-yes-letter {
    background: #44CF6C;
    color: white;
}

.btn-no-letter {
    background: #FF6B6B;
    color: white;
}

/* Name Entry Screen */
.name-entry-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    padding: 2rem;
}

.name-entry-title {
    font-size: 3rem;
    color: white;
    text-shadow: 3px 3px 0 rgba(0,0,0,0.3);
}

.name-input {
    font-size: 2rem;
    font-family: 'Comic Sans MS', 'Chalkboard', sans-serif;
    padding: 1rem 2rem;
    border: 4px solid white;
    border-radius: 25px;
    background: rgba(255,255,255,0.9);
    text-align: center;
    width: 300px;
    outline: none;
}

.name-input:focus {
    box-shadow: 0 0 20px rgba(255,255,255,0.5);
}

.btn-lets-play {
    background: linear-gradient(135deg, #4ECDC4 0%, #44A08D 100%);
    color: white;
    font-size: 2rem;
    font-weight: bold;
    font-family: 'Comic Sans MS', 'Chalkboard', sans-serif;
    padding: 1rem 3rem;
    border: 4px solid white;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(78, 205, 196, 0.4);
    transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
}

.btn-lets-play:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(78, 205, 196, 0.5);
}

.btn-lets-play:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.loading-status {
    text-align: center;
}

.loading-text {
    font-size: 1.5rem;
    color: white;
    text-shadow: 2px 2px 0 rgba(0,0,0,0.3);
    margin-bottom: 1.5rem;
}

.loading-bar-container {
    width: 300px;
    height: 20px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    overflow: hidden;
    border: 3px solid white;
    margin: 0 auto 1rem auto;
}

.loading-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #4ECDC4, #44CF6C);
    border-radius: 7px;
    transition: width 0.3s ease;
}

.loading-progress {
    font-size: 1.2rem;
    color: #4ECDC4;
}
