/* 앱 아이콘 일괄 생성기 전용 스타일 (토큰만 사용) */

/* 원본 정보 행 */
.aig-source {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background-color: var(--color-surface-2);
}

.aig-source-thumb {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.aig-source-thumb img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.aig-source-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 0.875rem;
    color: var(--color-text);
}

.aig-source-info .file-name {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.aig-source-info .file-size {
    font-size: 0.8125rem;
    color: var(--color-text-light);
}

/* 옵션 */
.aig-options .form-hint {
    margin-top: -8px;
}

.aig-color {
    width: 40px;
    height: 32px;
    padding: 2px;
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-sm);
    background-color: var(--color-surface-2);
    cursor: pointer;
}

.aig-color-code {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    color: var(--color-text-light);
}

.aig-name-input {
    flex: 1;
    min-width: 0;
    max-width: 280px;
}

.aig-platforms {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
}

/* 미리보기 */
.aig-preview-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--color-border);
}

.aig-subtitle {
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-text);
    margin: 0;
}

.aig-preview-toggles {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
}

.aig-preview-head + .form-hint {
    margin-top: 6px;
}

.aig-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(116px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.aig-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 6px 10px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background-color: var(--color-surface-2);
    color: var(--color-text);
    font-family: inherit;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s;
}

.aig-tile:hover {
    border-color: var(--color-primary);
    background-color: var(--color-surface-hover);
}

.aig-tile:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.aig-tile-frame {
    position: relative;
    width: 88px;
    height: 88px;
    margin-bottom: 4px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-radius 0.2s;
}

.aig-tile-frame canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* 파비콘은 실제 픽셀 크기로 표시 */
.aig-tile-frame.is-actual canvas {
    width: auto;
    height: auto;
}

/* 적응형 아이콘: 108dp 레이어 중 가운데 72dp 만 보이도록 확대 */
.aig-tile-frame canvas.aig-adaptive-layer {
    position: absolute;
    top: -25%;
    left: -25%;
    width: 150%;
    height: 150%;
    max-width: none;
    max-height: none;
}

.aig-tile-frame.mask-adaptive-circle {
    border-radius: 50%;
}

.aig-tile-frame.mask-adaptive-squircle {
    border-radius: 32%;
}

/* 모서리 마스크 미리보기 토글 */
.aig-preview.is-masked .mask-ios {
    border-radius: 22.37%;
}

.aig-preview.is-masked .mask-play {
    border-radius: 20%;
}

.aig-preview.is-masked .mask-maskable {
    border-radius: 50%;
}

/* 안전 영역 오버레이 (마스커블 80%, 적응형 66/72dp) */
.aig-safe {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    width: 80%;
    height: 80%;
    transform: translate(-50%, -50%);
    border: 2px dashed var(--color-accent);
    border-radius: 50%;
    box-shadow: 0 0 0 1px var(--color-surface), inset 0 0 0 1px var(--color-surface);
    pointer-events: none;
}

.aig-safe.is-adaptive {
    width: 91.67%;
    height: 91.67%;
}

.aig-preview.show-safe .aig-safe {
    display: block;
}

.aig-tile-label {
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.3;
    text-align: center;
}

.aig-tile-size {
    font-size: 0.6875rem;
    color: var(--color-text-light);
    font-family: var(--font-mono);
}

.aig-editor .nm-progress {
    margin-top: 16px;
}

@media (max-width: 480px) {
    .aig-preview {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .aig-tile-frame {
        width: 80px;
        height: 80px;
    }

    .aig-name-input {
        max-width: none;
    }
}
