/* CSS Custom Properties untuk warna */
:root {
    --primary: #6c5ce7;
    --primary-dark: #5649c9;
    --primary-light: #a29bfe;
    --success: #00b894;
    --success-dark: #00a382;
    --danger: #ff7675;
    --danger-dark: #e17076;
    --warning: #fdcb6e;
    --warning-dark: #f0b44c;
    --dark: #2d3436;
    --light: #dfe6e9;
    --gray: #b2bec3;
    --bg-gradient: linear-gradient(120deg, #a1c4fd 0%, #c2e9fb 100%);
    --card-bg: rgba(255, 255, 255, 0.95);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

/* Reset dan base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: var(--bg-gradient);
    color: var(--dark);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    line-height: 1.6;
    position: relative;
    overflow-x: hidden;
}

/* Animated Background Bubbles */
.bg-bubbles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.bubble {
    position: absolute;
    bottom: -100px;
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    animation: rise 15s infinite ease-in;
}

.bubble:nth-child(1) {
    width: 40px;
    height: 40px;
    left: 10%;
    animation-duration: 15s;
    animation-delay: 1s;
}

.bubble:nth-child(2) {
    width: 20px;
    height: 20px;
    left: 20%;
    animation-duration: 12s;
    animation-delay: 2s;
}

.bubble:nth-child(3) {
    width: 50px;
    height: 50px;
    left: 35%;
    animation-duration: 18s;
    animation-delay: 3s;
}

.bubble:nth-child(4) {
    width: 80px;
    height: 80px;
    left: 50%;
    animation-duration: 22s;
    animation-delay: 0s;
}

.bubble:nth-child(5) {
    width: 35px;
    height: 35px;
    left: 55%;
    animation-duration: 16s;
    animation-delay: 1s;
}

.bubble:nth-child(6) {
    width: 45px;
    height: 45px;
    left: 65%;
    animation-duration: 19s;
    animation-delay: 4s;
}

.bubble:nth-child(7) {
    width: 25px;
    height: 25px;
    left: 75%;
    animation-duration: 14s;
    animation-delay: 2s;
}

.bubble:nth-child(8) {
    width: 60px;
    height: 60px;
    left: 80%;
    animation-duration: 17s;
    animation-delay: 0s;
}

.bubble:nth-child(9) {
    width: 30px;
    height: 30px;
    left: 70%;
    animation-duration: 13s;
    animation-delay: 1s;
}

.bubble:nth-child(10) {
    width: 40px;
    height: 40px;
    left: 85%;
    animation-duration: 15s;
    animation-delay: 3s;
}

@keyframes rise {
    0% {
        bottom: -100px;
        transform: translateX(0) rotate(0deg);
        opacity: 0.6;
    }
    50% {
        transform: translateX(100px) rotate(180deg);
        opacity: 0.8;
    }
    100% {
        bottom: 1080px;
        transform: translateX(-200px) rotate(360deg);
        opacity: 0;
    }
}

/* Header Styles */
header {
    text-align: center;
    margin: 1.5rem 0 1rem;
    animation: fadeInDown 1s ease;
}

header h1 {
    font-size: 2.8rem;
    color: var(--dark);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 0.5rem;
}

header h1 i {
    color: var(--primary);
    margin-right: 0.5rem;
}

.subtitle {
    font-size: 1.1rem;
    color: var(--dark);
    opacity: 0.8;
    font-weight: 400;
}

/* Main Game Container */
.game-container {
    background-color: var(--card-bg);
    border-radius: 20px;
    box-shadow: var(--shadow);
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    animation: scaleIn 0.8s ease;
    backdrop-filter: blur(10px);
}

/* Instruction Section */
.instruction {
    text-align: center;
    margin-bottom: 1.8rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.instruction-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    box-shadow: 0 5px 15px rgba(108, 92, 231, 0.3);
    animation: pulse 2s infinite;
}

.instruction-icon i {
    font-size: 1.8rem;
    color: white;
}

.instruction p {
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--dark);
}

.highlight {
    color: var(--primary);
    font-weight: 700;
}

/* Progress Bar Section */
.progress-container {
    margin-bottom: 1.8rem;
}

.progress-bar {
    height: 12px;
    background-color: var(--light);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 0.5rem;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.progress-fill {
    height: 100%;
    width: 100%;
    background: linear-gradient(to right, var(--success), var(--primary));
    border-radius: 10px;
    transition: width 0.5s ease;
}

.progress-text {
    text-align: center;
    font-size: 0.9rem;
    color: var(--dark);
    opacity: 0.8;
}

/* Input Section */
.input-section {
    margin-bottom: 1.8rem;
}

.input-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: relative;
}

#guess-input {
    padding: 1rem 1.2rem;
    border: 2px solid var(--gray);
    border-radius: 12px;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    font-weight: 500;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

#guess-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.2), 0 4px 10px rgba(108, 92, 231, 0.1);
    transform: translateY(-2px);
}

#submit-btn {
    padding: 1rem 1.5rem;
    background: linear-gradient(to right, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 4px 15px rgba(108, 92, 231, 0.3);
}

#submit-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 7px 20px rgba(108, 92, 231, 0.4);
}

#submit-btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 10px rgba(108, 92, 231, 0.3);
}

/* Feedback Section */
.feedback {
    text-align: center;
    margin-bottom: 1.8rem;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feedback-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
}

.feedback-icon {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    animation: bounceIn 0.6s ease;
    transition: all 0.5s ease;
}

.feedback-default-icon {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    color: white;
    box-shadow: 0 5px 15px rgba(108, 92, 231, 0.3);
}

.feedback-success-icon {
    background: linear-gradient(135deg, var(--success) 0%, var(--success-dark) 100%);
    color: white;
    box-shadow: 0 5px 15px rgba(0, 184, 148, 0.3);
    animation: tada 1s ease;
}

.feedback-error-icon {
    background: linear-gradient(135deg, var(--danger) 0%, var(--danger-dark) 100%);
    color: white;
    box-shadow: 0 5px 15px rgba(255, 118, 117, 0.3);
    animation: shake 0.5s ease;
}

.feedback-warning-icon {
    background: linear-gradient(135deg, var(--warning) 0%, var(--warning-dark) 100%);
    color: white;
    box-shadow: 0 5px 15px rgba(253, 203, 110, 0.3);
    animation: pulse 0.5s ease;
}

#feedback-text {
    font-size: 1.2rem;
    font-weight: 500;
    padding: 0.8rem 1.2rem;
    border-radius: 12px;
    transition: all 0.3s ease;
    max-width: 100%;
}

.feedback-default {
    background-color: rgba(108, 92, 231, 0.1);
    color: var(--primary-dark);
}

.feedback-success {
    background-color: rgba(0, 184, 148, 0.1);
    color: var(--success-dark);
}

.feedback-error {
    background-color: rgba(255, 118, 117, 0.1);
    color: var(--danger-dark);
}

.feedback-warning {
    background-color: rgba(253, 203, 110, 0.1);
    color: var(--warning-dark);
}

/* Attempts Section */
.attempts {
    text-align: center;
    margin-bottom: 1.8rem;
}

#attempts-info {
    font-size: 1.1rem;
    color: var(--dark);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

#attempts-info i {
    color: var(--primary);
}

#attempts-info span {
    font-weight: 700;
    color: var(--primary);
}

/* Restart Button Section */
.restart-section {
    text-align: center;
}

#restart-btn {
    padding: 1rem 2rem;
    background: linear-gradient(to right, var(--success), var(--success-dark));
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 4px 15px rgba(0, 184, 148, 0.3);
    margin: 0 auto;
}

#restart-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 7px 20px rgba(0, 184, 148, 0.4);
}

#restart-btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 10px rgba(0, 184, 148, 0.3);
}

/* Footer */
footer {
    text-align: center;
    margin-top: 2rem;
    color: var(--dark);
    font-size: 0.9rem;
    opacity: 0.8;
}

.heart {
    color: var(--danger);
    animation: heartbeat 1.5s infinite;
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes tada {
    0% {
        transform: scale(1);
    }
    10%, 20% {
        transform: scale(0.9) rotate(-3deg);
    }
    30%, 50%, 70%, 90% {
        transform: scale(1.1) rotate(3deg);
    }
    40%, 60%, 80% {
        transform: scale(1.1) rotate(-3deg);
    }
    100% {
        transform: scale(1) rotate(0);
    }
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

@keyframes heartbeat {
    0% {
        transform: scale(1);
    }
    5% {
        transform: scale(1.2);
    }
    10% {
        transform: scale(1.1);
    }
    15% {
        transform: scale(1.3);
    }
    50% {
        transform: scale(1);
    }
    100% {
        transform: scale(1);
    }
}

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

/* Responsive Design */
@media (min-width: 768px) {
    .input-wrapper {
        flex-direction: row;
    }
    
    #guess-input {
        flex: 1;
    }
    
    #submit-btn {
        width: auto;
    }
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    #submit-btn:hover,
    #restart-btn:hover {
        transform: none;
    }
    
    .bubble {
        animation: none;
        display: none;
    }
}

/* Small screen adjustments */
@media (max-width: 480px) {
    .game-container {
        padding: 1.8rem 1.5rem;
    }
    
    header h1 {
        font-size: 2.2rem;
    }
    
    .instruction p {
        font-size: 1.1rem;
    }
    
    .instruction-icon {
        width: 50px;
        height: 50px;
    }
    
    .instruction-icon i {
        font-size: 1.5rem;
    }
    
    .feedback-icon {
        width: 60px;
        height: 60px;
        font-size: 1.8rem;
    }
    
    #feedback-text {
        font-size: 1.1rem;
    }
}