/* BASIC css start */
:root {
    --muted: #6b7684;
    --line: #e2e6ea;
    --danger: #e0483e;
    --ok: #1c9c6b;
    --radius: 14px;
    /* PC¿¡¼­ stage-wrapÀÌ ¾Æ¹«¸® ´­·Áµµ º¸ÀåÇÒ ÃÖ¼Ò ³ôÀÌ. script.jsµµ
       (panel ³ôÀÌ ÇÏÇÑ °è»ê ½Ã) ÀÌ °ªÀ» ±×´ë·Î ÀÐ¾î ¾²¹Ç·Î ¿©±â¼­¸¸ ¹Ù²Ù¸é µÈ´Ù. */
    --min-cap-height: 220px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    color: var(--black);
    -webkit-tap-highlight-color: transparent;
}
#pageContainer {
    background: linear-gradient(
        0deg,
        rgba(64, 129, 206, 1) 0%,
        rgba(17, 17, 17, 1) 100%
    );
}
.headerWrapper * {
    background: #b5f965 !important;
}
.headerNews {
    display: none !important;
}
.nav2Search fieldset {
    border: 2px solid #000;
}
.nav2Category .depth1 > a {
    border-bottom: none !important;
}
#footer {
    background: #b5f965 !important;
}
.footerDown {
    background: #000 !important;
}
.footerDown * {
    color: #fff !important;
}
/* header ¹× ±âº» ¼³Á¤ */
.app {
    max-width: 1440px;
    min-width: 300px;
    margin: 0 auto;
    padding: 20px 16px 60px;
}
.app-header {
    display: flex;
    flex-flow: column nowrap;
    align-items: center;
    gap: 1rem;
    margin: 1rem 0;
}
.app-header * {
    color: var(--white);
}
.app-header h1 {
    font-size: 5rem;
    text-align: center;
}
.app-header h3 {
    font-size: 1rem;
    text-align: center;
}
.app-header .sub {
    color: var(--bordergrey);
    font-size: 0.875rem;
    text-align: center;
}

.layout {
    display: grid;
    gap: 20px;
    align-items: stretch;
}

/* ---------- canvas / stage ---------- */

.canvas-panel {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px;
    height: min-content;
}

.stage-block + .stage-block {
    margin-top: 18px;
}

.stage-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 700;
}

.stage-label .side-count {
    font-weight: 600;
    color: var(--muted);
}

.stage-label .mini-clear {
    margin-left: auto;
    border: 1px solid var(--line);
    background: #fafbfc;
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
    padding: 4px 9px;
    border-radius: 999px;
    cursor: pointer;
}

.stage-wrap {
    position: relative;
    background: linear-gradient(180deg, #eef4fb 0%, #dfeaf6 100%);
    border-radius: 12px;
    padding: 20px 0 0 0;
}

.cap-stage {
    position: relative;
    width: 100%;
    aspect-ratio: 468 / 416; /* ¸ðÀÚ SVG ½ÇÁ¦ ºñÀ²   Àý´ë ´Ù¸¥ °ªÀ¸·Î µ¤¾î¾²¸é ¾È µÊ */
    margin: 0 auto;
    /* touch-actionÀº ¿©±â µÎÁö ¾Ê´Â´Ù   Ä¸ ¹è°æ±îÁö noneÀÌ¸é ¸ð¹ÙÀÏ¿¡¼­
       È­¸é ´ëºÎºÐÀ» Â÷ÁöÇÏ´Â ÀÌ ¿µ¿ª À§¿¡¼­ ÆäÀÌÁö ½ºÅ©·ÑÀÌ ¾Æ¿¹ ¾È ¸ÔÈù´Ù.
       ½ÇÁ¦·Î Ä¿½ºÅÒ µå·¡±×°¡ ÇÊ¿äÇÑ .placed-sticker/.sticker-tile¿¡¸¸ °Ç´Ù. */
}

.cap-shape {
    position: absolute;
    inset: 0;
    pointer-events: none;
}
.cap-shape svg {
    width: 100%;
    height: 100%;
    display: block;
    filter: drop-shadow(0 10px 18px rgba(20, 40, 80, 0.12));
}

.drop-zone {
    position: absolute;
    inset: 0;
}

/* ÀÎ¼â °¡´É ¿µ¿ª °¡ÀÌµå   À§Ä¡/Å©±â´Â PRINT_AREA_PCT ±âÁØÀ¸·Î JS°¡ ÀÎ¶óÀÎÀ¸·Î ÁöÁ¤ */
.print-area {
    position: absolute;
    border: 2px solid #1a3fd6;
    box-sizing: border-box;
    pointer-events: none;
}

/* ¹èÄ¡ ¿Ï·á »óÅÂ: °¡ÀÌµå ¼û±â°í ÆíÁý Àá±Ý */
.layout.finished .print-area {
    display: none;
}
.layout.finished .placed-sticker {
    pointer-events: none;
}
.layout.finished .mini-clear,
.layout.finished #clear-all,
.layout.finished .sticker-tile {
    opacity: 0.45;
    pointer-events: none;
}

.placed-sticker {
    position: absolute;
    /* width/height´Â ½ÇÁ¦ ÀÌ¹ÌÁö ÇØ»óµµ ºñÀ²¿¡ ¸ÂÃç JS¿¡¼­ °³º° ÁöÁ¤ */
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none; /* iOS ·ÕÇÁ·¹½º ½Ã ÀÌ¹ÌÁö ÄÝ¾Æ¿ô/¼±ÅÃ ¸Þ´º ¹æÁö */
    /* pan-y·Î µÎ¸é "´©¸£°í ¹öÆ¼±â" Å¸ÀÌ¸Ó¿Í ºê¶ó¿ìÀú ÀÚÃ¼ ½ºÅ©·Ñ ÆÇÁ¤ÀÌ
       µ¿½Ã¿¡ °æÀïÇÏ¸é¼­ ½ºÅ©·Ñ°ú µå·¡±×°¡ °°ÀÌ ¹ß»ýÇÏ´Â ¹®Á¦°¡ »ý±ä´Ù.
       ±×·¡¼­ noneÀ¸·Î ¿ÏÀüÈ÷ ºê¶ó¿ìÀú ±âº» µ¿ÀÛÀ» ²ô°í, ´ë±â Áß ¼Õ°¡¶ôÀÌ
       ¿òÁ÷ÀÌ¸é JS°¡ Á÷Á¢ ½ºÅ©·ÑÀ» Èä³»³»ÁØ´Ù (startHoldToDrag Âü°í). */
    touch-action: none;
}
.placed-sticker.dragging {
    cursor: grabbing;
    z-index: 999 !important;
}

.placed-sticker .sticker-face {
    width: 100%;
    height: 100%;
}
.placed-sticker .sticker-face img {
    -webkit-user-drag: none;
    -webkit-touch-callout: none;
    pointer-events: none; /* È÷Æ®Å×½ºÆ®°¡ Ç×»ó .placed-sticker·Î °¡µµ·Ï */
}

.placed-sticker .remove-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--danger);
    color: #fff;
    border: 2px solid #fff;
    font-size: 12px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
}
.placed-sticker:hover .remove-btn,
.placed-sticker.active .remove-btn {
    opacity: 1;
    pointer-events: auto;
}

.stage-info {
    margin-top: 12px;
    font-size: 12px;
    color: var(--muted);
    display: flex;
    gap: 6px;
    justify-content: center;
}
.stage-info .dot {
    opacity: 0.5;
}
.stage-info.warn #logo-status,
#logo-status.warn {
    color: var(--danger);
    font-weight: 600;
}
#logo-status.ok {
    color: var(--ok);
    font-weight: 600;
}

.canvas-actions {
    display: flex;
    gap: 8px;
    margin-top: 14px;
}
.canvas-actions button {
    flex: 1;
    padding: 10px 0;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: #fff;
    font-size: 13px;
    font-weight: 600;
    color: var(--black);
    cursor: pointer;
}
.canvas-actions button.primary {
    color: #fff;
    background: var(--black);
}

/* ---------- sticker tray ---------- */

.sticker-tray {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.tray-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: none;
    border: none;
    padding: 0;
    margin: 0 0 12px;
    font: inherit;
    color: inherit;
    text-align: left;
    cursor: default;
}
.sticker-tray h2 {
    font-size: 15px;
    margin: 0;
}
.tray-toggle-icon {
    display: none;
}

.category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.category-tab {
    border: 1px solid var(--line);
    background: #fafbfc;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 999px;
    cursor: pointer;
}

.category-tab.active {
    color: #fff;
    background: var(--black);
}
.sticker-grid-wrapper {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}
.sticker-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    padding-right: 2px;
}

.sticker-tile {
    position: relative;
    aspect-ratio: 1 / 1;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: #f6f8fa;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none; /* iOS ·ÕÇÁ·¹½º ½Ã ÀÌ¹ÌÁö ÄÝ¾Æ¿ô/¼±ÅÃ ¸Þ´º ¹æÁö */
    /* pan-y·Î µÎ¸é "´©¸£°í ¹öÆ¼±â" Å¸ÀÌ¸Ó¿Í ºê¶ó¿ìÀú ÀÚÃ¼ ½ºÅ©·Ñ ÆÇÁ¤ÀÌ
       µ¿½Ã¿¡ °æÀïÇÏ¸é¼­ ½ºÅ©·Ñ°ú µå·¡±×°¡ °°ÀÌ ¹ß»ýÇÏ´Â ¹®Á¦°¡ »ý±ä´Ù.
       ±×·¡¼­ noneÀ¸·Î ¿ÏÀüÈ÷ ºê¶ó¿ìÀú ±âº» µ¿ÀÛÀ» ²ô°í, ´ë±â Áß ¼Õ°¡¶ôÀÌ
       ¿òÁ÷ÀÌ¸é JS°¡ Á÷Á¢ sticker-grid-wrapper¸¦ ½ºÅ©·Ñ½ÃÄÑÁØ´Ù
       (startHoldToDrag Âü°í). */
    touch-action: none;
}
.sticker-tile:active {
    cursor: grabbing;
}
.sticker-tile.tile-hidden {
    display: none;
}
.sticker-tile img {
    width: 78%;
    height: 78%;
    object-fit: contain;
    -webkit-user-drag: none;
    -webkit-touch-callout: none;
    pointer-events: none; /* È÷Æ®Å×½ºÆ®°¡ Ç×»ó .sticker-tile·Î °¡µµ·Ï */
}

/* ghost element that follows the pointer while dragging from tray */
.drag-ghost {
    position: fixed;
    top: 0;
    left: 0;
    /* width/height´Â ½ÇÁ¦ ÀÌ¹ÌÁö ÇØ»óµµ ºñÀ²¿¡ ¸ÂÃç JS¿¡¼­ °³º° ÁöÁ¤ */
    pointer-events: none;
    z-index: 2000;
    opacity: 0.9;
    transform: translate(-50%, -50%);
}
.drag-ghost img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.3));
}

/* ---------- guide footer ---------- */

.guide {
    margin-top: 24px;
    background: var(--black);
    border-radius: var(--radius);
    padding: 18px 20px;
}
.guide h3 {
    margin: 0 0 10px;
    font-size: 16px;
    letter-spacing: 0.5px;
    color: var(--white);
    font-weight: 800;
}
.guide ol {
    margin: 0;
    padding-left: 18px;
    font-size: 14px;
}
.guide ol li {
    color: var(--white);
    line-height: 1.5rem;
    list-style: decimal;
}
/* ---------- toast ---------- */
.toast {
    position: fixed;
    left: 50%;
    bottom: 28px;
    transform: translateX(-50%) translateY(12px);
    background: rgba(20, 24, 30, 0.92);
    color: #fff;
    padding: 10px 16px;
    border-radius: 999px;
    font-size: 13px;
    opacity: 0;
    pointer-events: none;
    transition:
        opacity 0.2s ease,
        transform 0.2s ease;
    z-index: 3000;
}
.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
/* Ä«Åå ¹öÆ°  */
.visualNavPromotion {
    display: flex;
    flex-flow: column nowrap;
    align-items: center;
    justify-content: center;
    gap: 0.875rem;
    margin: 3rem 0;
}
.visualNavPromotionBtn {
    padding: 0.875rem 3rem;
    border-radius: 1.5rem;
    background-color: #b5f965;
    color: var(--black);
    font-weight: 600;
}
.visualNavPromotionBtn:hover {
    background-color: var(--black);
    color: #b5f965;
}
.visualNavPromotion h5 {
    text-align: center;
    /* background-color: #b5f965; */
    border-bottom: 2px solid #b5f965;
    padding: 0.25rem 0.5rem;
    /* color: var(--black); */
    color: #b5f965;
    font-weight: 500;
}
.visualNavPromotion p {
    color: #b5f965;
}
/*  */

/* ============================================================
    ¹Ìµð¾î Äõ¸® (¹ÝÀÀÇü ±ÔÄ¢ ¸ðÀ½   ÀüºÎ ¿©±â ÇÏ´Ü¿¡ ¸ð¾ÆµÒ)
   ============================================================ */

/* PC: canvas-panel/sticker-tray ³ôÀÌ´Â JS°¡ ºäÆ÷Æ®¿¡ ¸ÂÃç ÁöÁ¤ÇØÁØ´Ù.
    ±× ¾ÈÀÇ stage-wrap(Ä¸À» °¨½Î´Â ¹Ú½º) Å©±â´Â ¼ø¼ö CSS·Î ÇØ°áÇÑ´Ù  
    aspect-ratio¸¦ 1:1~1.5:1 »çÀÌ(1.1/1)·Î °íÁ¤ÇÏ°í min-height·Î ¹Ù´ÚÀ»
    ±ò¾ÆÁÖ¸é, stage-blockÀÌ flex·Î ¾Æ¹«¸® ´­¸®°Å³ª ´Ã¾î³ªµµ stage-wrap
    ÀÚÃ¼´Â Ç×»ó ÀÌ ºñÀ²/ÃÖ¼Ò ³ôÀÌ¸¦ À¯ÁöÇÑ´Ù. Ä¸(cap-stage)ÀÇ ½ÇÁ¦ 468:416
    ºñÀ²(1.125)Àº stage-wrapÀÇ 1.1 ºñÀ²º¸´Ù »ìÂ¦ ´õ "¼¼·Î·Î ±ä" ÂÊÀÌ¶ó
    stage-wrap ¾È¿¡ ²Ë Ã¤¿öµµ Àý´ë ³ÑÄ¡Áö ¾Ê´Â´Ù   JS·Î ÇÈ¼¿À» °è»êÇÒ
   ÇÊ¿ä°¡ ¾ø´Ù. ¸ð¹ÙÀÏÀº ±âÁ¸ ¹æ½Ä(³Êºñ ±âÁØ) ±×´ë·Î. */
@media (min-width: 761px) {
    .canvas-panel {
        display: flex;
        flex-direction: column;
        min-height: 0;
    }
    .stage-block {
        flex: 1;
        min-height: 0;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
    .stage-wrap {
        width: 100%;
        min-height: var(--min-cap-height);
        flex: 0 0 auto;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .cap-stage {
        width: 100%;
        height: auto;
    }

    /* ÇÑ È­¸é¿¡ CUSTOM GUIDE±îÁö µé¾î¿Àµµ·Ï ¿©¹éÀ» »ìÂ¦ ÁÙÀÓ */
    .app {
        padding: 16px 16px 24px;
    }
    .app-header .sub {
        margin-bottom: 12px;
    }
    .guide {
        margin-top: 16px;
        padding: 14px 20px;
    }
    .guide ol {
        line-height: 1.5;
    }
}

@media (min-width: 1081px) {
    .layout {
        grid-template-columns: 0.7fr 1fr;
    }
    .sticker-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}
@media (max-width: 1080px) {
    .layout {
        grid-template-columns: 1fr 1fr;
    }
    .sticker-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}
@media (max-width: 760px) {
    .layout {
        grid-template-columns: 1fr;
    }
    .cap-stage {
        width: 100%;
        height: auto;
    }

    /* ¸ð¹ÙÀÏ¿¡¼­´Â canvas-panelÀÌ ¼¼·Î·Î ¸ÕÀú ½×ÀÌ°í, sticker-tray´Â È­¸é
       ÇÏ´Ü¿¡ °íÁ¤µÈ ¹ÙÅÒ½ÃÆ®·Î ºÙ´Â´Ù. Æò¼Ò¿£ "½ºÆ¼Ä¿ ¼±ÅÃ" Çì´õ ¹Ù¸¸
       º¸ÀÌ°í, ÅÇÇÏ¸é À§·Î ÆîÃÄÁø´Ù (Åä±ÛÀº script.js¿¡¼­ Ã³¸®). */
    .app {
        padding-bottom: 76px;
    }
    .sticker-tray {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 500;
        margin: 0;
        border: none;
        border-top: 1px solid var(--line);
        border-radius: 16px 16px 0 0;
        box-shadow: 0 -6px 24px rgba(20, 40, 80, 0.16);
        padding-bottom: max(16px, env(safe-area-inset-bottom));
        /* max-height°¡ ¾Æ´Ï¶ó height¸¦ ¸íÈ®È÷ ÁöÁ¤ÇØ¾ß ÇÑ´Ù   flex:1ÀÎ
            sticker-grid-wrapper°¡ "auto ³ôÀÌ + max-height·Î »óÇÑ¸¸ °É¸°"
            ºÎ¸ð ¾È¿¡¼­´Â ÆîÃÄÁú ±âÁØ(definite height)ÀÌ ¾ø¾î¼­ ±×³É
            Âî±×·¯Á®¹ö¸°´Ù (µ¥½ºÅ©Åé ·¹ÀÌ¾Æ¿ô¿¡¼­ °Þ¾ú´ø °Í°ú °°Àº ¹®Á¦). */
        height: 60px;
        overflow: hidden;
        transition: height 0.25s ease;
    }
    .sticker-tray.expanded {
        height: 50vh;
    }
    .sticker-tray:not(.expanded) .category-tabs,
    .sticker-tray:not(.expanded) .sticker-grid-wrapper {
        display: none;
    }
    .tray-header {
        cursor: pointer;
        padding: 0.25rem;
        margin-bottom: 0;
    }
    .sticker-tray.expanded .tray-header {
        margin-bottom: 12px;
    }
    .tray-toggle-icon {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 22px;
        height: 22px;
        font-size: 15px;
        color: var(--muted);
        flex-shrink: 0;
    }
    .sticker-grid-wrapper {
        overflow-y: auto;
    }
    .sticker-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}
@media (max-width: 540px) {
    .sticker-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (max-width: 420px) {
    .sticker-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* BASIC css end */

