@font-face {
    font-family: "Ownglyph_ParkDaHyun";
    src: url("https://fastly.jsdelivr.net/gh/projectnoonnu/2411-3@1.0/Ownglyph_ParkDaHyun.woff2") format("woff2");
    font-weight: normal;
    font-style: normal;
}
* {
    font-family: "Ownglyph_ParkDaHyun";
}
body {
    background: #222;
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

#currentImage {
    position: absolute;
    width: 100%;
    opacity: 0.1;
    z-index: 1;
}

.game-container {
    background: #222;
    padding: 30px;
    max-width: 90vw;
    overflow: auto;
}

h1 {
    text-align: center;
    color: white;
    margin-bottom: 20px;
    font-size: 2.5em;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.settings {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.setting-group {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.1);
    padding: 10px 15px;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.setting-group label {
    color: white;
    font-weight: bold;
    font-size: 14px;
}

.setting-group select,
.setting-group input {
    padding: 8px 12px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    font-weight: bold;
}

.puzzle-sections {
    display: flex;
    gap: 40px;
    justify-content: center;
    align-items: flex-start;
    flex-wrap: wrap;
    flex-direction: column-reverse;
}

.section {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.section h3 {
    color: white;
    margin-bottom: 15px;
    font-size: 1.2em;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

#puzzle-container {
    display: flex;
    flex-wrap: wrap;
    max-width: 500px;
    gap: 5px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    border: 2px dashed rgba(255, 255, 255, 0.5);
    overflow-y: auto;
}

#drop-target-container {
    position: relative;
    display: grid;
    gap: 2px;
    border: 3px solid #fff;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.1);
    padding: 2px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    max-width: 500px;
    max-height: 500px;
    overflow: hidden;
}

.puzzle-piece {
    background-image: url("https://picsum.photos/500/500?random=1");
    background-size: var(--bg-size);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 3px;
    cursor: grab;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: calc(var(--piece-size) * 0.3);
    font-weight: bold;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    width: var(--piece-size);
    height: var(--piece-size);
}

.puzzle-piece:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    z-index: 10;
}

.puzzle-piece:active {
    cursor: grabbing;
    transform: scale(0.95);
}

.puzzle-piece.dragging {
    opacity: 0.5;
    transform: rotate(5deg);
}

.drop-target {
    z-index: 2;
    border: 1px dashed rgba(255, 255, 255, 0.5);
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: calc(var(--piece-size) * 0.2);
    color: rgba(255, 255, 255, 0.7);
    transition: all 0.3s ease;
    position: relative;
    width: var(--piece-size);
    height: var(--piece-size);
}

.drop-target.drag-over {
    border-color: #4caf50;
    background: rgba(76, 175, 80, 0.2);
    transform: scale(1.02);
}

.drop-target.filled {
    border: none;
    background: transparent;
}

.controls {
    text-align: center;
    margin-top: 30px;
}

.btn {
    padding: 12px 24px;
    margin: 5px;
    background: linear-gradient(135deg, #667eea, #4ba28f);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.success-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #4caf50, #45a049);
    color: white;
    padding: 30px 50px;
    border-radius: 20px;
    font-size: 24px;
    font-weight: bold;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    display: none;
    text-align: center;
}

.progress-bar {
    width: 200px;
    height: 10px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    overflow: hidden;
    margin: 10px auto;
}

.progress {
    height: 100%;
    background: linear-gradient(135deg, #4caf50, #45a049);
    width: 0%;
    transition: width 0.3s ease;
}

.stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.stat {
    background: rgba(255, 255, 255, 0.1);
    padding: 10px 20px;
    border-radius: 15px;
    text-align: center;
    color: white;
}

.stat-value {
    font-size: 1.5em;
    font-weight: bold;
    display: block;
}

.stat-label {
    font-size: 0.9em;
    opacity: 0.8;
}

@media (max-width: 768px) {
    .puzzle-sections {
        flex-direction: column;
        gap: 20px;
    }

    h1 {
        font-size: 2em;
    }

    .settings {
        flex-direction: column;
        gap: 10px;
    }

    #puzzle-container {
        max-width: 90vw;
    }

    #drop-target-container {
        max-width: 90vw;
        max-height: 50vh;
    }
}

@keyframes shake {
    0%,
    100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-5px);
    }
    75% {
        transform: translateX(5px);
    }
}

@keyframes bounce {
    0%,
    100% {
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.1);
    }
}
