/* ========================================
   PEN TOOL MASTER - BEZIER GAME STYLES
   ======================================== */

/* ===== Page Setup ===== */
.bezier-page {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    height: 100vh;
    overflow: hidden;
}

.bezier-page .main-content {
    padding: 0;
    height: calc(100vh - 70px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.bezier-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    height: 100%;
    overflow: hidden;
}

/* ===== Start Screen ===== */
.start-screen {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.start-screen__content {
    text-align: center;
    max-width: 500px;
}

.start-screen__icon {
    font-size: 5rem;
    margin-bottom: 20px;
    animation: float 3s ease-in-out infinite;
}

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

.start-screen__title {
    font-size: 3rem;
    font-weight: 800;
    color: #fff;
    margin: 0 0 10px 0;
    text-shadow: 0 4px 20px rgba(99, 102, 241, 0.5);
}

.start-screen__subtitle {
    font-size: 1.3rem;
    color: rgba(255, 255, 255, 0.8);
    margin: 0 0 20px 0;
}

.start-screen__desc {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.8;
    margin: 0 0 30px 0;
}

.btn-start {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 18px 40px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border: none;
    border-radius: 50px;
    color: #fff;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.4);
}

.btn-start:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(99, 102, 241, 0.6);
}

.btn-start:active {
    transform: translateY(0);
}

.start-screen__tips {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.tip {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

.tip__icon {
    font-size: 1.2rem;
}

/* ===== Game Screen ===== */
.game-screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

/* Top Bar */
.game-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.game-topbar__left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.level-info {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.level-info__label {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
}

.level-info__value {
    font-size: 1.2rem;
    font-weight: 800;
    color: #fff;
}

.level-info__total {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.4);
}

.level-name {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
    padding: 4px 12px;
    background: rgba(99, 102, 241, 0.2);
    border-radius: 16px;
}

.game-topbar__center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.score-display {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
}

.score-display__icon {
    font-size: 1rem;
}

.score-display__value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fbbf24;
}

.game-topbar__right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* Canvas Area */
.canvas-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 24px;
    position: relative;
    width: 100%;
    min-height: 0; /* flexbox 오버플로우 방지 */
    overflow: hidden;
}

#gameCanvas {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    cursor: crosshair;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Hint Overlay */
.hint-overlay {
    position: absolute;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
}

.hint-content {
    padding: 8px 18px;
    background: rgba(251, 191, 36, 0.95);
    border-radius: 8px;
    color: #1a1a2e;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 4px 20px rgba(251, 191, 36, 0.4);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateX(-50%) translateY(-20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* Bottom Bar */
.game-bottombar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.game-bottombar__left,
.game-bottombar__right {
    min-width: 150px;
}

.game-bottombar__right {
    text-align: right;
}

.node-count {
    display: flex;
    align-items: center;
    gap: 8px;
}

.node-count__label {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
}

.node-count__value {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
}

.game-bottombar__center {
    display: flex;
    gap: 12px;
}

.btn-action {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-action:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.btn-action:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-action--primary {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-color: transparent;
}

.btn-action--primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.4);
}

.btn-skip {
    padding: 10px 16px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
    cursor: pointer;
    transition: color 0.2s ease;
}

.btn-skip:hover {
    color: rgba(255, 255, 255, 0.8);
}

/* ===== Result Screen ===== */
.result-screen {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.result-screen__content {
    text-align: center;
    max-width: 600px;
    width: 100%;
}

.result-score {
    margin-bottom: 40px;
}

.result-score__stars {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
}

.result-score__stars .star {
    font-size: 3rem;
    opacity: 0.3;
    transition: all 0.3s ease;
}

.result-score__stars .star.active {
    opacity: 1;
    animation: starPop 0.5s ease;
}

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

.result-score__value {
    font-size: 4rem;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 4px 20px rgba(99, 102, 241, 0.5);
}

.result-score__label {
    font-size: 1.3rem;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 10px;
}

.result-comparison {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 40px;
}

.comparison-item {
    text-align: center;
}

.comparison-item__label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 10px;
}

.comparison-canvas {
    width: 150px;
    height: 150px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.result-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
}

.btn-retry,
.btn-next {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-retry {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
}

.btn-retry:hover {
    background: rgba(255, 255, 255, 0.2);
}

.btn-next {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: #fff;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
}

.btn-next:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.6);
}

/* ===== Complete Screen ===== */
.complete-screen {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.complete-screen__content {
    text-align: center;
    max-width: 500px;
}

.complete-screen__icon {
    font-size: 5rem;
    margin-bottom: 20px;
    animation: bounce 1s ease infinite;
}

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

.complete-screen__title {
    font-size: 2.5rem;
    font-weight: 800;
    color: #fff;
    margin: 0 0 10px 0;
}

.complete-screen__subtitle {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.7);
    margin: 0 0 40px 0;
}

.complete-stats {
    display: flex;
    justify-content: center;
    gap: 60px;
    margin-bottom: 40px;
}

.stat-item {
    text-align: center;
}

.stat-item__value {
    font-size: 3rem;
    font-weight: 800;
    color: #fbbf24;
}

.stat-item__label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 5px;
}

.complete-actions {
    display: flex;
    justify-content: center;
}

.btn-restart {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 32px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
}

.btn-restart:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.6);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .start-screen__title {
        font-size: 2rem;
    }
    
    .start-screen__tips {
        flex-direction: column;
        gap: 15px;
    }
    
    .game-topbar {
        padding: 12px 16px;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .game-topbar__center {
        position: static;
        transform: none;
        order: -1;
        width: 100%;
        display: flex;
        justify-content: center;
    }
    
    .level-name {
        display: none;
    }
    
    .game-bottombar {
        padding: 12px 16px;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .game-bottombar__left,
    .game-bottombar__right {
        min-width: auto;
    }
    
    .game-bottombar__center {
        order: 1;
        width: 100%;
        justify-content: center;
    }
    
    .btn-action {
        padding: 10px 16px;
        font-size: 0.9rem;
    }
    
    .result-comparison {
        flex-direction: column;
        align-items: center;
    }
    
    .complete-stats {
        gap: 40px;
    }
}

@media (max-width: 480px) {
    .canvas-wrapper {
        padding: 10px;
    }
    
    .btn-icon {
        width: 38px;
        height: 38px;
        font-size: 1rem;
    }
    
    .result-score__value {
        font-size: 3rem;
    }
    
    .result-score__stars .star {
        font-size: 2rem;
    }
}

