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

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
}

.container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    padding: 30px;
    max-width: 500px;
    width: 90%;
    margin: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    color: #5a67d8;
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

header p {
    color: #666;
    font-size: 1.1em;
}

.game-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding: 15px;
    background: #f8f9ff;
    border-radius: 10px;
    border: 2px solid #e2e8f0;
}

.attempts {
    font-size: 1.2em;
    font-weight: bold;
    color: #5a67d8;
}

.new-game-btn {
    background: #48bb78;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.new-game-btn:hover {
    background: #38a169;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.input-area {
    text-align: center;
    margin-bottom: 30px;
}

.number-inputs {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.number-input {
    width: 60px;
    height: 60px;
    border: 3px solid #cbd5e0;
    border-radius: 12px;
    text-align: center;
    font-size: 2em;
    font-weight: bold;
    color: #2d3748;
    background: white;
    transition: all 0.3s ease;
}

.number-input:focus {
    outline: none;
    border-color: #5a67d8;
    box-shadow: 0 0 0 3px rgba(90, 103, 216, 0.2);
}

.number-input.filled {
    background: #e6fffa;
    border-color: #38b2ac;
}

.submit-btn, .clear-btn {
    margin: 0 10px;
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.submit-btn {
    background: #5a67d8;
    color: white;
}

.submit-btn:hover:not(:disabled) {
    background: #4c51bf;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.submit-btn:disabled {
    background: #a0aec0;
    cursor: not-allowed;
}

.clear-btn {
    background: #f56565;
    color: white;
}

.clear-btn:hover {
    background: #e53e3e;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.number-pad {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-bottom: 30px;
}

.number-btn {
    background: #edf2f7;
    border: 2px solid #cbd5e0;
    border-radius: 12px;
    padding: 15px;
    font-size: 1.5em;
    font-weight: bold;
    color: #2d3748;
    cursor: pointer;
    transition: all 0.3s ease;
}

.number-btn:hover {
    background: #e2e8f0;
    border-color: #a0aec0;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.number-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.game-history {
    margin-top: 20px;
}

.game-history h3 {
    color: #4a5568;
    margin-bottom: 15px;
    text-align: center;
}

.history-list {
    max-height: 200px;
    overflow-y: auto;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    background: #f8f9ff;
}

.history-item {
    padding: 12px 15px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-item:last-child {
    border-bottom: none;
}

.history-number {
    font-family: 'Courier New', monospace;
    font-size: 1.2em;
    font-weight: bold;
    color: #2d3748;
}

.history-result {
    font-size: 1.5em;
    display: flex;
    align-items: center;
    gap: 3px;
}

.result-icon {
    display: inline-block;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    text-align: center;
    line-height: 24px;
    font-weight: bold;
    font-size: 14px;
    margin: 0 2px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    position: relative;
}

.result-icon:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.circle {
    background: linear-gradient(135deg, #e53e3e, #ff6b6b);
    color: white;
    border: 2px solid #c53030;
}

.triangle {
    background: linear-gradient(135deg, #d69e2e, #f6ad55);
    color: white;
    border: 2px solid #b7791f;
    border-radius: 3px;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.cross {
    background: linear-gradient(135deg, #718096, #a0aec0);
    color: white;
    border: 2px solid #4a5568;
    font-size: 16px;
}

.reach {
    color: #e53e3e;
    font-weight: bold;
    font-size: 0.8em;
    background: linear-gradient(45deg, #e53e3e, #ff6b6b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: reachGlow 1s ease-in-out infinite alternate;
}

@keyframes reachGlow {
    from {
        text-shadow: 0 0 5px rgba(229, 62, 62, 0.5);
    }
    to {
        text-shadow: 0 0 10px rgba(229, 62, 62, 0.8);
    }
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.modal-content h2 {
    color: #5a67d8;
    margin-bottom: 15px;
    font-size: 2em;
}

.modal-content p {
    color: #666;
    margin-bottom: 25px;
    font-size: 1.1em;
}

.modal-btn {
    background: #5a67d8;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0 5px;
}

.modal-btn:hover {
    background: #4c51bf;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.retry-btn {
    background: #48bb78;
}

.retry-btn:hover {
    background: #38a169;
}

/* 반응형 디자인 */
@media (max-width: 480px) {
    .container {
        padding: 20px;
        margin: 10px;
    }
    
    header h1 {
        font-size: 2em;
    }
    
    .number-inputs {
        gap: 10px;
    }
    
    .number-input {
        width: 50px;
        height: 50px;
        font-size: 1.5em;
    }
    
    .number-pad {
        grid-template-columns: repeat(5, 1fr);
        gap: 8px;
    }
    
    .number-btn {
        padding: 12px;
        font-size: 1.2em;
    }
}
