/* 기본 스타일 및 폰트 설정 */
body {
    font-family: 'M PLUS Rounded 1c', sans-serif;
    background-color: #e3f2fd;
    background-image: radial-gradient(#ffffff 15%, transparent 16%), radial-gradient(#ffffff 15%, transparent 16%);
    background-size: 60px 60px;
    background-position: 0 0, 30px 30px;
    color: #333;
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
}

#app-container {
    width: 100%;
    max-width: 1400px;
}

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

header h1 {
    color: #5d9cec; 
    font-weight: 700;
    font-size: 2.8em;
    text-shadow: 3px 3px 0px #ffffff;
    margin: 0;
}

header::after { content: '☁️'; font-size: 2em; position: absolute; top: -20px; right: 20%; opacity: 0.6; }
header::before { content: '☁️'; font-size: 2em; position: absolute; top: 10px; left: 20%; opacity: 0.6; }

#main-content {
    display: flex;
    gap: 30px;
    align-items: stretch;
}

#cinnamon-section {
    flex: 1;
    min-width: 420px;
    margin-top: 65px;
}

.cinnamon-card {
    background-color: #ffffff;
    border-radius: 40px;
    padding: 30px;
    box-shadow: 0 15px 35px rgba(93, 156, 236, 0.15);
    text-align: center;
    border: 5px solid #f0f8ff;
}

#cinnamon-img {
    width: 100%;
    max-width: 350px;
    border-radius: 25px;
    margin-bottom: 25px;
    border: 3px solid #e3f2fd;
}

.code-box {
    background-color: #ffffff;
    color: #2d3748;
    border: 3px solid #5d9cec;
    padding: 20px;
    border-radius: 20px;
    text-align: left;
    height: 350px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
    margin-bottom: 25px;
    overflow-y: auto;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
    scroll-behavior: smooth;
}

.code-line {
    margin-bottom: 4px;
    animation: fadeIn 0.3s ease-out forwards;
}

.code-line.comment { color: #718096; font-style: italic; }
.code-line.positive { color: #d53f8c; font-weight: bold; }
.code-line.negative { color: #e53e3e; font-weight: bold; }
.code-line.system { color: #3182ce; }
.code-line.result-text { color: #2d3748; font-weight: 700; padding-left: 15px; margin-bottom: 12px; }
.code-line.cinnamoroll-reaction {
    color: #5d9cec; font-weight: bold; background-color: #f0f9ff; padding: 8px; border-radius: 10px; margin-top: 10px; border-left: 4px solid #5d9cec;
}

#code-button {
    background-color: #ffc0cb;
    color: white;
    border: none;
    border-radius: 25px;
    padding: 18px 40px;
    font-size: 1.3em;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 6px 15px rgba(255, 192, 203, 0.4);
}

#code-button:hover:not(:disabled) { background-color: #ffafbd; transform: scale(1.05); }
#code-button:disabled { background-color: #cbd5e0; cursor: not-allowed; box-shadow: none; }

#characters-section { flex: 2; }

h2 {
    color: #5d9cec; text-align: center; margin-top: 0; margin-bottom: 25px; font-size: 1.5em; background: white; display: inline-block; padding: 5px 25px; border-radius: 50px; box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

#character-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

.character-card {
    background-color: #ffffff;
    border-radius: 25px;
    padding: 15px;
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    border-bottom: 5px solid #e3f2fd;
    position: relative;
    border: 2px solid transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.character-card.exhausted { opacity: 0.5; filter: grayscale(40%); }

.card-header { width: 100%; display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.character-name { font-size: 1.1em; font-weight: 700; color: #5d9cec; margin: 0; }
.status-icon { font-size: 1.2em; }

.character-img-container {
    width: 100%;
    aspect-ratio: 1/1;
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 12px;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
}

.character-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.character-card:hover .character-avatar { transform: scale(1.05); }

.status-bar-container { width: 100%; margin-bottom: 8px; }
.status-label-group { display: flex; justify-content: space-between; align-items: center; margin-bottom: 3px; font-size: 0.75em; font-weight: 700; color: #718096; }
.status-bar { width: 100%; height: 10px; background-color: #edf2f7; border-radius: 5px; overflow: hidden; border: 1px solid #e2e8f0; }
.status-bar-inner { height: 100%; border-radius: 5px; transition: width 0.5s ease-out; }
.health-bar { background: linear-gradient(90deg, #ff9a9e 0%, #fecfef 100%); }
.satiety-bar { background: linear-gradient(90deg, #f6d365 0%, #fda085 100%); }

.money-status { font-size: 0.95em; font-weight: 700; color: #48bb78; margin-top: 10px; text-align: center; background: #f0fff4; padding: 5px 15px; border-radius: 10px; width: 100%; box-sizing: border-box; }

@keyframes wealthy-animation {
    0% { border-color: #ffd700; box-shadow: 0 0 10px #ffd700; transform: scale(1); }
    50% { border-color: #ff4500; box-shadow: 0 0 25px #ff4500; transform: scale(1.03); }
    100% { border-color: #ffd700; box-shadow: 0 0 10px #ffd700; transform: scale(1); }
}
.wealthy-glow { animation: wealthy-animation 1s infinite; background: linear-gradient(135deg, #ffffff 0%, #fff9c4 100%); }

.pulse-gain { animation: pulse-gain 0.6s ease-out; }
.pulse-loss { animation: pulse-loss 0.6s ease-out; }
@keyframes pulse-gain { 0% { transform: scale(1); } 50% { transform: scale(1.02); box-shadow: 0 0 15px rgba(72, 187, 120, 0.5); } 100% { transform: scale(1); } }
@keyframes pulse-loss { 0% { transform: scale(1); } 50% { transform: scale(0.98); box-shadow: 0 0 15px rgba(245, 101, 101, 0.5); } 100% { transform: scale(1); } }

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