/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Comic Sans MS', 'Comic Sans', cursive, sans-serif;
    background-color: #f0f0f0;
    color: #333;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

#app {
    width: 100%;
    max-width: 500px;
    height: 100vh;
    background: #fff;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
    border: 4px solid #000;
}

.view {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 20px;
}

.hidden {
    display: none !important;
}

/* [화면 1] 둥지 (The Nest) */
header {
    text-align: center;
    margin-bottom: 20px;
    position: relative;
}

.lang-switch {
    position: absolute;
    top: -10px;
    right: 0;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8rem;
}

.lang-btn {
    border: none;
    background: none;
    padding: 2px 5px;
    font-size: 0.8rem;
    color: #888;
}

.lang-btn.active {
    color: #000;
    text-decoration: underline;
    font-weight: bold;
}

.logo {
    font-size: 2.5rem;
    color: #4a90e2;
    text-shadow: 2px 2px 0px #000;
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.canvas-container {
    border: 3px solid #000;
    background: white;
    cursor: crosshair;
}

canvas {
    display: block;
    max-width: 100%;
    height: auto;
}

.toolbar {
    width: 100%;
    background: #ccc;
    border: 3px solid #000;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.tool-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tool-group label {
    font-weight: bold;
    min-width: 60px;
}

/* 도구 버튼 공통 */
button {
    cursor: pointer;
    border: 2px solid #000;
    background: #eee;
    font-family: inherit;
    font-weight: bold;
}

button:active {
    background: #ddd;
    transform: translate(1px, 1px);
}

/* 선 두께 버튼 */
.size-buttons {
    display: flex;
    gap: 5px;
}

.size-btn {
    width: 30px;
    height: 30px;
    position: relative;
}

.size-btn.active {
    background: #fff;
    border-width: 3px;
}

.size-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #000;
    border-radius: 50%;
}

.thin::after { width: 4px; height: 4px; }
.medium::after { width: 8px; height: 8px; }
.thick::after { width: 14px; height: 14px; }

/* 색상 팔레트 */
.palette {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.color-btn {
    width: 25px;
    height: 25px;
}

.color-btn.active {
    outline: 2px solid #fff;
    outline-offset: -4px;
    border-width: 3px;
}

/* 하단 실행 버튼 */
.action-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 10px;
}

.primary-btn, .secondary-btn {
    padding: 10px 20px;
    font-size: 1.1rem;
}

.primary-btn {
    background: #ffec3d;
}

.secondary-btn {
    background: #87e8de;
}

/* [화면 2] 하늘 (The Sky) */
#sky-view {
    padding: 0;
    background-color: #87CEEB; /* Sky Blue */
    position: relative;
}

.sky-background {
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: relative;
}

.sun {
    position: absolute;
    top: 40px;
    left: 40px;
    width: 60px;
    height: 60px;
    background: yellow;
    border: 3px solid #000;
    border-radius: 50%;
    box-shadow: 0 0 20px rgba(255, 255, 0, 0.5);
}

.back-btn {
    position: absolute;
    bottom: 20px;
    right: 20px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.8);
    z-index: 10;
}

/* 구름 애니메이션 */
.cloud {
    position: absolute;
    background: white;
    border: 2px solid #000;
    border-radius: 50px;
    opacity: 0.9;
}

/* 새 비행 효과 */
.bird-entity {
    position: absolute;
    cursor: pointer;
    transition: transform 0.1s;
}

.bird-entity:hover {
    transform: scale(1.1);
}

.bird-name-tag {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    white-space: nowrap;
    display: none;
}

.bird-entity:hover .bird-name-tag {
    display: block;
}

/* 모달 */
.modal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.modal-content {
    background: #fff;
    border: 4px solid #000;
    padding: 30px;
    text-align: center;
    width: 80%;
}

.modal-content input {
    margin: 20px 0;
    padding: 10px;
    width: 100%;
    border: 2px solid #000;
    font-family: inherit;
    font-size: 1rem;
}

.modal-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.modal-buttons button {
    padding: 10px 20px;
}

/* 애니메이션 */
@keyframes wobble {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.wobble {
    animation: wobble 2s ease-in-out infinite;
}
